UNPKG

78.8 kBJavaScriptView Raw
1/*! For license information please see waveform-playlist.var.min.js.LICENSE.txt */
2var WaveformPlaylist;(()=>{var t={6824:t=>{var e,s,i;t.exports=(s=String.prototype.split,i=/()??/.exec("")[1]===e,function(t,r,n){if("[object RegExp]"!==Object.prototype.toString.call(r))return s.call(t,r,n);var a,o,l,c,h=[],u=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),d=0;for(r=new RegExp(r.source,u+"g"),t+="",i||(a=new RegExp("^"+r.source+"$(?!\\s)",u)),n=n===e?-1>>>0:n>>>0;(o=r.exec(t))&&!((l=o.index+o[0].length)>d&&(h.push(t.slice(d,o.index)),!i&&o.length>1&&o[0].replace(a,(function(){for(var t=1;t<arguments.length-2;t++)arguments[t]===e&&(o[t]=e)})),o.length>1&&o.index<t.length&&Array.prototype.push.apply(h,o.slice(1)),c=o[0].length,d=l,h.length>=n));)r.lastIndex===o.index&&r.lastIndex++;return d===t.length?!c&&r.test("")||h.push(""):h.push(t.slice(d)),h.length>n?h.slice(0,n):h})},1804:(t,e,s)=>{"use strict";var i=s(5618),r=s(7205),n=s(7191),a=s(5516),o=s(9981);(t.exports=function(t,e){var s,r,l,c,h;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],i(t)?(s=o.call(t,"c"),r=o.call(t,"e"),l=o.call(t,"w")):(s=l=!0,r=!1),h={value:e,configurable:s,enumerable:r,writable:l},c?n(a(c),h):h}).gs=function(t,e,s){var l,c,h,u;return"string"!=typeof t?(h=s,s=e,e=t,t=null):h=arguments[3],i(e)?r(e)?i(s)?r(s)||(h=s,s=void 0):s=void 0:(h=e,e=s=void 0):e=void 0,i(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),u={get:e,set:s,configurable:l,enumerable:c},h?n(a(h),u):u}},430:t=>{"use strict";t.exports=function(){}},7191:(t,e,s)=>{"use strict";t.exports=s(6560)()?Object.assign:s(7346)},6560:t=>{"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},7346:(t,e,s)=>{"use strict";var i=s(5103),r=s(2745),n=Math.max;t.exports=function(t,e){var s,a,o,l=n(arguments.length,2);for(t=Object(r(t)),o=function(i){try{t[i]=e[i]}catch(t){s||(s=t)}},a=1;a<l;++a)i(e=arguments[a]).forEach(o);if(void 0!==s)throw s;return t}},6914:(t,e,s)=>{"use strict";var i=s(430)();t.exports=function(t){return t!==i&&null!==t}},5103:(t,e,s)=>{"use strict";t.exports=s(7446)()?Object.keys:s(6137)},7446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},6137:(t,e,s)=>{"use strict";var i=s(6914),r=Object.keys;t.exports=function(t){return r(i(t)?Object(t):t)}},5516:(t,e,s)=>{"use strict";var i=s(6914),r=Array.prototype.forEach,n=Object.create,a=function(t,e){var s;for(s in t)e[s]=t[s]};t.exports=function(t){var e=n(null);return r.call(arguments,(function(t){i(t)&&a(Object(t),e)})),e}},1290:t=>{"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},2745:(t,e,s)=>{"use strict";var i=s(6914);t.exports=function(t){if(!i(t))throw new TypeError("Cannot use null or undefined");return t}},9981:(t,e,s)=>{"use strict";t.exports=s(3591)()?String.prototype.contains:s(6042)},3591:t=>{"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&(!0===e.contains("dwa")&&!1===e.contains("foo"))}},6042:t=>{"use strict";var e=String.prototype.indexOf;t.exports=function(t){return e.call(this,t,arguments[1])>-1}},8832:(t,e,s)=>{"use strict";s(4167)("ev-store","7");var i="__EV_STORE_KEY@7";t.exports=function(t){var e=t[i];e||(e=t[i]={});return e}},8370:(t,e,s)=>{"use strict";var i,r,n,a,o,l,c,h=s(1804),u=s(1290),d=Function.prototype.apply,p=Function.prototype.call,f=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var s,r;return u(e),r=this,i.call(this,t,s=function(){n.call(r,t,s),d.call(e,this,arguments)}),s.__eeOnceListener__=e,this},o={on:i=function(t,e){var s;return u(e),g.call(this,"__ee__")?s=this.__ee__:(s=y.value=f(null),m(this,"__ee__",y),y.value=null),s[t]?"object"==typeof s[t]?s[t].push(e):s[t]=[s[t],e]:s[t]=e,this},once:r,off:n=function(t,e){var s,i,r,n;if(u(e),!g.call(this,"__ee__"))return this;if(!(s=this.__ee__)[t])return this;if("object"==typeof(i=s[t]))for(n=0;r=i[n];++n)r!==e&&r.__eeOnceListener__!==e||(2===i.length?s[t]=i[n?0:1]:i.splice(n,1));else i!==e&&i.__eeOnceListener__!==e||delete s[t];return this},emit:a=function(t){var e,s,i,r,n;if(g.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(s=arguments.length,n=new Array(s-1),e=1;e<s;++e)n[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)d.call(i,this,n)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(s=arguments.length,n=new Array(s-1),e=1;e<s;++e)n[e-1]=arguments[e];d.call(r,this,n)}}},l={on:h(i),once:h(r),off:h(n),emit:h(a)},c=v({},l),t.exports=e=function(t){return null==t?f(c):v(Object(t),l)},e.methods=o},6226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.linear=function(t,e){var s,i,r=new Float32Array(t),n=t-1;for(s=0;s<t;s++)i=s/n,r[s]=e>0?i:1-i;return r},e.exponential=function(t,e){var s,i,r=new Float32Array(t),n=t-1;for(s=0;s<t;s++)i=s/n,r[e>0?s:t-1-s]=Math.exp(2*i-1)/Math.exp(1);return r},e.sCurve=function(t,e){var s,i=new Float32Array(t),r=e>0?Math.PI/2:-Math.PI/2;for(s=0;s<t;++s)i[s]=Math.sin(Math.PI*s/t-r)/2+.5;return i},e.logarithmic=function(t,e,s){var i,r=new Float32Array(t),n=0;for(i=0;i<t;i++)n=i/t,r[s>0?i:t-1-i]=Math.log(1+e*n)/Math.log(1+e);return r}},1114:(t,e,s)=>{"use strict";e.h7=e.Y1=e.Hp=e.Jl=e.t$=e._h=void 0,e.L7=function(t,e,s,i){switch(e){case r:l.call(t,s,i);break;case n:h.call(t,s,i);break;case a:d.call(t,s,i);break;case o:f.call(t,s,i);break;default:throw new Error("Unsupported Fade type")}},e.Mt=function(t,e,s,i){switch(e){case r:c.call(t,s,i);break;case n:u.call(t,s,i);break;case a:p.call(t,s,i);break;case o:m.call(t,s,i);break;default:throw new Error("Unsupported Fade type")}};var i=s(6226),r=e._h="sCurve",n=e.t$="linear",a=e.Jl="exponential",o=e.Hp="logarithmic";e.Y1="FadeIn",e.h7="FadeOut";function l(t,e){var s=(0,i.sCurve)(1e4,1);this.setValueCurveAtTime(s,t,e)}function c(t,e){var s=(0,i.sCurve)(1e4,-1);this.setValueCurveAtTime(s,t,e)}function h(t,e){this.linearRampToValueAtTime(0,t),this.linearRampToValueAtTime(1,t+e)}function u(t,e){this.linearRampToValueAtTime(1,t),this.linearRampToValueAtTime(0,t+e)}function d(t,e){this.exponentialRampToValueAtTime(.01,t),this.exponentialRampToValueAtTime(1,t+e)}function p(t,e){this.exponentialRampToValueAtTime(1,t),this.exponentialRampToValueAtTime(.01,t+e)}function f(t,e){var s=(0,i.logarithmic)(1e4,10,1);this.setValueCurveAtTime(s,t,e)}function m(t,e){var s=(0,i.logarithmic)(1e4,10,-1);this.setValueCurveAtTime(s,t,e)}},9144:(t,e,s)=>{var i,r=void 0!==s.g?s.g:"undefined"!=typeof window?window:{},n=s(5893);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=n),t.exports=i},8070:(t,e,s)=>{"use strict";var i="undefined"!=typeof window?window:void 0!==s.g?s.g:{};t.exports=function(t,e){if(t in i)return i[t];return i[t]=e,e}},4167:(t,e,s)=>{"use strict";var i=s(8070);t.exports=function(t,e,s){var r="__INDIVIDUAL_ONE_VERSION_"+t,n=i(r+"_ENFORCE_SINGLETON",e);if(n!==e)throw new Error("Can only have one copy of "+t+".\nYou already have version "+n+" installed.\nThis means you cannot install version "+e);return i(r,s)}},849:(t,e,s)=>{var i=!!(s.g===s.g.window&&s.g.URL&&s.g.Blob&&s.g.Worker);function r(t,e){var r,n=this;if(e=e||{},i)return r=t.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],new s.g.Worker(s.g.URL.createObjectURL(new s.g.Blob([r],{type:"text/javascript"})));this.self=e,this.self.postMessage=function(t){setTimeout((function(){n.onmessage({data:t})}),0)},setTimeout(t.bind(e,e),0)}r.prototype.postMessage=function(t){var e=this;setTimeout((function(){e.self.onmessage({data:t})}),0)},t.exports=r},6240:t=>{"use strict";t.exports=function(t){return"object"==typeof t&&null!==t}},1730:t=>{var e=9007199254740991,s="[object Arguments]",i="[object Function]",r="[object GeneratorFunction]",n=/^(?:0|[1-9]\d*)$/;function a(t,e,s){switch(s.length){case 0:return t.call(e);case 1:return t.call(e,s[0]);case 2:return t.call(e,s[0],s[1]);case 3:return t.call(e,s[0],s[1],s[2])}return t.apply(e,s)}var o,l,c=Object.prototype,h=c.hasOwnProperty,u=c.toString,d=c.propertyIsEnumerable,p=(o=Object.keys,l=Object,function(t){return o(l(t))}),f=Math.max,m=!d.call({valueOf:1},"valueOf");function v(t,e){var i=w(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&x(t)}(t)&&h.call(t,"callee")&&(!d.call(t,"callee")||u.call(t)==s)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],r=i.length,n=!!r;for(var a in t)!e&&!h.call(t,a)||n&&("length"==a||y(a,r))||i.push(a);return i}function g(t,e,s){var i=t[e];h.call(t,e)&&k(i,s)&&(void 0!==s||e in t)||(t[e]=s)}function y(t,s){return!!(s=null==s?e:s)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<s}function b(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||c)}function k(t,e){return t===e||t!=t&&e!=e}var w=Array.isArray;function x(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=P(t)?u.call(t):"";return e==i||e==r}(t)}function P(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var S,T=(S=function(t,e){if(m||b(e)||x(e))!function(t,e,s,i){s||(s={});for(var r=-1,n=e.length;++r<n;){var a=e[r],o=i?i(s[a],t[a],a,s,t):void 0;g(s,a,void 0===o?t[a]:o)}}(e,function(t){return x(t)?v(t):function(t){if(!b(t))return p(t);var e=[];for(var s in Object(t))h.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}(e),t);else for(var s in e)h.call(e,s)&&g(t,s,e[s])},function(t,e){return e=f(void 0===e?t.length-1:e,0),function(){for(var s=arguments,i=-1,r=f(s.length-e,0),n=Array(r);++i<r;)n[i]=s[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=s[i];return o[e]=n,a(t,this,o)}}((function(t,e){var s=-1,i=e.length,r=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(r=S.length>3&&"function"==typeof r?(i--,r):void 0,n&&function(t,e,s){if(!P(s))return!1;var i=typeof e;return!!("number"==i?x(s)&&y(e,s.length):"string"==i&&e in s)&&k(s[e],t)}(e[0],e[1],n)&&(r=i<3?void 0:r,i=1),t=Object(t);++s<i;){var a=e[s];a&&S(t,a,s,r)}return t})));t.exports=T},2098:(t,e,s)=>{t=s.nmd(t);var i="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",a="[object Function]",o="[object Object]",l=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[n]=h["[object Array]"]=h["[object ArrayBuffer]"]=h["[object Boolean]"]=h["[object DataView]"]=h["[object Date]"]=h["[object Error]"]=h[a]=h["[object Map]"]=h["[object Number]"]=h[o]=h["[object RegExp]"]=h["[object Set]"]=h["[object String]"]=h["[object WeakMap]"]=!1;var u="object"==typeof s.g&&s.g&&s.g.Object===Object&&s.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=u||d||Function("return this")(),f=e&&!e.nodeType&&e,m=f&&t&&!t.nodeType&&t,v=m&&m.exports===f,g=v&&u.process,y=function(){try{var t=m&&m.require&&m.require("util").types;return t||g&&g.binding&&g.binding("util")}catch(t){}}(),b=y&&y.isTypedArray;function k(t,e,s){switch(s.length){case 0:return t.call(e);case 1:return t.call(e,s[0]);case 2:return t.call(e,s[0],s[1]);case 3:return t.call(e,s[0],s[1],s[2])}return t.apply(e,s)}var w,x,P,S=Array.prototype,T=Function.prototype,_=Object.prototype,O=p["__core-js_shared__"],E=T.toString,R=_.hasOwnProperty,A=(w=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",j=_.toString,C=E.call(Object),L=RegExp("^"+E.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=v?p.Buffer:void 0,M=p.Symbol,F=p.Uint8Array,G=I?I.allocUnsafe:void 0,$=(x=Object.getPrototypeOf,P=Object,function(t){return x(P(t))}),D=Object.create,z=_.propertyIsEnumerable,V=S.splice,N=M?M.toStringTag:void 0,W=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),U=I?I.isBuffer:void 0,q=Math.max,H=Date.now,X=mt(p,"Map"),B=mt(Object,"create"),Y=function(){function t(){}return function(e){if(!Ot(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function Z(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function K(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Q(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var s=xt(t),i=!s&&wt(t),r=!s&&!i&&St(t),n=!s&&!i&&!r&&Rt(t),a=s||i||r||n,o=a?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],l=o.length;for(var c in t)!e&&!R.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||n&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||vt(c,l))||o.push(c);return o}function et(t,e,s){(void 0!==s&&!kt(t[e],s)||void 0===s&&!(e in t))&&rt(t,e,s)}function st(t,e,s){var i=t[e];R.call(t,e)&&kt(i,s)&&(void 0!==s||e in t)||rt(t,e,s)}function it(t,e){for(var s=t.length;s--;)if(kt(t[s][0],e))return s;return-1}function rt(t,e,s){"__proto__"==e&&W?W(t,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):t[e]=s}Z.prototype.clear=function(){this.__data__=B?B(null):{},this.size=0},Z.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Z.prototype.get=function(t){var e=this.__data__;if(B){var s=e[t];return s===i?void 0:s}return R.call(e,t)?e[t]:void 0},Z.prototype.has=function(t){var e=this.__data__;return B?void 0!==e[t]:R.call(e,t)},Z.prototype.set=function(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=B&&void 0===e?i:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,s=it(e,t);return!(s<0)&&(s==e.length-1?e.pop():V.call(e,s,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,s=it(e,t);return s<0?void 0:e[s][1]},J.prototype.has=function(t){return it(this.__data__,t)>-1},J.prototype.set=function(t,e){var s=this.__data__,i=it(s,t);return i<0?(++this.size,s.push([t,e])):s[i][1]=e,this},K.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(X||J),string:new Z}},K.prototype.delete=function(t){var e=ft(this,t).delete(t);return this.size-=e?1:0,e},K.prototype.get=function(t){return ft(this,t).get(t)},K.prototype.has=function(t){return ft(this,t).has(t)},K.prototype.set=function(t,e){var s=ft(this,t),i=s.size;return s.set(t,e),this.size+=s.size==i?0:1,this},Q.prototype.clear=function(){this.__data__=new J,this.size=0},Q.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},Q.prototype.get=function(t){return this.__data__.get(t)},Q.prototype.has=function(t){return this.__data__.has(t)},Q.prototype.set=function(t,e){var s=this.__data__;if(s instanceof J){var i=s.__data__;if(!X||i.length<199)return i.push([t,e]),this.size=++s.size,this;s=this.__data__=new K(i)}return s.set(t,e),this.size=s.size,this};var nt,at=function(t,e,s){for(var i=-1,r=Object(t),n=s(t),a=n.length;a--;){var o=n[nt?a:++i];if(!1===e(r[o],o,r))break}return t};function ot(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=R.call(t,N),s=t[N];try{t[N]=void 0;var i=!0}catch(t){}var r=j.call(t);i&&(e?t[N]=s:delete t[N]);return r}(t):function(t){return j.call(t)}(t)}function lt(t){return Et(t)&&ot(t)==n}function ct(t){return!(!Ot(t)||function(t){return!!A&&A in t}(t))&&(Tt(t)?L:l).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ht(t){if(!Ot(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=gt(t),s=[];for(var i in t)("constructor"!=i||!e&&R.call(t,i))&&s.push(i);return s}function ut(t,e,s,i,r){t!==e&&at(e,(function(n,a){if(r||(r=new Q),Ot(n))!function(t,e,s,i,r,n,a){var l=yt(t,s),c=yt(e,s),h=a.get(c);if(h)return void et(t,s,h);var u=n?n(l,c,s+"",t,e,a):void 0,d=void 0===u;if(d){var p=xt(c),f=!p&&St(c),m=!p&&!f&&Rt(c);u=c,p||f||m?xt(l)?u=l:Et(k=l)&&Pt(k)?u=function(t,e){var s=-1,i=t.length;e||(e=Array(i));for(;++s<i;)e[s]=t[s];return e}(l):f?(d=!1,u=function(t,e){if(e)return t.slice();var s=t.length,i=G?G(s):new t.constructor(s);return t.copy(i),i}(c,!0)):m?(d=!1,v=c,g=!0?(y=v.buffer,b=new y.constructor(y.byteLength),new F(b).set(new F(y)),b):v.buffer,u=new v.constructor(g,v.byteOffset,v.length)):u=[]:function(t){if(!Et(t)||ot(t)!=o)return!1;var e=$(t);if(null===e)return!0;var s=R.call(e,"constructor")&&e.constructor;return"function"==typeof s&&s instanceof s&&E.call(s)==C}(c)||wt(c)?(u=l,wt(l)?u=function(t){return function(t,e,s,i){var r=!s;s||(s={});var n=-1,a=e.length;for(;++n<a;){var o=e[n],l=i?i(s[o],t[o],o,s,t):void 0;void 0===l&&(l=t[o]),r?rt(s,o,l):st(s,o,l)}return s}(t,jt(t))}(l):Ot(l)&&!Tt(l)||(u=function(t){return"function"!=typeof t.constructor||gt(t)?{}:Y($(t))}(c))):d=!1}var v,g,y,b;var k;d&&(a.set(c,u),r(u,c,i,n,a),a.delete(c));et(t,s,u)}(t,e,a,s,ut,i,r);else{var l=i?i(yt(t,a),n,a+"",t,e,r):void 0;void 0===l&&(l=n),et(t,a,l)}}),jt)}function dt(t,e){return bt(function(t,e,s){return e=q(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,n=q(i.length-e,0),a=Array(n);++r<n;)a[r]=i[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=i[r];return o[e]=s(a),k(t,this,o)}}(t,e,It),t+"")}function pt(t,e,s,i,r,n){return Ot(t)&&Ot(e)&&(n.set(e,t),ut(t,e,void 0,pt,n),n.delete(e)),t}function ft(t,e){var s,i,r=t.__data__;return("string"==(i=typeof(s=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==s:null===s)?r["string"==typeof e?"string":"hash"]:r.map}function mt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return ct(s)?s:void 0}function vt(t,e){var s=typeof t;return!!(e=null==e?r:e)&&("number"==s||"symbol"!=s&&c.test(t))&&t>-1&&t%1==0&&t<e}function gt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_)}function yt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bt=function(t){var e=0,s=0;return function(){var i=H(),r=16-(i-s);if(s=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(W?function(t,e){return W(t,"toString",{configurable:!0,enumerable:!1,value:(s=e,function(){return s}),writable:!0});var s}:It);function kt(t,e){return t===e||t!=t&&e!=e}var wt=lt(function(){return arguments}())?lt:function(t){return Et(t)&&R.call(t,"callee")&&!z.call(t,"callee")},xt=Array.isArray;function Pt(t){return null!=t&&_t(t.length)&&!Tt(t)}var St=U||function(){return!1};function Tt(t){if(!Ot(t))return!1;var e=ot(t);return e==a||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function _t(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Ot(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var Rt=b?function(t){return function(e){return t(e)}}(b):function(t){return Et(t)&&_t(t.length)&&!!h[ot(t)]};var At=dt((function(t){return t.push(void 0,pt),k(Lt,void 0,t)}));function jt(t){return Pt(t)?tt(t,!0):ht(t)}var Ct,Lt=(Ct=function(t,e,s,i){ut(t,e,s,i)},dt((function(t,e){var s=-1,i=e.length,r=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(r=Ct.length>3&&"function"==typeof r?(i--,r):void 0,n&&function(t,e,s){if(!Ot(s))return!1;var i=typeof e;return!!("number"==i?Pt(s)&&vt(e,s.length):"string"==i&&e in s)&&kt(s[e],t)}(e[0],e[1],n)&&(r=i<3?void 0:r,i=1),t=Object(t);++s<i;){var a=e[s];a&&Ct(t,a,s,r)}return t})));function It(t){return t}t.exports=At},3520:t=>{var e=9007199254740991,s="[object Arguments]",i="[object Function]",r="[object GeneratorFunction]",n=/^(?:0|[1-9]\d*)$/;var a,o,l=Object.prototype,c=l.hasOwnProperty,h=l.toString,u=l.propertyIsEnumerable,d=(a=Object.keys,o=Object,function(t){return a(o(t))});function p(t,e){var i=y(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&b(t)}(t)&&c.call(t,"callee")&&(!u.call(t,"callee")||h.call(t)==s)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],r=i.length,n=!!r;for(var a in t)!e&&!c.call(t,a)||n&&("length"==a||g(a,r))||i.push(a);return i}var f,m=function(t,e,s){for(var i=-1,r=Object(t),n=s(t),a=n.length;a--;){var o=n[f?a:++i];if(!1===e(r[o],o,r))break}return t};function v(t){if(s=(e=t)&&e.constructor,i="function"==typeof s&&s.prototype||l,e!==i)return d(t);var e,s,i,r=[];for(var n in Object(t))c.call(t,n)&&"constructor"!=n&&r.push(n);return r}function g(t,s){return!!(s=null==s?e:s)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<s}var y=Array.isArray;function b(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?h.call(t):"";return e==i||e==r}(t)}function k(t){return b(t)?p(t):v(t)}function w(t){return t}t.exports=function(t,e){return t&&function(t,e){return t&&m(t,e,k)}(t,"function"==typeof e?e:w)}},372:(t,e,s)=>{"use strict";var i=s(6060);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!i(t)}},3940:(t,e,s)=>{"use strict";var i=s(5618),r={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!i(t)&&hasOwnProperty.call(r,typeof t)}},7205:(t,e,s)=>{"use strict";var i=s(372),r=/^\s*class[\s{/}]/,n=Function.prototype.toString;t.exports=function(t){return!!i(t)&&!r.test(n.call(t))}},6060:(t,e,s)=>{"use strict";var i=s(3940);t.exports=function(t){if(!i(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},5618:t=>{"use strict";t.exports=function(t){return null!=t}},4935:(t,e,s)=>{var i=s(3513);t.exports=i},7921:(t,e,s)=>{var i=s(3072);t.exports=i},347:(t,e,s)=>{var i=s(8744);t.exports=i},9720:(t,e,s)=>{var i=s(6943);t.exports=i},6672:(t,e,s)=>{var i=s(6240),r=s(7265);function n(t,e,s,i){if(i){var n=i[e];if(r(n))n.unhook&&n.unhook(t,e,s);else if("attributes"===e)for(var a in n)t.removeAttribute(a);else if("style"===e)for(var o in n)t.style[o]="";else t[e]="string"==typeof n?"":null}}function a(t,e,s,r,n){var a=s?s[r]:void 0;if("attributes"!==r)if(a&&i(a)&&o(a)!==o(n))t[r]=n;else{i(t[r])||(t[r]={});var l="style"===r?"":void 0;for(var c in n){var h=n[c];t[r][c]=void 0===h?l:h}}else for(var u in n){var d=n[u];void 0===d?t.removeAttribute(u):t.setAttribute(u,d)}}function o(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}t.exports=function(t,e,s){for(var o in e){var l=e[o];void 0===l?n(t,o,l,s):r(l)?(n(t,o,l,s),l.hook&&l.hook(t,o,s?s[o]:void 0)):i(l)?a(t,e,s,o,l):t[o]=l}}},3513:(t,e,s)=>{var i=s(9144),r=s(6672),n=s(5170),a=s(6221),o=s(4097),l=s(6078);t.exports=function t(e,s){var c=s&&s.document||i,h=s?s.warn:null;if(e=l(e).a,o(e))return e.init();if(a(e))return c.createTextNode(e.text);if(!n(e))return h&&h("Item is not a valid virtual dom node",e),null;var u=null===e.namespace?c.createElement(e.tagName):c.createElementNS(e.namespace,e.tagName),d=e.properties;r(u,d);for(var p=e.children,f=0;f<p.length;f++){var m=t(p[f],s);m&&u.appendChild(m)}return u}},8992:t=>{var e={};function s(t,r,n,a,o){if(a=a||{},t){i(n,o,o)&&(a[o]=t);var l=r.children;if(l)for(var c=t.childNodes,h=0;h<r.children.length;h++){o+=1;var u=l[h]||e,d=o+(u.count||0);i(n,o,d)&&s(c[h],u,n,a,o),o=d}}return a}function i(t,e,s){if(0===t.length)return!1;for(var i,r,n=0,a=t.length-1;n<=a;){if(r=t[i=(a+n)/2>>0],n===a)return r>=e&&r<=s;if(r<e)n=i+1;else{if(!(r>s))return!0;a=i-1}}return!1}function r(t,e){return t>e?1:-1}t.exports=function(t,e,i,n){return i&&0!==i.length?(i.sort(r),s(t,e,i,n,0)):{}}},9120:(t,e,s)=>{var i=s(6672),r=s(4097),n=s(8057),a=s(6670);function o(t,e){"function"==typeof e.destroy&&r(e)&&e.destroy(t)}t.exports=function(t,e,s){var r=t.type,l=t.vNode,c=t.patch;switch(r){case n.REMOVE:return function(t,e){var s=t.parentNode;s&&s.removeChild(t);return o(t,e),null}(e,l);case n.INSERT:return function(t,e,s){var i=s.render(e,s);t&&t.appendChild(i);return t}(e,c,s);case n.VTEXT:return function(t,e,s,i){var r;if(3===t.nodeType)t.replaceData(0,t.length,s.text),r=t;else{var n=t.parentNode;r=i.render(s,i),n&&r!==t&&n.replaceChild(r,t)}return r}(e,0,c,s);case n.WIDGET:return function(t,e,s,i){var r,n=a(e,s);r=n?s.update(e,t)||t:i.render(s,i);var l=t.parentNode;l&&r!==t&&l.replaceChild(r,t);n||o(t,e);return r}(e,l,c,s);case n.VNODE:return function(t,e,s,i){var r=t.parentNode,n=i.render(s,i);r&&n!==t&&r.replaceChild(n,t);return n}(e,0,c,s);case n.ORDER:return function(t,e){for(var s,i,r,n=t.childNodes,a={},o=0;o<e.removes.length;o++)s=n[(i=e.removes[o]).from],i.key&&(a[i.key]=s),t.removeChild(s);for(var l=n.length,c=0;c<e.inserts.length;c++)s=a[(r=e.inserts[c]).key],t.insertBefore(s,r.to>=l++?null:n[r.to])}(e,c),e;case n.PROPS:return i(e,c,l.properties),e;case n.THUNK:return function(t,e){t&&e&&t!==e&&t.parentNode&&t.parentNode.replaceChild(e,t);return e}(e,s.patch(e,c,s));default:return e}}},6943:(t,e,s)=>{var i=s(9144),r=s(7362),n=s(3513),a=s(8992),o=s(9120);function l(t,e,s){var r=function(t){var e=[];for(var s in t)"a"!==s&&e.push(Number(s));return e}(e);if(0===r.length)return t;var n=a(t,e.a,r),o=t.ownerDocument;s.document||o===i||(s.document=o);for(var l=0;l<r.length;l++){var h=r[l];t=c(t,n[h],e[h],s)}return t}function c(t,e,s,i){if(!e)return t;var n;if(r(s))for(var a=0;a<s.length;a++)n=o(s[a],e,i),e===t&&(t=n);else n=o(s,e,i),e===t&&(t=n);return t}t.exports=function t(e,s,i){return(i=i||{}).patch=i.patch&&i.patch!==t?i.patch:l,i.render=i.render||n,i.patch(e,s,i)}},6670:(t,e,s)=>{var i=s(4097);t.exports=function(t,e){if(i(t)&&i(e))return"name"in t&&"name"in e?t.id===e.id:t.init===e.init;return!1}},6505:(t,e,s)=>{"use strict";var i=s(8832);function r(t){if(!(this instanceof r))return new r(t);this.value=t}t.exports=r,r.prototype.hook=function(t,e){i(t)[e.substr(3)]=this.value},r.prototype.unhook=function(t,e){i(t)[e.substr(3)]=void 0}},7199:t=>{"use strict";function e(t){if(!(this instanceof e))return new e(t);this.value=t}t.exports=e,e.prototype.hook=function(t,e){t[e]!==this.value&&(t[e]=this.value)}},8744:(t,e,s)=>{"use strict";var i=s(7362),r=s(4282),n=s(4268),a=s(5170),o=s(6221),l=s(4097),c=s(7265),h=s(6741),u=s(1948),d=s(7199),p=s(6505);function f(t,e,s,r){if("string"==typeof t)e.push(new n(t));else if("number"==typeof t)e.push(new n(String(t)));else if(m(t))e.push(t);else{if(!i(t)){if(null==t)return;throw o={foreignObject:t,parentVnode:{tagName:s,properties:r}},(l=new Error).type="virtual-hyperscript.unexpected.virtual-element",l.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+v(o.foreignObject)+".\nThe parent vnode is:\n"+v(o.parentVnode),l.foreignObject=o.foreignObject,l.parentVnode=o.parentVnode,l}for(var a=0;a<t.length;a++)f(t[a],e,s,r)}var o,l}function m(t){return a(t)||o(t)||l(t)||h(t)}function v(t){try{return JSON.stringify(t,null," ")}catch(e){return String(t)}}t.exports=function(t,e,s){var n,a,o,l,h=[];!s&&(v=e,"string"==typeof v||i(v)||m(v))&&(s=e,a={});var v;n=u(t,a=a||e||{}),a.hasOwnProperty("key")&&(o=a.key,a.key=void 0);a.hasOwnProperty("namespace")&&(l=a.namespace,a.namespace=void 0);"INPUT"!==n||l||!a.hasOwnProperty("value")||void 0===a.value||c(a.value)||(a.value=d(a.value));(function(t){for(var e in t)if(t.hasOwnProperty(e)){var s=t[e];if(c(s))continue;"ev-"===e.substr(0,3)&&(t[e]=p(s))}})(a),null!=s&&f(s,h,n,a);return new r(n,a,h,o,l)}},1948:(t,e,s)=>{"use strict";var i=s(6824),r=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,n=/^\.|#/;t.exports=function(t,e){if(!t)return"DIV";var s,a,o,l,c=!e.hasOwnProperty("id"),h=i(t,r),u=null;n.test(h[1])&&(u="DIV");for(l=0;l<h.length;l++)(a=h[l])&&(o=a.charAt(0),u?"."===o?(s=s||[]).push(a.substring(1,a.length)):"#"===o&&c&&(e.id=a.substring(1,a.length)):u=a);s&&(e.className&&s.push(e.className),e.className=s.join(" "));return e.namespace?u:u.toUpperCase()}},6078:(t,e,s)=>{var i=s(5170),r=s(6221),n=s(4097),a=s(6741);function o(t,e){var s=t.vnode;if(s||(s=t.vnode=t.render(e)),!(i(s)||r(s)||n(s)))throw new Error("thunk did not return a valid node");return s}t.exports=function(t,e){var s=t,i=e;a(e)&&(i=o(e,t));a(t)&&(s=o(t,null));return{a:s,b:i}}},6741:t=>{t.exports=function(t){return t&&"Thunk"===t.type}},7265:t=>{t.exports=function(t){return t&&("function"==typeof t.hook&&!t.hasOwnProperty("hook")||"function"==typeof t.unhook&&!t.hasOwnProperty("unhook"))}},5170:(t,e,s)=>{var i=s(9962);t.exports=function(t){return t&&"VirtualNode"===t.type&&t.version===i}},6221:(t,e,s)=>{var i=s(9962);t.exports=function(t){return t&&"VirtualText"===t.type&&t.version===i}},4097:t=>{t.exports=function(t){return t&&"Widget"===t.type}},9962:t=>{t.exports="2"},4282:(t,e,s)=>{var i=s(9962),r=s(5170),n=s(4097),a=s(6741),o=s(7265);t.exports=h;var l={},c=[];function h(t,e,s,i,h){this.tagName=t,this.properties=e||l,this.children=s||c,this.key=null!=i?String(i):void 0,this.namespace="string"==typeof h?h:null;var u,d=s&&s.length||0,p=0,f=!1,m=!1,v=!1;for(var g in e)if(e.hasOwnProperty(g)){var y=e[g];o(y)&&y.unhook&&(u||(u={}),u[g]=y)}for(var b=0;b<d;b++){var k=s[b];r(k)?(p+=k.count||0,!f&&k.hasWidgets&&(f=!0),!m&&k.hasThunks&&(m=!0),v||!k.hooks&&!k.descendantHooks||(v=!0)):!f&&n(k)?"function"==typeof k.destroy&&(f=!0):!m&&a(k)&&(m=!0)}this.count=d+p,this.hasWidgets=f,this.hasThunks=m,this.hooks=u,this.descendantHooks=v}h.prototype.version=i,h.prototype.type="VirtualNode"},8057:(t,e,s)=>{var i=s(9962);function r(t,e,s){this.type=Number(t),this.vNode=e,this.patch=s}r.NONE=0,r.VTEXT=1,r.VNODE=2,r.WIDGET=3,r.PROPS=4,r.ORDER=5,r.INSERT=6,r.REMOVE=7,r.THUNK=8,t.exports=r,r.prototype.version=i,r.prototype.type="VirtualPatch"},4268:(t,e,s)=>{var i=s(9962);function r(t){this.text=String(t)}t.exports=r,r.prototype.version=i,r.prototype.type="VirtualText"},9973:(t,e,s)=>{var i=s(6240),r=s(7265);function n(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}t.exports=function t(e,s){var a;for(var o in e){o in s||((a=a||{})[o]=void 0);var l=e[o],c=s[o];if(l!==c)if(i(l)&&i(c))if(n(c)!==n(l))(a=a||{})[o]=c;else if(r(c))(a=a||{})[o]=c;else{var h=t(l,c);h&&((a=a||{})[o]=h)}else(a=a||{})[o]=c}for(var u in s)u in e||((a=a||{})[u]=s[u]);return a}},3072:(t,e,s)=>{var i=s(7362),r=s(8057),n=s(5170),a=s(6221),o=s(4097),l=s(6741),c=s(6078),h=s(9973);function u(t,e){var s={a:t};return d(t,e,s,0),s}function d(t,e,s,i){if(t!==e){var c=s[i],u=!1;if(l(t)||l(e))m(t,e,s,i);else if(null==e)o(t)||(p(t,s,i),c=s[i]),c=b(c,new r(r.REMOVE,t,e));else if(n(e))if(n(t))if(t.tagName===e.tagName&&t.namespace===e.namespace&&t.key===e.key){var f=h(t.properties,e.properties);f&&(c=b(c,new r(r.PROPS,t,f))),c=function(t,e,s,i,a){for(var o=t.children,l=function(t,e){var s=y(e),i=s.keys,r=s.free;if(r.length===e.length)return{children:e,moves:null};var n=y(t),a=n.keys;if(n.free.length===t.length)return{children:e,moves:null};for(var o=[],l=0,c=r.length,h=0,u=0;u<t.length;u++){var d,p=t[u];p.key?i.hasOwnProperty(p.key)?(d=i[p.key],o.push(e[d])):(d=u-h++,o.push(null)):l<c?(d=r[l++],o.push(e[d])):(d=u-h++,o.push(null))}for(var f=l>=r.length?e.length:r[l],m=0;m<e.length;m++){var v=e[m];v.key?a.hasOwnProperty(v.key)||o.push(v):m>=f&&o.push(v)}for(var b,k=o.slice(),w=0,x=[],P=[],S=0;S<e.length;){var T=e[S];for(b=k[w];null===b&&k.length;)x.push(g(k,w,null)),b=k[w];b&&b.key===T.key?(w++,S++):T.key?(b&&b.key&&i[b.key]!==S+1?(x.push(g(k,w,b.key)),(b=k[w])&&b.key===T.key?w++:P.push({key:T.key,to:S})):P.push({key:T.key,to:S}),S++):b&&b.key&&x.push(g(k,w,b.key))}for(;w<k.length;)b=k[w],x.push(g(k,w,b&&b.key));if(x.length===h&&!P.length)return{children:o,moves:null};return{children:o,moves:{removes:x,inserts:P}}}(o,e.children),c=l.children,h=o.length,u=c.length,p=h>u?h:u,f=0;f<p;f++){var m=o[f],v=c[f];a+=1,m?d(m,v,s,a):v&&(i=b(i,new r(r.INSERT,null,v))),n(m)&&m.count&&(a+=m.count)}l.moves&&(i=b(i,new r(r.ORDER,t,l.moves)));return i}(t,e,s,c,i)}else c=b(c,new r(r.VNODE,t,e)),u=!0;else c=b(c,new r(r.VNODE,t,e)),u=!0;else a(e)?a(t)?t.text!==e.text&&(c=b(c,new r(r.VTEXT,t,e))):(c=b(c,new r(r.VTEXT,t,e)),u=!0):o(e)&&(o(t)||(u=!0),c=b(c,new r(r.WIDGET,t,e)));c&&(s[i]=c),u&&p(t,s,i)}}function p(t,e,s){v(t,e,s),f(t,e,s)}function f(t,e,s){if(o(t))"function"==typeof t.destroy&&(e[s]=b(e[s],new r(r.REMOVE,t,null)));else if(n(t)&&(t.hasWidgets||t.hasThunks))for(var i=t.children,a=i.length,c=0;c<a;c++){var h=i[c];f(h,e,s+=1),n(h)&&h.count&&(s+=h.count)}else l(t)&&m(t,null,e,s)}function m(t,e,s,i){var n=c(t,e),a=u(n.a,n.b);(function(t){for(var e in t)if("a"!==e)return!0;return!1})(a)&&(s[i]=new r(r.THUNK,null,a))}function v(t,e,s){if(n(t)){if(t.hooks&&(e[s]=b(e[s],new r(r.PROPS,t,function(t){var e={};for(var s in t)e[s]=void 0;return e}(t.hooks)))),t.descendantHooks||t.hasThunks)for(var i=t.children,a=i.length,o=0;o<a;o++){var c=i[o];v(c,e,s+=1),n(c)&&c.count&&(s+=c.count)}}else l(t)&&m(t,null,e,s)}function g(t,e,s){return t.splice(e,1),{from:e,key:s}}function y(t){for(var e={},s=[],i=t.length,r=0;r<i;r++){var n=t[r];n.key?e[n.key]=r:s.push(r)}return{keys:e,free:s}}function b(t,e){return t?(i(t)?t.push(e):t=[t,e],t):e}t.exports=u},4991:t=>{"use strict";function e(t){for(var e,s=1/0,i=-1/0,r=0,n=t.length;r<n;r++)s>(e=t[r])&&(s=e),i<e&&(i=e);return{min:s,max:i}}function s(t,e){var s=Math.pow(2,e-1),i=t<0?t*s:t*(s-1);return Math.max(-s,Math.min(s-1,i))}function i(t,i,n){var a,o,l,c,h,u,d=t.length,p=Math.ceil(d/i),f=r(n,2*p);for(a=0;a<p;a++)o=a*i,l=(a+1)*i>d?d:(a+1)*i,h=s((u=e(t.subarray(o,l))).min,n),c=s(u.max,n),f[2*a]=h,f[2*a+1]=c;return f}function r(t,e){return new(new Function(`return Int${t}Array`)())(e)}function n(t,e){return"number"==typeof t?t:e}t.exports=function(t,e,s,a,o,l){if(e=n(e,1e3),l=n(l,16),null==s&&(s=!0),[8,16,32].indexOf(l)<0)throw new Error("Invalid number of bits specified for peaks.");var c,h,u=t.numberOfChannels,d=[];if(a=n(a,0),o=n(o,t.length),void 0===t.subarray)for(c=0;c<u;c++)h=t.getChannelData(c).subarray(a,o),d.push(i(h,e,l));else d.push(i(t.subarray(a,o),e,l));return s&&d.length>1&&(d=function(t,e){var s,i,n=t.length,a=1/n,o=t[0].length/2,l=0,c=0,h=r(e,2*o);for(c=0;c<o;c++){for(s=0,i=0,l=0;l<n;l++)s+=a*t[l][2*c],i+=a*t[l][2*c+1];h[2*c]=s,h[2*c+1]=i}return[h]}(d,l)),{length:d[0].length/2,data:d,bits:l}}},7362:t=>{var e=Array.isArray,s=Object.prototype.toString;t.exports=e||function(t){return"[object Array]"===s.call(t)}},5893:()=>{}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i](n,n.exports,s),n.loaded=!0,n.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};(()=>{"use strict";s.r(i),s.d(i,{default:()=>ot,init:()=>at});var t=s(2098),e=s.n(t),r=s(4935),n=s.n(r),a=s(8370),o=s.n(a),l=s(347),c=s.n(l),h=s(7921),u=s.n(h),d=s(9720),p=s.n(d),f=s(849),m=s.n(f);function v(t,e){return Math.ceil(t*e)}function g(t,e,s){return t*e/s}function y(t,e,s){return Math.ceil(t*s/e)}const b=class{constructor(t,e,s=o()()){this.src=t,this.ac=e,this.audioRequestState=0,this.ee=s}setStateChange(t){this.audioRequestState=t,this.ee.emit("audiorequeststatechange",this.audioRequestState,this.src)}fileProgress(t){let e=0;0===this.audioRequestState&&this.setStateChange(1),t.lengthComputable&&(e=t.loaded/t.total*100),this.ee.emit("loadprogress",e,this.src)}fileLoad(t){const e=t.target.response||t.target.result;return this.setStateChange(2),new Promise(((t,s)=>{this.ac.decodeAudioData(e,(e=>{this.audioBuffer=e,this.setStateChange(3),t(e)}),(t=>{s(null===t?Error("MediaDecodeAudioDataUnknownContentType"):t)}))}))}},k=class extends b{load(){return new Promise(((t,e)=>{if(this.src.type.match(/audio.*/)||this.src.type.match(/video\/ogg/)){const s=new FileReader;s.readAsArrayBuffer(this.src),s.addEventListener("progress",(t=>{super.fileProgress(t)})),s.addEventListener("load",(s=>{super.fileLoad(s).then((e=>{t(e)})).catch(e)})),s.addEventListener("error",e)}else e(Error(`Unsupported file type ${this.src.type}`))}))}};class w extends b{load(){return Promise.resolve(this.src)}}const x=class extends b{load(){return new Promise(((t,e)=>{const s=new XMLHttpRequest;s.open("GET",this.src,!0),s.responseType="arraybuffer",s.send(),s.addEventListener("progress",(t=>{super.fileProgress(t)})),s.addEventListener("load",(s=>{super.fileLoad(s).then((e=>{t(e)})).catch(e)})),s.addEventListener("error",(()=>{e(Error(`Track ${this.src} failed to load`))}))}))}},P=class{static createLoader(t,e,s){if(t instanceof Blob)return new k(t,e,s);if(t instanceof AudioBuffer)return new w(t,e,s);if("string"==typeof t)return new x(t,e,s);throw new Error("Unsupported src type")}},S=class{constructor(t){this.playlist=t}hook(t){const e=this.playlist;if(!e.isScrolling){const s=t;if(e.isAutomaticScroll){const s=t.getBoundingClientRect(),i=e.controls.show?e.controls.width:0,r=g(s.width-i,e.samplesPerPixel,e.sampleRate),n=e.isPlaying()?e.playbackSeconds:e.getTimeSelection().start;(n<e.scrollLeft||n>=e.scrollLeft+r)&&(e.scrollLeft=Math.min(n,e.duration-r))}const i=y(e.scrollLeft,e.samplesPerPixel,e.sampleRate);s.scrollLeft=i}}},T=class{constructor(t,e,s,i,r){this.tickInfo=t,this.offset=e,this.samplesPerPixel=s,this.duration=i,this.colors=r}hook(t,e,s){if(void 0!==s&&s.offset===this.offset&&s.duration===this.duration&&s.samplesPerPixel===this.samplesPerPixel)return;const i=t.width,r=t.height,n=t.getContext("2d");n.clearRect(0,0,i,r),n.fillStyle=this.colors.timeColor,Object.keys(this.tickInfo).forEach((t=>{const e=this.tickInfo[t],s=r-e;n.fillRect(t,s,1,e)}))}};class _{constructor(t,e,s,i,r=0,n){this.duration=t,this.offset=e,this.samplesPerPixel=s,this.sampleRate=i,this.marginLeft=r,this.colors=n,this.timeinfo={2e4:{marker:3e4,bigStep:1e4,smallStep:5e3,secondStep:5},12e3:{marker:15e3,bigStep:5e3,smallStep:1e3,secondStep:1},1e4:{marker:1e4,bigStep:5e3,smallStep:1e3,secondStep:1},5e3:{marker:5e3,bigStep:1e3,smallStep:500,secondStep:.5},2500:{marker:2e3,bigStep:1e3,smallStep:500,secondStep:.5},1500:{marker:2e3,bigStep:1e3,smallStep:200,secondStep:.2},700:{marker:1e3,bigStep:500,smallStep:100,secondStep:.1}}}getScaleInfo(t){let e=Object.keys(this.timeinfo).map((t=>parseInt(t,10)));e=e.sort(((t,e)=>t-e));for(let s=0;s<e.length;s+=1)if(t<=e[s])return this.timeinfo[e[s]];return this.timeinfo[e[0]]}static formatTime(t){const e=t/1e3;let s=e%60;const i=(e-s)/60;return s<10&&(s=`0${s}`),`${i}:${s}`}render(){const t=y(this.duration,this.samplesPerPixel,this.sampleRate),e=this.sampleRate/this.samplesPerPixel,s=y(this.offset,this.samplesPerPixel,this.sampleRate),i=this.getScaleInfo(this.samplesPerPixel),r={},n=[],a=t+s;let o=0;for(let t=0;t<a;t+=e*i.secondStep){const e=Math.floor(t),a=e-s;e>=s&&(i.marker&&o%i.marker==0?(n.push(c()("div.time",{attributes:{style:`position: absolute; left: ${a}px;`}},[_.formatTime(o)])),r[a]=10):i.bigStep&&o%i.bigStep==0?r[a]=5:i.smallStep&&o%i.smallStep==0&&(r[a]=2)),o+=1e3*i.secondStep}return c()("div.playlist-time-scale",{attributes:{style:`position: relative; left: 0; right: 0; margin-left: ${this.marginLeft}px;`}},[n,c()("canvas",{attributes:{width:t,height:30,style:"position: absolute; left: 0; right: 0; top: 0; bottom: 0;"},hook:new T(r,this.offset,this.samplesPerPixel,this.duration,this.colors)})])}}const O=_;var E,R=s(1730),A=s.n(R),j=s(3520),C=s.n(j),L=new Uint8Array(16);function I(){if(!E&&!(E="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(L)}const M=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const F=function(t){return"string"==typeof t&&M.test(t)};for(var G=[],$=0;$<256;++$)G.push(($+256).toString(16).substr(1));const D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=(G[t[e+0]]+G[t[e+1]]+G[t[e+2]]+G[t[e+3]]+"-"+G[t[e+4]]+G[t[e+5]]+"-"+G[t[e+6]]+G[t[e+7]]+"-"+G[t[e+8]]+G[t[e+9]]+"-"+G[t[e+10]]+G[t[e+11]]+G[t[e+12]]+G[t[e+13]]+G[t[e+14]]+G[t[e+15]]).toLowerCase();if(!F(s))throw TypeError("Stringified UUID is invalid");return s};const z=function(t,e,s){var i=(t=t||{}).random||(t.rng||I)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){s=s||0;for(var r=0;r<16;++r)e[s+r]=i[r];return e}return D(i)};var V=s(4991),N=s.n(V),W=s(1114);const U={cursor:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){t.preventDefault();const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}static getClass(){return".state-cursor"}static getEvents(){return["click"]}},select:class{constructor(t){this.track=t,this.active=!1}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}emitSelection(t){const e=Math.min(t,this.startX),s=Math.max(t,this.startX),i=g(e,this.samplesPerPixel,this.sampleRate),r=g(s,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",i,r,this.track)}complete(t){this.emitSelection(t),this.active=!1}mousedown(t){t.preventDefault(),this.active=!0,this.startX=t.offsetX;const e=g(this.startX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}mousemove(t){this.active&&(t.preventDefault(),this.emitSelection(t.offsetX))}mouseup(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}mouseleave(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}static getClass(){return".state-select"}static getEvents(){return["mousedown","mousemove","mouseup","mouseleave"]}},shift:class{constructor(t){this.track=t,this.active=!1}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}emitShift(t){const e=g(t-this.prevX,this.samplesPerPixel,this.sampleRate);this.prevX=t,this.track.ee.emit("shift",e,this.track)}complete(t){this.emitShift(t),this.active=!1}mousedown(t){t.preventDefault(),this.active=!0,this.el=t.target,this.prevX=t.offsetX}mousemove(t){this.active&&(t.preventDefault(),this.emitShift(t.offsetX))}mouseup(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}mouseleave(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}static getClass(){return".state-shift"}static getEvents(){return["mousedown","mousemove","mouseup","mouseleave"]}},fadein:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);e>this.track.getStartTime()&&e<this.track.getEndTime()&&this.track.ee.emit("fadein",e-this.track.getStartTime(),this.track)}static getClass(){return".state-fadein"}static getEvents(){return["click"]}},fadeout:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);e>this.track.getStartTime()&&e<this.track.getEndTime()&&this.track.ee.emit("fadeout",this.track.getEndTime()-e,this.track)}static getClass(){return".state-fadeout"}static getEvents(){return["click"]}}};class q{constructor(t,e,s,i,r,n,a,o){this.peaks=t,this.offset=e,this.color=i,this.bits=s,this.scale=r,this.height=n,this.barWidth=a,this.barGap=o}static drawFrame(t,e,s,i,r,n,a){const o=Math.abs(i*e),l=Math.abs(r*e);t.fillRect(s,0,n,e-l),t.fillRect(s,e+o,n,e-o),0!==a&&t.fillRect(s+n,0,a,2*e)}hook(t,e,s){if(void 0!==s&&s.peaks===this.peaks&&s.scale===this.scale&&s.height===this.height)return;const i=this.scale,r=t.width/i,n=t.getContext("2d"),a=t.height/i/2,o=2**(this.bits-1),l=this.barWidth,c=this.barGap,h=l+c;n.clearRect(0,0,t.width,t.height),n.save(),n.fillStyle=this.color,n.scale(i,i);for(let t=0;t<r;t+=h){const e=this.peaks[2*(t+this.offset)]/o,s=this.peaks[2*(t+this.offset)+1]/o;q.drawFrame(n,a,t,e,s,l,c)}n.restore()}}const H=q;var X=s(6226);class B{constructor(t,e,s,i){this.type=t,this.shape=e,this.duration=s,this.samplesPerPixel=i}static createCurve(t,e,s){let i,r;switch(e){case W.Y1:i=1;break;case W.h7:i=-1;break;default:throw new Error("Unsupported fade type.")}switch(t){case W._h:r=(0,X.sCurve)(s,i);break;case W.t$:r=(0,X.linear)(s,i);break;case W.Jl:r=(0,X.exponential)(s,i);break;case W.Hp:r=(0,X.logarithmic)(s,10,i);break;default:throw new Error("Unsupported fade shape")}return r}hook(t,e,s){if(void 0!==s&&s.shape===this.shape&&s.type===this.type&&s.duration===this.duration&&s.samplesPerPixel===this.samplesPerPixel)return;const i=t.getContext("2d"),r=t.width,n=t.height,a=B.createCurve(this.shape,this.type,r),o=a.length;let l=n-a[0]*n;i.clearRect(0,0,t.width,t.height),i.save(),i.strokeStyle="black",i.beginPath(),i.moveTo(0,l);for(let t=1;t<o;t+=1)l=n-a[t]*n,i.lineTo(t,l);i.stroke(),i.restore()}}const Y=B,Z=class{constructor(t){this.gain=t}hook(t){t.value=100*this.gain,t.title=`${Math.round(100*this.gain)}% volume`}},J=class{constructor(t){this.stereoPan=t}hook(t){let e;t.value=100*this.stereoPan,e=0===this.stereoPan?"Center":this.stereoPan<0?"Left":"Right";const s=`${Math.abs(Math.round(100*this.stereoPan))}% `;t.title=`Pan: ${0!==this.stereoPan?s:""}${e}`}},K=class{constructor(){this.name="Untitled",this.customClass=void 0,this.waveOutlineColor=void 0,this.gain=1,this.fades={},this.peakData={type:"WebAudio",mono:!1},this.cueIn=0,this.cueOut=0,this.duration=0,this.startTime=0,this.endTime=0,this.stereoPan=0}setEventEmitter(t){this.ee=t}setName(t){this.name=t}setCustomClass(t){this.customClass=t}setWaveOutlineColor(t){this.waveOutlineColor=t}setCues(t,e){if(e<t)throw new Error("cue out cannot be less than cue in");this.cueIn=t,this.cueOut=e,this.duration=this.cueOut-this.cueIn,this.endTime=this.startTime+this.duration}trim(t,e){const s=this.getStartTime(),i=this.getEndTime(),r=this.cueIn-s;if(s<=t&&i>=t||s<=e&&i>=e){const n=t<s?s:t,a=e>i?i:e;this.setCues(n+r,a+r),t>s&&this.setStartTime(t)}}setStartTime(t){this.startTime=t,this.endTime=t+this.duration}setPlayout(t){this.playout=t}setOfflinePlayout(t){this.offlinePlayout=t}setEnabledStates(t={}){this.enabledStates=A()({},{cursor:!0,fadein:!0,fadeout:!0,select:!0,shift:!0},t)}setFadeIn(t,e="logarithmic"){if(t>this.duration)throw new Error("Invalid Fade In");const s={shape:e,start:0,end:t};this.fadeIn&&(this.removeFade(this.fadeIn),this.fadeIn=void 0),this.fadeIn=this.saveFade(W.Y1,s.shape,s.start,s.end)}setFadeOut(t,e="logarithmic"){if(t>this.duration)throw new Error("Invalid Fade Out");const s={shape:e,start:this.duration-t,end:this.duration};this.fadeOut&&(this.removeFade(this.fadeOut),this.fadeOut=void 0),this.fadeOut=this.saveFade(W.h7,s.shape,s.start,s.end)}saveFade(t,e,s,i){const r=z();return this.fades[r]={type:t,shape:e,start:s,end:i},r}removeFade(t){delete this.fades[t]}setBuffer(t){this.buffer=t}setPeakData(t){this.peakData=t}calculatePeaks(t,e){const s=v(this.cueIn,e),i=v(this.cueOut,e);this.setPeaks(N()(this.buffer,t,this.peakData.mono,s,i))}setPeaks(t){this.peaks=t}setState(t){if(this.state=t,this.state&&this.enabledStates[this.state]){const t=U[this.state];this.stateObj=new t(this)}else this.stateObj=void 0}getStartTime(){return this.startTime}getEndTime(){return this.endTime}getDuration(){return this.duration}isPlaying(){return this.playout.isPlaying()}setShouldPlay(t){this.playout.setShouldPlay(t)}setGainLevel(t){this.gain=t,this.playout.setVolumeGainLevel(t)}setMasterGainLevel(t){this.playout.setMasterGainLevel(t)}setStereoPanValue(t){this.stereoPan=t,this.playout.setStereoPanValue(t)}schedulePlay(t,e,s,i){let r,n,a=t,o=s?s-e:void 0;const l=A()({},{shouldPlay:!0,masterGain:1,isOffline:!1},i),c=l.isOffline?this.offlinePlayout:this.playout;if(this.endTime<=e||o&&e+o<this.startTime)return Promise.resolve();this.startTime>=e?(r=0,a+=this.startTime-e,s?(o-=this.startTime-e,n=Math.min(o,this.duration)):n=this.duration):(r=e-this.startTime,n=s?Math.min(o,this.duration-r):this.duration-r),r+=this.cueIn;const h=e-this.startTime,u=c.setUpSource();return C()(this.fades,(e=>{let s,i;if(h<e.end)switch(h<=e.start?(s=t+(e.start-h),i=e.end-e.start):h>e.start&&h<e.end&&(s=t-(h-e.start),i=e.end-e.start),e.type){case W.Y1:c.applyFadeIn(s,i,e.shape);break;case W.h7:c.applyFadeOut(s,i,e.shape);break;default:throw new Error("Invalid fade type saved on track.")}})),c.setVolumeGainLevel(this.gain),c.setShouldPlay(l.shouldPlay),c.setMasterGainLevel(l.masterGain),c.setStereoPanValue(this.stereoPan),c.play(a,r,n),u}scheduleStop(t=0){this.playout.stop(t)}renderOverlay(t){const e={attributes:{style:`position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: ${y(t.playlistLength,t.resolution,t.sampleRate)}px; z-index: 9;`}};let s="";if(this.stateObj){this.stateObj.setup(t.resolution,t.sampleRate);const i=U[this.state];i.getEvents().forEach((t=>{e[`on${t}`]=this.stateObj[t].bind(this.stateObj)})),s=i.getClass()}return c()(`div.playlist-overlay${s}`,e)}renderControls(t){const e=t.muted?".active":"",s=t.soloed?".active":"",i=t.collapsed,r=this.peaks.data.length,n=t.controls.widgets,a=c()("button.btn.btn-danger.btn-xs.track-remove",{attributes:{type:"button",title:"Remove track"},onclick:()=>{this.ee.emit("removeTrack",this)}},[c()("i.fas.fa-times")]),o=c()("span",[this.name]),l=c()("button.btn.btn-info.btn-xs.track-collapse",{attributes:{type:"button",title:i?"Expand track":"Collapse track"},onclick:()=>{this.ee.emit("changeTrackView",this,{collapsed:!i})}},[c()("i.fas."+(i?"fa-caret-down":"fa-caret-up"))]),h=[];n.remove&&h.push(a),h.push(o),n.collapse&&h.push(l);const u=[c()("div.track-header",h)];return i||(n.muteOrSolo&&u.push(c()("div.btn-group",[c()(`button.btn.btn-outline-dark.btn-xs.btn-mute${e}`,{attributes:{type:"button"},onclick:()=>{this.ee.emit("mute",this)}},["Mute"]),c()(`button.btn.btn-outline-dark.btn-xs.btn-solo${s}`,{onclick:()=>{this.ee.emit("solo",this)}},["Solo"])])),n.volume&&u.push(c()("label.volume",[c()("input.volume-slider",{attributes:{"aria-label":"Track volume control",type:"range",min:0,max:100,value:100},hook:new Z(this.gain),oninput:t=>{this.ee.emit("volumechange",t.target.value,this)}})])),n.stereoPan&&u.push(c()("label.stereopan",[c()("input.stereopan-slider",{attributes:{"aria-label":"Track stereo pan control",type:"range",min:-100,max:100,value:100},hook:new J(this.stereoPan),oninput:t=>{this.ee.emit("stereopan",t.target.value/100,this)}})]))),c()("div.controls",{attributes:{style:`height: ${r*t.height}px; width: ${t.controls.width}px; position: absolute; left: 0; z-index: 10;`}},u)}render(t){const e=this.peaks.length,s=y(t.playbackSeconds,t.resolution,t.sampleRate),i=y(this.startTime,t.resolution,t.sampleRate),r=y(this.endTime,t.resolution,t.sampleRate);let n=0;const a=this.peaks.data.length,o=Math.floor(window.devicePixelRatio);s>0&&s>i&&(n=s<r?s-i:e);const l=[c()("div.cursor",{attributes:{style:`position: absolute; width: 1px; margin: 0; padding: 0; top: 0; left: ${s}px; bottom: 0; z-index: 5;`}})],h=Object.keys(this.peaks.data).map((s=>{const r=[c()("div.channel-progress",{attributes:{style:`position: absolute; width: ${n}px; height: ${t.height}px; z-index: 2;`}})];let a=0,l=e;const h=this.peaks.data[s];for(;l>0;){const e=Math.min(l,1e3),s=this.waveOutlineColor?this.waveOutlineColor:t.colors.waveOutlineColor;r.push(c()("canvas",{attributes:{width:e*o,height:t.height*o,style:`float: left; position: relative; margin: 0; padding: 0; z-index: 3; width: ${e}px; height: ${t.height}px;`},hook:new H(h,a,this.peaks.bits,s,o,t.height,t.barWidth,t.barGap)})),l-=e,a+=1e3}if(this.fadeIn){const e=this.fades[this.fadeIn],s=y(e.end-e.start,t.resolution,t.sampleRate);r.push(c()("div.wp-fade.wp-fadein",{attributes:{style:`position: absolute; height: ${t.height}px; width: ${s}px; top: 0; left: 0; z-index: 4;`}},[c()("canvas",{attributes:{width:s,height:t.height},hook:new Y(e.type,e.shape,e.end-e.start,t.resolution)})]))}if(this.fadeOut){const e=this.fades[this.fadeOut],s=y(e.end-e.start,t.resolution,t.sampleRate);r.push(c()("div.wp-fade.wp-fadeout",{attributes:{style:`position: absolute; height: ${t.height}px; width: ${s}px; top: 0; right: 0; z-index: 4;`}},[c()("canvas",{attributes:{width:s,height:t.height},hook:new Y(e.type,e.shape,e.end-e.start,t.resolution)})]))}return c()(`div.channel.channel-${s}`,{attributes:{style:`height: ${t.height}px; width: ${e}px; top: ${s*t.height}px; left: ${i}px; position: absolute; margin: 0; padding: 0; z-index: 1;`}},r)}));if(l.push(h),l.push(this.renderOverlay(t)),!0===t.isActive){const e=y(t.timeSelection.start,t.resolution,t.sampleRate),s=y(t.timeSelection.end,t.resolution,t.sampleRate)-e+1,i=s>1?".segment":".point";l.push(c()(`div.selection${i}`,{attributes:{style:`position: absolute; width: ${s}px; bottom: 0; top: 0; left: ${e}px; z-index: 4;`}}))}const u=c()("div.waveform",{attributes:{style:`height: ${a*t.height}px; position: relative;`}},l),d=[];let p=0;t.controls.show&&(d.push(this.renderControls(t)),p=t.controls.width),d.push(u);const f=t.shouldPlay?"":".silent",m=void 0===this.customClass?"":`.${this.customClass}`;return c()(`div.channel-wrapper${f}${m}`,{attributes:{style:`margin-left: ${p}px; height: ${t.height*a}px;`}},d)}getTrackDetails(){const t={src:this.src,start:this.startTime,end:this.endTime,name:this.name,customClass:this.customClass,cuein:this.cueIn,cueout:this.cueOut,stereoPan:this.stereoPan,gain:this.gain};if(this.fadeIn){const e=this.fades[this.fadeIn];t.fadeIn={shape:e.shape,duration:e.end-e.start}}if(this.fadeOut){const e=this.fades[this.fadeOut];t.fadeOut={shape:e.shape,duration:e.end-e.start}}return t}},Q=class{constructor(t,e){this.ac=t,this.gain=1,this.buffer=e,this.destination=this.ac.destination,this.ac.createStereoPanner=t.createStereoPanner||t.createPanner}applyFade(t,e,s,i="logarithmic"){if(t===W.Y1)(0,W.L7)(this.fadeGain.gain,i,e,s);else{if(t!==W.h7)throw new Error("Unsupported fade type");(0,W.Mt)(this.fadeGain.gain,i,e,s)}}applyFadeIn(t,e,s="logarithmic"){this.applyFade(W.Y1,t,e,s)}applyFadeOut(t,e,s="logarithmic"){this.applyFade(W.h7,t,e,s)}isPlaying(){return void 0!==this.source}getDuration(){return this.buffer.duration}setAudioContext(t){this.ac=t,this.ac.createStereoPanner=t.createStereoPanner||t.createPanner,this.destination=this.ac.destination}setUpSource(){this.source=this.ac.createBufferSource(),this.source.buffer=this.buffer;const t=new Promise((t=>{this.source.onended=()=>{this.source.disconnect(),this.fadeGain.disconnect(),this.volumeGain.disconnect(),this.shouldPlayGain.disconnect(),this.panner.disconnect(),this.masterGain.disconnect(),this.source=void 0,this.fadeGain=void 0,this.volumeGain=void 0,this.shouldPlayGain=void 0,this.panner=void 0,this.masterGain=void 0,t()}}));return this.fadeGain=this.ac.createGain(),this.volumeGain=this.ac.createGain(),this.shouldPlayGain=this.ac.createGain(),this.masterGain=this.ac.createGain(),this.panner=this.ac.createStereoPanner(),this.source.connect(this.fadeGain),this.fadeGain.connect(this.volumeGain),this.volumeGain.connect(this.shouldPlayGain),this.shouldPlayGain.connect(this.masterGain),this.masterGain.connect(this.panner),this.panner.connect(this.destination),t}setVolumeGainLevel(t){this.volumeGain&&(this.volumeGain.gain.value=t)}setShouldPlay(t){this.shouldPlayGain&&(this.shouldPlayGain.gain.value=t?1:0)}setMasterGainLevel(t){this.masterGain&&(this.masterGain.gain.value=t)}setStereoPanValue(t){const e=void 0===t?0:t;this.panner&&(void 0!==this.panner.pan?this.panner.pan.value=e:(this.panner.panningModel="equalpower",this.panner.setPosition(e,0,1-Math.abs(e))))}play(t,e,s){this.source.start(t,e,s)}stop(t=0){this.source&&this.source.stop(t)}};const tt=class{constructor(t,e={}){this.playlist=t,this.data=e,this.active=!1,this.ondragover=t=>{this.active&&(t.preventDefault(),this.emitDrag(t.clientX))}}emitDrag(t){const e=t-this.prevX;if(e){const s=g(e,this.playlist.samplesPerPixel,this.playlist.sampleRate);this.prevX=t,this.playlist.ee.emit("dragged",s,this.data)}}complete(){this.active=!1,document.removeEventListener("dragover",this.ondragover)}dragstart(t){const e=t;this.active=!0,this.prevX=t.clientX,e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",""),document.addEventListener("dragover",this.ondragover)}dragend(t){this.active&&(t.preventDefault(),this.complete())}static getClass(){return".shift"}static getEvents(){return["dragstart","dragend"]}},et=function(){};et.prototype.hook=function(t){const e=t.querySelector(".current");if(e){const s=t.getBoundingClientRect(),i=e.getBoundingClientRect().top-s.top;t.scrollTop+=i}};const st=et;const it=class{constructor(t,e,s=[],i=!1,r=!1,n=!1,a=0){this.playlist=t,this.marginLeft=a,this.resizeHandlers=[],this.editable=i,this.annotations=e.map((t=>function(t){return{id:t.id||z(),start:Number(t.begin)||0,end:Number(t.end)||0,lines:t.lines||[""],lang:t.language||"en"}}(t))),this.setupInteractions(),this.controls=s,this.setupEE(t.ee),this.playlist.isContinuousPlay=n,this.playlist.linkEndpoints=r,this.length=this.annotations.length}setupInteractions(){this.annotations.forEach(((t,e)=>{const s=new tt(this.playlist,{direction:"left",index:e}),i=new tt(this.playlist,{direction:"right",index:e});this.resizeHandlers.push(s),this.resizeHandlers.push(i)}))}setupEE(t){return t.on("dragged",((t,e)=>{const s=e.index,i=this.annotations,r=i[s];if("left"===e.direction){const e=r.start;r.start+=t,r.start<0&&(r.start=0),s&&i[s-1].end>r.start&&(i[s-1].end=r.start),this.playlist.linkEndpoints&&s&&i[s-1].end===e&&(i[s-1].end=r.start)}else{const e=r.end;r.end+=t,r.end>this.playlist.duration&&(r.end=this.playlist.duration),s<i.length-1&&i[s+1].start<r.end&&(i[s+1].start=r.end),this.playlist.linkEndpoints&&s<i.length-1&&i[s+1].start===e&&(i[s+1].start=r.end)}this.playlist.drawRequest()})),t.on("continuousplay",(t=>{this.playlist.isContinuousPlay=t})),t.on("linkendpoints",(t=>{this.playlist.linkEndpoints=t})),t.on("annotationsrequest",(()=>{this.export()})),t}export(){const t=this.annotations.map((t=>{return e=t,{begin:String(e.start.toFixed(3)),end:String(e.end.toFixed(3)),id:String(e.id),language:e.lang,lines:e.lines};var e})),e=`data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`,s=document.createElement("a");document.body.appendChild(s),s.href=e,s.download="annotations.json",s.click(),document.body.removeChild(s)}renderResizeLeft(t){const e=tt.getEvents(),s={attributes:{style:"position: absolute; height: 30px; width: 10px; top: 0; left: -2px",draggable:!0}},i=this.resizeHandlers[2*t];return e.forEach((t=>{s[`on${t}`]=i[t].bind(i)})),c()("div.resize-handle.resize-w",s)}renderResizeRight(t){const e=tt.getEvents(),s={attributes:{style:"position: absolute; height: 30px; width: 10px; top: 0; right: -2px",draggable:!0}},i=this.resizeHandlers[2*t+1];return e.forEach((t=>{s[`on${t}`]=i[t].bind(i)})),c()("div.resize-handle.resize-e",s)}renderControls(t,e){const s=this;return this.controls.map((i=>c()(`i.${i.class}`,{attributes:{title:i.title},onclick:()=>{i.action(t,e,s.annotations,{linkEndpoints:s.playlist.linkEndpoints}),this.setupInteractions(),s.playlist.drawRequest()}})))}render(){const t=c()("div.annotations-boxes",{attributes:{style:`height: 30px; position: relative; margin-left: ${this.marginLeft}px;`}},this.annotations.map(((t,e)=>{const s=this.playlist.samplesPerPixel,i=this.playlist.sampleRate,r=i/s,n=y(this.playlist.scrollLeft,s,i),a=Math.floor(t.start*r-n),o=Math.ceil(t.end*r-t.start*r);return c()("div.annotation-box",{attributes:{style:`position: absolute; height: 30px; width: ${o}px; left: ${a}px`,"data-id":t.id}},[this.renderResizeLeft(e),c()("span.id",{onclick:()=>{const t=this.annotations[e].start,s=this.annotations[e].end;this.playlist.isContinuousPlay?(this.playlist.seek(t,t),this.playlist.ee.emit("play",t)):(this.playlist.seek(t,s),this.playlist.ee.emit("play",t,s))}},[t.id]),this.renderResizeRight(e)])}))),e=c()("div.annotations-boxes-wrapper",{attributes:{style:"overflow: hidden;"}},[t]),s=c()("div.annotations-text",{hook:new st},this.annotations.map(((t,e)=>{const s=function(t){function e(t,e){const s=parseInt(t/3600,10)%24,i=parseInt(t/60,10)%60,r=(t%60).toFixed(e);return`${s<10?`0${s}`:s}:${i<10?`0${i}`:i}:${r<10?`0${r}`:r}`}return{seconds:t=>t.toFixed(0),thousandths:t=>t.toFixed(3),"hh:mm:ss":function(t){return e(t,0)},"hh:mm:ss.u":function(t){return e(t,1)},"hh:mm:ss.uu":function(t){return e(t,2)},"hh:mm:ss.uuu":function(t){return e(t,3)}}[t]}(this.playlist.durationFormat),i=s(t.start),r=s(t.end);let n="";this.playlist.isPlaying()&&this.playlist.playbackSeconds>=t.start&&this.playlist.playbackSeconds<=t.end&&(n=".current");const a={attributes:{contenteditable:!0},oninput:e=>{t.lines=[e.target.innerText]},onkeypress:t=>{13!==t.which&&13!==t.keyCode||(t.target.blur(),t.preventDefault())}},o=this.editable?a:{};return c()(`div.annotation${n}`,[c()("span.annotation-id",[t.id]),c()("span.annotation-start",[i]),c()("span.annotation-end",[r]),c()("span.annotation-lines",o,[t.lines]),c()("span.annotation-actions",this.renderControls(t,e))])})));return c()("div.annotations",[e,s])}};function rt(){function t(t){let e,s=1/0,i=-1/0;for(let r=0;r<t.length;r+=1)e=t[r],s>e&&(s=e),i<e&&(i=e);return{min:s,max:i}}function e(t,e){const s=2**(e-1),i=t<0?t*s:t*s-1;return Math.max(-s,Math.min(s-1,i))}function s(s,i=1e4,r=8){if([8,16,32].indexOf(r)<0)throw new Error("Invalid number of bits specified for peaks.");const n=[],a=s.length;n.push(function(s,i,r){const n=s.length,a=Math.ceil(n/i);let o,l,c,h,u,d;const p=new self[`Int${r}Array`](2*a);for(let f=0;f<a;f+=1)o=f*i,l=(f+1)*i>n?n:(f+1)*i,c=s.subarray(o,l),d=t(c),u=e(d.min,r),h=e(d.max,r),p[2*f]=u,p[2*f+1]=h;return p}(s.subarray(0,a),i,r));return{bits:r,length:n[0].length/2,data:n}}onmessage=function(t){const e=s(t.data.samples,t.data.samplesPerPixel);postMessage(e)}}function nt(){let t,e=0,s=[],i=[];function r(t,e,s){for(let i=0;i<s.length;i+=1)t.setUint8(e+i,s.charCodeAt(i))}function n(e,s=!1){const i=new ArrayBuffer(44+2*e.length),n=new DataView(i);return r(n,0,"RIFF"),n.setUint32(4,32+2*e.length,!0),r(n,8,"WAVE"),r(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,s?1:2,!0),n.setUint32(24,t,!0),n.setUint32(28,4*t,!0),n.setUint16(32,4,!0),n.setUint16(34,16,!0),r(n,36,"data"),n.setUint32(40,2*e.length,!0),function(t,e,s){let i=e;for(let e=0;e<s.length;e+=1,i+=2){const r=Math.max(-1,Math.min(1,s[e]));t.setInt16(i,r<0?32768*r:32767*r,!0)}}(n,44,e),n}function a(t,e){const s=new Float32Array(e);let i=0;for(let e=0;e<t.length;e+=1)s.set(t[e],i),i+=t[e].length;return s}function o(t){const r=n(function(t,e){const s=t.length+e.length,i=new Float32Array(s);let r=0,n=0;for(;r<s;)i[r+=1]=t[n],i[r+=1]=e[n],n+=1;return i}(a(s,e),a(i,e))),o=new Blob([r],{type:t});postMessage(o)}onmessage=function(r){switch(r.data.command){case"init":a=r.data.config,t=a.sampleRate;break;case"record":n=r.data.buffer,s.push(n[0]),i.push(n[1]),e+=n[0].length;break;case"exportWAV":o(r.data.type);break;case"clear":e=0,s=[],i=[];break;default:throw new Error("Unknown export worker command")}var n,a}}function at(t={},s=o()()){if(void 0===t.container)throw new Error("DOM element container must be given.");window.OfflineAudioContext=window.OfflineAudioContext||window.webkitOfflineAudioContext,window.AudioContext=window.AudioContext||window.webkitAudioContext;const i=new window.AudioContext,r={ac:i,sampleRate:i.sampleRate,samplesPerPixel:4096,mono:!0,fadeType:"logarithmic",exclSolo:!1,timescale:!1,controls:{show:!1,width:150,widgets:{muteOrSolo:!0,volume:!0,stereoPan:!0,collapse:!0,remove:!0}},colors:{waveOutlineColor:"white",timeColor:"grey",fadeColor:"black"},seekStyle:"line",waveHeight:128,collapsedWaveHeight:30,barWidth:1,barGap:0,state:"cursor",zoomLevels:[512,1024,2048,4096],annotationList:{annotations:[],controls:[],editable:!1,linkEndpoints:!1,isContinuousPlay:!1},isAutomaticScroll:!1},a=e()({},t,r),l=a.zoomLevels.indexOf(a.samplesPerPixel);if(-1===l)throw new Error("initial samplesPerPixel must be included in array zoomLevels");const h=new class{constructor(){this.tracks=[],this.soloedTracks=[],this.mutedTracks=[],this.collapsedTracks=[],this.playoutPromises=[],this.cursor=0,this.playbackSeconds=0,this.duration=0,this.scrollLeft=0,this.scrollTimer=void 0,this.showTimescale=!1,this.isScrolling=!1,this.fadeType="logarithmic",this.masterGain=1,this.annotations=[],this.durationFormat="hh:mm:ss.uuu",this.isAutomaticScroll=!1,this.resetDrawTimer=void 0}initExporter(){this.exportWorker=new(m())(nt)}initRecorder(t){this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.onstart=()=>{const t=new K;t.setName("Recording"),t.setEnabledStates(),t.setEventEmitter(this.ee),this.recordingTrack=t,this.tracks.push(t),this.chunks=[],this.working=!1},this.mediaRecorder.ondataavailable=t=>{if(this.chunks.push(t.data),!this.working){const t=new Blob(this.chunks,{type:"audio/ogg; codecs=opus"});P.createLoader(t,this.ac).load().then((t=>{this.recorderWorker.postMessage({samples:t.getChannelData(0),samplesPerPixel:this.samplesPerPixel}),this.recordingTrack.setCues(0,t.duration),this.recordingTrack.setBuffer(t),this.recordingTrack.setPlayout(new Q(this.ac,t)),this.adjustDuration()})).catch((()=>{this.working=!1})),this.working=!0}},this.mediaRecorder.onstop=()=>{this.chunks=[],this.working=!1},this.recorderWorker=new(m())(rt),this.recorderWorker.onmessage=t=>{this.recordingTrack.setPeaks(t.data),this.working=!1,this.drawRequest()}}setShowTimeScale(t){this.showTimescale=t}setMono(t){this.mono=t}setExclSolo(t){this.exclSolo=t}setSeekStyle(t){this.seekStyle=t}getSeekStyle(){return this.seekStyle}setSampleRate(t){this.sampleRate=t}setSamplesPerPixel(t){this.samplesPerPixel=t}setAudioContext(t){this.ac=t}setControlOptions(t){this.controls=t}setWaveHeight(t){this.waveHeight=t}setCollapsedWaveHeight(t){this.collapsedWaveHeight=t}setColors(t){this.colors=t}setBarWidth(t){this.barWidth=t}setBarGap(t){this.barGap=t}setAnnotations(t){const e=this.controls.show?this.controls.width:0;this.annotationList=new it(this,t.annotations,t.controls,t.editable,t.linkEndpoints,t.isContinuousPlay,e)}setEventEmitter(t){this.ee=t}getEventEmitter(){return this.ee}setUpEventEmitter(){const t=this.ee;t.on("automaticscroll",(t=>{this.isAutomaticScroll=t})),t.on("durationformat",(t=>{this.durationFormat=t,this.drawRequest()})),t.on("select",((t,e,s)=>{this.isPlaying()?(this.lastSeeked=t,this.pausedAt=void 0,this.restartPlayFrom(t)):(this.seek(t,e,s),this.ee.emit("timeupdate",t),this.drawRequest())})),t.on("startaudiorendering",(t=>{this.startOfflineRender(t)})),t.on("statechange",(t=>{this.setState(t),this.drawRequest()})),t.on("shift",((t,e)=>{e.setStartTime(e.getStartTime()+t),this.adjustDuration(),this.drawRequest()})),t.on("record",(()=>{this.record()})),t.on("play",((t,e)=>{this.play(t,e)})),t.on("pause",(()=>{this.pause()})),t.on("stop",(()=>{this.stop()})),t.on("rewind",(()=>{this.rewind()})),t.on("fastforward",(()=>{this.fastForward()})),t.on("clear",(()=>{this.clear().then((()=>{this.drawRequest()}))})),t.on("solo",(t=>{this.soloTrack(t),this.adjustTrackPlayout(),this.drawRequest()})),t.on("mute",(t=>{this.muteTrack(t),this.adjustTrackPlayout(),this.drawRequest()})),t.on("removeTrack",(t=>{this.removeTrack(t),this.adjustTrackPlayout(),this.drawRequest()})),t.on("changeTrackView",((t,e)=>{this.collapseTrack(t,e),this.drawRequest()})),t.on("volumechange",((t,e)=>{e.setGainLevel(t/100),this.drawRequest()})),t.on("mastervolumechange",(t=>{this.masterGain=t/100,this.tracks.forEach((t=>{t.setMasterGainLevel(this.masterGain)}))})),t.on("fadein",((t,e)=>{e.setFadeIn(t,this.fadeType),this.drawRequest()})),t.on("fadeout",((t,e)=>{e.setFadeOut(t,this.fadeType),this.drawRequest()})),t.on("stereopan",((t,e)=>{e.setStereoPanValue(t),this.drawRequest()})),t.on("fadetype",(t=>{this.fadeType=t})),t.on("newtrack",(t=>{this.load([{src:t,name:t.name}])})),t.on("trim",(()=>{const t=this.getActiveTrack(),e=this.getTimeSelection();t.trim(e.start,e.end),t.calculatePeaks(this.samplesPerPixel,this.sampleRate),this.setTimeSelection(0,0),this.drawRequest()})),t.on("zoomin",(()=>{const t=Math.max(0,this.zoomIndex-1),e=this.zoomLevels[t];e!==this.samplesPerPixel&&(this.setZoom(e),this.drawRequest())})),t.on("zoomout",(()=>{const t=Math.min(this.zoomLevels.length-1,this.zoomIndex+1),e=this.zoomLevels[t];e!==this.samplesPerPixel&&(this.setZoom(e),this.drawRequest())})),t.on("scroll",(()=>{this.isScrolling=!0,this.drawRequest(),clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((()=>{this.isScrolling=!1}),200)}))}load(t){const e=t.map((t=>P.createLoader(t.src,this.ac,this.ee).load()));return Promise.all(e).then((e=>{this.ee.emit("audiosourcesloaded");const s=e.map(((e,s)=>{const i=t[s],r=i.name||"Untitled",n=i.start||0,a=i.states||{},o=i.fadeIn,l=i.fadeOut,c=i.cuein||0,h=i.cueout||e.duration,u=i.gain||1,d=i.muted||!1,p=i.soloed||!1,f=i.selected,m=i.peaks||{type:"WebAudio",mono:this.mono},v=i.customClass||void 0,g=i.waveOutlineColor||void 0,y=i.stereoPan||0,b=new Q(this.ac,e),k=new K;return k.src=i.src,k.setBuffer(e),k.setName(r),k.setEventEmitter(this.ee),k.setEnabledStates(a),k.setCues(c,h),k.setCustomClass(v),k.setWaveOutlineColor(g),void 0!==o&&k.setFadeIn(o.duration,o.shape),void 0!==l&&k.setFadeOut(l.duration,l.shape),void 0!==f&&(this.setActiveTrack(k),this.setTimeSelection(f.start,f.end)),void 0!==m&&k.setPeakData(m),k.setState(this.getState()),k.setStartTime(n),k.setPlayout(b),k.setGainLevel(u),k.setStereoPanValue(y),d&&this.muteTrack(k),p&&this.soloTrack(k),k.calculatePeaks(this.samplesPerPixel,this.sampleRate),k}));this.tracks=this.tracks.concat(s),this.adjustDuration(),this.draw(this.render()),this.ee.emit("audiosourcesrendered")})).catch((t=>{this.ee.emit("audiosourceserror",t)}))}setActiveTrack(t){this.activeTrack=t}getActiveTrack(){return this.activeTrack}isSegmentSelection(){return this.timeSelection.start!==this.timeSelection.end}setTimeSelection(t=0,e){this.timeSelection={start:t,end:void 0===e?t:e},this.cursor=t}startOfflineRender(t){if(this.isRendering)return;this.isRendering=!0,this.offlineAudioContext=new OfflineAudioContext(2,44100*this.duration,44100);const e=this.offlineAudioContext.currentTime;this.tracks.forEach((t=>{t.setOfflinePlayout(new Q(this.offlineAudioContext,t.buffer)),t.schedulePlay(e,0,0,{shouldPlay:this.shouldTrackPlay(t),masterGain:1,isOffline:!0})})),this.offlineAudioContext.startRendering().then((e=>{if("buffer"===t)return this.ee.emit("audiorenderingfinished",t,e),void(this.isRendering=!1);"wav"===t&&(this.exportWorker.postMessage({command:"init",config:{sampleRate:44100}}),this.exportWorker.onmessage=e=>{this.ee.emit("audiorenderingfinished",t,e.data),this.isRendering=!1,this.exportWorker.postMessage({command:"clear"})},this.exportWorker.postMessage({command:"record",buffer:[e.getChannelData(0),e.getChannelData(1)]}),this.exportWorker.postMessage({command:"exportWAV",type:"audio/wav"}))})).catch((t=>{throw t}))}getTimeSelection(){return this.timeSelection}setState(t){this.state=t,this.tracks.forEach((e=>{e.setState(t)}))}getState(){return this.state}setZoomIndex(t){this.zoomIndex=t}setZoomLevels(t){this.zoomLevels=t}setZoom(t){this.samplesPerPixel=t,this.zoomIndex=this.zoomLevels.indexOf(t),this.tracks.forEach((e=>{e.calculatePeaks(t,this.sampleRate)}))}muteTrack(t){const e=this.mutedTracks.indexOf(t);e>-1?this.mutedTracks.splice(e,1):this.mutedTracks.push(t)}soloTrack(t){const e=this.soloedTracks.indexOf(t);e>-1?this.soloedTracks.splice(e,1):this.exclSolo?this.soloedTracks=[t]:this.soloedTracks.push(t)}collapseTrack(t,e){if(e.collapsed)this.collapsedTracks.push(t);else{const e=this.collapsedTracks.indexOf(t);e>-1&&this.collapsedTracks.splice(e,1)}}removeTrack(t){t.isPlaying()&&t.scheduleStop(),[this.mutedTracks,this.soloedTracks,this.collapsedTracks,this.tracks].forEach((e=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)}))}adjustTrackPlayout(){this.tracks.forEach((t=>{t.setShouldPlay(this.shouldTrackPlay(t))}))}adjustDuration(){this.duration=this.tracks.reduce(((t,e)=>Math.max(t,e.getEndTime())),0)}shouldTrackPlay(t){let e;return this.soloedTracks.length>0?(e=!1,this.soloedTracks.indexOf(t)>-1&&(e=!0)):(e=!0,this.mutedTracks.indexOf(t)>-1&&(e=!1)),e}isPlaying(){return this.tracks.reduce(((t,e)=>t||e.isPlaying()),!1)}getCurrentTime(){return(this.lastSeeked||this.pausedAt||this.cursor)+this.getElapsedTime()}getElapsedTime(){return this.ac.currentTime-this.lastPlay}setMasterGain(t){this.ee.emit("mastervolumechange",t)}restartPlayFrom(t,e){return this.stopAnimation(),this.tracks.forEach((t=>{t.scheduleStop()})),Promise.all(this.playoutPromises).then(this.play.bind(this,t,e))}play(t,e){clearTimeout(this.resetDrawTimer);const s=this.ac.currentTime,i=this.getTimeSelection(),r=[],n=t||this.pausedAt||this.cursor;let a=e;return!a&&i.end!==i.start&&i.end>n&&(a=i.end),this.isPlaying()?this.restartPlayFrom(n,a):(this.tracks.forEach((t=>{t.setState("cursor"),r.push(t.schedulePlay(s,n,a,{shouldPlay:this.shouldTrackPlay(t),masterGain:this.masterGain}))})),this.lastPlay=s,this.playoutPromises=r,this.startAnimation(n),Promise.all(this.playoutPromises))}pause(){return this.isPlaying()?(this.pausedAt=this.getCurrentTime(),this.playbackReset()):Promise.all(this.playoutPromises)}stop(){return this.mediaRecorder&&"recording"===this.mediaRecorder.state&&this.mediaRecorder.stop(),this.pausedAt=void 0,this.playbackSeconds=0,this.playbackReset()}playbackReset(){return this.lastSeeked=void 0,this.stopAnimation(),this.tracks.forEach((t=>{t.scheduleStop(),t.setState(this.getState())})),this.drawRequest(),Promise.all(this.playoutPromises)}rewind(){return this.stop().then((()=>{this.scrollLeft=0,this.ee.emit("select",0,0)}))}fastForward(){return this.stop().then((()=>{this.viewDuration<this.duration?this.scrollLeft=this.duration-this.viewDuration:this.scrollLeft=0,this.ee.emit("select",this.duration,this.duration)}))}clear(){return this.stop().then((()=>{this.tracks=[],this.soloedTracks=[],this.mutedTracks=[],this.playoutPromises=[],this.cursor=0,this.playbackSeconds=0,this.duration=0,this.scrollLeft=0,this.seek(0,0,void 0)}))}record(){const t=[];this.mediaRecorder.start(300),this.tracks.forEach((e=>{e.setState("none"),t.push(e.schedulePlay(this.ac.currentTime,0,void 0,{shouldPlay:this.shouldTrackPlay(e)}))})),this.playoutPromises=t}startAnimation(t){this.lastDraw=this.ac.currentTime,this.animationRequest=window.requestAnimationFrame((()=>{this.updateEditor(t)}))}stopAnimation(){window.cancelAnimationFrame(this.animationRequest),this.lastDraw=void 0}seek(t,e,s){this.isPlaying()?(this.lastSeeked=t,this.pausedAt=void 0,this.restartPlayFrom(t)):(this.setActiveTrack(s||this.tracks[0]),this.pausedAt=t,this.setTimeSelection(t,e),"fill"===this.getSeekStyle()&&(this.playbackSeconds=t))}updateEditor(t){const e=this.ac.currentTime,s=this.getTimeSelection(),i=t||this.cursor,r=e-this.lastDraw;if(this.isPlaying()){const t=i+r;this.ee.emit("timeupdate",t),this.animationRequest=window.requestAnimationFrame((()=>{this.updateEditor(t)})),this.playbackSeconds=t,this.draw(this.render()),this.lastDraw=e}else i+r>=(this.isSegmentSelection()?s.end:this.duration)&&this.ee.emit("finished"),this.stopAnimation(),this.resetDrawTimer=setTimeout((()=>{this.pausedAt=void 0,this.lastSeeked=void 0,this.setState(this.getState()),this.playbackSeconds=0,this.draw(this.render())}),0)}drawRequest(){window.requestAnimationFrame((()=>{this.draw(this.render())}))}draw(t){const e=u()(this.tree,t);this.rootNode=p()(this.rootNode,e),this.tree=t,this.viewDuration=g(this.rootNode.clientWidth-this.controls.width,this.samplesPerPixel,this.sampleRate)}getTrackRenderData(t={}){const s={height:this.waveHeight,resolution:this.samplesPerPixel,sampleRate:this.sampleRate,controls:this.controls,isActive:!1,timeSelection:this.getTimeSelection(),playlistLength:this.duration,playbackSeconds:this.playbackSeconds,colors:this.colors,barWidth:this.barWidth,barGap:this.barGap};return e()({},t,s)}isActiveTrack(t){const e=this.getActiveTrack();return!this.isSegmentSelection()||e===t}renderAnnotations(){return this.annotationList.render()}renderTimeScale(){const t=this.controls.show?this.controls.width:0;return new O(this.duration,this.scrollLeft,this.samplesPerPixel,this.sampleRate,t,this.colors).render()}renderTrackSection(){const t=this.tracks.map((t=>{const e=this.collapsedTracks.indexOf(t)>-1;return t.render(this.getTrackRenderData({isActive:this.isActiveTrack(t),shouldPlay:this.shouldTrackPlay(t),soloed:this.soloedTracks.indexOf(t)>-1,muted:this.mutedTracks.indexOf(t)>-1,collapsed:e,height:e?this.collapsedWaveHeight:this.waveHeight,barGap:this.barGap,barWidth:this.barWidth}))}));return c()("div.playlist-tracks",{attributes:{style:"overflow: auto;"},onscroll:t=>{this.scrollLeft=g(t.target.scrollLeft,this.samplesPerPixel,this.sampleRate),this.ee.emit("scroll")},hook:new S(this)},t)}render(){const t=[];return this.showTimescale&&t.push(this.renderTimeScale()),t.push(this.renderTrackSection()),this.annotationList.length&&t.push(this.renderAnnotations()),c()("div.playlist",{attributes:{style:"overflow: hidden; position: relative;"}},t)}getInfo(){const t=[];return this.tracks.forEach((e=>{t.push(e.getTrackDetails())})),t}};h.setSampleRate(a.sampleRate),h.setSamplesPerPixel(a.samplesPerPixel),h.setAudioContext(a.ac),h.setEventEmitter(s),h.setUpEventEmitter(),h.setTimeSelection(0,0),h.setState(a.state),h.setControlOptions(a.controls),h.setWaveHeight(a.waveHeight),h.setCollapsedWaveHeight(a.collapsedWaveHeight),h.setColors(a.colors),h.setZoomLevels(a.zoomLevels),h.setZoomIndex(l),h.setMono(a.mono),h.setExclSolo(a.exclSolo),h.setShowTimeScale(a.timescale),h.setSeekStyle(a.seekStyle),h.setAnnotations(a.annotationList),h.setBarGap(a.barGap),h.setBarWidth(a.barWidth),h.isAutomaticScroll=a.isAutomaticScroll,h.isContinuousPlay=a.isContinuousPlay,h.linkedEndpoints=a.linkedEndpoints;const d=h.render(),f=n()(d);return a.container.appendChild(f),h.tree=d,h.rootNode=f,h}function ot(t={},e=o()()){return at(t,e)}})(),WaveformPlaylist=i})();
\No newline at end of file