@opendaw/studio-core-wasm 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var jT=Object.defineProperty;var Qa=(t,e)=>{for(var r in e)jT(t,r,{get:e[r],enumerable:!0})};var LP=globalThis;LP.self??=globalThis;LP.location??={href:"/"};var W=t=>t!=null,Yi=t=>t===null,ZP=t=>t!==null,Kh=t=>t===void 0,x0=t=>t!==void 0,y0=t=>t==null,w0=(t,e)=>t!=null?e(t):void 0,Ue=(t,e="asDefined failed")=>t??j(ca(e)),ht=(t,e)=>t instanceof e,Te=(t,e)=>t instanceof e?t:j(`${t} is not instance of ${e}`),b0=(t,e)=>{t instanceof e||j(`${t} is not instance of ${e}`)};var ca=t=>t instanceof Function?t():t;var $=(t,...e)=>t?.apply(null,e),Wh=t=>W(t)&&typeof t=="object";var Lh=t=>{throw new Error(`Unhandled ${t}`)},j=t=>{throw typeof t=="string"?new Error(t):t},re=(t,e)=>t?void 0:j(ca(e));var hp=t=>new Proxy({},{get(){return j(t)}});var g0=class{value;status="success";constructor(e){this.value=e}error=hp("Cannot access error when succeeded")},v0=class{error;status="failure";constructor(e){this.error=e}value=hp("Cannot access value when failed")},Lt=t=>{try{return new g0(t())}catch(e){return new v0(e)}};var eo=(t,e)=>Object.keys(e).length===0?j("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:j(`Invalid enum value: ${String(t)}`),gp=()=>{};var _0;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(_0||(_0={}));var de=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>Ue(e.at(0),r);static getLast=(e,r)=>Ue(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ue(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ue(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>Ue(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return j(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=_0.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>W(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=Ue(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>j(W(r)?ca(r):"unwrap failed");unwrapOrElse=r=>ca(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>ca(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>j(ca(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Er;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>j(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>ca(n);unwrapOrElse=r=>ca(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Er||(Er={}));var gt;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,c=n(i(e[s]),r);if(c===0)return s;c<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(gt||(gt={}));var Zh=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var er=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(W(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=c=>(c+e/30)%12,a=r*Math.min(n,1-n),o=c=>n-a*Math.max(-1,Math.min(i(c)-3,Math.min(9-i(c),1))),s=c=>Math.round(c*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),c=(o+s)/2,d=0,f=0;if(o!==s){let v=o-s;switch(f=c>.5?v/(2-o-s):v/(o+s),o){case n:d=((i-a)/v+(i<a?6:0))*60;break;case i:d=((a-n)/v+2)*60;break;case a:d=((n-i)/v+4)*60;break}}return{h:d,s:f,l:c}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}lerp(e,r){let n=Math.PI/180,i=this.#t*Math.cos(this.#e*n),a=this.#t*Math.sin(this.#e*n),o=e.#t*Math.cos(e.#e*n),s=e.#t*Math.sin(e.#e*n),c=i+(o-i)*r,d=a+(s-a)*r,f=(Math.atan2(d,c)/n+360)%360,v=Math.sqrt(c*c+d*d),h=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(f,v,h,w)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Do=(t,e)=>t-e;var to=Math.PI*2,Zz=Math.PI/2,Gz=Math.PI/4,Hz=1/Math.sqrt(2),He=(t,e,r)=>Math.max(e,Math.min(t,r)),GP=t=>Math.max(0,Math.min(t,1)),HP=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),A0=(t,e)=>Math.floor(t/e)*e;var qP=(t,e,r)=>t+(e-t)*r;var Ks=(t,e)=>KT(t/e)*e,KT=t=>t-Math.floor(t),Gh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var F0=(t,e)=>t*e/((2*e-1)*(t-1)+e);var tr;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},c)=>t.normalizedAt(c/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=He(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=He(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),c=a-s*i.y0;return{m:s,q:c}};function*r(i,a,o,s){let{m:c,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let f=0,v=o;f<a;f++)yield v=c*v+d}t.walk=r,t.run=(i,a,o,s,c)=>{let{m:d,q:f}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let v=0,h=o;v<a;v++)c(h=d*h+f)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let f=0,v=0;f<a;f++)yield v=d*v+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(tr||(tr={}));var ua=new DataView(new ArrayBuffer(8)),Sr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ua.setInt8(0,e),ua.getInt8(0)),t.toShort=e=>(ua.setInt16(0,e),ua.getInt16(0)),t.toInt=e=>(ua.setInt32(0,e),ua.getInt32(0))})(Sr||(Sr={}));var ro;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(ua.setFloat32(0,o),ua.getFloat32(0))})(ro||(ro={}));var JP;(function(t){t.floatToIntBits=e=>{let r=ro.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return ro.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return ro.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(JP||(JP={}));var Hh;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(ua.setFloat64(0,o),ua.getFloat64(0))})(Hh||(Hh={}));var rr=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){re(W(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=W(r)?e:0,a=W(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);W(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var ir=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(Gh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},Pc=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},qh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(ro.floatToIntBits(e))}writeDouble(e){this.writeLong(Hh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(rr.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},it=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var WT=t=>W(t)?t.value!==void 0?"value":t.get!==void 0?"get":j(`Cannot resolve method key of ${t}`):j("Cannot resolve method key of undefined descriptor"),Mc=(t,e,r)=>{if(!W(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!W(s?.get))return j(`Cannot find getter for property '${e}'`);let c=s.get.apply(this);return Object.defineProperty(this,e,{value:c,configurable:!1,writable:!1,enumerable:!1}),c}};let n=WT(r),i=Ue(r[n]);return{[n]:function(...a){if(a.length>0)return j("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var io;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(io||(io={}));var nr=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?$(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var vp=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var xp=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var Jh=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return rr.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return rr.includes(this.map.keys(),e)}containsValue(e){return rr.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??xp.empty()}isEmpty(){return this.keyCount()===0}add(e,r){vp.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=vp.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??xp.empty()}forEach(e){rr.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var pe=Object.freeze({Empty:{terminate:gp},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),J=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>de.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var fe=class{static subscribeMany(e,...r){return pe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Yh;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return j(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(Yh||(Yh={}));var YP;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return pe.Empty}catchupAndSubscribe(r){return r(this),pe.Empty}}})(YP||(YP={}));var XP;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return pe.Empty}catchupAndSubscribe(e){return e(this),pe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(XP||(XP={}));var Pr=class{#e;#t=b.None;constructor(e){this.#e=new fe,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(W(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var Xi=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new fe,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var E0=class{#e;#t;constructor(e,r){re(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return He(e,this.#e,this.#t)}floating(){return!0}},S0=class{#e;#t;#r;constructor(e,r){this.#e=He(Math.round(e),Sr.MIN_VALUE,Sr.MAX_VALUE),this.#t=He(Math.round(r),Sr.MIN_VALUE,Sr.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(He(e,0,1)*this.#r)}clamp(e){return He(Math.round(e),this.#e,this.#t)}floating(){return!1}},P0=class{#e;#t;constructor(e,r){re(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Xh=class{#e;#t;#r;#i;constructor(e,r,n){re(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},M0=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?j(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(He(e,0,1)*(this.#e.length-1));return r>-1?Ue(this.#e.at(r),`Could not find value for ${e}`):j(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},$0=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,c=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(c*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-c/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},F;(function(t){t.linear=(a,o)=>new E0(a,o),t.linearInteger=(a,o)=>new S0(a,o),t.exponential=(a,o)=>new P0(a,o),t.power=(a,o,s)=>new Xh(a,o,s),t.powerByCenter=(a,o,s)=>{let c=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(c))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new Xh(c,o,s)},t.values=a=>new M0(a),t.decibel=(a,o,s)=>new $0(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(F||(F={}));var E;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:c}={})=>new e(a,o,s,c),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let c=o.indexOf(s);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:c}}},t.values=(a,o,s)=>new class{x(c){return{unit:a,value:s.at(o.indexOf(c))??"N/A"}}y(c){let d=s.indexOf(c);return d===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[d]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,c,d){this.#e=o??"",this.#t=s??0,this.#r=c??!1,this.#i=d??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let c=parseFloat(s);if(isNaN(c))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:c/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?He(c/200+.5,0,1):He(c/100,0,1)};{let f=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(W(f)){let v=r.indexOf(f);if(v>-1)return{type:"explicit",value:c*Math.pow(10,(v-4)*3)}}return{type:"explicit",value:c}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:c}=i(o);return{value:s.toFixed(this.#t),unit:`${c}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return W(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(E||(E={}));var $c;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})($c||($c={}));var Qh;(function(t){t.create=(e=252854082)=>new N0(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return j("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let c=Math.floor(n.uniform()*(1+r))+1;e[s]=c,a+=c}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(Qh||(Qh={}));var N0=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var Ni;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,c])=>{c instanceof e?o[s]=c.initialValue():typeof c=="object"&&(o[s]=i(c))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([c,d])=>{let f=s;d instanceof e?f[c]=d.read(i,f[c]):typeof d=="object"&&a(d,f[c])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([c,d])=>{let f=s;d instanceof e?d.write(i,f[c]):typeof d=="object"&&a(d,f[c])})};a(this.#e,this.#t)}#i(){let i=new Pc;return this.write(i),i.count}}})(Ni||(Ni={}));var Nc=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=gt.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return W(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=gt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(W(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return j(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):j(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return Ue(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(W(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return W(this.#i(e))}hasValue(e){return W(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){de.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var kc=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:gp}),some:r=>r.progress(e)}),notify:e=>t.match({none:gp,some:r=>r.notify(e)}),install:e=>{re(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var yp=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return Lh(e)}}};var eg;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return j("Insufficient memory allocated.");let a=new Uint8Array(n),o=ir.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new it(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(eg||(eg={}));var B;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:j(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=de.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return j(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return j("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new Nc(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(re(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(B||(B={}));var tg=class{#e=new J;#t;#r;#i;constructor(e){this.#r=e,this.#t=this.#e.own(new fe),this.#i=this.#o(e,[])}get data(){return this.#r}get proxy(){return this.#i}subscribe(e,...r){let n=()=>r.reduce((i,a)=>i[a],this.#i);return this.#t.subscribe(i=>{this.#n(i,r)&&e(n())})}catchupAndSubscribe(e,...r){return e(r.reduce((i,a)=>i[a],this.#i)),this.subscribe(e,...r)}subscribeAll(e){return this.#t.subscribe(r=>e(r[0]))}createMutableObservableValue(...e){let r=this.#e.own(new J),n=r.own(new fe),i=()=>e.slice(0,-1).reduce((s,c)=>s[c],this.#i),a=e[e.length-1],o={getValue:()=>e.reduce((s,c)=>s[c],this.#i),setValue:s=>i()[a]=s,subscribe:s=>n.subscribe(s),catchupAndSubscribe:s=>(s(o),n.subscribe(s)),terminate:()=>r.terminate()};return r.own(this.subscribe(()=>n.notify(o),...e)),o}update(e){let r=new Set;this.#a(this.#r,e,r);for(let n of r)this.#t.notify([n])}terminate(){this.#e.terminate(),this.#t.terminate()}#n=(e,r)=>{let n=Math.min(e.length,r.length);for(let i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0};#a=(e,r,n,i)=>{for(let a of Object.keys(r)){let o=i??a,s=r[a],c=e[a];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#a(e[a],s,n,o):c!==s&&(e[a]=s,n.add(o))}};#o=(e,r)=>new Proxy(e,{get:(n,i)=>{let a=n[i];return a!==null&&typeof a=="object"&&!Array.isArray(a)?this.#o(a,[...r,i]):a},set:(n,i,a)=>(n[i]=a,this.#t.notify([...r,i]),!0),preventExtensions:()=>!1})};var rg=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new ig(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=wp.create(wp.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var k0=(t,e)=>Math.floor(3840/e)*t,QP=(t,e=4,r=4)=>{let n=k0(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-k0(a*e,r))%n,c=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:c,ticks:d}},eM=(t,e)=>t*e/60*960,tM=(t,e)=>t*60/960/e,LT=(t,e)=>e*60/960/t,ZT=(t,e,r)=>eM(t/r,e),GT=(t,e,r)=>tM(t,e)*r,ke={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:k0,toParts:QP,secondsToPulses:eM,pulsesToSeconds:tM,secondsToBpm:LT,samplesToPulses:ZT,pulsesToSamples:GT,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=QP(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var da=128,ng=ke.fromSignature(1,48);var bp=class{a1=0;a2=0;b0=0;b1=0;b2=0;constructor(){this.identity()}identity(){this.setNormalizedCoefficients(1,0,0,1,0,0)}setLowpassParams(e,r=Math.SQRT1_2){if(e=He(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1-a)/2,s=o,c=2*o,d=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,d,f,v,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,r=Math.SQRT1_2){if(e=He(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1+a)/2,s=o,c=-2*o,d=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,d,f,v,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,r,n,i,a,o){let s=1/i;return this.b0=e*s,this.b1=r*s,this.b2=n*s,this.a1=a*s,this.a2=o*s,this}setLowShelfParams(e,r){e=He(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=to*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,d=n+1,f=n-1,v=n*(d-f*s+c),h=2*n*(f-d*s),w=n*(d-f*s-c),A=d+f*s+c,N=-2*(f+d*s),S=d+f*s-c;this.setNormalizedCoefficients(v,h,w,A,N,S)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,r){e=He(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=to*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,d=n+1,f=n-1,v=n*(d+f*s+c),h=-2*n*(f+d*s),w=n*(d+f*s-c),A=d-f*s+c,N=2*(f-d*s),S=d-f*s-c;this.setNormalizedCoefficients(v,h,w,A,N,S)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,r,n){e=He(e,0,1),r=Math.max(0,r);let i=Math.pow(10,n/40);if(e>0&&e<1)if(r>0){let a=to*e,o=Math.sin(a)/(2*r),s=Math.cos(a),c=1+o*i,d=-2*s,f=1-o*i,v=1+o/i,h=-2*s,w=1-o/i;this.setNormalizedCoefficients(c,d,f,v,h,w)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,r){if(e=He(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1-i,s=-2*a,c=1+i,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,r){if(e=He(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1,s=-2*a,c=1,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,r){if(e=Math.max(0,e),r=Math.max(0,r),e>0&&e<1){let n=to*e;if(r>0){let i=Math.sin(n)/(2*r),a=Math.cos(n),o=i,s=0,c=-i,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,r,n){re(e.length===r.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,a=this.b1,o=this.b2,s=this.a1,c=this.a2;for(let d=0;d<e.length;++d){let f=-Math.PI*2*e[d],v=Math.cos(f),h=Math.sin(f),w=i+((a+o*v)*v-o*h*h),A=(a+o*v)*h+o*h*v,N=1+((s+c*v)*v-c*h*h),S=(s+c*v)*h+c*h*v,O=N*N+S*S,z=(w*N+A*S)/O,Y=(A*N-w*S)/O;r[d]=Math.sqrt(z*z+Y*Y),n[d]=Math.atan2(Y,z)}}};var Ws=class{#e=0;#t=0;#r=0;#i=0;reset(){this.#e=0,this.#t=0,this.#r=0,this.#i=0}process({a1:e,a2:r,b0:n,b1:i,b2:a},o,s,c,d){let f=this.#e,v=this.#t,h=this.#r,w=this.#i;for(let A=c;A<d;A++){let N=o[A],S=s[A]=n*N+i*f+a*v-e*h-r*w+1e-18-1e-18;v=f,f=N,w=h,h=S}this.#e=f,this.#t=v,this.#r=h,this.#i=w}processFrame({a1:e,a2:r,b0:n,b1:i,b2:a},o){let s=n*o+i*this.#e+a*this.#t-e*this.#r-r*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=o,this.#i=this.#r,this.#r=s,s}};var _p;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(_p||(_p={}));var Ap;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Ap||(Ap={}));var no;(function(t){t.globalToLocal=(r,n)=>Ks(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{let c=r-i,d=c+a;if(c>=s||d<=o)return b.None;let f=Math.max(c,o),v=Math.min(d,s);return b.wrap({index:0,rawStart:c,rawEnd:d,regionStart:Math.max(c,r),regionEnd:Math.min(d,n),resultStart:f,resultEnd:v,resultStartValue:c<f?(f-c)/a:0,resultEndValue:d>v?(v-c)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){let c=r-i,d=Math.max(r,o),f=Math.min(n,s),v=Math.floor((d-c)/a),h=c+v*a;for(;h<f;){let w=h+a,A=Math.max(h,r),N=Math.min(w,n),S=Math.max(h,d),O=Math.min(w,f),z=h<S?(S-h)/a:0,Y=w>O?(O-h)/a:1;yield{index:v++,rawStart:h,rawEnd:w,regionStart:A,regionEnd:N,resultStart:S,resultEnd:O,resultStartValue:z,resultEndValue:Y},h=w}}t.locateLoops=e})(no||(no={}));var zr=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new ag(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?io.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Ro=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new ag(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return io.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return io.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return io.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var ag=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=gt.leftMostMapped(this.#e,n,Do,_p.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,de.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),gt.rightMostMapped(this.#e,e,Do,_p.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),gt.leftMostMapped(this.#e,e,Do,_p.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Sr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Sr.MAX_VALUE,r);i--}return this.iterate(n,Sr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=$c.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var og;(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,c=1,d=1;i>0&&e<i&&(c=tr.normalizedAt(e/i,o));let f=r-a;if(a>0&&e>f){let v=(e-f)/a;d=1-tr.normalizedAt(v,s)}return Math.min(c,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:c,inSlope:d,outSlope:f}=o;if(e.fill(1,0,a),s<=0&&c<=0)return;let v=i-c;if(r>=s&&n<=v)return;let h=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),A=Math.min(a,Math.ceil((w-r)/h));if(A>0){let N=r/s,S=w/s,O=tr.walk(d,A,N,S);for(let z=0;z<A;z++)e[z]=O.next().value}}if(c>0&&n>v){let w=Math.max(r,v),A=Math.max(0,Math.floor((w-r)/h)),N=a-A;if(N>0){let S=(w-v)/c,O=(n-v)/c,z=tr.walk(f,N,1-S,1-O);for(let Y=A;Y<a;Y++)e[Y]=Math.min(e[Y],z.next().value)}}}})(og||(og={}));var ig=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let d=0;d<this.#e;++d)i=t.reverse(d)>>>this.#t,i>d&&(o=e[d],e[d]=e[i],e[i]=o,o=r[d],r[d]=r[i],r[i]=o);let s=this.#r,c=this.#i;for(let d=2;d<=this.#e;d<<=1){let f=d>>1,v=this.#e/d;for(n=0;n<this.#e;n+=d){let h=n+f;for(i=n,a=0;i<h;i++,a=a+v|0){let w=i+f|0,A=s[a],N=c[a],S=e[w],O=r[w],z=S*A+O*N,Y=O*A-S*N,te=e[i],me=r[i];e[w]=te-z,r[w]=me-Y,e[i]=te+z,r[i]=me+Y}}if(d===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}};var Co;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>ke.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(Co||(Co={}));var rM;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(rM||(rM={}));var sg=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=A0(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var pa;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(pa||(pa={}));var Bc;(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Ap.complete(e)-Ap.complete(r);return n!==0?n:e.pitch-r.pitch}})(Bc||(Bc={}));var lg=class{#e;#t;#r;#i;constructor(e){this.#e=new Float32Array(e),this.#t=1/e,this.#r=0,this.#i=0}pushPop(e){let r=e*e;return this.#i-=this.#e[this.#r],this.#i+=r,this.#e[this.#r]=r,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,r,n){let i=this.#e,a=i.length,o=this.#r,s=this.#i;for(let c=r;c<n;c++){let d=e[c]*e[c];s+=d-i[o],i[o]=d,++o===a&&(o=0)}return this.#r=o,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var cg=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),c=this.#n;for(let d=r;d<n;++d){let f=o[d],v=s[d],h=Math.max(Math.abs(f),Math.abs(v));if(c=h>c?i*(c-h)+h:a*(c-h)+h,c>1){let w=1/c;o[d]=f*w,s[d]=v*w}}this.#n=c}};var Jr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Jr||(Jr={}));var Ls;(function(t){function e(r,n,i){return new B0(r,n,i)}t.aware=e})(Ls||(Ls={}));var B0=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===Jr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Jr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===Jr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return eo(this.#t.getValue(),Jr)}};var iM=ke.fromSignature(1,384);var ui={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?ui.Linear:{type:"curve",slope:t}},ug;(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:j(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return rr.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=gt.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:c,value:d}=s.next();if(c)return o;if(d.position<=a){let{done:f,value:v}=s.next();if(f)return d.value;if(a<v.position)return n(d,v,a);if(d.interpolation===ui.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let c=i.iterateFrom(a),{done:d,value:f}=c.next();if(d)return;let v=o/s,h=f;if(h.position>a){for(;a<h.position;)if(yield{position:a,value:h.value},a+=v,a>o)return;h.position<=o&&(yield h)}for(;a<=o;){let{done:w,value:A}=c.next();if(w)break;for(;a<A.position;){if(a>o)return;yield{position:a,value:n(h,A,a)},a+=v}A.position<o&&(h.interpolation===ui.None&&(yield{position:A.position,value:h.value}),yield A),h=A}for(;a<=o;)yield{position:a,value:h.value},a+=v}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,c)=>o.type==="none"?i:o.type==="linear"?i+(c-a)/(s.position-a)*(s.value-i):o.type==="curve"?tr.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},c-a):j("Unknown interpolation")})(ug||(ug={}));var wp;(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let c=0;c<n;++c)i[c]=.42323-.49755*Math.cos(o*c)+.07922*Math.cos(s*c);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,c=6*a;for(let d=0;d<n;++d)i[d]=.35875-.48829*Math.cos(o*d)+.14128*Math.cos(s*d)-.01168*Math.cos(c*d);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(wp||(wp={}));var fa;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let c of o)c instanceof e?s.push(c.value):(c instanceof MessagePort||typeof ImageBitmap<"u"&&c instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&c instanceof OffscreenCanvas)&&s.push(c);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...c)=>{let d=r(c);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(rr.map(c,f=>({value:n(f)})))},d)};dispatchAndReturn=(s,...c)=>new Promise((d,f)=>{let v=rr.reduce(c,(w,A,N)=>(typeof A=="function"&&w.push([N,A]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:f},callbacks:new Map(v)});let h=r(c);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(rr.map(c,(w,A)=>typeof w=="function"?{callback:A}:{value:n(w)}))},h),this.#i++});#n=s=>{let c=this.#t.get(s.returnId);W(c)?s.type==="resolve"?(c.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(c.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&c.callbacks?.get(s.funcAt).apply(this,s.args):j(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,c){this.#e=s,this.#t=c,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{re(s.type==="send",()=>"Message type must be 'send'");let c=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=Ue(c[s.func],`${s.func.toString()} does not exists on ${this.#t}`),f=s.returnId;if(f===!1)d.apply(this.#t,s.args.map(v=>"value"in v?v.value:j(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(h=>"callback"in h?(...w)=>this.#o(f,h.callback,w):h.value)).then(h=>{try{this.#n(f,h)}catch(w){this.#a(f,w)}},h=>this.#a(f,h))}catch(v){this.#a(f,v)}};#n=(s,c)=>this.#e.send({type:"resolve",returnId:s,resolve:c});#a=(s,c)=>this.#e.send({type:"reject",returnId:s,reject:c});#o=(s,c,d)=>this.#e.send({type:"callback",returnId:s,funcAt:c,args:d})}t.Executor=a})(fa||(fa={}));var nM={for:t=>new I0(t)},HT=[],I0=class{#e;#t=new fe;constructor(e){if(this.#e=e,W(e.onmessage)||W(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??HT)}channel(e){return new T0(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},T0=class t{#e;#t;#r=new fe;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{W(n)&&n.__id__==="42"&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Fp;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=Lt(()=>e.next());if(a==="success"){let{done:c,value:d}=o;c&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(Fp||(Fp={}));var D0=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},dg;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=hp("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=hp("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let c=!0;return o.own(pe.create(()=>c=!1)),new Promise((d,f)=>s.then(v=>{c&&d(v)},v=>{c&&f(v)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new D0(3,yp.seconds(3));t.retry=(o,s=n)=>o().catch(c=>new Promise((d,f)=>{let v=h=>{s.retry(h,()=>o().then(w=>d(w),v))||f(h)};v(c)})),t.guardedRetry=(o,s)=>{let c=async(d=0)=>{try{return await o()}catch(f){if(s(f,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,f),await Fp.timeSpan(yp.seconds(1)),c(d);throw new Error(`Failed after ${d} retries: ${f}`)}};return c()},t.approvedRetry=(o,s)=>{let c=async()=>{try{return await o()}catch(d){if(await kc.approve(s(d)))return c();throw d}};return c()},t.delay=(o,s)=>Promise.all([o,Fp.timeSpan(s)]).then(([c])=>c),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,c)=>new Promise((d,f)=>{let v=!0,h=setTimeout(()=>{v=!1,f(new Error(c??"timeout"))},s.millis());o.then(w=>{v&&d(w)},w=>{v&&f(w)}).finally(()=>clearTimeout(h))}),t.sequentialAll=o=>o.reduce((s,c)=>s.then(async d=>[...d,await c()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return c=>{let d=()=>o(c),f=s.then(d,d);return s=f.catch(()=>{}),f}},t.memoizeAsync=(o,s)=>{let c=null,d=Date.now();return()=>{let f=Date.now();return(Yi(c)||W(s)&&f-d>s.millis())&&(d=f,c=o(),c.catch(v=>(c=null,v))),c}},t.allWithLimit=async(o,s=1)=>{let c=new Array(o.length),d=0,f=!1,v=async()=>{for(;d<o.length&&!f;){let h=d++;try{let w=await o[h]();f||(c[h]=w)}catch(w){throw f=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},v)),c},t.allSettledWithLimit=async(o,s=1)=>{let c=new Array(o.length),d=0,f=async()=>{for(;d<o.length;){let v=d++;try{let h=await o[v]();c[v]={status:"fulfilled",value:h}}catch(h){c[v]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},f)),c};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let c=Promise.withResolvers();return this.#e.push([s,c]),c.promise.finally(()=>this.#r())}}#r(){if(re(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:c,reject:d}]=this.#e.shift();this.#t++,s().then(c,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,c,d){this.#e=s,this.#t=c,this.#r=d}update(s){this.#i=b.wrap(s),s.then(c=>{this.#i.contains(s)&&this.#e(c)}).catch(c=>{this.#i.contains(s)&&this.#t(c)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),$(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(dg||(dg={}));var De=class t{static newSet(e){return new Nc(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return re(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return re(r.length>0,"Unable to parse Address"),t.compose(B.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=gt.leftMostMapped(i,r,B.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(B.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return B.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(B.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,B.length),e.buffer}toString(){return[B.toString(this.#t),...this.#r].join("/")}static read(e){let r=B.fromDataInput(e),n=e.readByte();return t.compose(r,...de.create(()=>e.readShort(),n))}},Zs;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>De.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=gt.rangeMapped(r,e,De.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=gt.rangeMapped(r,e,De.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=gt.leftMostMapped(r,e,De.LengthComparator,t.AddressReader),i=gt.rightMostMapped(r,e,De.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Zs||(Zs={}));var ma=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new nr}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=De.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{ZP(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():rr.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return j(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var R0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ic=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},L=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return $(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new ma(this)}get address(){return this.#e.address.append(this.#t)}get debugPath(){return`${this.box.name}:${this.box.mapFields(e=>e.fieldName,...this.address.fieldKeys).join("/")}`}isBox(){return!1}isField(){return!0}isAttached(){return this.graph.findBox(this.address.uuid).nonEmpty()}fields(){return de.empty()}record(){return Yh.empty()}getField(e){return j()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return j("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};R0([Mc,Ic("design:type",ma),Ic("design:paramtypes",[])],L.prototype,"pointerHub",null);R0([Mc,Ic("design:type",De),Ic("design:paramtypes",[])],L.prototype,"address",null);R0([Mc,Ic("design:type",String),Ic("design:paramtypes",[])],L.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Gs=class t extends L{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=de.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return $(e.visitArrayField,this)}fields(){return this.#e}record(){return de.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return Ue(this.#e[e])}optField(e){return b.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return j("Type mismatch")}};var zo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=ir.create();o.write(s);let c=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(c.length),r.writeBytes(c)})},t.readFields=(r,n)=>{re(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(Kh(n[o]))continue;let s=r.readInt(),c=new Int8Array(s);r.readBytes(c);let{status:d,error:f}=Lt(()=>n[o]?.read(new it(c.buffer)));d==="failure"&&console.warn(n,f)}}})(zo||(zo={}));var qT=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},aM=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},D=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=De.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return Ue(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#s}get pointerHub(){return new ma(this)}estimateMemory(){let e=new Pc;return this.write(e),e.count}isBox(){return!0}asBox(e){return Te(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){zo.readFields(e,this.#o)}write(e){zo.writeFields(e,this.#o)}serialize(){let e=ir.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=ir.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return W(i)&&(e[r]=i),e},{})}fromJSON(e){if(Wh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];W(n)&&i.fromJSON(n)});else return j("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return de.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
1
+ var jT=Object.defineProperty;var Qa=(t,e)=>{for(var r in e)jT(t,r,{get:e[r],enumerable:!0})};var LP=globalThis;LP.self??=globalThis;LP.location??={href:"/"};var W=t=>t!=null,Yi=t=>t===null,ZP=t=>t!==null,Kh=t=>t===void 0,x0=t=>t!==void 0,y0=t=>t==null,w0=(t,e)=>t!=null?e(t):void 0,Ue=(t,e="asDefined failed")=>t??j(ca(e)),ht=(t,e)=>t instanceof e,Te=(t,e)=>t instanceof e?t:j(`${t} is not instance of ${e}`),b0=(t,e)=>{t instanceof e||j(`${t} is not instance of ${e}`)};var ca=t=>t instanceof Function?t():t;var $=(t,...e)=>t?.apply(null,e),Wh=t=>W(t)&&typeof t=="object";var Lh=t=>{throw new Error(`Unhandled ${t}`)},j=t=>{throw typeof t=="string"?new Error(t):t},re=(t,e)=>t?void 0:j(ca(e));var hp=t=>new Proxy({},{get(){return j(t)}});var g0=class{value;status="success";constructor(e){this.value=e}error=hp("Cannot access error when succeeded")},v0=class{error;status="failure";constructor(e){this.error=e}value=hp("Cannot access value when failed")},Lt=t=>{try{return new g0(t())}catch(e){return new v0(e)}};var eo=(t,e)=>Object.keys(e).length===0?j("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:j(`Invalid enum value: ${String(t)}`),gp=()=>{};var _0;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(_0||(_0={}));var de=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>Ue(e.at(0),r);static getLast=(e,r)=>Ue(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ue(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ue(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>Ue(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return j(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=_0.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>W(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=Ue(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>j(W(r)?ca(r):"unwrap failed");unwrapOrElse=r=>ca(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>ca(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>j(ca(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Er;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>j(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>ca(n);unwrapOrElse=r=>ca(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Er||(Er={}));var gt;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,c=n(i(e[s]),r);if(c===0)return s;c<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(gt||(gt={}));var Zh=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var er=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(W(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=c=>(c+e/30)%12,a=r*Math.min(n,1-n),o=c=>n-a*Math.max(-1,Math.min(i(c)-3,Math.min(9-i(c),1))),s=c=>Math.round(c*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),c=(o+s)/2,d=0,f=0;if(o!==s){let v=o-s;switch(f=c>.5?v/(2-o-s):v/(o+s),o){case n:d=((i-a)/v+(i<a?6:0))*60;break;case i:d=((a-n)/v+2)*60;break;case a:d=((n-i)/v+4)*60;break}}return{h:d,s:f,l:c}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}lerp(e,r){let n=Math.PI/180,i=this.#t*Math.cos(this.#e*n),a=this.#t*Math.sin(this.#e*n),o=e.#t*Math.cos(e.#e*n),s=e.#t*Math.sin(e.#e*n),c=i+(o-i)*r,d=a+(s-a)*r,f=(Math.atan2(d,c)/n+360)%360,v=Math.sqrt(c*c+d*d),h=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(f,v,h,w)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Do=(t,e)=>t-e;var to=Math.PI*2,Zz=Math.PI/2,Gz=Math.PI/4,Hz=1/Math.sqrt(2),He=(t,e,r)=>Math.max(e,Math.min(t,r)),GP=t=>Math.max(0,Math.min(t,1)),HP=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),A0=(t,e)=>Math.floor(t/e)*e;var qP=(t,e,r)=>t+(e-t)*r;var Ks=(t,e)=>KT(t/e)*e,KT=t=>t-Math.floor(t),Gh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var F0=(t,e)=>t*e/((2*e-1)*(t-1)+e);var tr;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},c)=>t.normalizedAt(c/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=He(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=He(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),c=a-s*i.y0;return{m:s,q:c}};function*r(i,a,o,s){let{m:c,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let f=0,v=o;f<a;f++)yield v=c*v+d}t.walk=r,t.run=(i,a,o,s,c)=>{let{m:d,q:f}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let v=0,h=o;v<a;v++)c(h=d*h+f)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let f=0,v=0;f<a;f++)yield v=d*v+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(tr||(tr={}));var ua=new DataView(new ArrayBuffer(8)),Sr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ua.setInt8(0,e),ua.getInt8(0)),t.toShort=e=>(ua.setInt16(0,e),ua.getInt16(0)),t.toInt=e=>(ua.setInt32(0,e),ua.getInt32(0))})(Sr||(Sr={}));var ro;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(ua.setFloat32(0,o),ua.getFloat32(0))})(ro||(ro={}));var JP;(function(t){t.floatToIntBits=e=>{let r=ro.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return ro.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return ro.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(JP||(JP={}));var Hh;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(ua.setFloat64(0,o),ua.getFloat64(0))})(Hh||(Hh={}));var rr=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){re(W(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=W(r)?e:0,a=W(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);W(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var ir=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(Gh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},Pc=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},qh=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(ro.floatToIntBits(e))}writeDouble(e){this.writeLong(Hh.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(rr.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},it=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var WT=t=>W(t)?t.value!==void 0?"value":t.get!==void 0?"get":j(`Cannot resolve method key of ${t}`):j("Cannot resolve method key of undefined descriptor"),Mc=(t,e,r)=>{if(!W(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!W(s?.get))return j(`Cannot find getter for property '${e}'`);let c=s.get.apply(this);return Object.defineProperty(this,e,{value:c,configurable:!1,writable:!1,enumerable:!1}),c}};let n=WT(r),i=Ue(r[n]);return{[n]:function(...a){if(a.length>0)return j("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var io;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(io||(io={}));var nr=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?$(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var vp=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var xp=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var Jh=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return rr.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return rr.includes(this.map.keys(),e)}containsValue(e){return rr.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??xp.empty()}isEmpty(){return this.keyCount()===0}add(e,r){vp.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=vp.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??xp.empty()}forEach(e){rr.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var pe=Object.freeze({Empty:{terminate:gp},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),J=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>de.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var fe=class{static subscribeMany(e,...r){return pe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Yh;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return j(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(Yh||(Yh={}));var YP;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return pe.Empty}catchupAndSubscribe(r){return r(this),pe.Empty}}})(YP||(YP={}));var XP;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return pe.Empty}catchupAndSubscribe(e){return e(this),pe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(XP||(XP={}));var Pr=class{#e;#t=b.None;constructor(e){this.#e=new fe,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(W(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var Xi=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new fe,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var E0=class{#e;#t;constructor(e,r){re(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return He(e,this.#e,this.#t)}floating(){return!0}},S0=class{#e;#t;#r;constructor(e,r){this.#e=He(Math.round(e),Sr.MIN_VALUE,Sr.MAX_VALUE),this.#t=He(Math.round(r),Sr.MIN_VALUE,Sr.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(He(e,0,1)*this.#r)}clamp(e){return He(Math.round(e),this.#e,this.#t)}floating(){return!1}},P0=class{#e;#t;constructor(e,r){re(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Xh=class{#e;#t;#r;#i;constructor(e,r,n){re(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},M0=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?j(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(He(e,0,1)*(this.#e.length-1));return r>-1?Ue(this.#e.at(r),`Could not find value for ${e}`):j(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},$0=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,c=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(c*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-c/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},F;(function(t){t.linear=(a,o)=>new E0(a,o),t.linearInteger=(a,o)=>new S0(a,o),t.exponential=(a,o)=>new P0(a,o),t.power=(a,o,s)=>new Xh(a,o,s),t.powerByCenter=(a,o,s)=>{let c=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(c))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new Xh(c,o,s)},t.values=a=>new M0(a),t.decibel=(a,o,s)=>new $0(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(F||(F={}));var E;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:c}={})=>new e(a,o,s,c),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let c=o.indexOf(s);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:c}}},t.values=(a,o,s)=>new class{x(c){return{unit:a,value:s.at(o.indexOf(c))??"N/A"}}y(c){let d=s.indexOf(c);return d===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[d]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,c,d){this.#e=o??"",this.#t=s??0,this.#r=c??!1,this.#i=d??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let c=parseFloat(s);if(isNaN(c))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:c/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?He(c/200+.5,0,1):He(c/100,0,1)};{let f=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(W(f)){let v=r.indexOf(f);if(v>-1)return{type:"explicit",value:c*Math.pow(10,(v-4)*3)}}return{type:"explicit",value:c}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:c}=i(o);return{value:s.toFixed(this.#t),unit:`${c}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return W(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(E||(E={}));var $c;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})($c||($c={}));var Qh;(function(t){t.create=(e=252854082)=>new N0(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return j("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let c=Math.floor(n.uniform()*(1+r))+1;e[s]=c,a+=c}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(Qh||(Qh={}));var N0=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var Ni;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,c])=>{c instanceof e?o[s]=c.initialValue():typeof c=="object"&&(o[s]=i(c))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([c,d])=>{let f=s;d instanceof e?f[c]=d.read(i,f[c]):typeof d=="object"&&a(d,f[c])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([c,d])=>{let f=s;d instanceof e?d.write(i,f[c]):typeof d=="object"&&a(d,f[c])})};a(this.#e,this.#t)}#i(){let i=new Pc;return this.write(i),i.count}}})(Ni||(Ni={}));var Nc=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=gt.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return W(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=gt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(W(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return j(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):j(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return Ue(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(W(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return W(this.#i(e))}hasValue(e){return W(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){de.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=gt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return W(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var kc=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:gp}),some:r=>r.progress(e)}),notify:e=>t.match({none:gp,some:r=>r.notify(e)}),install:e=>{re(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var yp=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return Lh(e)}}};var eg;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return j("Insufficient memory allocated.");let a=new Uint8Array(n),o=ir.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new it(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(eg||(eg={}));var B;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:j(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=de.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return j(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return j("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new Nc(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(re(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(B||(B={}));var tg=class{#e=new J;#t;#r;#i;constructor(e){this.#r=e,this.#t=this.#e.own(new fe),this.#i=this.#o(e,[])}get data(){return this.#r}get proxy(){return this.#i}subscribe(e,...r){let n=()=>r.reduce((i,a)=>i[a],this.#i);return this.#t.subscribe(i=>{this.#n(i,r)&&e(n())})}catchupAndSubscribe(e,...r){return e(r.reduce((i,a)=>i[a],this.#i)),this.subscribe(e,...r)}subscribeAll(e){return this.#t.subscribe(r=>e(r[0]))}createMutableObservableValue(...e){let r=this.#e.own(new J),n=r.own(new fe),i=()=>e.slice(0,-1).reduce((s,c)=>s[c],this.#i),a=e[e.length-1],o={getValue:()=>e.reduce((s,c)=>s[c],this.#i),setValue:s=>i()[a]=s,subscribe:s=>n.subscribe(s),catchupAndSubscribe:s=>(s(o),n.subscribe(s)),terminate:()=>r.terminate()};return r.own(this.subscribe(()=>n.notify(o),...e)),o}update(e){let r=new Set;this.#a(this.#r,e,r);for(let n of r)this.#t.notify([n])}terminate(){this.#e.terminate(),this.#t.terminate()}#n=(e,r)=>{let n=Math.min(e.length,r.length);for(let i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0};#a=(e,r,n,i)=>{for(let a of Object.keys(r)){let o=i??a,s=r[a],c=e[a];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#a(e[a],s,n,o):c!==s&&(e[a]=s,n.add(o))}};#o=(e,r)=>new Proxy(e,{get:(n,i)=>{let a=n[i];return a!==null&&typeof a=="object"&&!Array.isArray(a)?this.#o(a,[...r,i]):a},set:(n,i,a)=>(n[i]=a,this.#t.notify([...r,i]),!0),preventExtensions:()=>!1})};var rg=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new ig(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=wp.create(wp.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var k0=(t,e)=>Math.floor(3840/e)*t,QP=(t,e=4,r=4)=>{let n=k0(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-k0(a*e,r))%n,c=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:c,ticks:d}},eM=(t,e)=>t*e/60*960,tM=(t,e)=>t*60/960/e,LT=(t,e)=>e*60/960/t,ZT=(t,e,r)=>eM(t/r,e),GT=(t,e,r)=>tM(t,e)*r,ke={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:k0,toParts:QP,secondsToPulses:eM,pulsesToSeconds:tM,secondsToBpm:LT,samplesToPulses:ZT,pulsesToSamples:GT,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=QP(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var da=128,ng=ke.fromSignature(1,48);var bp=class{a1=0;a2=0;b0=0;b1=0;b2=0;constructor(){this.identity()}identity(){this.setNormalizedCoefficients(1,0,0,1,0,0)}setLowpassParams(e,r=Math.SQRT1_2){if(e=He(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1-a)/2,s=o,c=2*o,d=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,d,f,v,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,r=Math.SQRT1_2){if(e=He(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1+a)/2,s=o,c=-2*o,d=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,d,f,v,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,r,n,i,a,o){let s=1/i;return this.b0=e*s,this.b1=r*s,this.b2=n*s,this.a1=a*s,this.a2=o*s,this}setLowShelfParams(e,r){e=He(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=to*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,d=n+1,f=n-1,v=n*(d-f*s+c),h=2*n*(f-d*s),w=n*(d-f*s-c),A=d+f*s+c,N=-2*(f+d*s),S=d+f*s-c;this.setNormalizedCoefficients(v,h,w,A,N,S)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,r){e=He(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=to*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,d=n+1,f=n-1,v=n*(d+f*s+c),h=-2*n*(f+d*s),w=n*(d+f*s-c),A=d-f*s+c,N=2*(f-d*s),S=d-f*s-c;this.setNormalizedCoefficients(v,h,w,A,N,S)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,r,n){e=He(e,0,1),r=Math.max(0,r);let i=Math.pow(10,n/40);if(e>0&&e<1)if(r>0){let a=to*e,o=Math.sin(a)/(2*r),s=Math.cos(a),c=1+o*i,d=-2*s,f=1-o*i,v=1+o/i,h=-2*s,w=1-o/i;this.setNormalizedCoefficients(c,d,f,v,h,w)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,r){if(e=He(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1-i,s=-2*a,c=1+i,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,r){if(e=He(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=to*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1,s=-2*a,c=1,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,r){if(e=Math.max(0,e),r=Math.max(0,r),e>0&&e<1){let n=to*e;if(r>0){let i=Math.sin(n)/(2*r),a=Math.cos(n),o=i,s=0,c=-i,d=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,d,f,v)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,r,n){re(e.length===r.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,a=this.b1,o=this.b2,s=this.a1,c=this.a2;for(let d=0;d<e.length;++d){let f=-Math.PI*2*e[d],v=Math.cos(f),h=Math.sin(f),w=i+((a+o*v)*v-o*h*h),A=(a+o*v)*h+o*h*v,N=1+((s+c*v)*v-c*h*h),S=(s+c*v)*h+c*h*v,O=N*N+S*S,z=(w*N+A*S)/O,Y=(A*N-w*S)/O;r[d]=Math.sqrt(z*z+Y*Y),n[d]=Math.atan2(Y,z)}}};var Ws=class{#e=0;#t=0;#r=0;#i=0;reset(){this.#e=0,this.#t=0,this.#r=0,this.#i=0}process({a1:e,a2:r,b0:n,b1:i,b2:a},o,s,c,d){let f=this.#e,v=this.#t,h=this.#r,w=this.#i;for(let A=c;A<d;A++){let N=o[A],S=s[A]=n*N+i*f+a*v-e*h-r*w+1e-18-1e-18;v=f,f=N,w=h,h=S}this.#e=f,this.#t=v,this.#r=h,this.#i=w}processFrame({a1:e,a2:r,b0:n,b1:i,b2:a},o){let s=n*o+i*this.#e+a*this.#t-e*this.#r-r*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=o,this.#i=this.#r,this.#r=s,s}};var _p;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(_p||(_p={}));var Ap;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Ap||(Ap={}));var no;(function(t){t.globalToLocal=(r,n)=>Ks(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{if(!(a>0))return b.None;let c=r-i,d=c+a;if(c>=s||d<=o)return b.None;let f=Math.max(c,o),v=Math.min(d,s);return b.wrap({index:0,rawStart:c,rawEnd:d,regionStart:Math.max(c,r),regionEnd:Math.min(d,n),resultStart:f,resultEnd:v,resultStartValue:c<f?(f-c)/a:0,resultEndValue:d>v?(v-c)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){if(!(a>0))return;let c=r-i,d=Math.max(r,o),f=Math.min(n,s),v=Math.floor((d-c)/a),h=c+v*a;for(;h<f;){let w=h+a,A=Math.max(h,r),N=Math.min(w,n),S=Math.max(h,d),O=Math.min(w,f),z=h<S?(S-h)/a:0,Y=w>O?(O-h)/a:1;yield{index:v++,rawStart:h,rawEnd:w,regionStart:A,regionEnd:N,resultStart:S,resultEnd:O,resultStartValue:z,resultEndValue:Y},h=w}}t.locateLoops=e})(no||(no={}));var zr=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new ag(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?io.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Ro=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new ag(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?io.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return io.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return io.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return io.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var ag=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=gt.leftMostMapped(this.#e,n,Do,_p.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,de.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),gt.rightMostMapped(this.#e,e,Do,_p.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),gt.leftMostMapped(this.#e,e,Do,_p.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Sr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Sr.MAX_VALUE,r);i--}return this.iterate(n,Sr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=$c.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var og;(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,c=1,d=1;i>0&&e<i&&(c=tr.normalizedAt(e/i,o));let f=r-a;if(a>0&&e>f){let v=(e-f)/a;d=1-tr.normalizedAt(v,s)}return Math.min(c,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:c,inSlope:d,outSlope:f}=o;if(e.fill(1,0,a),s<=0&&c<=0)return;let v=i-c;if(r>=s&&n<=v)return;let h=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),A=Math.min(a,Math.ceil((w-r)/h));if(A>0){let N=r/s,S=w/s,O=tr.walk(d,A,N,S);for(let z=0;z<A;z++)e[z]=O.next().value}}if(c>0&&n>v){let w=Math.max(r,v),A=Math.max(0,Math.floor((w-r)/h)),N=a-A;if(N>0){let S=(w-v)/c,O=(n-v)/c,z=tr.walk(f,N,1-S,1-O);for(let Y=A;Y<a;Y++)e[Y]=Math.min(e[Y],z.next().value)}}}})(og||(og={}));var ig=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let d=0;d<this.#e;++d)i=t.reverse(d)>>>this.#t,i>d&&(o=e[d],e[d]=e[i],e[i]=o,o=r[d],r[d]=r[i],r[i]=o);let s=this.#r,c=this.#i;for(let d=2;d<=this.#e;d<<=1){let f=d>>1,v=this.#e/d;for(n=0;n<this.#e;n+=d){let h=n+f;for(i=n,a=0;i<h;i++,a=a+v|0){let w=i+f|0,A=s[a],N=c[a],S=e[w],O=r[w],z=S*A+O*N,Y=O*A-S*N,te=e[i],me=r[i];e[w]=te-z,r[w]=me-Y,e[i]=te+z,r[i]=me+Y}}if(d===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}};var Co;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>ke.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(Co||(Co={}));var rM;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(rM||(rM={}));var sg=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=A0(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var pa;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(pa||(pa={}));var Bc;(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Ap.complete(e)-Ap.complete(r);return n!==0?n:e.pitch-r.pitch}})(Bc||(Bc={}));var lg=class{#e;#t;#r;#i;constructor(e){this.#e=new Float32Array(e),this.#t=1/e,this.#r=0,this.#i=0}pushPop(e){let r=e*e;return this.#i-=this.#e[this.#r],this.#i+=r,this.#e[this.#r]=r,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,r,n){let i=this.#e,a=i.length,o=this.#r,s=this.#i;for(let c=r;c<n;c++){let d=e[c]*e[c];s+=d-i[o],i[o]=d,++o===a&&(o=0)}return this.#r=o,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var cg=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),c=this.#n;for(let d=r;d<n;++d){let f=o[d],v=s[d],h=Math.max(Math.abs(f),Math.abs(v));if(c=h>c?i*(c-h)+h:a*(c-h)+h,c>1){let w=1/c;o[d]=f*w,s[d]=v*w}}this.#n=c}};var Jr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Jr||(Jr={}));var Ls;(function(t){function e(r,n,i){return new B0(r,n,i)}t.aware=e})(Ls||(Ls={}));var B0=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===Jr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Jr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===Jr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return eo(this.#t.getValue(),Jr)}};var iM=ke.fromSignature(1,384);var ui={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?ui.Linear:{type:"curve",slope:t}},ug;(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:j(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return rr.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=gt.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:c,value:d}=s.next();if(c)return o;if(d.position<=a){let{done:f,value:v}=s.next();if(f)return d.value;if(a<v.position)return n(d,v,a);if(d.interpolation===ui.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let c=i.iterateFrom(a),{done:d,value:f}=c.next();if(d)return;let v=o/s,h=f;if(h.position>a){for(;a<h.position;)if(yield{position:a,value:h.value},a+=v,a>o)return;h.position<=o&&(yield h)}for(;a<=o;){let{done:w,value:A}=c.next();if(w)break;for(;a<A.position;){if(a>o)return;yield{position:a,value:n(h,A,a)},a+=v}A.position<o&&(h.interpolation===ui.None&&(yield{position:A.position,value:h.value}),yield A),h=A}for(;a<=o;)yield{position:a,value:h.value},a+=v}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,c)=>o.type==="none"?i:o.type==="linear"?i+(c-a)/(s.position-a)*(s.value-i):o.type==="curve"?tr.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},c-a):j("Unknown interpolation")})(ug||(ug={}));var wp;(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let c=0;c<n;++c)i[c]=.42323-.49755*Math.cos(o*c)+.07922*Math.cos(s*c);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,c=6*a;for(let d=0;d<n;++d)i[d]=.35875-.48829*Math.cos(o*d)+.14128*Math.cos(s*d)-.01168*Math.cos(c*d);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(wp||(wp={}));var fa;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let c of o)c instanceof e?s.push(c.value):(c instanceof MessagePort||typeof ImageBitmap<"u"&&c instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&c instanceof OffscreenCanvas)&&s.push(c);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...c)=>{let d=r(c);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(rr.map(c,f=>({value:n(f)})))},d)};dispatchAndReturn=(s,...c)=>new Promise((d,f)=>{let v=rr.reduce(c,(w,A,N)=>(typeof A=="function"&&w.push([N,A]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:f},callbacks:new Map(v)});let h=r(c);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(rr.map(c,(w,A)=>typeof w=="function"?{callback:A}:{value:n(w)}))},h),this.#i++});#n=s=>{let c=this.#t.get(s.returnId);W(c)?s.type==="resolve"?(c.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(c.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&c.callbacks?.get(s.funcAt).apply(this,s.args):j(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,c){this.#e=s,this.#t=c,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{re(s.type==="send",()=>"Message type must be 'send'");let c=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=Ue(c[s.func],`${s.func.toString()} does not exists on ${this.#t}`),f=s.returnId;if(f===!1)d.apply(this.#t,s.args.map(v=>"value"in v?v.value:j(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(h=>"callback"in h?(...w)=>this.#o(f,h.callback,w):h.value)).then(h=>{try{this.#n(f,h)}catch(w){this.#a(f,w)}},h=>this.#a(f,h))}catch(v){this.#a(f,v)}};#n=(s,c)=>this.#e.send({type:"resolve",returnId:s,resolve:c});#a=(s,c)=>this.#e.send({type:"reject",returnId:s,reject:c});#o=(s,c,d)=>this.#e.send({type:"callback",returnId:s,funcAt:c,args:d})}t.Executor=a})(fa||(fa={}));var nM={for:t=>new I0(t)},HT=[],I0=class{#e;#t=new fe;constructor(e){if(this.#e=e,W(e.onmessage)||W(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??HT)}channel(e){return new T0(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},T0=class t{#e;#t;#r=new fe;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{W(n)&&n.__id__==="42"&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var Fp;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=Lt(()=>e.next());if(a==="success"){let{done:c,value:d}=o;c&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(Fp||(Fp={}));var D0=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},dg;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=hp("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=hp("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let c=!0;return o.own(pe.create(()=>c=!1)),new Promise((d,f)=>s.then(v=>{c&&d(v)},v=>{c&&f(v)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new D0(3,yp.seconds(3));t.retry=(o,s=n)=>o().catch(c=>new Promise((d,f)=>{let v=h=>{s.retry(h,()=>o().then(w=>d(w),v))||f(h)};v(c)})),t.guardedRetry=(o,s)=>{let c=async(d=0)=>{try{return await o()}catch(f){if(s(f,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,f),await Fp.timeSpan(yp.seconds(1)),c(d);throw new Error(`Failed after ${d} retries: ${f}`)}};return c()},t.approvedRetry=(o,s)=>{let c=async()=>{try{return await o()}catch(d){if(await kc.approve(s(d)))return c();throw d}};return c()},t.delay=(o,s)=>Promise.all([o,Fp.timeSpan(s)]).then(([c])=>c),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,c)=>new Promise((d,f)=>{let v=!0,h=setTimeout(()=>{v=!1,f(new Error(c??"timeout"))},s.millis());o.then(w=>{v&&d(w)},w=>{v&&f(w)}).finally(()=>clearTimeout(h))}),t.sequentialAll=o=>o.reduce((s,c)=>s.then(async d=>[...d,await c()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return c=>{let d=()=>o(c),f=s.then(d,d);return s=f.catch(()=>{}),f}},t.memoizeAsync=(o,s)=>{let c=null,d=Date.now();return()=>{let f=Date.now();return(Yi(c)||W(s)&&f-d>s.millis())&&(d=f,c=o(),c.catch(v=>(c=null,v))),c}},t.allWithLimit=async(o,s=1)=>{let c=new Array(o.length),d=0,f=!1,v=async()=>{for(;d<o.length&&!f;){let h=d++;try{let w=await o[h]();f||(c[h]=w)}catch(w){throw f=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},v)),c},t.allSettledWithLimit=async(o,s=1)=>{let c=new Array(o.length),d=0,f=async()=>{for(;d<o.length;){let v=d++;try{let h=await o[v]();c[v]={status:"fulfilled",value:h}}catch(h){c[v]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},f)),c};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let c=Promise.withResolvers();return this.#e.push([s,c]),c.promise.finally(()=>this.#r())}}#r(){if(re(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:c,reject:d}]=this.#e.shift();this.#t++,s().then(c,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,c,d){this.#e=s,this.#t=c,this.#r=d}update(s){this.#i=b.wrap(s),s.then(c=>{this.#i.contains(s)&&this.#e(c)}).catch(c=>{this.#i.contains(s)&&this.#t(c)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),$(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(dg||(dg={}));var De=class t{static newSet(e){return new Nc(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return re(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return re(r.length>0,"Unable to parse Address"),t.compose(B.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=gt.leftMostMapped(i,r,B.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(B.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=B.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return B.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(B.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,B.length),e.buffer}toString(){return[B.toString(this.#t),...this.#r].join("/")}static read(e){let r=B.fromDataInput(e),n=e.readByte();return t.compose(r,...de.create(()=>e.readShort(),n))}},Zs;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>De.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=gt.rangeMapped(r,e,De.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=gt.rangeMapped(r,e,De.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=gt.leftMostMapped(r,e,De.LengthComparator,t.AddressReader),i=gt.rightMostMapped(r,e,De.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Zs||(Zs={}));var ma=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new nr}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=De.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{ZP(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():rr.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return j(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var R0=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ic=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},L=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return $(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new ma(this)}get address(){return this.#e.address.append(this.#t)}get debugPath(){return`${this.box.name}:${this.box.mapFields(e=>e.fieldName,...this.address.fieldKeys).join("/")}`}isBox(){return!1}isField(){return!0}isAttached(){return this.graph.findBox(this.address.uuid).nonEmpty()}fields(){return de.empty()}record(){return Yh.empty()}getField(e){return j()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return j("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};R0([Mc,Ic("design:type",ma),Ic("design:paramtypes",[])],L.prototype,"pointerHub",null);R0([Mc,Ic("design:type",De),Ic("design:paramtypes",[])],L.prototype,"address",null);R0([Mc,Ic("design:type",String),Ic("design:paramtypes",[])],L.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Gs=class t extends L{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=de.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return $(e.visitArrayField,this)}fields(){return this.#e}record(){return de.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return Ue(this.#e[e])}optField(e){return b.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return j("Type mismatch")}};var zo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=ir.create();o.write(s);let c=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(c.length),r.writeBytes(c)})},t.readFields=(r,n)=>{re(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(Kh(n[o]))continue;let s=r.readInt(),c=new Int8Array(s);r.readBytes(c);let{status:d,error:f}=Lt(()=>n[o]?.read(new it(c.buffer)));d==="failure"&&console.warn(n,f)}}})(zo||(zo={}));var qT=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},aM=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},D=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=De.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return Ue(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#s}get pointerHub(){return new ma(this)}estimateMemory(){let e=new Pc;return this.write(e),e.count}isBox(){return!0}asBox(e){return Te(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){zo.readFields(e,this.#o)}write(e){zo.writeFields(e,this.#o)}serialize(){let e=ir.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=ir.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return W(i)&&(e[r]=i),e},{})}fromJSON(e){if(Wh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];W(n)&&i.fromJSON(n)});else return j("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return de.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
2
2
  `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
3
3
  `),this));for(let n of r)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=r=>r.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};qT([Mc,aM("design:type",ma),aM("design:paramtypes",[])],D.prototype,"pointerHub",null);var Ep;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Ep||(Ep={}));var Re;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Re||(Re={}));var pg;(function(t){t.create=()=>new C0})(pg||(pg={}));var C0=class{#e=new Sp(Zs.equals);#t=new Sp(Zs.startsWith);#r=new Sp(Zs.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new z0(r,e,this.#n++,n);if(this.#a){let a=new O0(i,e);return this.#i.push(a),a}else return this.subscribeMonitor(i,e)}dispatch(e){this.#a=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#a=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,r){switch(r){case Re.This:return this.#e.subscribe(e);case Re.Parent:return this.#t.subscribe(e);case Re.Children:return this.#r.subscribe(e);default:return Lh(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},z0=class{address;propagation;order;procedure;constructor(e,r,n,i){this.address=e,this.propagation=r,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Re[this.propagation]}, order: ${this.order} }`}},Sp=class{filterStrategy;#e=[];#t=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#e.push(e),this.#t=this.#e.length<2,{terminate:()=>{let r=this.#e.length;for(;--r>=0;)this.#e[r]===e&&this.#e.splice(r,1)}}}stations(){return this.#t||(this.#e.sort(Zs.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},O0=class{monitor;propagation;#e=new J;#t=!1;constructor(e,r){this.monitor=e,this.propagation=r}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var Ut;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Ut||(Ut={}));var qs={[Ut.Boolean]:{type:Ut.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Ut.Float32]:{type:Ut.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Ut.Int32]:{type:Ut.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Ut.String]:{type:Ut.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Ut.Bytes]:{type:Ut.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},Hs=class extends L{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return $(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Re.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){re(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let r=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,r,n))}writeValue(e,r){re(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,r)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?j("not implemented"):e}fromJSON(e){return j("Type mismatch")}reset(){this.setValue(this.#t)}},I=class t extends Hs{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Ut.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return qs[Ut.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){re(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},_=class t extends Hs{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Ut.Float32,i),this.#e=r,this.#t=n}serialization(){return qs[Ut.Float32]}equals(e){return this.getValue()===e}clamp(e){return Ep.clampFloat32(this.#e,ro.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){re(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},M=class t extends Hs{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Ut.Int32,i),this.#e=r,this.#t=n}serialization(){return qs[Ut.Int32]}equals(e){return this.getValue()===e}clamp(e){return Ep.clampInt32(this.#e,Sr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){re(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Sr.MIN_VALUE&&e<=Sr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},T=class t extends Hs{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Ut.String,r)}serialization(){return qs[Ut.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){re(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},oM=class t extends Hs{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Ut.Bytes,r)}serialization(){return qs[Ut.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let r=new Int8Array(e.readInt());e.readBytes(r),this.setValue(r)}write(e){re(!this.deprecated,"ByteArrayField.write: deprecated field");let r=this.getValue();e.writeInt(r.length),e.writeBytes(r)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(r=>typeof r=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var lM=t=>{let e=B.newSet(i=>i),r=B.newSet(i=>i);for(let i of t)i instanceof Js?e.add(i.uuid):i instanceof Qs&&r.add(i.uuid);let n=B.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof Js||i instanceof Qs?!n.hasKey(i.uuid):i instanceof Xs||i instanceof Ys?!n.hasKey(i.address.uuid):!0)},sM;(function(t){t.decode=e=>{let r=e.readInt();return de.create(()=>{switch(e.readString()){case"new":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Js(i,a,o.buffer)}case"pointer":{let i=De.read(e),a=e.readBoolean()?b.wrap(De.read(e)):b.None,o=e.readBoolean()?b.wrap(De.read(e)):b.None;return new Xs(i,a,o)}case"primitive":{let i=De.read(e),a=e.readString(),o=qs[a],s=o.decode(e),c=o.decode(e);return new Ys(i,o,s,c)}case"delete":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Qs(i,a,o.buffer)}}},r)}})(sM||(sM={}));var Js=class{type="new";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,r=>r.read(new it(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Ys=class{type="primitive";#e;#t;#r;#i;constructor(e,r,n,i){this.#e=e,this.#t=r,this.#r=n,this.#i=i}get address(){return this.#e}get serialization(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PrimitiveField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),e.writeString(this.#t.type),this.#t.encode(e,this.#r),this.#t.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},Xs=class{type="pointer";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},Qs=class{type="delete";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,r=>r.read(new it(this.#r)))}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var GV=Symbol("Unreferenceable"),k=class t extends L{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){re(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Lt(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){re(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Lt(r);if(this.#t=b.None,n.status==="failure")throw n.error;return n.value}static#e=b.None;static#t=b.None;#r;#i;#n=b.None;#a=b.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return j(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return $(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Re.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=b.wrap(e)}defer(){this.targetVertex=b.None}get targetVertex(){return this.graph.inTransaction()?this.#a.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let r=ma.validate(this,e.unwrap());r.nonEmpty()&&j(r.unwrap())}this.targetAddress=e.map(r=>r.address)}get targetAddress(){return this.#a}set targetAddress(e){let r=this.#a;r.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&r.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#a=e,this.graph.onPointerAddressUpdated(this,r,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap("targetVertex"))}resolvedTo(e){this.#n=e}read(e){let r=e.readBoolean()?b.wrap(De.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){re(!this.deprecated,"PointerField.write: deprecated field"),t.#e.match({none:()=>this.#a,some:r=>r.map(this)}).match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toJSON(){if(!this.deprecated)return t.#e.match({none:()=>this.#a,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Yi(e)||typeof e=="string"){let r=b.wrap(Yi(e)?null:De.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return j(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var fg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=De.newSet(e=>e.address),this.#t=De.newSet(e=>e.address),this.#r=De.newSet(e=>e.address),this.#i=De.newSet(([e])=>e),this.#n=De.newSet(([e])=>e.address),this.#a=B.newSet(e=>e)}watchVertex(e){if(ht(e,k)){if(!e.mandatory)return j("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return j("watchVertex called but has no edge requirement");r&&this.#t.add(e),n&&this.#r.add(e)}this.#a.add(e.address.uuid)}unwatchVerticesOf(...e){let r=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return j(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return j(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r)}connect(e,r){this.#n.add([e,r]),this.#i.opt(r).match({none:()=>this.#i.add([r,[e]]),some:([,n])=>n.push(e)}),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}disconnect(e){let[,r]=this.#n.removeByKey(e.address),[,n]=this.#i.get(r,"incoming by address");de.remove(n,e),n.length===0&&this.#i.removeByKey(r),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}isConnected(e,r){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(r),!1)}outgoingEdgesOf(e){return this.#o(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,de.empty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#o(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?b.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#o(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?b.wrap(new Error(`Target ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#o(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),b.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),b.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),j(`Pointer ${e.toString()} requires an edge.`)):j(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?(console.warn(e),console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} requires an edge.`),j(`Target ${e.toString()} requires an edge.`)):j(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let r=e.pointerHub.size();if(r>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${r} incoming pointers.`),j(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=De.boxRange(e,r,n);return W(i)?e.values().slice(i[0],i[1]):de.empty()}#s(e,r,n){let i=De.boxRange(e,r,n);W(i)&&e.removeRange(i[0],i[1])}};var ao=class{#e;#t;#r;#i;#n;#a;#o;#s;#u;#l;#c;#d;#p;#g=!1;#v=!1;#m=!1;constructor(e=b.None){this.#e=e,this.#t=B.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#u=pg.create(),this.#a=new nr,this.#o=new nr,this.#s=new nr,this.#l=new fg,this.#c=De.newSet(({pointer:r})=>r.address),this.#d=[],this.#p=B.newSet(r=>r.uuid)}beginTransaction(){re(!this.#g,"Transaction already in progress"),this.#g=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){re(this.#g,"No transaction in progress"),this.#A(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#f()}endTransaction(){re(this.#g,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>{this.#n.push(r),this.#h(e,r)}),this.#r.length=0),!this.#m&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#A(),this.#f(),e}),this.#x(),this.#f()}inTransaction(){return this.#g}constructingBox(){return this.#v}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),re(!this.#v,"Cannot construct box while other box is constructing"),W(r)){this.#v=!0;let a=Lt(()=>r(e));if(this.#v=!1,a.status==="failure")throw this.#F(e),a.error}if(!this.#t.add(e))return this.#F(e),j(`${e.name} ${e.address.toString()} already staged`);let i=new Js(e.address.uuid,e.name,e.toArrayBuffer());return this.#m||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#s.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#u.subscribe(e,r,n)}subscribeEndTransaction(e){this.#d.push(e)}subscribeDeletion(e,r){let n=this.#p.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#p.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);re(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new Qs(e.address.uuid,e.name,e.toArrayBuffer());this.#m||this.#n.push(n),this.#p.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#o.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(r=>r.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new qh;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#v){let i=new Ys(e.address,e.serialization(),r,n);this.#m||this.#n.push(i),this.#u.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#w(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new Xs(e.address,r,n);this.#v?this.#r.push({pointerField:e,update:i}):(this.#m||this.#n.push(i),this.#y(e,i),this.#o.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#u.dispatch(r),this.#a.proxy.onUpdate(r)}#h(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#u.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#f(){for(this.#c.values().toSorted((e,r)=>e.index-r.index).forEach(({pointer:e,initial:r,final:n})=>{r.equals(n)||(r.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#c.clear(),this.#g=!1;this.#d.length>0;)this.#d.splice(0).forEach(e=>e()),this.#d.length>0&&console.debug(`${this.#d.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#m),this.#m=!1}#A(){this.#m=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=lM(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof Xs||n instanceof Ys)&&this.findVertex(n.address).isEmpty()){console.warn(`[BoxGraph] rollback skips ${n.type}-update, vertex not found at ${n.address.toString()}`);continue}n.inverse(this)}this.#i.length=0,this.#l.clearAffected(),this.#c.clear(),this.#n.length=0}#F(e){for(let r=this.#r.length-1;r>=0;r--)this.#r[r].pointerField.box===e&&this.#r.splice(r,1);this.#l.outgoingEdgesOf(e).forEach(([r])=>this.#l.disconnect(r)),this.#l.forgetVerticesOf(e)}findOrphans(e){let r=this.#S(e);return this.boxes().filter(n=>!r.has(n))}#S(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#_(i).forEach(a=>{a.targetAddress.ifSome(o=>{this.findBox(o.uuid).ifSome(s=>{r.has(s)||n.push(s)})})});for(let a of i.incomingEdges())r.has(a.box)||n.push(a.box)}}return r}#_(e){let r=[],n=i=>{for(let a of i)a.accept({visitPointerField:o=>r.push(o),visitObjectField:o=>n(o.fields()),visitArrayField:o=>n(o.fields())})};return n(e.fields()),r}dependenciesOf(e,r={}){let n=W(r.excludeBox)?r.excludeBox:$c.alwaysFalse,i=W(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=W(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,c=(f,v=!1)=>{if(!(o.has(f)||!v&&n(f))){if(o.add(f),a&&W(f.resource)){f.incomingEdges().forEach(h=>{s.add(h);let w=h.targetAddress.mapOr(A=>!A.isBox(),!1);if(h.mandatory&&w){if(f.resource==="shared"&&h.targetAddress.flatMap(N=>this.findVertex(N)).mapOr(N=>N.pointerRules.mandatory,!1))return;c(h.box)}});return}f.outgoingEdges().filter(([h])=>!s.has(h)).forEach(([h,w])=>{let A=this.findVertex(w).unwrap(`Could not find target of ${h.toString()}`);if(s.add(h),A.pointerRules.mandatory&&(i||A.pointerHub.incoming().filter(N=>N.targetAddress.mapOr(S=>S.equals(w),!1)).every(N=>s.has(N))))return c(A.box)}),f.incomingEdges().forEach(h=>{s.add(h),h.mandatory&&c(h.box)})}},d=Array.isArray(e)?e:[e];return d.forEach(f=>c(f,!0)),d.forEach(f=>o.delete(f)),{boxes:o,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,r=n=>{for(let i of n.fields())i.accept({visitPointerField:a=>{if(a.targetAddress.nonEmpty()){let o=a.targetVertex.nonEmpty(),s=this.findVertex(a.targetAddress.unwrap()).nonEmpty();re(o,`pointer ${a.address} is broken`),re(s,`Cannot find target for pointer ${a.address}`),e++}},visitObjectField:a=>r(a)})};return this.#t.forEach(n=>r(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,r)=>(e[B.toString(r.address.uuid)]={class:r.name,"incoming links":r.incomingEdges().length,"outgoing links":r.outgoingEdges().length,"est. memory (bytes)":r.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let r of this.dependenciesOf(e).boxes)console.debug(` ${r}`)})}addressToDebugPath(e){return e.flatMap(r=>r.isBox()?this.findBox(r.uuid).map(n=>n.name):this.findBox(r.uuid).flatMap(n=>n.searchVertex(r.fieldKeys).map(i=>i.isField()?i.debugPath:j("Unknown address"))))}toArrayBuffer(){let e=ir.create(),r=this.#t.values();return e.writeInt(r.length),r.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e,r=!0){re(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new it(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),c=new Int8Array(s);n.readBytes(c);let d=new it(c.buffer),f=d.readInt(),v=d.readString(),h=B.fromDataInput(d);a.push({creationIndex:f,name:v,uuid:h,boxStream:d})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:c})=>this.createBox(o,s,d=>d.read(c))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#y(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#f())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:Ue(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return j("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,B.parse(i),s=>{let c=Lt(()=>s.fromJSON(o));c.status==="failure"&&console.warn(c.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#y(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#f())}#w(){re(this.#g,()=>"Modification only prohibited in transaction mode.")}};var di;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=He(r,0,n.length);if(i<n.length)for(let a=i;a<n.length;a++)n[a].index.setValue(a+1);return i},t.removeOrder=(e,r)=>{let n=t.collectIndexedBoxes(e);if(r<n.length)for(let i=r+1;i<n.length;i++)n[i].index.setValue(i-1)},t.moveIndex=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=i[r];if(n<0){let o=He(r+n,0,i.length-1);for(let s=o;s<r;s++)i[s].index.setValue(s+1);a.index.setValue(o)}else if(n>1){let o=He(r+(n-1),0,i.length-1);for(let s=r;s<o;s++)i[s+1].index.setValue(s);a.index.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${r}, delta: ${n}`)},t.moveIndices=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=new Set(r),o=0;for(;o<r.length&&r[o]<n;)o++;let s=n-o,c=s,d=s+r.length,f=0,v=0,h=0;for(let w=0;w<i.length;w++){let A=i[w],N=a.has(w)?c+v++:w<n?f++:d+h++;A.index.setValue(N)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof M,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:j(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(di||(di={}));var Be=class extends L{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return $(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return Ue(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Re.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){zo.readFields(e,this.#e)}write(e){zo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[r,n])=>(e[r]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Wh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];W(n)&&i.fromJSON(n)});else return j("Type mismatch")}};var Oo;(function(t){t[t.Float=0]="Float",t[t.FloatArray=1]="FloatArray",t[t.Integer=2]="Integer",t[t.IntegerArray=3]="IntegerArray",t[t.ByteArray=4]="ByteArray"})(Oo||(Oo={}));var Pp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Pp||(Pp={}));var Tc;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(Tc||(Tc={}));var mg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=ir.create(0);#a=b.None;#o=b.None;#s=b.None;#u=-1;#l=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=fa.sender(e,({dispatchAndForget:r})=>new class{sendShareLock(n){r(this.sendShareLock,n)}sendUpdateData(n){r(this.sendUpdateData,n)}sendUpdateStructure(n){r(this.sendUpdateStructure,n)}})}flush(){let e=this.#g();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#v(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#p){let o=Gh(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=ir.use(s,r),this.#a=b.wrap(s),this.#p=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Pp.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Pp.READ))}broadcastFloat(e,r){return this.#h(new class{type=Oo.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=Oo.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=Oo.FloatArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n?.(a),i.writeInt(r.length);for(let o of r)i.writeFloat(o)}})}broadcastIntegers(e,r,n){return this.#h(new class{type=Oo.IntegerArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n(a),i.writeInt(r.length),r.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,r,n){return this.#h(new class{type=Oo.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#g(){if(this.#c){try{this.#s=b.wrap(this.#f())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#v(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){de.clear(this.#e),this.#s=b.None,this.#c=!1,this.#l=0}#m(e){re(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#v();re(e.remaining>=r,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Tc.START);let n=this.#o;for(let i=0;i<this.#e.length;i++){let a=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,a)}e.writeInt(Tc.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{de.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#c=!0}#f(){let e=ir.create();e.writeInt(Tc.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Mp=class{#e=new J;#t;constructor(e,r){this.#t=this.#e.own(new tg(r)),this.#e.own(fa.executor(e,{updateSettings:n=>this.#t.update(n)}))}get settings(){return this.#t.data}catchupAndSubscribe(e,...r){return this.#t.catchupAndSubscribe(e,...r)}terminate(){this.#e.terminate(),this.#t.terminate()}};var cM;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(cM||(cM={}));var uM;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(uM||(uM={}));var St;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(St||(St={}));var Vo={white:new er(0,0,100),blue:new er(189,100,65),green:new er(150,77,69),yellow:new er(60,100,84),cream:new er(65,20,83),orange:new er(31,100,73),red:new er(354,100,65),purple:new er(314,100,78),bright:new er(197,5,95),gray:new er(197,31,88),dark:new er(197,15,70),shadow:new er(197,10,55),black:new er(197,10,25),background:new er(197,8,9),panelBackground:new er(197,14,12),panelBackgroundBright:new er(197,13,19),panelBackgroundDark:new er(197,14,11)};var je;(function(t){t[t.Add=0]="Add",t[t.Adsr=1]="Adsr",t[t.ArrowDown=2]="ArrowDown",t[t.ArrowLeft=3]="ArrowLeft",t[t.ArrowRight=4]="ArrowRight",t[t.ArrowUp=5]="ArrowUp",t[t.AudioBus=6]="AudioBus",t[t.AudioDevice=7]="AudioDevice",t[t.AudioFile=8]="AudioFile",t[t.AutoGain=9]="AutoGain",t[t.Automation=10]="Automation",t[t.BassGuitar=11]="BassGuitar",t[t.Book=12]="Book",t[t.Box=13]="Box",t[t.Browse=14]="Browse",t[t.Bug=15]="Bug",t[t.Capture=16]="Capture",t[t.Chain=17]="Chain",t[t.ChatEmpty=18]="ChatEmpty",t[t.ChatMessage=19]="ChatMessage",t[t.Copy=20]="Copy",t[t.Maximizer=21]="Maximizer",t[t.Fold=22]="Fold",t[t.Folder=23]="Folder",t[t.Charts=24]="Charts",t[t.Checkbox=25]="Checkbox",t[t.Clips=26]="Clips",t[t.Close=27]="Close",t[t.CloudFolder=28]="CloudFolder",t[t.Code=29]="Code",t[t.CollapseDown=30]="CollapseDown",t[t.Compressor=31]="Compressor",t[t.Connected=32]="Connected",t[t.Cube=33]="Cube",t[t.Cursor=34]="Cursor",t[t.Curve=35]="Curve",t[t.Dattorro=36]="Dattorro",t[t.Delete=37]="Delete",t[t.Dial=38]="Dial",t[t.DinSlot=39]="DinSlot",t[t.Disconnected=40]="Disconnected",t[t.Divide=41]="Divide",t[t.DragConnections=42]="DragConnections",t[t.Dropdown=43]="Dropdown",t[t.Dropbox=44]="Dropbox",t[t.DrumSet=45]="DrumSet",t[t.Tidal=46]="Tidal",t[t.Duration=47]="Duration",t[t.EditBox=48]="EditBox",t[t.Effects=49]="Effects",t[t.Embed=50]="Embed",t[t.EQ=51]="EQ",t[t.Eraser=52]="Eraser",t[t.Exclude=53]="Exclude",t[t.Exit=54]="Exit",t[t.ExpandWidth=55]="ExpandWidth",t[t.FileList=56]="FileList",t[t.Film=57]="Film",t[t.Flask=58]="Flask",t[t.Focus=59]="Focus",t[t.Fullscreen=60]="Fullscreen",t[t.Gate=61]="Gate",t[t.Generator=62]="Generator",t[t.GoogleDrive=63]="GoogleDrive",t[t.Nextcloud=64]="Nextcloud",t[t.Groove=65]="Groove",t[t.Guitar=66]="Guitar",t[t.GuitarTab=67]="GuitarTab",t[t.Headphone=68]="Headphone",t[t.Heart=69]="Heart",t[t.Help=70]="Help",t[t.HighPass=71]="HighPass",t[t.HighShelf=72]="HighShelf",t[t.Insert=73]="Insert",t[t.InsertDown=74]="InsertDown",t[t.Invert=75]="Invert",t[t.Info=76]="Info",t[t.Lock=77]="Lock",t[t.Loop=78]="Loop",t[t.LoopEnd=79]="LoopEnd",t[t.LoopStart=80]="LoopStart",t[t.LowPass=81]="LowPass",t[t.LowShelf=82]="LowShelf",t[t.Magnet=83]="Magnet",t[t.MainMenu=84]="MainMenu",t[t.Maximized=85]="Maximized",t[t.Menu=86]="Menu",t[t.Merge=87]="Merge",t[t.Metronome=88]="Metronome",t[t.Microphone=89]="Microphone",t[t.Midi=90]="Midi",t[t.Minimized=91]="Minimized",t[t.Mix=92]="Mix",t[t.Mixing=93]="Mixing",t[t.Mute=94]="Mute",t[t.NanoWave=95]="NanoWave",t[t.NeuralAmp=96]="NeuralAmp",t[t.New=97]="New",t[t.NoAudio=98]="NoAudio",t[t.Note=99]="Note",t[t.NotePad=100]="NotePad",t[t.Notification=101]="Notification",t[t.OpenDAW=102]="OpenDAW",t[t.Panel=103]="Panel",t[t.Paste=104]="Paste",t[t.Peak=105]="Peak",t[t.Pencil=106]="Pencil",t[t.Piano=107]="Piano",t[t.Play=108]="Play",t[t.Playfield=109]="Playfield",t[t.PlayOnce=110]="PlayOnce",t[t.PlayRepeat=111]="PlayRepeat",t[t.PlayAlternate=112]="PlayAlternate",t[t.Pointer=113]="Pointer",t[t.Popout=114]="Popout",t[t.Primary=115]="Primary",t[t.Random=116]="Random",t[t.Record=117]="Record",t[t.Rectangle=118]="Rectangle",t[t.Redo=119]="Redo",t[t.Region=120]="Region",t[t.Robot=121]="Robot",t[t.RoundDown=122]="RoundDown",t[t.RoundUp=123]="RoundUp",t[t.Run=124]="Run",t[t.Sawtooth=125]="Sawtooth",t[t.Saxophone=126]="Saxophone",t[t.Scissors=127]="Scissors",t[t.Search=128]="Search",t[t.Share=129]="Share",t[t.SelectDown=130]="SelectDown",t[t.SelectUp=131]="SelectUp",t[t.Shadertoy=132]="Shadertoy",t[t.Shutdown=133]="Shutdown",t[t.Signalsmith=134]="Signalsmith",t[t.Sine=135]="Sine",t[t.Solo=136]="Solo",t[t.SoundFont=137]="SoundFont",t[t.Speaker=138]="Speaker",t[t.SpeakerHeadphone=139]="SpeakerHeadphone",t[t.Square=140]="Square",t[t.Stack=141]="Stack",t[t.Start=142]="Start",t[t.Stereo=143]="Stereo",t[t.Stop=144]="Stop",t[t.Subtract=145]="Subtract",t[t.Sun=146]="Sun",t[t.Swap=147]="Swap",t[t.System=148]="System",t[t.Table=149]="Table",t[t.Tape=150]="Tape",t[t.TapeReel=151]="TapeReel",t[t.Time=152]="Time",t[t.Timeline=153]="Timeline",t[t.Tone3000=154]="Tone3000",t[t.Tool=155]="Tool",t[t.Triangle=156]="Triangle",t[t.Undo=157]="Undo",t[t.Unknown=158]="Unknown",t[t.UserFolder=159]="UserFolder",t[t.Velocity=160]="Velocity",t[t.Vinyl=161]="Vinyl",t[t.Vocoder=162]="Vocoder",t[t.Volume=163]="Volume",t[t.VUMeter=164]="VUMeter",t[t.Warning=165]="Warning",t[t.Waveform=166]="Waveform",t[t.Zeitgeist=167]="Zeitgeist",t[t.Github=168]="Github",t[t.Discord=169]="Discord",t[t.Instagram=170]="Instagram",t[t.LinkedIn=171]="LinkedIn",t[t.Neon=172]="Neon",t[t.Ring=173]="Ring",t[t.Noise=174]="Noise"})(je||(je={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(je||(je={}));var l;(function(t){t[t.Deprecated=NaN]="Deprecated",t[t.MetaData=0]="MetaData",t[t.AudioBusses=1]="AudioBusses",t[t.AudioConnection=2]="AudioConnection",t[t.AudioEffectHost=3]="AudioEffectHost",t[t.AudioFile=4]="AudioFile",t[t.AudioOutput=5]="AudioOutput",t[t.AudioPlayMode=6]="AudioPlayMode",t[t.AudioUnit=7]="AudioUnit",t[t.AudioUnits=8]="AudioUnits",t[t.Automation=9]="Automation",t[t.AuxSend=10]="AuxSend",t[t.Capture=11]="Capture",t[t.ClipCollection=12]="ClipCollection",t[t.ConnectionCollection=13]="ConnectionCollection",t[t.Device=14]="Device",t[t.DeviceUserInterface=15]="DeviceUserInterface",t[t.Editing=16]="Editing",t[t.FileUploadState=17]="FileUploadState",t[t.Groove=18]="Groove",t[t.InstrumentHost=19]="InstrumentHost",t[t.MarkerEvents=20]="MarkerEvents",t[t.MarkerTrack=21]="MarkerTrack",t[t.MIDIControl=22]="MIDIControl",t[t.MIDIControllers=23]="MIDIControllers",t[t.MIDIDevice=24]="MIDIDevice",t[t.MIDIEffectHost=25]="MIDIEffectHost",t[t.ModularSetup=26]="ModularSetup",t[t.Modulation=27]="Modulation",t[t.ModuleCollection=28]="ModuleCollection",t[t.NoteEventCollection=29]="NoteEventCollection",t[t.NoteEventFeature=30]="NoteEventFeature",t[t.NoteEvents=31]="NoteEvents",t[t.NotesConnection=32]="NotesConnection",t[t.Parameter=33]="Parameter",t[t.ParameterController=34]="ParameterController",t[t.PianoMode=35]="PianoMode",t[t.ProjectMeta=36]="ProjectMeta",t[t.RegionCollection=37]="RegionCollection",t[t.Sample=38]="Sample",t[t.Selection=39]="Selection",t[t.Shadertoy=40]="Shadertoy",t[t.SideChain=41]="SideChain",t[t.SignatureAutomation=42]="SignatureAutomation",t[t.SoundfontFile=43]="SoundfontFile",t[t.StepAutomation=44]="StepAutomation",t[t.Timeline=45]="Timeline",t[t.TrackCollection=46]="TrackCollection",t[t.TransientMarkers=47]="TransientMarkers",t[t.User=48]="User",t[t.ValueEventCollection=49]="ValueEventCollection",t[t.ValueEvents=50]="ValueEvents",t[t.ValueInterpolation=51]="ValueInterpolation",t[t.VoltageConnection=52]="VoltageConnection",t[t.WarpMarkers=53]="WarpMarkers",t[t.NeuralAmpModel=54]="NeuralAmpModel",t[t.CompositeCell=55]="CompositeCell",t[t.AudioEffectCompositeCell=56]="AudioEffectCompositeCell"})(l||(l={}));var hg;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(hg||(hg={}));var ha;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(ha||(ha={}));var dM=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?j(`Indices cannot be equal (${t}, ${e})`):r};var oo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gg,Rn,Uo,vg,so,Rt=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){gg.set(this,void 0),Rn.set(this,void 0),Uo.set(this,void 0),vg.set(this,void 0),so.set(this,null),oo(this,gg,e,"f"),oo(this,Rn,B.newSet(i=>i.adapter.uuid),"f"),oo(this,Uo,new nr,"f"),oo(this,vg,e.pointerHub.catchupAndSubscribe({onAdded:i=>{oo(this,so,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{oo(this,so,null,"f"),Mr(this,Uo,"f").proxy.onReorder(a)}),s=Mr(this,Rn,"f").add({adapter:a,subscription:o});re(s,`Could not add ${a}`),Mr(this,Uo,"f").proxy.onAdd(a)},onRemoved:i=>{oo(this,so,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=Mr(this,Rn,"f").removeByKey(a);s.terminate(),Mr(this,Uo,"f").proxy.onRemove(o)}},n),"f")}field(){return Mr(this,gg,"f")}subscribe(e){return Mr(this,Uo,"f").subscribe(e)}catchupAndSubscribe(e){return Mr(this,Rn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=gt.exactMapped(this.adapters(),e,dM,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return Mr(this,Rn,"f").opt(e).map(({adapter:r})=>r)}getMinFreeIndex(){let e=this.adapters();for(let r=0;r<e.length;r++)if(e[r].indexField.getValue()>r)return r;return e.length}adapters(){return Mr(this,so,"f")===null&&oo(this,so,Mr(this,Rn,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),Mr(this,so,"f")}move(e,r){this.moveIndex(e.indexField.getValue(),r)}moveIndex(e,r){if(r===0)return;let n=this.adapters(),i=n[e],a=He(e+r,0,n.length-1);if(a!==e){if(r<0)for(let o=a;o<e;o++)n[o].indexField.setValue(o+1);else for(let o=e;o<a;o++)n[o+1].indexField.setValue(o);i.indexField.setValue(a)}}size(){return Mr(this,Rn,"f").size()}isEmpty(){return this.size()===0}terminate(){oo(this,so,null,"f"),Mr(this,Rn,"f").forEach(({subscription:e})=>e.terminate()),Mr(this,Rn,"f").clear(),Mr(this,Uo,"f").terminate(),Mr(this,vg,"f").terminate()}};gg=new WeakMap,Rn=new WeakMap,Uo=new WeakMap,vg=new WeakMap,so=new WeakMap;var lo;(function(t){t.names=["MetaDataBox","ProjectMetaBox","RootBox","SelectionBox","UserInterfaceBox","UploadFileBox","ShadertoyBox","MIDIControllerBox","TimelineBox","TrackBox","NoteEventBox","NoteEventRepeatBox","NoteEventCollectionBox","NoteRegionBox","NoteClipBox","ValueEventBox","ValueEventCollectionBox","ValueEventCurveBox","ValueRegionBox","ValueClipBox","SignatureEventBox","AudioRegionBox","AudioClipBox","AudioPitchStretchBox","AudioTimeStretchBox","AudioSignalsmithBox","TransientMarkerBox","WarpMarkerBox","MarkerBox","AudioFileBox","SoundfontFileBox","NeuralAmpModelBox","AudioUnitBox","CaptureAudioBox","CaptureMidiBox","AudioBusBox","AuxSendBox","GrooveShuffleBox","UnknownAudioEffectDeviceBox","UnknownMidiEffectDeviceBox","DeviceInterfaceKnobBox","ModularDeviceBox","StereoToolDeviceBox","MaximizerDeviceBox","CompressorDeviceBox","GateDeviceBox","DelayDeviceBox","AutotuneDeviceBox","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NeonDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","AudioEffectCompositeBox","AudioEffectCompositeCellBox","StereoCompositeBox","FrequencySplitBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return Cn.create(r,n,i);case"ProjectMetaBox":return xg.create(r,n,i);case"RootBox":return jo.create(r,n,i);case"SelectionBox":return ga.create(r,n,i);case"UserInterfaceBox":return co.create(r,n,i);case"UploadFileBox":return yg.create(r,n,i);case"ShadertoyBox":return wg.create(r,n,i);case"MIDIControllerBox":return bg.create(r,n,i);case"TimelineBox":return el.create(r,n,i);case"TrackBox":return pi.create(r,n,i);case"NoteEventBox":return Ko.create(r,n,i);case"NoteEventRepeatBox":return _g.create(r,n,i);case"NoteEventCollectionBox":return uo.create(r,n,i);case"NoteRegionBox":return tl.create(r,n,i);case"NoteClipBox":return Dc.create(r,n,i);case"ValueEventBox":return zn.create(r,n,i);case"ValueEventCollectionBox":return On.create(r,n,i);case"ValueEventCurveBox":return Wo.create(r,n,i);case"ValueRegionBox":return rl.create(r,n,i);case"ValueClipBox":return Rc.create(r,n,i);case"SignatureEventBox":return Cc.create(r,n,i);case"AudioRegionBox":return Lo.create(r,n,i);case"AudioClipBox":return zc.create(r,n,i);case"AudioPitchStretchBox":return Oc.create(r,n,i);case"AudioTimeStretchBox":return Vc.create(r,n,i);case"AudioSignalsmithBox":return Uc.create(r,n,i);case"TransientMarkerBox":return Ag.create(r,n,i);case"WarpMarkerBox":return va.create(r,n,i);case"MarkerBox":return jc.create(r,n,i);case"AudioFileBox":return Qi.create(r,n,i);case"SoundfontFileBox":return xa.create(r,n,i);case"NeuralAmpModelBox":return Fg.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return ya.create(r,n,i);case"CaptureMidiBox":return wa.create(r,n,i);case"AudioBusBox":return Vn.create(r,n,i);case"AuxSendBox":return Kc.create(r,n,i);case"GrooveShuffleBox":return Wc.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Eg.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Sg.create(r,n,i);case"DeviceInterfaceKnobBox":return Pg.create(r,n,i);case"ModularDeviceBox":return Mg.create(r,n,i);case"StereoToolDeviceBox":return $g.create(r,n,i);case"MaximizerDeviceBox":return Lc.create(r,n,i);case"CompressorDeviceBox":return Ng.create(r,n,i);case"GateDeviceBox":return kg.create(r,n,i);case"DelayDeviceBox":return Bg.create(r,n,i);case"AutotuneDeviceBox":return Ig.create(r,n,i);case"CrusherDeviceBox":return Tg.create(r,n,i);case"DattorroReverbDeviceBox":return Dg.create(r,n,i);case"VelocityDeviceBox":return Rg.create(r,n,i);case"FoldDeviceBox":return Cg.create(r,n,i);case"TidalDeviceBox":return zg.create(r,n,i);case"RevampDeviceBox":return Og.create(r,n,i);case"ReverbDeviceBox":return Vg.create(r,n,i);case"VaporisateurDeviceBox":return Zc.create(r,n,i);case"MIDIOutputDeviceBox":return Gc.create(r,n,i);case"MIDIOutputBox":return Zo.create(r,n,i);case"MIDIOutputParameterBox":return il.create(r,n,i);case"SoundfontDeviceBox":return Hc.create(r,n,i);case"NeonDeviceBox":return qc.create(r,n,i);case"NanoDeviceBox":return Jc.create(r,n,i);case"PlayfieldDeviceBox":return Yc.create(r,n,i);case"PlayfieldSampleBox":return Go.create(r,n,i);case"TapeDeviceBox":return Xc.create(r,n,i);case"ArpeggioDeviceBox":return Ug.create(r,n,i);case"PitchDeviceBox":return jg.create(r,n,i);case"ZeitgeistDeviceBox":return Kg.create(r,n,i);case"NeuralAmpDeviceBox":return Wg.create(r,n,i);case"VocoderDeviceBox":return Lg.create(r,n,i);case"WaveshaperDeviceBox":return Zg.create(r,n,i);case"WerkstattDeviceBox":return Gg.create(r,n,i);case"WerkstattParameterBox":return ba.create(r,n,i);case"WerkstattSampleBox":return nl.create(r,n,i);case"SpielwerkDeviceBox":return Hg.create(r,n,i);case"ApparatDeviceBox":return Qc.create(r,n,i);case"NoopInstrumentBox":return eu.create(r,n,i);case"CompositeDeviceBox":return qg.create(r,n,i);case"CompositeCellBox":return Jg.create(r,n,i);case"AudioEffectCompositeBox":return Yg.create(r,n,i);case"AudioEffectCompositeCellBox":return tu.create(r,n,i);case"StereoCompositeBox":return Xg.create(r,n,i);case"FrequencySplitBox":return Qg.create(r,n,i);case"ModularBox":return ev.create(r,n,i);case"ModuleConnectionBox":return tv.create(r,n,i);case"ModularAudioInputBox":return rv.create(r,n,i);case"ModularAudioOutputBox":return iv.create(r,n,i);case"ModuleDelayBox":return nv.create(r,n,i);case"ModuleMultiplierBox":return av.create(r,n,i);case"ModuleGainBox":return ov.create(r,n,i);default:return j(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new it(r),i=n.readString(),a=B.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(lo||(lo={}));var Cn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MetaDataBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MetaDataBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMetaDataBox,this)}get tags(){return t.Tags}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:T.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};var xg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ProjectMetaBox",pointerRules:{accepts:[l.ProjectMeta],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ProjectMetaBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitProjectMetaBox,this)}get tags(){return t.Tags}get projectName(){return this.getField(1)}get artist(){return this.getField(2)}get description(){return this.getField(3)}get tagList(){return this.getField(4)}get notepad(){return this.getField(5)}get created(){return this.getField(6)}get modified(){return this.getField(7)}get coverId(){return this.getField(8)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:T.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:T.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};var sv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:_.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:I.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:M.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var jo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RootBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RootBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitRootBox,this)}get tags(){return t.Tags}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get baseFrequency(){return this.getField(5)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get projectMeta(){return this.getField(101)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:_.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:L.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:L.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:L.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:sv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:k.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:k.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:k.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var ga=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SelectionBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="SelectionBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var co=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UserInterfaceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUserInterfaceBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:L.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:k.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:k.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:k.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:L.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var yg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UploadFileBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="UploadFileBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var wg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ShadertoyBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:I.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var bg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIControllerBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="MIDIControllerBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIControllerBox,this)}get tags(){return t.Tags}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:k.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:T.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:M.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:M.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var lv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:M.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var cv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:M.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:M.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var uv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get markers(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var dv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:M.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:M.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var pv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var el=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TimelineBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TimelineBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTimelineBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:lv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:cv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:L.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:uv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:dv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:pv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:M.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:_.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var pi=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TrackBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTrackBox,this)}get tags(){return t.Tags}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:M.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:I.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var Ko=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:M.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:_.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:M.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:_.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:_.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:M.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var _g=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventRepeatBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventRepeatBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventRepeatBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:M.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:_.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:_.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var uo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var tl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:I.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:T.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:M.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Ho=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:I.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:M.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:M.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:M.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var Dc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Ho.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var zn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:M.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:_.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:_.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var On=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Wo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCurveBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCurveBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:_.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var rl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Rc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Ho.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Cc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SignatureEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSignatureEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:M.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:M.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:M.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:M.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var fv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get in(){return this.getField(1)}get out(){return this.getField(2)}get inSlope(){return this.getField(3)}get outSlope(){return this.getField(4)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:_.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:_.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:_.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var Lo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}get fading(){return this.getField(18)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:T.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:_.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:_.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:_.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:_.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:fv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var zc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:Ho.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:_.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:_.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:_.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:T.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};var Oc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioPitchStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Vc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioTimeStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioTimeStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:M.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:_.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Uc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioSignalsmithBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioSignalsmithBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:_.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Ag=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TransientMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:_.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var va=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WarpMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWarpMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:_.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var jc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMarkerBox,this)}get tags(){return t.Tags}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:M.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:M.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Qi=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="AudioFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioFileBox,this)}get tags(){return t.Tags}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:_.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:T.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var xa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="SoundfontFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var Fg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[l.NeuralAmpModel],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="NeuralAmpModelBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpModelBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}get packId(){return this.getField(3)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"packId",deprecated:!1,pointerRules:p})}}};var mv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var Xe=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioUnitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioUnitBox,this)}get tags(){return t.Tags}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}get userInterface(){return this.getField(30)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:k.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:_.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:_.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:L.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:L.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:L.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:k.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:k.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:mv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var ya=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureAudioBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureAudioBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}get inputLatency(){return this.getField(12)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:M.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:_.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var wa=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureMidiBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureMidiBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:M.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Vn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioBusBox",pointerRules:{accepts:[l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioBusBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioBusBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:k.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:I.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Kc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AuxSendBox",pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AuxSendBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAuxSendBox,this)}get tags(){return t.Tags}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:k.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:M.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:_.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:_.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Wc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0,exclusive:!1},resource:"internal",ephemeral:!1}),n)}static ClassName="GrooveShuffleBox";static Resource="internal";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitGrooveShuffleBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:_.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};var Eg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownAudioEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Sg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownMidiEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Pg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="DeviceInterfaceKnobBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitDeviceInterfaceKnobBox,this)}get tags(){return t.Tags}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:k.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:_.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:T.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var hv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Mg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitModularDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:hv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var $g=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoToolDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoToolDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:_.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:_.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:I.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:M.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Lc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MaximizerDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitMaximizerDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get threshold(){return this.getField(11)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:_.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:0,scaling:"linear"},"dB",0)}}};var Ng=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompressorDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCompressorDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:I.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:I.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:I.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:_.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:_.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:_.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:_.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:_.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:_.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:_.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:_.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var kg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="GateDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitGateDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get threshold(){return this.getField(10)}get return(){return this.getField(11)}get attack(){return this.getField(12)}get hold(){return this.getField(13)}get release(){return this.getField(14)}get floor(){return this.getField(15)}get inverse(){return this.getField(16)}get sideChain(){return this.getField(30)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-80,max:0,scaling:"linear"},"dB",-6),11:_.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",1),13:_.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:_.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:_.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:I.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Bg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DelayDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDelayDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:_.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:_.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:_.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:_.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:_.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:_.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:_.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:_.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:_.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:_.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:_.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:_.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Ig=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AutotuneDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AutotuneDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAutotuneDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get key(){return this.getField(10)}get scale(){return this.getField(11)}get amount(){return this.getField(12)}get retune(){return this.getField(13)}get shift(){return this.getField(14)}get smooth(){return this.getField(15)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"key",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:11},"",0),11:M.create({parent:this,fieldKey:11,fieldName:"scale",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:7},"",1),12:_.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:_.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:_.create({parent:this,fieldKey:14,fieldName:"shift",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-12,max:12,scaling:"linear"},"st",0),15:_.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};var Tg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CrusherDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCrusherDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:M.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:_.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:_.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:1,scaling:"exponential"},"%",1)}}};var Dg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DattorroReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDattorroReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:_.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:_.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:_.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:_.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:_.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:_.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:_.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:_.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:_.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:_.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:_.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Rg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VelocityDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitVelocityDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:_.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:M.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:_.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:_.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:_.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Cg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FoldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFoldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:M.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:_.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var zg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TidalDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitTidalDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:_.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:_.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:16,scaling:"linear"},"",3),21:_.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:_.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:_.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var $p=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:M.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:_.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Np=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:_.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var ru=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:_.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:_.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Og=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RevampDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitRevampDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:$p.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Np.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:ru.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:ru.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:ru.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Np.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:$p.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:_.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Vg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:_.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:_.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:_.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:_.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:_.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var gv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:_.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:M.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:_.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var vv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:_.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:I.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:_.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:_.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:_.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var xv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:_.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:_.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:_.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var Zc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VaporisateurDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitVaporisateurDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:M.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:_.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:M.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:_.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:_.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:_.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:_.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:_.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:_.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:_.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:_.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:M.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:M.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:_.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:_.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:M.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:_.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:vv.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Gs.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>gv.create(e),2),50:xv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var yv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var Gc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:yv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:M.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:M.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:L.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Zo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:M.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:I.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var il=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:M.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:_.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var Hc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SoundfontDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitSoundfontDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:M.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var wv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get wave1(){return this.getField(1)}get wave2(){return this.getField(2)}get dcwKeyFollow(){return this.getField(3)}get dcaKeyFollow(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"wave1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:8},"",0),2:M.create({parent:this,fieldKey:2,fieldName:"wave2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:9},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"dcwKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"dcaKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0)}}};var bv=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get rate1(){return this.getField(1)}get rate2(){return this.getField(2)}get rate3(){return this.getField(3)}get rate4(){return this.getField(4)}get rate5(){return this.getField(5)}get rate6(){return this.getField(6)}get rate7(){return this.getField(7)}get rate8(){return this.getField(8)}get level1(){return this.getField(11)}get level2(){return this.getField(12)}get level3(){return this.getField(13)}get level4(){return this.getField(14)}get level5(){return this.getField(15)}get level6(){return this.getField(16)}get level7(){return this.getField(17)}get level8(){return this.getField(18)}get sustain(){return this.getField(20)}get end(){return this.getField(21)}initializeFields(){return{1:_.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:_.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:_.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:_.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:_.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:_.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:_.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:_.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:_.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:_.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:_.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:_.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:_.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:M.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:M.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var _v=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get wave(){return this.getField(1)}get delay(){return this.getField(2)}get rate(){return this.getField(3)}get depth(){return this.getField(4)}initializeFields(){return{1:M.create({parent:this,fieldKey:1,fieldName:"wave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),2:_.create({parent:this,fieldKey:2,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),3:_.create({parent:this,fieldKey:3,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),4:_.create({parent:this,fieldKey:4,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0)}}};var qc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeonDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeonDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNeonDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lineSelect(){return this.getField(10)}get modulation(){return this.getField(11)}get octave(){return this.getField(12)}get detune(){return this.getField(13)}get glideTime(){return this.getField(15)}get tune(){return this.getField(16)}get voicingMode(){return this.getField(17)}get vibrato(){return this.getField(20)}get lines(){return this.getField(30)}get envelopes(){return this.getField(40)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lineSelect",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),11:M.create({parent:this,fieldKey:11,fieldName:"modulation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),12:M.create({parent:this,fieldKey:12,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),13:_.create({parent:this,fieldKey:13,fieldName:"detune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-4800,max:4800,scaling:"linear"},"ct",0),15:_.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:_.create({parent:this,fieldKey:16,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),17:M.create({parent:this,fieldKey:17,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),20:_v.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:Gs.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>wv.create(e),2),40:Gs.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>bv.create(e),6)}}};var Jc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NanoDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNanoDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:k.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:_.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Yc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Go=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing,l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes",copyable:!1});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldSampleBox,this)}get tags(){return t.Tags}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}get volume(){return this.getField(50)}get panning(){return this.getField(51)}initializeFields(){return{10:k.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:k.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:L.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:L.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:T.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:I.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:I.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:I.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:I.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:I.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:M.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),45:_.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:_.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:_.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:_.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:_.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02),50:_.create({parent:this,fieldKey:50,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),51:_.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Xc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain,l.Automation],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TapeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitTapeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:_.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:_.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:_.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var Ug=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ArpeggioDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitArpeggioDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:M.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:M.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:_.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:M.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:_.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var jg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PitchDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitPitchDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:_.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:M.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};var Kg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ZeitgeistDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitZeitgeistDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var Wg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeuralAmpDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modelJson(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mono(){return this.getField(13)}get mix(){return this.getField(14)}get model(){return this.getField(20)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:_.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:I.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:_.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:k.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var Lg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VocoderDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VocoderDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitVocoderDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get carrierMinFreq(){return this.getField(10)}get carrierMaxFreq(){return this.getField(11)}get modulatorMinFreq(){return this.getField(12)}get modulatorMaxFreq(){return this.getField(13)}get qEnd(){return this.getField(14)}get qStart(){return this.getField(15)}get envRelease(){return this.getField(16)}get mix(){return this.getField(17)}get bandCount(){return this.getField(18)}get modulatorSource(){return this.getField(19)}get envAttack(){return this.getField(20)}get gain(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:_.create({parent:this,fieldKey:10,fieldName:"carrierMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),11:_.create({parent:this,fieldKey:11,fieldName:"carrierMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),12:_.create({parent:this,fieldKey:12,fieldName:"modulatorMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),13:_.create({parent:this,fieldKey:13,fieldName:"modulatorMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),14:_.create({parent:this,fieldKey:14,fieldName:"qEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",2),15:_.create({parent:this,fieldKey:15,fieldName:"qStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",20),16:_.create({parent:this,fieldKey:16,fieldName:"envRelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",30),17:_.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:M.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:T.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:_.create({parent:this,fieldKey:20,fieldName:"envAttack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:100,scaling:"exponential"},"ms",5),21:_.create({parent:this,fieldKey:21,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-20,max:20,scaling:"linear"},"dB",0),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Zg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WaveshaperDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WaveshaperDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWaveshaperDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get equation(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:_.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:40,scaling:"linear"},"dB",0),12:_.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB",0),13:_.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Gg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWerkstattDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var ba=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get value(){return this.getField(4)}get defaultValue(){return this.getField(5)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:_.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:_.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var nl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattSampleBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattSampleBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get file(){return this.getField(4)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:k.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var Hg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SpielwerkDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SpielwerkDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitSpielwerkDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Qc=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ApparatDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ApparatDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitApparatDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var eu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoopInstrumentBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoopInstrumentBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitNoopInstrumentBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var qg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCompositeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get cells(){return this.getField(10)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var Jg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeCellBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get instrument(){return this.getField(2)}get midiEffects(){return this.getField(3)}get audioEffects(){return this.getField(4)}get index(){return this.getField(5)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:M.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};var Yg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var tu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeCellBox",pointerRules:{accepts:[l.Editing,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get audioEffects(){return this.getField(2)}get index(){return this.getField(3)}get label(){return this.getField(4)}get minimized(){return this.getField(5)}get gain(){return this.getField(40)}get mute(){return this.getField(41)}get solo(){return this.getField(42)}get pan(){return this.getField(43)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:_.create({parent:this,fieldKey:40,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),41:I.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:_.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Xg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Qg=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FrequencySplitBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FrequencySplitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFrequencySplitBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}get crossover1(){return this.getField(14)}get crossover2(){return this.getField(15)}get crossover3(){return this.getField(16)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:_.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:_.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),14:_.create({parent:this,fieldKey:14,fieldName:"crossover1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",200),15:_.create({parent:this,fieldKey:15,fieldName:"crossover2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",1e3),16:_.create({parent:this,fieldKey:16,fieldName:"crossover3",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",5e3)}}};var ev=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModularBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:T.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};var tv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleConnectionBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleConnectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleConnectionBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var en=class t extends Be{static create(e){return new t(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:M.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:M.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:I.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:I.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var rv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioInputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:en.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var iv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:en.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var nv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleDelayBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleDelayBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:en.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var av=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleMultiplierBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleMultiplierBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:en.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};var ov=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleGainBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleGainBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:en.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var fi;(function(t){t.write=(e,r)=>{if(r.type==="none")e.disconnect(),e.setValue(0);else if(r.type==="linear")e.disconnect(),e.setValue(1);else if(r.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;W(n)?(b0(n,Wo),n.slope.setValue(r.slope)):Wo.create(e.box.graph,B.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return W(r)?(b0(r,Wo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?ui.None:e.getValue()===1?ui.Linear:j("Unknown Interpolation value")}})(fi||(fi={}));var qo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},et=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},kp,iu,Ct,Bp,Jo,Ip,po=class t{constructor(e,r){this.type="value-event",kp.set(this,new J),iu.set(this,void 0),Ct.set(this,void 0),Bp.set(this,void 0),Jo.set(this,void 0),Ip.set(this,!1),qo(this,iu,e,"f"),qo(this,Ct,r,"f"),qo(this,Bp,et(this,kp,"f").own(new Zh(()=>fi.read(et(this,Ct,"f").interpolation))),"f");let n=()=>{et(this,Bp,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};et(this,kp,"f").ownAll(et(this,Ct,"f").subscribe(Re.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=de.equals(et(this,Ct,"f").index.address.fieldKeys,o),c=de.equals(et(this,Ct,"f").position.address.fieldKeys,o);s||c?a.requestSorting():a.onEventPropertyChanged()}}),et(this,Ct,"f").interpolation.subscribe(n),et(this,Ct,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{et(this,Jo,"f").terminate(),qo(this,Jo,i.subscribe(Re.Children,n),"f"),n()},onRemoved:()=>{et(this,Jo,"f").terminate(),qo(this,Jo,pe.Empty,"f"),n()}})),qo(this,Jo,et(this,Ct,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Re.Children,n)??pe.Empty,"f")}onSelected(){qo(this,Ip,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){qo(this,Ip,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){et(this,Jo,"f").terminate(),et(this,kp,"f").terminate()}get box(){return et(this,Ct,"f")}get uuid(){return et(this,Ct,"f").address.uuid}get address(){return et(this,Ct,"f").address}get position(){return et(this,Ct,"f").position.getValue()}get index(){return et(this,Ct,"f").index.getValue()}set interpolation(e){fi.write(et(this,Ct,"f").interpolation,e)}get interpolation(){return et(this,Bp,"f").get()}get value(){return et(this,Ct,"f").value.getValue()}get isSelected(){return et(this,Ip,"f")}get collection(){return et(this,Ct,"f").events.targetVertex.map(e=>et(this,iu,"f").boxAdapters.adapterFor(e.box,$r))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=zn.create(et(this,iu,"f").boxGraph,B.generate(),a=>{a.position.setValue(r),a.index.setValue(n),a.events.refer(e?.events??this.collection.unwrap("collection").box.events),a.value.setValue(e?.value??this.value)});return fi.write(i.interpolation,e?.interpolation??this.interpolation),et(this,iu,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return et(this,Ct,"f").position.setValue(e?.position??this.position),et(this,Ct,"f").index.setValue(e?.index??this.index),et(this,Ct,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),et(this,Ct,"f").value.setValue(e?.value??this.value),fi.write(et(this,Ct,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};kp=new WeakMap,iu=new WeakMap,Ct=new WeakMap,Bp=new WeakMap,Jo=new WeakMap,Ip=new WeakMap;po.Comparator=(t,e)=>{if(t===e)return j(`${t} is equal to itself`);let r=t.position-e.position;if(r!==0)return r;let n=t.index-e.index;return n!==0?n:j(`${t} and ${e} are identical in terms of comparison`)};var Tp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dp,Rp,Yo,tn,al,nu,fo,Av,$r=class t{constructor(e,r){Dp.add(this),Rp.set(this,new J),Yo.set(this,void 0),tn.set(this,void 0),al.set(this,void 0),nu.set(this,void 0),fo.set(this,void 0),Tp(this,Yo,e,"f"),Tp(this,tn,r,"f"),Tp(this,al,new fe,"f"),Tp(this,nu,B.newSet(i=>i.uuid),"f"),Tp(this,fo,zr.create(po.Comparator),"f");let n=i=>{let a=Ue(i.accept({visitValueEventBox:o=>Qe(this,Yo,"f").boxAdapters.adapterFor(o,po)}),`Could not find adapter for ${i}`);Qe(this,nu,"f").add(a)&&(Qe(this,fo,"f").add(a),Qe(this,Dp,"m",Av).call(this))};Qe(this,tn,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,Rp,"f").own(Qe(this,tn,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,fo,"f").remove(Qe(this,nu,"f").removeByKey(i)),Qe(this,Dp,"m",Av).call(this)}})),Qe(this,Rp,"f").own(Qe(this,tn,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,al,"f").notify(this),onRemoved:()=>Qe(this,al,"f").notify(this)}))}valueAt(e,r){return ug.valueAt(Qe(this,fo,"f"),e,r)}copy(){let e=Qe(this,Yo,"f").boxGraph,r=On.create(e,B.generate());return Qe(this,fo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Qe(this,Yo,"f").boxAdapters.adapterFor(r,t)}cut(e,r=F.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?b.None:b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return b.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return b.wrap(n);if(i.position===e)return b.wrap(i);if(n.interpolation.type==="none")return b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),d=qP(s,c,(e-a)/(o-a));return b.wrap(this.createEvent({position:e,value:r.y(d),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),d=o-a,f=e-a,v=tr.byHalf(d,s,tr.valueAt({slope:n.interpolation.slope,steps:d,y0:s,y1:c},d*.5),c),h=tr.valueAt(v,f),w=tr.slopeByHalf(s,tr.valueAt(v,f*.5),h);return fi.write(n.box.interpolation,ui.Curve(w)),b.wrap(this.createEvent({position:e,value:r.y(h),index:0,interpolation:ui.Curve(tr.slopeByHalf(h,tr.valueAt(v,(f+d)*.5),c))}))}return j("Unknown interpolation type")}subscribeChange(e){return Qe(this,al,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Qe(this,nu,"f").values().find(c=>c.position===a&&c.index===r);if(W(o)&&o.box.isAttached())return o.box.value.setValue(n),fi.write(o.box.interpolation,i),o;let s=zn.create(Qe(this,Yo,"f").boxGraph,B.generate(),c=>{c.position.setValue(e),c.index.setValue(r),c.value.setValue(n),c.events.refer(Qe(this,tn,"f").events)});return fi.write(s.interpolation,i),Qe(this,Yo,"f").boxAdapters.adapterFor(s,po)}requestSorting(){Qe(this,fo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,Dp,"m",Av).call(this)}terminate(){Qe(this,Rp,"f").terminate()}get box(){return Qe(this,tn,"f")}get uuid(){return Qe(this,tn,"f").address.uuid}get address(){return Qe(this,tn,"f").address}get numOwners(){return Qe(this,tn,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Qe(this,fo,"f")}toString(){return`{ValueEventCollectionBox ${B.toString(Qe(this,tn,"f").address.uuid)}}`}};Rp=new WeakMap,Yo=new WeakMap,tn=new WeakMap,al=new WeakMap,nu=new WeakMap,fo=new WeakMap,Dp=new WeakSet,Av=function(){Qe(this,al,"f").notify(this)};var ol=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ve=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sl,Xo,ll,ar,cl,Op,Cp,zp,au,Qo=class{constructor(e,r){sl.add(this),this.type="value-clip",Xo.set(this,new J),ll.set(this,void 0),ar.set(this,void 0),cl.set(this,void 0),Op.set(this,void 0),Cp.set(this,void 0),zp.set(this,pe.Empty),ol(this,ll,e,"f"),ol(this,ar,r,"f"),ol(this,Cp,!0,"f"),ol(this,cl,Ve(this,Xo,"f").own(new Xi(!1)),"f"),ol(this,Op,Ve(this,Xo,"f").own(new fe),"f"),Ve(this,Xo,"f").own(Ve(this,ar,"f").pointerHub.subscribe({onAdded:()=>Ve(this,sl,"m",au).call(this),onRemoved:()=>Ve(this,sl,"m",au).call(this)})),Ve(this,Xo,"f").own(Ve(this,ar,"f").subscribe(Re.Children,n=>Ve(this,sl,"m",au).call(this))),Ve(this,Xo,"f").own(Ve(this,ar,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ve(this,zp,"f").terminate(),ol(this,zp,n.match({none:()=>pe.Empty,some:({box:i})=>Ve(this,ll,"f").boxAdapters.adapterFor(i,$r).subscribeChange(()=>Ve(this,sl,"m",au).call(this))}),"f"),Ve(this,sl,"m",au).call(this)})),ol(this,Cp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ve(this,cl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ve(this,Op,"f").subscribe(e)}accept(e){return $(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ve(this,ar,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ve(this,ar,"f").events.targetVertex.unwrap("events.target");Rc.create(Ve(this,ll,"f").boxGraph,B.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ve(this,ar,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ve(this,cl,"f").setValue(!0)}onDeselected(){Ve(this,cl,"f").setValue(!1)}get isSelected(){return Ve(this,cl,"f").getValue()}terminate(){Ve(this,zp,"f").terminate(),Ve(this,Xo,"f").terminate()}get box(){return Ve(this,ar,"f")}get uuid(){return Ve(this,ar,"f").address.uuid}get address(){return Ve(this,ar,"f").address}get indexField(){return Ve(this,ar,"f").index}get duration(){return Ve(this,ar,"f").duration.getValue()}get mute(){return Ve(this,ar,"f").mute.getValue()}get hue(){return Ve(this,ar,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ve(this,ar,"f").events.targetVertex.map(e=>Ve(this,ll,"f").boxAdapters.adapterFor(e.box,$r))}get label(){return Ve(this,ar,"f").label.getValue()}get trackBoxAdapter(){return Ve(this,Cp,"f")?b.None:Ve(this,ar,"f").clips.targetVertex.map(e=>Ve(this,ll,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${B.toString(Ve(this,ar,"f").address.uuid)} d: ${ke.toString(this.duration)}}`}};Xo=new WeakMap,ll=new WeakMap,ar=new WeakMap,cl=new WeakMap,Op=new WeakMap,Cp=new WeakMap,zp=new WeakMap,sl=new WeakSet,au=function(){Ve(this,Op,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Fv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vp,Ev,ul,jp,Up,Sv,ou=class{constructor(e){Vp.add(this),this.type="transient-marker",Ev.set(this,new J),ul.set(this,void 0),jp.set(this,void 0),Up.set(this,!1),Fv(this,ul,e,"f"),Fv(this,jp,new fe,"f"),rn(this,Ev,"f").own(e.subscribe(Re.Children,()=>rn(this,Vp,"m",Sv).call(this)))}onSelected(){Fv(this,Up,!0,"f"),rn(this,Vp,"m",Sv).call(this)}onDeselected(){Fv(this,Up,!1,"f"),rn(this,Vp,"m",Sv).call(this)}get box(){return rn(this,ul,"f")}get uuid(){return rn(this,ul,"f").address.uuid}get address(){return rn(this,ul,"f").address}get position(){return rn(this,ul,"f").position.getValue()}get isSelected(){return rn(this,Up,"f")}subscribe(e){return rn(this,jp,"f").subscribe(e)}terminate(){rn(this,Ev,"f").terminate()}};Ev=new WeakMap,ul=new WeakMap,jp=new WeakMap,Up=new WeakMap,Vp=new WeakSet,Sv=function(){rn(this,jp,"f").notify()};var Kp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Pv,Wp,_a,Lp,su,Mv,Un=class t{constructor(e,r){Pv.set(this,new J),Wp.set(this,void 0),_a.set(this,void 0),Lp.set(this,void 0),su.set(this,void 0),Mv.set(this,void 0),Kp(this,Wp,e,"f"),Kp(this,_a,r,"f"),Kp(this,Lp,B.newSet(({uuid:n})=>n),"f"),Kp(this,su,zr.create(t.Comparator),"f"),Kp(this,Mv,dg.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:a}=Promise.withResolvers(),o=this.getOrCreateLoader(),s=o.subscribe(c=>{c.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):c.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(c.reason)))});return n}),"f"),Nr(this,Pv,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Nr(this,Wp,"f").boxAdapters.adapterFor(n.box,ou);Nr(this,Lp,"f").add(i)&&Nr(this,su,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Nr(this,su,"f").remove(Nr(this,Lp,"f").removeByKey(n))}}))}get box(){return Nr(this,_a,"f")}get uuid(){return Nr(this,_a,"f").address.uuid}get address(){return Nr(this,_a,"f").address}get startInSeconds(){return Nr(this,_a,"f").startInSeconds.getValue()}get endInSeconds(){return Nr(this,_a,"f").endInSeconds.getValue()}get transients(){return Nr(this,su,"f")}get fileName(){return Nr(this,_a,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Nr(this,Mv,"f").call(this)}getOrCreateLoader(){return Nr(this,Wp,"f").sampleManager.getOrCreate(Nr(this,_a,"f").address.uuid)}terminate(){Nr(this,Pv,"f").terminate()}};Pv=new WeakMap,Wp=new WeakMap,_a=new WeakMap,Lp=new WeakMap,su=new WeakMap,Mv=new WeakMap;Un.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var Zp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gp,$v,Nv,mo,qp,Hp,kv,Aa=class{constructor(e,r){Gp.add(this),this.type="warp-marker",$v.set(this,new J),Nv.set(this,void 0),mo.set(this,void 0),qp.set(this,void 0),Hp.set(this,!1),Zp(this,Nv,e,"f"),Zp(this,mo,r,"f"),Zp(this,qp,new fe,"f"),Yr(this,$v,"f").own(r.subscribe(Re.Children,()=>Yr(this,Gp,"m",kv).call(this)))}onSelected(){Zp(this,Hp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Yr(this,Gp,"m",kv).call(this)}onDeselected(){Zp(this,Hp,!1,"f"),Yr(this,Gp,"m",kv).call(this)}get box(){return Yr(this,mo,"f")}get uuid(){return Yr(this,mo,"f").address.uuid}get address(){return Yr(this,mo,"f").address}get position(){return Yr(this,mo,"f").position.getValue()}get seconds(){return Yr(this,mo,"f").seconds.getValue()}get isSelected(){return Yr(this,Hp,"f")}get optWarping(){return Yr(this,mo,"f").owner.targetVertex.map(e=>Yr(this,Nv,"f").boxAdapters.adapterFor(e.box,Fa.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Yr(this,qp,"f").subscribe(e)}terminate(){Yr(this,$v,"f").terminate()}};$v=new WeakMap,Nv=new WeakMap,mo=new WeakMap,qp=new WeakMap,Hp=new WeakMap,Gp=new WeakSet,kv=function(){Yr(this,qp,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var lu=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var Jp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Or=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Bv,Iv,dl,pl,Yp,cu,Ea=class{constructor(e,r){Bv.set(this,new J),Iv.set(this,void 0),dl.set(this,void 0),pl.set(this,void 0),Yp.set(this,void 0),cu.set(this,void 0),Jp(this,Iv,e,"f"),Jp(this,dl,r,"f"),Jp(this,pl,new fe,"f"),Jp(this,Yp,B.newSet(({uuid:n})=>n),"f"),Jp(this,cu,zr.create(lu),"f"),Or(this,Bv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Or(this,Iv,"f").boxAdapters.adapterFor(n.box,Aa);Or(this,Yp,"f").add(i)&&(Or(this,cu,"f").add(i),Or(this,pl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Or(this,cu,"f").remove(Or(this,Yp,"f").removeByKey(n)),Or(this,pl,"f").notify()}}))}get box(){return Or(this,dl,"f")}get uuid(){return Or(this,dl,"f").address.uuid}get address(){return Or(this,dl,"f").address}get warpMarkers(){return Or(this,cu,"f")}clone(){let e=Oc.create(Or(this,dl,"f").graph,B.generate());return this.warpMarkers.asArray().forEach(r=>va.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Or(this,pl,"f").subscribe(e)}onChanged(){Or(this,pl,"f").notify()}terminate(){Or(this,Bv,"f").terminate()}};Bv=new WeakMap,Iv=new WeakMap,dl=new WeakMap,pl=new WeakMap,Yp=new WeakMap,cu=new WeakMap;var Xp=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},sr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tv,Dv,jn,fl,Qp,uu,Sa=class{constructor(e,r){Tv.set(this,new J),Dv.set(this,void 0),jn.set(this,void 0),fl.set(this,void 0),Qp.set(this,void 0),uu.set(this,void 0),Xp(this,Dv,e,"f"),Xp(this,jn,r,"f"),Xp(this,fl,new fe,"f"),Xp(this,Qp,B.newSet(({uuid:n})=>n),"f"),Xp(this,uu,zr.create(lu),"f"),sr(this,Tv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=sr(this,Dv,"f").boxAdapters.adapterFor(n.box,Aa);sr(this,Qp,"f").add(i)&&(sr(this,uu,"f").add(i),sr(this,fl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{sr(this,uu,"f").remove(sr(this,Qp,"f").removeByKey(n)),sr(this,fl,"f").notify()}}))}get box(){return sr(this,jn,"f")}get uuid(){return sr(this,jn,"f").address.uuid}get address(){return sr(this,jn,"f").address}get warpMarkers(){return sr(this,uu,"f")}get playbackRate(){return sr(this,jn,"f").playbackRate.getValue()}get cents(){return Math.log2(sr(this,jn,"f").playbackRate.getValue())*1200}set cents(e){sr(this,jn,"f").playbackRate.setValue(He(2**(e/1200),.5,2))}get transientPlayMode(){return eo(sr(this,jn,"f").transientPlayMode.getValue(),hg)}clone(){let e=Vc.create(sr(this,jn,"f").graph,B.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>va.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return sr(this,fl,"f").subscribe(e)}onChanged(){sr(this,fl,"f").notify()}terminate(){sr(this,Tv,"f").terminate()}};Tv=new WeakMap,Dv=new WeakMap,jn=new WeakMap,fl=new WeakMap,Qp=new WeakMap,uu=new WeakMap;var ef=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Rv,Cv,nn,ml,tf,du,Pa=class{constructor(e,r){Rv.set(this,new J),Cv.set(this,void 0),nn.set(this,void 0),ml.set(this,void 0),tf.set(this,void 0),du.set(this,void 0),ef(this,Cv,e,"f"),ef(this,nn,r,"f"),ef(this,ml,new fe,"f"),ef(this,tf,B.newSet(({uuid:n})=>n),"f"),ef(this,du,zr.create(lu),"f"),Zt(this,Rv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Zt(this,Cv,"f").boxAdapters.adapterFor(n.box,Aa);Zt(this,tf,"f").add(i)&&(Zt(this,du,"f").add(i),Zt(this,ml,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Zt(this,du,"f").remove(Zt(this,tf,"f").removeByKey(n)),Zt(this,ml,"f").notify()}}))}get box(){return Zt(this,nn,"f")}get uuid(){return Zt(this,nn,"f").address.uuid}get address(){return Zt(this,nn,"f").address}get warpMarkers(){return Zt(this,du,"f")}get transpose(){return Zt(this,nn,"f").transpose.getValue()}set transpose(e){Zt(this,nn,"f").transpose.setValue(e)}get cents(){return Zt(this,nn,"f").transpose.getValue()*100}set cents(e){Zt(this,nn,"f").transpose.setValue(e/100)}clone(){let e=Uc.create(Zt(this,nn,"f").graph,B.generate());return e.transpose.setValue(Zt(this,nn,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>va.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Zt(this,ml,"f").subscribe(e)}onChanged(){Zt(this,ml,"f").notify()}terminate(){Zt(this,Rv,"f").terminate()}};Rv=new WeakMap,Cv=new WeakMap,nn=new WeakMap,ml=new WeakMap,tf=new WeakMap,du=new WeakMap;var Fa;(function(t){t.isAudioPlayMode=e=>e instanceof Ea||e instanceof Sa||e instanceof Pa})(Fa||(Fa={}));var ki=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hl,pu,gl,zt,vl,xl,rf,af,nf,es,fu,mu,hu,gu=class{constructor(e,r){hl.add(this),this.type="audio-clip",pu.set(this,new J),gl.set(this,void 0),zt.set(this,void 0),vl.set(this,void 0),xl.set(this,void 0),rf.set(this,void 0),af.set(this,void 0),nf.set(this,void 0),es.set(this,b.None),fu.set(this,b.None),mu.set(this,pe.Empty),ki(this,gl,e,"f"),ki(this,zt,r,"f"),ki(this,nf,!0,"f"),ki(this,vl,new Pr,"f"),ki(this,xl,ye(this,pu,"f").own(new Xi(!1)),"f"),ki(this,rf,Ls.aware(e.tempoMap,r.timeBase,r.duration),"f"),ki(this,af,ye(this,pu,"f").own(new fe),"f"),ye(this,pu,"f").ownAll(ye(this,zt,"f").pointerHub.subscribe({onAdded:()=>ye(this,hl,"m",hu).call(this),onRemoved:()=>ye(this,hl,"m",hu).call(this)}),ye(this,zt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ye(this,mu,"f").terminate(),n.match({none:()=>ye(this,vl,"f").clear(),some:({box:i})=>{let a=ye(this,gl,"f").boxAdapters.adapterFor(i,Fa.isAudioPlayMode);ki(this,mu,a.subscribe(()=>ye(this,hl,"m",hu).call(this)),"f"),ye(this,vl,"f").wrap(a)}})}),ye(this,zt,"f").file.catchupAndSubscribe(n=>{ki(this,es,n.targetVertex.map(i=>ye(this,gl,"f").boxAdapters.adapterFor(i.box,Un)),"f"),ye(this,fu,"f").ifSome(i=>i.terminate()),ki(this,fu,ye(this,es,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ye(this,hl,"m",hu).call(this))),"f")}),ye(this,zt,"f").subscribe(Re.Children,n=>ye(this,hl,"m",hu).call(this))),ki(this,nf,!1,"f")}catchupAndSubscribeSelected(e){return ye(this,xl,"f").catchupAndSubscribe(e)}subscribeChange(e){return ye(this,af,"f").subscribe(e)}accept(e){return $(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());zc.create(ye(this,gl,"f").boxGraph,B.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(ye(this,zt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(ye(this,zt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(ye(this,zt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){ye(this,xl,"f").setValue(!0)}onDeselected(){ye(this,xl,"f").setValue(!1)}get isSelected(){return ye(this,xl,"f").getValue()}get box(){return ye(this,zt,"f")}get uuid(){return ye(this,zt,"f").address.uuid}get address(){return ye(this,zt,"f").address}get indexField(){return ye(this,zt,"f").index}get duration(){return ye(this,rf,"f").toPPQN(0)}set duration(e){ye(this,rf,"f").fromPPQN(e,0)}get mute(){return ye(this,zt,"f").mute.getValue()}get hue(){return ye(this,zt,"f").hue.getValue()}get gain(){return ye(this,zt,"f").gain}get file(){return ye(this,es,"f").unwrap("Cannot access file.")}get optFile(){return ye(this,es,"f")}get observableOptPlayMode(){return ye(this,vl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return eo(ye(this,zt,"f").timeBase.getValue(),Jr)}get waveformOffset(){return ye(this,zt,"f").waveformOffset}get isPlayModeNoStretch(){return ye(this,zt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>ht(e,Ea)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>ht(e,Sa)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>ht(e,Pa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Fa.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ye(this,es,"f").isEmpty())return"No Audio File";let e=ye(this,es,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ye(this,zt,"f").label.getValue()}get trackBoxAdapter(){return ye(this,nf,"f")?b.None:ye(this,zt,"f").clips.targetVertex.map(e=>ye(this,gl,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ye(this,vl,"f").nonEmpty()}terminate(){ye(this,fu,"f").ifSome(e=>e.terminate()),ki(this,fu,b.None,"f"),ye(this,mu,"f").terminate(),ki(this,mu,pe.Empty,"f"),ye(this,pu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${B.toString(ye(this,zt,"f").address.uuid)} d: ${ke.toString(this.duration)}}`}};pu=new WeakMap,gl=new WeakMap,zt=new WeakMap,vl=new WeakMap,xl=new WeakMap,rf=new WeakMap,af=new WeakMap,nf=new WeakMap,es=new WeakMap,fu=new WeakMap,mu=new WeakMap,hl=new WeakSet,hu=function(){ye(this,af,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var of=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vu,hr,zv,sf,yl=class t{constructor(e,r){this.type="note-event",vu.set(this,void 0),hr.set(this,void 0),zv.set(this,void 0),sf.set(this,!1),of(this,vu,e,"f"),of(this,hr,r,"f"),of(this,zv,Gt(this,hr,"f").subscribe(Re.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=de.equals(Gt(this,hr,"f").pitch.address.fieldKeys,a),s=de.equals(Gt(this,hr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){of(this,sf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){of(this,sf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Gt(this,zv,"f").terminate()}get box(){return Gt(this,hr,"f")}get uuid(){return Gt(this,hr,"f").address.uuid}get address(){return Gt(this,hr,"f").address}get position(){return Gt(this,hr,"f").position.getValue()}get duration(){return Gt(this,hr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Gt(this,hr,"f").velocity.getValue()}get pitch(){return Gt(this,hr,"f").pitch.getValue()}get cent(){return Gt(this,hr,"f").cent.getValue()}get chance(){return Gt(this,hr,"f").chance.getValue()}get playCount(){return Gt(this,hr,"f").playCount.getValue()}get playCurve(){return Gt(this,hr,"f").playCurve.getValue()}get isSelected(){return Gt(this,sf,"f")}get collection(){return Gt(this,hr,"f").events.targetVertex.map(e=>Gt(this,vu,"f").boxAdapters.adapterFor(e.box,an))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:r}=this.collection.unwrap();return e===r?.5:1-(this.pitch-e)/(r-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Gt(this,vu,"f").boxAdapters.adapterFor(Ko.create(Gt(this,vu,"f").boxGraph,B.generate(),r=>{r.position.setValue(e?.position??this.position),r.duration.setValue(e?.duration??this.duration),r.pitch.setValue(e?.pitch??this.pitch),r.playCount.setValue(e?.playCount??this.playCount),r.events.refer(e?.events??this.collection.unwrap("collection").box.events),r.velocity.setValue(this.velocity),r.cent.setValue(this.cent),r.chance.setValue(this.chance)}),t)}computeCurveValue(e){return Bc.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=de.create(i=>{let a=Math.floor(this.computeCurveValue(i/e)*this.duration),o=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+a),duration:Math.max(1,o-a),playCount:1,events:r})},e);return Gt(this,hr,"f").delete(),n}};vu=new WeakMap,hr=new WeakMap,zv=new WeakMap,sf=new WeakMap;var Ma=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ee=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ho,lf,ts,Kn,wl,cf,mi,Vv,Uv,jv,rs,Ov,uf,an=class t{constructor(e,r){ho.add(this),lf.set(this,new J),ts.set(this,void 0),Kn.set(this,void 0),wl.set(this,void 0),cf.set(this,void 0),mi.set(this,void 0),Vv.set(this,60),Uv.set(this,60),jv.set(this,0),rs.set(this,!1),Ma(this,ts,e,"f"),Ma(this,Kn,r,"f"),Ma(this,wl,new fe,"f"),Ma(this,cf,B.newSet(n=>n.uuid),"f"),Ma(this,mi,zr.create(Bc.Comparator),"f"),Ee(this,lf,"f").own(Ee(this,Kn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ee(this,ts,"f").boxAdapters.adapterFor(n,yl);Ee(this,cf,"f").add(i)&&(Ee(this,mi,"f").add(i),Ee(this,ho,"m",Ov).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ee(this,mi,"f").remove(Ee(this,cf,"f").removeByKey(n)),Ee(this,ho,"m",Ov).call(this)}})),Ee(this,lf,"f").own(Ee(this,Kn,"f").owners.pointerHub.subscribe({onAdded:()=>Ee(this,wl,"f").notify(this),onRemoved:()=>Ee(this,wl,"f").notify(this)}))}copy(){let e=Ee(this,ts,"f").boxGraph,r=uo.create(e,B.generate());return Ee(this,mi,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ee(this,ts,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Ee(this,ts,"f").boxAdapters.adapterFor(Ko.create(Ee(this,ts,"f").boxGraph,B.generate(),c=>{c.position.setValue(e),c.duration.setValue(r),c.velocity.setValue(n),c.pitch.setValue(i),c.chance.setValue(a),c.playCount.setValue(o),c.cent.setValue(s),c.events.refer(Ee(this,Kn,"f").events)}),yl)}subscribeChange(e){return Ee(this,wl,"f").subscribe(e)}selectable(){return Ee(this,mi,"f").asArray()}selectableAt(e){for(let r of Ee(this,mi,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return rr.one(r);return rr.empty()}selectablesBetween(e,r){let n=[],i=Ee(this,mi,"f").asArray(),a=Ee(this,mi,"f").ceilFirstIndex(r.u);for(let o=0;o<a;o++){let s=i[o];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=r.v&&n.push(s)}return n}overlapping(e,r,n){let i=[];for(let a of Ee(this,mi,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Ee(this,mi,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ee(this,ho,"m",Ov).call(this)}terminate(){Ee(this,lf,"f").terminate()}get box(){return Ee(this,Kn,"f")}get uuid(){return Ee(this,Kn,"f").address.uuid}get address(){return Ee(this,Kn,"f").address}get numOwners(){return Ee(this,Kn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Ee(this,rs,"f")||Ee(this,ho,"m",uf).call(this),Ee(this,mi,"f")}get minPitch(){return Ee(this,rs,"f")||Ee(this,ho,"m",uf).call(this),Ee(this,Vv,"f")}get maxPitch(){return Ee(this,rs,"f")||Ee(this,ho,"m",uf).call(this),Ee(this,Uv,"f")}get maxDuration(){return Ee(this,rs,"f")||Ee(this,ho,"m",uf).call(this),Ee(this,jv,"f")}toString(){return`{NoteEventCollectionBox ${B.toString(Ee(this,Kn,"f").address.uuid)}}`}};lf=new WeakMap,ts=new WeakMap,Kn=new WeakMap,wl=new WeakMap,cf=new WeakMap,mi=new WeakMap,Vv=new WeakMap,Uv=new WeakMap,jv=new WeakMap,rs=new WeakMap,ho=new WeakSet,Ov=function(){Ma(this,rs,!1,"f"),Ee(this,wl,"f").notify(this)},uf=function(){let e=127,r=0,n=0;Ee(this,mi,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),Ma(this,Vv,e,"f"),Ma(this,Uv,r,"f"),Ma(this,jv,n,"f"),Ma(this,rs,!0,"f")};var bl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_l,xu,Al,lr,Fl,ff,df,pf,yu,wu=class{constructor(e,r){_l.add(this),this.type="note-clip",xu.set(this,new J),Al.set(this,void 0),lr.set(this,void 0),Fl.set(this,void 0),ff.set(this,void 0),df.set(this,void 0),pf.set(this,pe.Empty),bl(this,Al,e,"f"),bl(this,lr,r,"f"),bl(this,df,!0,"f"),bl(this,Fl,Ke(this,xu,"f").own(new Xi(!1)),"f"),bl(this,ff,Ke(this,xu,"f").own(new fe),"f"),Ke(this,xu,"f").ownAll(Ke(this,lr,"f").pointerHub.subscribe({onAdded:()=>Ke(this,_l,"m",yu).call(this),onRemoved:()=>Ke(this,_l,"m",yu).call(this)}),Ke(this,lr,"f").subscribe(Re.Children,n=>Ke(this,_l,"m",yu).call(this)),Ke(this,lr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ke(this,pf,"f").terminate(),bl(this,pf,n.match({none:()=>pe.Empty,some:({box:i})=>Ke(this,Al,"f").boxAdapters.adapterFor(i,an).subscribeChange(()=>Ke(this,_l,"m",yu).call(this))}),"f"),Ke(this,_l,"m",yu).call(this)})),bl(this,df,!1,"f")}catchupAndSubscribeSelected(e){return Ke(this,Fl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ke(this,ff,"f").subscribe(e)}accept(e){return $(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ke(this,lr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ke(this,lr,"f").events.targetVertex.unwrap("events.target");Dc.create(Ke(this,Al,"f").boxGraph,B.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ke(this,lr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ke(this,Fl,"f").setValue(!0)}onDeselected(){Ke(this,Fl,"f").setValue(!1)}get isSelected(){return Ke(this,Fl,"f").getValue()}terminate(){Ke(this,pf,"f").terminate(),Ke(this,xu,"f").terminate()}get box(){return Ke(this,lr,"f")}get uuid(){return Ke(this,lr,"f").address.uuid}get address(){return Ke(this,lr,"f").address}get indexField(){return Ke(this,lr,"f").index}get duration(){return Ke(this,lr,"f").duration.getValue()}get mute(){return Ke(this,lr,"f").mute.getValue()}get hue(){return Ke(this,lr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ke(this,lr,"f").events.targetVertex.map(e=>Ke(this,Al,"f").boxAdapters.adapterFor(e.box,an))}get label(){return Ke(this,lr,"f").label.getValue()}get trackBoxAdapter(){return Ke(this,df,"f")?b.None:Ke(this,lr,"f").clips.targetVertex.map(e=>Ke(this,Al,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${B.toString(Ke(this,lr,"f").address.uuid)} d: ${ke.toString(this.duration)}}`}};xu=new WeakMap,Al=new WeakMap,lr=new WeakMap,Fl=new WeakMap,ff=new WeakMap,df=new WeakMap,pf=new WeakMap,_l=new WeakSet,yu=function(){Ke(this,ff,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var pM={for:(t,e)=>Ue(e.accept({visitNoteClipBox:r=>t.adapterFor(r,wu),visitValueClipBox:r=>t.adapterFor(r,Qo),visitAudioClipBox:r=>t.adapterFor(r,gu)}),"")};var Kv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},is=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Wv,bu,mf,hf,Lv=class{constructor(e,r){Wv.set(this,void 0),bu.set(this,void 0),mf.set(this,void 0),hf.set(this,void 0),Kv(this,Wv,e,"f"),Kv(this,bu,new J,"f"),Kv(this,mf,is(this,bu,"f").own(new fe),"f"),Kv(this,hf,is(this,bu,"f").own(Rt.create(e.box.clips,n=>pM.for(r,n),l.ClipCollection)),"f"),is(this,hf,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return is(this,Wv,"f")}get collection(){return is(this,hf,"f")}dispatchChange(){is(this,mf,"f").notify()}subscribeChanges(e){return is(this,mf,"f").subscribe(e)}terminate(){is(this,bu,"f").terminate()}};Wv=new WeakMap,bu=new WeakMap,mf=new WeakMap,hf=new WeakMap;var JT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},on=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xr,Zv=class{constructor(e){Xr.set(this,void 0),JT(this,Xr,e,"f")}get inField(){return on(this,Xr,"f").in}get outField(){return on(this,Xr,"f").out}get inSlopeField(){return on(this,Xr,"f").inSlope}get outSlopeField(){return on(this,Xr,"f").outSlope}get in(){return on(this,Xr,"f").in.getValue()}get out(){return on(this,Xr,"f").out.getValue()}get inSlope(){return on(this,Xr,"f").inSlope.getValue()}get outSlope(){return on(this,Xr,"f").outSlope.getValue()}get hasFading(){return og.hasFading(this)}copyTo(e){e.in.setValue(this.in),e.out.setValue(this.out),e.inSlope.setValue(this.inSlope),e.outSlope.setValue(this.outSlope)}reset(){on(this,Xr,"f").in.setValue(0),on(this,Xr,"f").out.setValue(0),on(this,Xr,"f").inSlope.setValue(.75),on(this,Xr,"f").outSlope.setValue(.25)}};Xr=new WeakMap;var vt=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Bi,gf,sn,tt,_u,Au,Fu,vf,Wn,xf,ns,Eu,Su,Pu,Mu,$u,Nu,ku,ln,Bu=class t{constructor(e,r){Bi.add(this),this.type="audio-region",gf.set(this,void 0),sn.set(this,void 0),tt.set(this,void 0),_u.set(this,void 0),Au.set(this,void 0),Fu.set(this,void 0),vf.set(this,void 0),Wn.set(this,void 0),xf.set(this,void 0),ns.set(this,b.None),Eu.set(this,pe.Empty),Su.set(this,pe.Empty),Pu.set(this,pe.Empty),Mu.set(this,pe.Empty),$u.set(this,void 0),Nu.set(this,Number.NaN),ku.set(this,Number.NaN),vt(this,sn,e,"f"),vt(this,tt,r,"f"),vt(this,gf,new J,"f");let{timeBase:n,duration:i,loopDuration:a}=r;vt(this,_u,Ls.aware(e.tempoMap,n,i),"f"),vt(this,Au,Ls.aware(e.tempoMap,n,a),"f"),vt(this,Fu,new Pr,"f"),vt(this,vf,new fe,"f"),vt(this,Wn,new Zv(r.fading),"f"),vt(this,$u,!1,"f"),vt(this,xf,!0,"f"),Q(this,gf,"f").ownAll(Q(this,tt,"f").pointerHub.subscribe({onAdded:()=>Q(this,Bi,"m",ln).call(this),onRemoved:()=>Q(this,Bi,"m",ln).call(this)}),Q(this,tt,"f").file.catchupAndSubscribe(o=>{vt(this,ns,o.targetVertex.map(s=>Q(this,sn,"f").boxAdapters.adapterFor(s.box,Un)),"f"),Q(this,Eu,"f").terminate(),vt(this,Eu,Q(this,ns,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Q(this,Bi,"m",ln).call(this)),pe.Empty),"f")}),Q(this,tt,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Su,"f").terminate(),o.match({none:()=>Q(this,Fu,"f").clear(),some:({box:s})=>{let c=Q(this,sn,"f").boxAdapters.adapterFor(s,Fa.isAudioPlayMode);vt(this,Su,c.subscribe(()=>Q(this,Bi,"m",ln).call(this)),"f"),Q(this,Fu,"f").wrap(c)}})}),Q(this,tt,"f").timeBase.catchupAndSubscribe(o=>{Q(this,Pu,"f").terminate(),eo(o.getValue(),Jr)===Jr.Seconds&&vt(this,Pu,e.tempoMap.subscribe(()=>Q(this,Bi,"m",ln).call(this)),"f")}),Q(this,tt,"f").subscribe(Re.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Q(this,tt,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Q(this,Bi,"m",ln).call(this)):Q(this,Bi,"m",ln).call(this)}}),Q(this,tt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Mu,"f").terminate(),vt(this,Mu,o.match({none:()=>pe.Empty,some:({box:s})=>Q(this,sn,"f").boxAdapters.adapterFor(s,$r).subscribeChange(()=>Q(this,Bi,"m",ln).call(this))}),"f"),Q(this,Bi,"m",ln).call(this)})),vt(this,xf,!1,"f")}subscribeChange(e){return Q(this,vf,"f").subscribe(e)}accept(e){return $(e.visitAudioRegionBoxAdapter,this)}onSelected(){vt(this,$u,!0,"f"),Q(this,Bi,"m",ln).call(this)}onDeselected(){vt(this,$u,!1,"f"),Q(this,Bi,"m",ln).call(this)}get isSelected(){return Q(this,$u,"f")}get box(){return Q(this,tt,"f")}get uuid(){return Q(this,tt,"f").address.uuid}get address(){return Q(this,tt,"f").address}get position(){return Q(this,tt,"f").position.getValue()}get duration(){return Number.isNaN(Q(this,Nu,"f"))&&vt(this,Nu,Q(this,_u,"f").toPPQN(this.position),"f"),Q(this,Nu,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Q(this,tt,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Q(this,ku,"f"))&&vt(this,ku,Q(this,Au,"f").toPPQN(this.position),"f"),Q(this,ku,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Q(this,_u,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Q(this,Au,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Q(this,tt,"f").mute.getValue()}get hue(){return Q(this,tt,"f").hue.getValue()}get gain(){return Q(this,tt,"f").gain}get fading(){return Q(this,Wn,"f")}get file(){return Q(this,ns,"f").unwrap("Cannot access file.")}get optFile(){return Q(this,ns,"f")}get observableOptPlayMode(){return Q(this,Fu,"f")}get timeBase(){return eo(Q(this,tt,"f").timeBase.getValue(),Jr)}get waveformOffset(){return Q(this,tt,"f").waveformOffset}get isPlayModeNoStretch(){return Q(this,tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>ht(e,Ea)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>ht(e,Sa)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>ht(e,Pa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Fa.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Q(this,ns,"f").isEmpty())return"No Audio File";let e=Q(this,ns,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Q(this,tt,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}get trackBoxAdapter(){return Q(this,tt,"f").regions.targetVertex.map(e=>Q(this,sn,"f").boxAdapters.adapterFor(e.box,or))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Q(this,tt,"f").events.targetVertex.map(e=>Q(this,sn,"f").boxAdapters.adapterFor(e.box,$r))}set position(e){Q(this,tt,"f").position.setValue(e)}set duration(e){Q(this,_u,"f").fromPPQN(e,this.position);let r=Q(this,Wn,"f").in+Q(this,Wn,"f").out;if(r>e){let n=e/r;Q(this,Wn,"f").inField.setValue(Q(this,Wn,"f").in*n),Q(this,Wn,"f").outField.setValue(Q(this,Wn,"f").out*n)}}set loopOffset(e){Q(this,tt,"f").loopOffset.setValue(Ks(e,this.loopDuration))}set loopDuration(e){Q(this,Au,"f").fromPPQN(e,this.position)}moveContentStart(e){let r=this.position,n=r+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===Jr.Seconds){let i=e>=0?Q(this,sn,"f").tempoMap.intervalToSeconds(r,n):-Q(this,sn,"f").tempoMap.intervalToSeconds(n,r);Q(this,tt,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(a=>a.box.position.setValue(a.position-e)))}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners,i=this.observableOptPlayMode.map(o=>o.clone()),a=Q(this,sn,"f").boxAdapters.adapterFor(Lo.create(Q(this,sn,"f").boxGraph,B.generate(),o=>{o.timeBase.setValue(Q(this,tt,"f").timeBase.getValue()),o.position.setValue(e?.position??Q(this,tt,"f").position.getValue()),o.regions.refer(e?.target??Q(this,tt,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Q(this,tt,"f").file.targetVertex.unwrap("file.target")),o.events.refer(n),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),o.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>o.playMode.refer(s)),Q(this,Wn,"f").copyTo(o.fading)}),t);return a.loopDuration=e?.loopDuration??this.resolveLoopDuration(a.position),a.loopOffset=e?.loopOffset??this.loopOffset,a.duration=e?.duration??this.resolveDuration(a.position),a}consolidate(){}canFlatten(e){return e.length>0&&de.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return b.None}terminate(){Q(this,Eu,"f").terminate(),vt(this,Eu,pe.Empty,"f"),Q(this,Pu,"f").terminate(),vt(this,Pu,pe.Empty,"f"),Q(this,Su,"f").terminate(),vt(this,Su,pe.Empty,"f"),Q(this,Mu,"f").terminate(),vt(this,Mu,pe.Empty,"f"),Q(this,gf,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${B.toString(Q(this,tt,"f").address.uuid)}}`}};gf=new WeakMap,sn=new WeakMap,tt=new WeakMap,_u=new WeakMap,Au=new WeakMap,Fu=new WeakMap,vf=new WeakMap,Wn=new WeakMap,xf=new WeakMap,ns=new WeakMap,Eu=new WeakMap,Su=new WeakMap,Pu=new WeakMap,Mu=new WeakMap,$u=new WeakMap,Nu=new WeakMap,ku=new WeakMap,Bi=new WeakSet,ln=function(){vt(this,Nu,Number.NaN,"f"),vt(this,ku,Number.NaN,"f"),!Q(this,xf,"f")&&(Q(this,vf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var go=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Me=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$a,Gv,Na,xt,bf,yf,Iu,wf,vo,Tu=class t{constructor(e,r){$a.add(this),this.type="note-region",Gv.set(this,new J),Na.set(this,void 0),xt.set(this,void 0),bf.set(this,void 0),yf.set(this,void 0),Iu.set(this,void 0),wf.set(this,pe.Empty),go(this,Na,e,"f"),go(this,xt,r,"f"),go(this,bf,new fe,"f"),go(this,Iu,!1,"f"),go(this,yf,!0,"f"),Me(this,Gv,"f").ownAll(Me(this,xt,"f").pointerHub.subscribe({onAdded:()=>Me(this,$a,"m",vo).call(this),onRemoved:()=>Me(this,$a,"m",vo).call(this)}),Me(this,xt,"f").subscribe(Re.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Me(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Me(this,$a,"m",vo).call(this)):Me(this,$a,"m",vo).call(this)}}),Me(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Me(this,wf,"f").terminate(),go(this,wf,n.match({none:()=>pe.Empty,some:({box:i})=>Me(this,Na,"f").boxAdapters.adapterFor(i,an).subscribeChange(()=>Me(this,$a,"m",vo).call(this))}),"f"),Me(this,$a,"m",vo).call(this)})),go(this,yf,!1,"f")}set position(e){Me(this,xt,"f").position.setValue(e)}set duration(e){Me(this,xt,"f").duration.setValue(e)}set loopOffset(e){Me(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Me(this,xt,"f").loopDuration.setValue(e)}isNoteRegion(){return!0}isAudioRegion(){return!1}isValueRegion(){return!1}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}subscribeChange(e){return Me(this,bf,"f").subscribe(e)}accept(e){return $(e.visitNoteRegionBoxAdapter,this)}onSelected(){go(this,Iu,!0,"f"),Me(this,$a,"m",vo).call(this)}onDeselected(){go(this,Iu,!1,"f"),Me(this,$a,"m",vo).call(this)}get isSelected(){return Me(this,Iu,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=no.globalToLocal(this,e);for(let a of n.events.iterateFrom(i-n.maxDuration)){if(i<a.position)return;i<a.complete&&(yield a.copyAsNoteEvent())}}terminate(){Me(this,wf,"f").terminate(),Me(this,Gv,"f").terminate()}get box(){return Me(this,xt,"f")}get uuid(){return Me(this,xt,"f").address.uuid}get address(){return Me(this,xt,"f").address}get position(){return Me(this,xt,"f").position.getValue()}get duration(){return Me(this,xt,"f").duration.getValue()}get loopOffset(){return Me(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Me(this,xt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Me(this,xt,"f").mute.getValue()}get hue(){return Me(this,xt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Me(this,xt,"f").events.targetVertex.map(e=>Me(this,Na,"f").boxAdapters.adapterFor(e.box,an))}get label(){return Me(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Me(this,yf,"f")?b.None:Me(this,xt,"f").regions.targetVertex.map(e=>Me(this,Na,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Me(this,Na,"f").boxAdapters.adapterFor(tl.create(Me(this,Na,"f").boxGraph,B.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Me(this,xt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Me(this,Na,"f").boxGraph,n=uo.create(r,B.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Me(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Me(this,Na,"f").boxGraph,n=e.toSorted(Ro.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=uo.create(r,B.generate()),f=Array.from(c.regions.collection.iterateRange(o,s));return f.filter(v=>v.isSelected).forEach(v=>{let h=v;for(let{resultStart:w,resultEnd:A,rawStart:N}of no.locateLoops(h,h.position,h.complete)){let S=Math.floor(w-N),O=Math.floor(A-N);for(let z of h.optCollection.unwrap("optCollection").events.iterateRange(S,O))z.copyTo({position:z.position+N-i.position,events:d.events})}}),f.forEach(({box:v})=>v.delete()),b.wrap(tl.create(r,B.generate(),v=>{v.position.setValue(o),v.duration.setValue(s-o),v.loopDuration.setValue(s-o),v.loopOffset.setValue(0),v.hue.setValue(this.hue),v.mute.setValue(this.mute),v.label.setValue(this.label),v.events.refer(d.owners),v.regions.refer(c.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${B.toString(Me(this,xt,"f").address.uuid)} p: ${ke.toString(this.position)}, c: ${ke.toString(this.complete)}}`}};Gv=new WeakMap,Na=new WeakMap,xt=new WeakMap,bf=new WeakMap,yf=new WeakMap,Iu=new WeakMap,wf=new WeakMap,$a=new WeakSet,vo=function(){Me(this,bf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var xo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ln,Du,ka,yt,Ff,Ru,_f,Af,Ba,yo=class t{constructor(e,r){Ln.add(this),this.type="value-region",Du.set(this,new J),ka.set(this,void 0),yt.set(this,void 0),Ff.set(this,void 0),Ru.set(this,void 0),_f.set(this,void 0),Af.set(this,pe.Empty),xo(this,ka,e,"f"),xo(this,yt,r,"f"),xo(this,_f,!0,"f"),xo(this,Ff,new fe,"f"),xo(this,Ru,!1,"f"),Fe(this,Du,"f").own(Fe(this,yt,"f").pointerHub.subscribe({onAdded:()=>Fe(this,Ln,"m",Ba).call(this),onRemoved:()=>Fe(this,Ln,"m",Ba).call(this)})),Fe(this,Du,"f").own(Fe(this,yt,"f").subscribe(Re.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Fe(this,yt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Fe(this,Ln,"m",Ba).call(this)):Fe(this,Ln,"m",Ba).call(this)}})),Fe(this,Du,"f").own(Fe(this,yt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Fe(this,Af,"f").terminate(),xo(this,Af,n.match({none:()=>pe.Empty,some:({box:i})=>Fe(this,ka,"f").boxAdapters.adapterFor(i,$r).subscribeChange(()=>Fe(this,Ln,"m",Ba).call(this))}),"f"),Fe(this,Ln,"m",Ba).call(this)})),xo(this,_f,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(no.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return W(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(no.globalToLocal(this,this.complete),e)}subscribeChange(e){return Fe(this,Ff,"f").subscribe(e)}accept(e){return $(e.visitValueRegionBoxAdapter,this)}onSelected(){xo(this,Ru,!0,"f"),Fe(this,Ln,"m",Ba).call(this)}onDeselected(){xo(this,Ru,!1,"f"),Fe(this,Ln,"m",Ba).call(this)}get isSelected(){return Fe(this,Ru,"f")}onValuesPropertyChanged(){Fe(this,Ln,"m",Ba).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Fe(this,Af,"f").terminate(),Fe(this,Du,"f").terminate()}get box(){return Fe(this,yt,"f")}get uuid(){return Fe(this,yt,"f").address.uuid}get address(){return Fe(this,yt,"f").address}get position(){return Fe(this,yt,"f").position.getValue()}get duration(){return Fe(this,yt,"f").duration.getValue()}get loopOffset(){return Fe(this,yt,"f").loopOffset.getValue()}get loopDuration(){return Fe(this,yt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}isNoteRegion(){return!1}isAudioRegion(){return!1}isValueRegion(){return!0}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Fe(this,yt,"f").mute.getValue()}get hue(){return Fe(this,yt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Fe(this,yt,"f").events.targetVertex.map(e=>Fe(this,ka,"f").boxAdapters.adapterFor(e.box,$r))}get label(){return Fe(this,yt,"f").label.getValue()}get trackBoxAdapter(){return Fe(this,_f,"f")?b.None:Fe(this,yt,"f").regions.targetVertex.map(e=>Fe(this,ka,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Fe(this,yt,"f").position.setValue(e)}set duration(e){Fe(this,yt,"f").duration.setValue(e)}set loopOffset(e){Fe(this,yt,"f").loopOffset.setValue(e)}set loopDuration(e){Fe(this,yt,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Fe(this,ka,"f").boxAdapters.adapterFor(rl.create(Fe(this,ka,"f").boxGraph,B.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Fe(this,yt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Fe(this,ka,"f").boxGraph,n=On.create(r,B.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Fe(this,yt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return b.None;let r=Fe(this,ka,"f").boxGraph,n=e.toSorted(Ro.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Array.from(c.regions.collection.iterateRange(o,s)),f=[];d.filter(A=>A.isSelected).forEach(A=>{let N=A,S=N.optCollection.unwrap("optCollection"),O=S.events;for(let{rawStart:z,regionStart:Y,regionEnd:te}of no.locateLoops(N,N.position,N.complete)){let me=Y-z,ee=te-z,be=O.greaterEqual(me);if(!W(be)||be.position!==me){let ze=O.lowerEqual(me);W(ze)&&f.push({position:Y-o,value:S.valueAt(me,0),interpolation:ze.interpolation})}let we=!1;for(let ze of O.iterateRange(me,Sr.MAX_VALUE)){let Tt=ze.position+z;if(Tt<te)f.push({position:Tt-o,value:ze.value,interpolation:ze.interpolation});else if(Tt===te){f.push({position:Tt-o,value:ze.value,interpolation:ui.None}),we=!0;break}else{f.push({position:te-o,value:S.valueAt(ee,0),interpolation:ui.None}),we=!0;break}}we||f.push({position:te-o,value:S.valueAt(ee,0),interpolation:ui.None})}});let v=[];for(let A of f){let N=v.length>0?v[v.length-1]:void 0;W(N)&&N.position===A.position&&N.value===A.value?v[v.length-1]=A:v.push(A)}let h=On.create(r,B.generate()),w=0;for(;w<v.length;){let A=w+1;for(;A<v.length&&v[A].position===v[w].position;)A++;let N=v[w],S=v[A-1],O=zn.create(r,B.generate(),z=>{z.position.setValue(N.position),z.index.setValue(0),z.value.setValue(N.value),z.events.refer(h.events)});if(fi.write(O.interpolation,A-w>1?ui.None:N.interpolation),A-w>1){let z=zn.create(r,B.generate(),Y=>{Y.position.setValue(S.position),Y.index.setValue(1),Y.value.setValue(S.value),Y.events.refer(h.events)});fi.write(z.interpolation,S.interpolation)}w=A}return d.forEach(({box:A})=>A.delete()),b.wrap(rl.create(r,B.generate(),A=>{A.position.setValue(o),A.duration.setValue(s-o),A.loopDuration.setValue(s-o),A.loopOffset.setValue(0),A.hue.setValue(this.hue),A.mute.setValue(this.mute),A.label.setValue(this.label),A.events.refer(h.owners),A.regions.refer(c.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${B.toString(Fe(this,yt,"f").address.uuid)} p: ${ke.toString(this.position)}, c: ${ke.toString(this.complete)}}`}};Du=new WeakMap,ka=new WeakMap,yt=new WeakMap,Ff=new WeakMap,Ru=new WeakMap,_f=new WeakMap,Af=new WeakMap,Ln=new WeakSet,Ba=function(){Fe(this,Ff,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var fM=(t,e)=>t.position-e.position,mM={for:(t,e)=>Ue(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,Tu),visitAudioRegionBox:r=>t.adapterFor(r,Bu),visitValueRegionBox:r=>t.adapterFor(r,yo)}),"")};var Cu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},cr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zu,El,Ef,Ou,as,Vu,Hv=class{constructor(e,r){zu.set(this,void 0),El.set(this,void 0),Ef.set(this,void 0),Ou.set(this,void 0),as.set(this,void 0),Vu.set(this,void 0),Cu(this,zu,e,"f"),Cu(this,El,new J,"f"),Cu(this,Ef,cr(this,El,"f").own(new fe),"f"),Cu(this,Ou,cr(this,El,"f").own(new nr),"f"),Cu(this,as,Ro.create(fM),"f"),Cu(this,Vu,B.newSet(n=>n.uuid),"f"),cr(this,El,"f").ownAll(cr(this,zu,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=mM.for(r,n),a=cr(this,Vu,"f").add(i);re(a,`Cannot add ${n}`),cr(this,as,"f").add(i);for(let o of cr(this,as,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:cr(this,zu,"f").listIndex,added:{p:i.position,d:i.duration,c:i.complete},existing:{p:o.position,d:o.duration,c:o.complete},stack:new Error().stack});break}cr(this,Ou,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=cr(this,Vu,"f").removeByKey(n);cr(this,as,"f").remove(i),cr(this,Ou,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return cr(this,zu,"f")}get collection(){return cr(this,as,"f")}get adapters(){return cr(this,Vu,"f")}onIndexingChanged(){cr(this,as,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),cr(this,Ou,"f").subscribe(e)}subscribeChanges(e){return cr(this,Ef,"f").subscribe(e)}dispatchChange(){cr(this,Ef,"f").notify()}terminate(){cr(this,El,"f").terminate()}};zu=new WeakMap,El=new WeakMap,Ef=new WeakMap,Ou=new WeakMap,as=new WeakMap,Vu=new WeakMap;var ge;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ge||(ge={}));(function(t){t.toLabelString=e=>{switch(e){case t.Audio:return"Audio";case t.Notes:return"Note";case t.Value:return"Automation";case t.Undefined:default:return"N/A"}},t.toIconSymbol=e=>{switch(e){case t.Audio:return je.Waveform;case t.Notes:return je.Piano;case t.Value:return je.Automation;case t.Undefined:return je.AudioBus;default:return je.Unknown}}})(ge||(ge={}));var qv;(function(t){t.isDeviceBox=e=>e.tags.type==="device",t.isInstrumentDeviceBox=e=>t.isDeviceBox(e)&&e.tags.deviceType==="instrument",t.isEffectDeviceBox=e=>t.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),t.isChainEffectOf=(e,r)=>t.isEffectDeviceBox(e)&&e.host.targetVertex.mapOr(n=>n.box===r,!1),t.lookupHostField=e=>W(e)&&"host"in e&&ht(e.host,k)?e.host:j(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>W(e)&&"label"in e&&ht(e.label,T)?e.label:j(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>W(e)&&"enabled"in e&&ht(e.enabled,I)?e.enabled:j(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>W(e)&&"minimized"in e&&ht(e.minimized,I)?e.minimized:j(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>W(e)&&"index"in e&&ht(e.index,M)?e.index:j(`Could not find 'index' field in '${e?.name}'`)})(qv||(qv={}));var hM;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ge.Notes;case"audio":return ge.Audio;default:return j()}}})(hM||(hM={}));var V0;(function(t){t.chainOf=(e,r)=>r==="audio"?e.audioEffects:e.midiEffects,t.chainFieldOf=(e,r)=>r==="audio"?e.audioEffectsField:e.midiEffectsField,t.takesEffect=(e,r)=>t.chainFieldOf(e,r).nonEmpty()&&(r==="audio"||!e.hostsInstrument||e.inputAdapter.mapOr(n=>n.accepts==="midi",!1))})(V0||(V0={}));var ie;(function(t){t.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),t.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),t.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",t.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",t.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",t.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",t.deleteEffectDevices=e=>{if(e.length===0)return;re(de.satisfy(e,(a,o)=>a.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];V0.chainFieldOf(r.deviceHost(),r.accepts).unwrap(`host takes no ${r.accepts} effects`).pointerHub.filter(r.accepts==="audio"?l.AudioEffectHost:l.MIDIEffectHost).map(({box:a})=>qv.lookupIndexField(a)).filter(a=>e.some(o=>B.Comparator(o.uuid,a.address.uuid)!==0)).sort((a,o)=>a.getValue()-o.getValue()).forEach((a,o)=>a.setValue(o)),e.forEach(a=>a.box.delete())}})(ie||(ie={}));var Jv=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Uu,Yv,Zn,Sl,Xv,Qv=class{constructor(e,r){Uu.set(this,void 0),Yv.set(this,new fe),Zn.set(this,void 0),Sl.set(this,void 0),Xv.set(this,void 0),Jv(this,Uu,e,"f"),Jv(this,Zn,Rt.create(e.box.tracks,n=>r.adapterFor(n,or),l.TrackCollection),"f"),Jv(this,Sl,B.newSet(({uuid:n})=>n),"f"),Jv(this,Xv,Ar(this,Zn,"f").catchupAndSubscribe({onAdd:n=>Ar(this,Sl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Ar(this,Yv,"f").notify())}),onRemove:({uuid:n})=>Ar(this,Sl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Ar(this,Uu,"f").box.graph,a=Ar(this,Uu,"f").box.tracks;pi.create(i,B.generate(),o=>{o.index.setValue(n??Ar(this,Zn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(Ar(this,Zn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Ar(this,Zn,"f").adapters(),n=r.indexOf(e);if(n===-1)return j(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<r.length;i++)r[i].indexField.setValue(i-1);e.box.delete()}get audioUnitBox(){return Ar(this,Uu,"f").box}get collection(){return Ar(this,Zn,"f")}values(){return Ar(this,Zn,"f").adapters()}catchupAndSubscribe(e){return Ar(this,Zn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Ar(this,Yv,"f").subscribe(e)}terminate(){Ar(this,Zn,"f").terminate(),Ar(this,Xv,"f").terminate(),Ar(this,Sl,"f").forEach(({subscription:e})=>e.terminate()),Ar(this,Sl,"f").clear()}};Uu=new WeakMap,Yv=new WeakMap,Zn=new WeakMap,Sl=new WeakMap,Xv=new WeakMap;var ne;(function(t){t.AudioBus="manuals/audio-bus",t.Arpeggio="manuals/devices/midi/arpeggio",t.Pitch="manuals/devices/midi/pitch",t.Spielwerk="manuals/devices/midi/spielwerk",t.Velocity="manuals/devices/midi/velocity",t.Zeitgeist="manuals/devices/midi/zeitgeist",t.Autotune="manuals/devices/audio/autotune",t.StereoTool="manuals/devices/audio/stereo-tool",t.Delay="manuals/devices/audio/delay",t.DattorroReverb="manuals/devices/audio/dattorro-reverb",t.Maximizer="manuals/devices/audio/maximizer",t.Compressor="manuals/devices/audio/compressor",t.Gate="manuals/devices/audio/gate",t.Reverb="manuals/devices/audio/cheap-reverb",t.Crusher="manuals/devices/audio/crusher",t.Fold="manuals/devices/audio/fold",t.Tidal="manuals/devices/audio/tidal",t.Revamp="manuals/devices/audio/revamp",t.Modular="manuals/devices/audio/modular",t.NeuralAmp="manuals/devices/audio/neural-amp",t.Vocoder="manuals/devices/audio/vocoder",t.Waveshaper="manuals/devices/audio/waveshaper",t.Werkstatt="manuals/devices/audio/werkstatt",t.AudioEffectComposite="manuals/devices/audio/effect-composite",t.StereoComposite="manuals/devices/audio/stereo-composite",t.Apparat="manuals/devices/instruments/apparat",t.Tape="manuals/devices/instruments/tape",t.Nano="manuals/devices/instruments/nano",t.Playfield="manuals/devices/instruments/playfield",t.Vaporisateur="manuals/devices/instruments/vaporisateur",t.Neon="manuals/devices/instruments/neon",t.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont",t.FrequencySplit="manuals/devices/audio/frequency-split"})(ne||(ne={}));var gM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ex,Ii,Ti=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=ne.AudioBus,ex.set(this,void 0),Ii.set(this,void 0),gM(this,ex,e,"f"),gM(this,Ii,r,"f")}catchupAndSubscribe(e){return e(this),Gn(this,Ii,"f").subscribe(Re.Children,()=>e(this))}get uuid(){return Gn(this,Ii,"f").address.uuid}get address(){return Gn(this,Ii,"f").address}get box(){return Gn(this,Ii,"f")}get enabledField(){return Gn(this,Ii,"f").enabled}get minimizedField(){return Gn(this,Ii,"f").minimized}get iconField(){return Gn(this,Ii,"f").icon}get labelField(){return Gn(this,Ii,"f").label}get colorField(){return Gn(this,Ii,"f").color}get iconSymbol(){return je.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Gn(this,ex,"f").boxAdapters.adapterFor(Gn(this,Ii,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};ex=new WeakMap,Ii=new WeakMap;var Sf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},wo,ju,Ku,Di,Pf,tx=class{constructor(e,r){wo.set(this,void 0),ju.set(this,void 0),Ku.set(this,void 0),Di.set(this,void 0),Pf.set(this,pe.Empty),Sf(this,wo,new J,"f"),Sf(this,ju,kt(this,wo,"f").own(new fe),"f"),Sf(this,Ku,kt(this,wo,"f").own(new Xi(je.Unknown)),"f"),Sf(this,Di,kt(this,wo,"f").own(new Pr),"f"),kt(this,wo,"f").own(kt(this,Di,"f").subscribe(n=>{kt(this,Pf,"f").terminate(),Sf(this,Pf,n.match({none:()=>(kt(this,ju,"f").notify(b.None),pe.Empty),some:({labelField:i,iconField:a})=>pe.many(a.catchupAndSubscribe(o=>kt(this,Ku,"f").setValue(je.fromName(o.getValue()))),i.catchupAndSubscribe(o=>kt(this,ju,"f").notify(b.wrap(o.getValue()))))}),"f")})),kt(this,wo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(kt(this,Di,"f").nonEmpty()){let o=kt(this,Di,"f").unwrap();j(`AudioUnitInput already has an input. Existing: ${o.box.name}@${o.box.address.toString()} (type: ${o.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let a=n instanceof Vn?r.adapterFor(n,Ti):r.adapterFor(n,ie.isInstrument);kt(this,Di,"f").unwrapOrNull()!==a&&kt(this,Di,"f").wrap(a)},onRemoved:({box:n})=>{re(kt(this,Di,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),kt(this,Di,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return kt(this,Di,"f")}subscribe(e){return kt(this,Di,"f").subscribe(e)}catchupAndSubscribe(e){return e(kt(this,Di,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),kt(this,ju,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return kt(this,Ku,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(r=>r.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(r=>r.iconField.setValue(je.toName(e)))}get icon(){return this.adapter().match({none:()=>je.Unknown,some:e=>je.fromName(e.iconField.getValue())})}get iconValue(){return kt(this,Ku,"f")}terminate(){kt(this,wo,"f").terminate(),kt(this,Pf,"f").terminate()}};wo=new WeakMap,ju=new WeakMap,Ku=new WeakMap,Di=new WeakMap,Pf=new WeakMap;var vM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pl=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},rx,bo,le=class{constructor(e){rx.set(this,void 0),bo.set(this,void 0),vM(this,rx,e,"f"),vM(this,bo,De.newSet(r=>r.address),"f")}terminate(){Pl(this,bo,"f").forEach(e=>e.terminate()),Pl(this,bo,"f").clear()}parameters(){return Pl(this,bo,"f").values()}parameterAt(e){return Pl(this,bo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new Ml(Pl(this,rx,"f"),e,r,n,i,a,o),c=Pl(this,bo,"f").add(s);return re(c,`Could not add adapter for ${e}`),s}removeParameter(e){return Pl(this,bo,"f").removeByKey(e)}};rx=new WeakMap,bo=new WeakMap;var $l=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nl,cn,os,Wu,ix,nx,Mf,Lu=class{constructor(e,r){Nl.set(this,void 0),cn.set(this,void 0),os.set(this,void 0),Wu.set(this,void 0),ix.set(this,void 0),nx.set(this,void 0),Mf.set(this,pe.Empty),$l(this,Nl,e,"f"),$l(this,cn,r,"f"),$l(this,os,new J,"f"),$l(this,Wu,Pt(this,os,"f").own(new fe),"f"),Pt(this,os,"f").own(r.targetBus.catchupAndSubscribe(()=>{Pt(this,Mf,"f").terminate(),$l(this,Mf,this.optTargetBus.match({none:()=>(Pt(this,Wu,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Pt(this,Wu,"f").notify(b.wrap(i)))}),"f")})),$l(this,ix,Pt(this,os,"f").own(new Ml(Pt(this,Nl,"f"),Pt(this,cn,"f").sendPan,F.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),$l(this,nx,Pt(this,os,"f").own(new Ml(Pt(this,Nl,"f"),Pt(this,cn,"f").sendGain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Pt(this,Wu,"f").subscribe(e)}get uuid(){return Pt(this,cn,"f").address.uuid}get address(){return Pt(this,cn,"f").address}get box(){return Pt(this,cn,"f")}get indexField(){return Pt(this,cn,"f").index}get sendPan(){return Pt(this,ix,"f")}get sendGain(){return Pt(this,nx,"f")}get targetBus(){return Pt(this,Nl,"f").boxAdapters.adapterFor(Pt(this,cn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Ti)}get optTargetBus(){return Pt(this,cn,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Pt(this,Nl,"f").boxAdapters.adapterFor(r,Ti)})))}delete(){Pt(this,cn,"f").delete()}terminate(){Pt(this,os,"f").terminate(),Pt(this,Mf,"f").terminate()}};Nl=new WeakMap,cn=new WeakMap,os=new WeakMap,Wu=new WeakMap,ix=new WeakMap,nx=new WeakMap,Mf=new WeakMap;var $f=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ia=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ax,ox,Zu,Gu,Nf,sx=class{constructor(e,r){ax.set(this,void 0),ox.set(this,void 0),Zu.set(this,void 0),Gu.set(this,void 0),Nf.set(this,pe.Empty),$f(this,ax,e,"f"),$f(this,ox,r,"f"),$f(this,Zu,new J,"f"),$f(this,Gu,Ia(this,Zu,"f").own(new fe),"f"),Ia(this,Zu,"f").own(e.catchupAndSubscribe(()=>{Ia(this,Nf,"f").terminate(),$f(this,Nf,this.adapter.match({none:()=>(Ia(this,Gu,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Ia(this,Gu,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return Ia(this,Gu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Ia(this,ax,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Ia(this,ox,"f").adapterFor(r,Ti)})))}terminate(){Ia(this,Zu,"f").terminate(),Ia(this,Nf,"f").terminate()}};ax=new WeakMap,ox=new WeakMap,Zu=new WeakMap,Gu=new WeakMap,Nf=new WeakMap;var _o=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ve=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},lx,xM,Ta,Ri,Ot,Bl,Hu,kl,cx,kf,ux,dx,yM,wM,un=class{constructor(e,r){lx.add(this),this.class="device-host",Ta.set(this,new J),Ri.set(this,void 0),Ot.set(this,void 0),Bl.set(this,void 0),Hu.set(this,void 0),kl.set(this,void 0),cx.set(this,void 0),kf.set(this,void 0),ux.set(this,void 0),dx.set(this,void 0),_o(this,Ri,e,"f"),_o(this,Ot,r,"f"),_o(this,Bl,ve(this,Ta,"f").own(new le(ve(this,Ri,"f"))),"f"),_o(this,Hu,ve(this,Ta,"f").own(new Qv(this,ve(this,Ri,"f").boxAdapters)),"f"),_o(this,kl,ve(this,Ta,"f").own(new tx(ve(this,Ot,"f").input.pointerHub,ve(this,Ri,"f").boxAdapters)),"f"),_o(this,cx,ve(this,Ta,"f").own(Rt.create(ve(this,Ot,"f").midiEffects,n=>ve(this,Ri,"f").boxAdapters.adapterFor(n,ie.isMidiEffect),l.MIDIEffectHost)),"f"),_o(this,kf,ve(this,Ta,"f").own(Rt.create(ve(this,Ot,"f").audioEffects,n=>ve(this,Ri,"f").boxAdapters.adapterFor(n,ie.isAudioEffect),l.AudioEffectHost)),"f"),_o(this,ux,ve(this,Ta,"f").own(Rt.create(ve(this,Ot,"f").auxSends,n=>ve(this,Ri,"f").boxAdapters.adapterFor(n,Lu),l.AuxSend)),"f"),_o(this,dx,ve(this,Ta,"f").own(new sx(ve(this,Ot,"f").output,ve(this,Ri,"f").boxAdapters)),"f"),this.namedParameter=ve(this,lx,"m",yM).call(this,r),ve(this,lx,"m",wM).call(this)}get box(){return ve(this,Ot,"f")}get uuid(){return ve(this,Ot,"f").address.uuid}get address(){return ve(this,Ot,"f").address}get indexField(){return ve(this,Ot,"f").index}get type(){return ve(this,Ot,"f").type.getValue()}get captureBox(){return ve(this,Ot,"f").capture.targetVertex}get tracks(){return ve(this,Hu,"f")}get input(){return ve(this,kl,"f")}get midiEffects(){return b.wrap(ve(this,cx,"f"))}get audioEffects(){return b.wrap(ve(this,kf,"f"))}get inputAdapter(){return ve(this,kl,"f").adapter()}get auxSends(){return ve(this,ux,"f")}get output(){return ve(this,dx,"f")}get isBus(){return this.input.adapter().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.adapter().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return ve(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ve(this,Ri,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return ve(this,Ot,"f").userInterface.automationCollapsed}get midiEffectsField(){return b.wrap(ve(this,Ot,"f").midiEffects)}get inputField(){return ve(this,Ot,"f").input}get audioEffectsField(){return b.wrap(ve(this,Ot,"f").audioEffects)}get tracksField(){return ve(this,Ot,"f").tracks}get minimizedField(){return ve(this,kl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return ve(this,kl,"f").adapter().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.adapter();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let r of ve(this,kf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=ve(this,Ri,"f").rootBoxAdapter.audioUnits.adapters(),r=this.indexField.getValue(),n=this.type,i=r,a=r;for(;i>0&&e[i-1].type===n;)i--;for(;a<e.length-1&&e[a+1].type===n;)a++;return[i,a+1]}move(e){ve(this,Ri,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){ve(this,Hu,"f").collection.move(e,r)}deleteTrack(e){ve(this,Hu,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ve(this,Ta,"f").terminate()}};xM=un,Ta=new WeakMap,Ri=new WeakMap,Ot=new WeakMap,Bl=new WeakMap,Hu=new WeakMap,kl=new WeakMap,cx=new WeakMap,kf=new WeakMap,ux=new WeakMap,dx=new WeakMap,lx=new WeakSet,yM=function(e){return{volume:ve(this,Bl,"f").createParameter(e.volume,xM.VolumeMapper,E.decible,"volume"),panning:ve(this,Bl,"f").createParameter(e.panning,F.bipolar(),E.panning,"panning",.5),mute:ve(this,Bl,"f").createParameter(e.mute,F.bool,E.bool,"mute"),solo:ve(this,Bl,"f").createParameter(e.solo,F.bool,E.bool,"solo")}},wM=function(){let e=this.address.toString(),r=ve(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ve(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;re(this.type!==St.Instrument||ve(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};un.VolumeMapper=F.decibel(-96,-9,6);var qu=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tl,ei,Qr,Il,px,fx,Bf,bM,_M,mx,or=class{constructor(e,r){Tl.add(this),ei.set(this,void 0),Qr.set(this,void 0),Il.set(this,void 0),px.set(this,void 0),fx.set(this,void 0),Bf.set(this,void 0),qu(this,ei,e,"f"),qu(this,Qr,r,"f"),qu(this,Il,new J,"f"),qu(this,Bf,qe(this,Il,"f").own(new Xi(-1)),"f"),qu(this,px,qe(this,Il,"f").own(new Lv(this,e.boxAdapters)),"f"),qu(this,fx,qe(this,Il,"f").own(new Hv(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[b.None,b.None],n=()=>{r.every(i=>i.nonEmpty())?e(b.wrap(r.map(i=>i.unwrap()))):e(b.None)};return pe.many(qe(this,Tl,"m",bM).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),qe(this,Tl,"m",_M).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return qe(this,ei,"f")}set targetName(e){qe(this,Qr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){qe(this,ei,"f").boxAdapters.adapterFor(n,un).input.adapter().ifSome(a=>a.labelField.setValue(e));return}qe(this,ei,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)}),qe(this,Tl,"m",mx).call(this,n).flatMap(i=>qe(this,ei,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)})})}get targetName(){return qe(this,Qr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return qe(this,ei,"f").boxAdapters.adapterFor(r,un).input.label;let n=qe(this,ei,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}let i=qe(this,Tl,"m",mx).call(this,r).flatMap(a=>qe(this,ei,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){qe(this,Il,"f").terminate()}get audioUnit(){return Te(qe(this,Qr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return qe(this,Qr,"f").target}get clips(){return qe(this,px,"f")}get regions(){return qe(this,fx,"f")}get enabled(){return qe(this,Qr,"f").enabled}get indexField(){return qe(this,Qr,"f").index}get type(){return qe(this,Qr,"f").type.getValue()}get box(){return qe(this,Qr,"f")}get uuid(){return qe(this,Qr,"f").address.uuid}get address(){return qe(this,Qr,"f").address}get listIndex(){return qe(this,Bf,"f").getValue()}set listIndex(e){qe(this,Bf,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ge.Audio;case"note-clip":return this.type===ge.Notes;case"value-clip":return this.type===ge.Value;case"audio-region":return this.type===ge.Audio;case"note-region":return this.type===ge.Notes;case"value-region":return this.type===ge.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=qe(this,ei,"f").clipSequencing.iterate(this.uuid,e,e+iM);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,c=>!c.mute);if(s===null){let c=this.regions.collection.optAt(0);return ht(c,yo)?c.incomingValue(r):r}else if(ht(s,yo))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&ht(s,Qo)&&!s.mute?s.valueAt(e,r):r});return n}};ei=new WeakMap,Qr=new WeakMap,Il=new WeakMap,px=new WeakMap,fx=new WeakMap,Bf=new WeakMap,Tl=new WeakSet,bM=function(e){let r=qe(this,Qr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return qe(this,ei,"f").boxAdapters.adapterFor(n,un).input.catchupAndSubscribeLabelChange(s=>e(s));let i=qe(this,ei,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}let a=qe(this,Tl,"m",mx).call(this,n).flatMap(o=>qe(this,ei,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}return e(b.wrap(n.name)),pe.Empty}return e(b.None),pe.Empty},_M=function(e){let r=this.type;switch(r){case ge.Audio:case ge.Notes:return e(b.wrap(ge[r])),pe.Empty;case ge.Value:{let n=qe(this,Qr,"f").target.targetVertex.unwrap("target.target");if(n.isField())e(qe(this,ei,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(b.wrap(n.name));else return j("Illegal State. Vertex is not a field nor box.");return pe.Empty}case ge.Undefined:return e(b.wrap("")),pe.Empty;default:return e(b.None),pe.Empty}},mx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var Ht=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},he=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ci,zi,hx,gx,vx,Dl,Ao,ss,ls,cs,us,Rl,ds,If,AM=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],Ml=class{constructor(e,r,n,i,a,o,s){Ci.set(this,void 0),zi.set(this,void 0),hx.set(this,void 0),gx.set(this,void 0),vx.set(this,void 0),Dl.set(this,new J),Ao.set(this,void 0),ss.set(this,void 0),ls.set(this,void 0),cs.set(this,void 0),us.set(this,b.None),Rl.set(this,b.None),ds.set(this,null),If.set(this,!1),Ht(this,Ci,e,"f"),Ht(this,zi,r,"f"),Ht(this,ls,n,"f"),Ht(this,cs,i,"f"),Ht(this,hx,a,"f"),Ht(this,gx,o??0,"f"),Ht(this,vx,b.wrap(s),"f"),he(this,Dl,"f").own(he(this,Ci,"f").parameterFieldAdapters.register(this)),Ht(this,Ao,he(this,Dl,"f").own(new fe),"f"),Ht(this,ss,new nr,"f"),he(this,Dl,"f").own(he(this,zi,"f").subscribe(()=>he(this,Ao,"f").notify(this))),he(this,Dl,"f").own(he(this,zi,"f").pointerHub.catchupAndSubscribe({onAdded:c=>{he(this,ss,"f").proxy.onControlSourceAdd(U0(c.pointerType)),c.box.accept({visitTrackBox:d=>{re(he(this,us,"f").isEmpty(),"Already assigned");let f=he(this,Ci,"f").boxAdapters.adapterFor(d,or);Ht(this,us,b.wrap(f),"f"),he(this,Ci,"f").isMainThread&&Ht(this,Rl,b.wrap(he(this,Ci,"f").liveStreamReceiver.subscribeFloat(he(this,zi,"f").address,v=>{if(isNaN(v)){if(Yi(he(this,ds,"f")))return;Ht(this,ds,null,"f"),he(this,Ao,"f").notify(this);return}he(this,ds,"f")!==v&&(Ht(this,ds,v,"f"),he(this,Ao,"f").notify(this))})),"f")}})},onRemoved:c=>{he(this,ss,"f").proxy.onControlSourceRemove(U0(c.pointerType)),c.box.accept({visitTrackBox:d=>{re(he(this,us,"f").unwrapOrNull()?.address?.equals(d.address)===!0,`Unknown ${d}`),Ht(this,us,b.None,"f"),he(this,Ci,"f").isMainThread&&(he(this,Rl,"f").ifSome(f=>f.terminate()),Ht(this,Rl,b.None,"f"),Ht(this,ds,null,"f"),he(this,Ao,"f").notify(this))}})}},...AM)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return he(this,ss,"f").proxy.onControlSourceAdd("midi"),Ht(this,If,!0,"f"),{terminate:()=>{Ht(this,If,!1,"f"),he(this,ss,"f").proxy.onControlSourceRemove("midi")}}}get field(){return he(this,zi,"f")}get valueMapping(){return he(this,ls,"f")}get stringMapping(){return he(this,cs,"f")}get name(){return he(this,hx,"f")}get anchor(){return he(this,gx,"f")}get type(){return he(this,zi,"f").type}get address(){return he(this,zi,"f").address}get track(){return he(this,us,"f")}registerTracks(e){return he(this,Ci,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){he(this,Ci,"f").parameterFieldAdapters.touchStart(this.address),he(this,Ci,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){he(this,Ci,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){Ht(this,ls,e,"f"),Ht(this,cs,r,"f"),he(this,Ao,"f").notify(this)}valueAt(e){let r=he(this,us,"f");if(r.nonEmpty()){let n=r.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return he(this,Ao,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return he(this,If,"f")&&e.onControlSourceAdd("midi"),he(this,zi,"f").pointerHub.filter(...AM).forEach(r=>e.onControlSourceAdd(U0(r.pointerType))),he(this,ss,"f").subscribe(e)}getValue(){return he(this,zi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();he(this,zi,"f").setValue(e),he(this,Ci,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(he(this,ls,"f").y(e))}getUnitValue(){return he(this,ls,"f").x(this.getValue())}getControlledValue(){return he(this,ls,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return he(this,ds,"f")??this.getUnitValue()}getControlledPrintValue(){return he(this,cs,"f").x(this.getControlledValue())}getPrintValue(){return he(this,cs,"f").x(this.getValue())}setPrintValue(e){let r=he(this,cs,"f").y(e);r.type==="unitValue"?this.setUnitValue(He(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(he(this,vx,"f").unwrapOrElse(he(this,zi,"f").initValue))}terminate(){he(this,Rl,"f").ifSome(e=>e.terminate()),Ht(this,Rl,b.None,"f"),he(this,Dl,"f").terminate()}};Ci=new WeakMap,zi=new WeakMap,hx=new WeakMap,gx=new WeakMap,vx=new WeakMap,Dl=new WeakMap,Ao=new WeakMap,ss=new WeakMap,ls=new WeakMap,cs=new WeakMap,us=new WeakMap,Rl=new WeakMap,ds=new WeakMap,If=new WeakMap;var U0=t=>{switch(t){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MIDIControl:return"midi";case l.ParameterController:return"external";default:return j(`${t.toString()} is an unknown pointer type`)}};var xx={min:400,max:480,default:440};var j0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fo,Cl,yx,wx=class{constructor(e,r,n){Fo.set(this,void 0),Cl.set(this,void 0),yx.set(this,void 0),j0(this,Fo,B.newSet(i=>i.uuid),"f"),j0(this,Cl,new nr,"f"),j0(this,yx,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=Hn(this,Fo,"f").add(a);re(o,`Could not add ${a}`),Hn(this,Cl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;Hn(this,Cl,"f").proxy.onRemove(Hn(this,Fo,"f").removeByKey(a))}},n),"f")}subscribe(e){return Hn(this,Cl,"f").subscribe(e)}catchupAndSubscribe(e){return Hn(this,Fo,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return Hn(this,Fo,"f").values()}size(){return Hn(this,Fo,"f").size()}isEmpty(){return this.size()===0}terminate(){Hn(this,Fo,"f").clear(),Hn(this,Cl,"f").terminate(),Hn(this,yx,"f").terminate()}};Fo=new WeakMap,Cl=new WeakMap,yx=new WeakMap;var K0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},W0,hi,Tf,dn,kr,FM,qn=class{constructor(e,r){W0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Delay,Tf.set(this,void 0),dn.set(this,void 0),kr.set(this,void 0),K0(this,Tf,e,"f"),K0(this,dn,r,"f"),K0(this,kr,new le(wt(this,Tf,"f")),"f"),this.namedParameter=wt(this,W0,"m",FM).call(this,r)}get box(){return wt(this,dn,"f")}get uuid(){return wt(this,dn,"f").address.uuid}get address(){return wt(this,dn,"f").address}get indexField(){return wt(this,dn,"f").index}get labelField(){return wt(this,dn,"f").label}get enabledField(){return wt(this,dn,"f").enabled}get minimizedField(){return wt(this,dn,"f").minimized}get host(){return wt(this,dn,"f").host}deviceHost(){return wt(this,Tf,"f").boxAdapters.adapterFor(wt(this,dn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wt(this,kr,"f").terminate()}};hi=qn,Tf=new WeakMap,dn=new WeakMap,kr=new WeakMap,W0=new WeakSet,FM=function(e){return{preSyncTimeLeft:wt(this,kr,"f").createParameter(e.preSyncTimeLeft,F.linearInteger(0,hi.Fractions.length-1),hi.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:wt(this,kr,"f").createParameter(e.preMillisTimeLeft,F.powerByCenter(100,0,hi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:wt(this,kr,"f").createParameter(e.preSyncTimeRight,F.linearInteger(0,hi.Fractions.length-1),hi.FractionsStringMapping,"pre sync R"),preMillisTimeRight:wt(this,kr,"f").createParameter(e.preMillisTimeRight,F.powerByCenter(100,0,hi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:wt(this,kr,"f").createParameter(e.delayMusical,F.linearInteger(0,hi.Fractions.length-1),hi.FractionsStringMapping,"delay"),millisTime:wt(this,kr,"f").createParameter(e.delayMillis,F.powerByCenter(100,0,hi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:wt(this,kr,"f").createParameter(e.feedback,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:wt(this,kr,"f").createParameter(e.cross,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:wt(this,kr,"f").createParameter(e.lfoSpeed,F.exponential(hi.LFO_SPEED_MIN,hi.LFO_SPEED_MAX),E.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:wt(this,kr,"f").createParameter(e.lfoDepth,F.power(4,0,hi.LFO_DEPTH_MAX),E.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:wt(this,kr,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:wt(this,kr,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:wt(this,kr,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};qn.Fractions=Co.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();qn.FractionsStringMapping=E.indices("",hi.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));qn.MAX_MILLIS_TIME=1e3;qn.LFO_SPEED_MIN=.1;qn.LFO_SPEED_MAX=5;qn.LFO_DEPTH_MAX=50;var L0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Z0,Df,pn,Da,EM,bx=class{constructor(e,r){Z0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Reverb,Df.set(this,void 0),pn.set(this,void 0),Da.set(this,void 0),L0(this,Df,e,"f"),L0(this,pn,r,"f"),L0(this,Da,new le(gr(this,Df,"f")),"f"),this.namedParameter=gr(this,Z0,"m",EM).call(this,r)}get box(){return gr(this,pn,"f")}get uuid(){return gr(this,pn,"f").address.uuid}get address(){return gr(this,pn,"f").address}get indexField(){return gr(this,pn,"f").index}get labelField(){return gr(this,pn,"f").label}get enabledField(){return gr(this,pn,"f").enabled}get minimizedField(){return gr(this,pn,"f").minimized}get host(){return gr(this,pn,"f").host}deviceHost(){return gr(this,Df,"f").boxAdapters.adapterFor(gr(this,pn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){gr(this,Da,"f").terminate()}};Df=new WeakMap,pn=new WeakMap,Da=new WeakMap,Z0=new WeakSet,EM=function(e){return{decay:gr(this,Da,"f").createParameter(e.decay,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:gr(this,Da,"f").createParameter(e.preDelay,F.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:gr(this,Da,"f").createParameter(e.damp,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"damping"),filter:gr(this,Da,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter"),dry:gr(this,Da,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:gr(this,Da,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};var G0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},q0,Rf,Oi,Jn,MM,_x=class{constructor(e,r){q0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Revamp,Rf.set(this,void 0),Oi.set(this,void 0),Jn.set(this,void 0),G0(this,Rf,e,"f"),G0(this,Oi,r,"f"),G0(this,Jn,new le(qt(this,Rf,"f")),"f"),this.namedParameter=qt(this,q0,"m",MM).call(this,r)}get box(){return qt(this,Oi,"f")}get uuid(){return qt(this,Oi,"f").address.uuid}get address(){return qt(this,Oi,"f").address}get indexField(){return qt(this,Oi,"f").index}get labelField(){return qt(this,Oi,"f").label}get enabledField(){return qt(this,Oi,"f").enabled}get minimizedField(){return qt(this,Oi,"f").minimized}get host(){return qt(this,Oi,"f").host}get spectrum(){return qt(this,Oi,"f").address.append(4095)}deviceHost(){return qt(this,Rf,"f").boxAdapters.adapterFor(qt(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){qt(this,Jn,"f").terminate()}};Rf=new WeakMap,Oi=new WeakMap,Jn=new WeakMap,q0=new WeakSet,MM=function(e){return{highPass:SM(qt(this,Jn,"f"),e.highPass,"High-Pass"),lowShelf:PM(qt(this,Jn,"f"),e.lowShelf,"Low-Shelf"),lowBell:H0(qt(this,Jn,"f"),e.lowBell,"Low-Bell"),midBell:H0(qt(this,Jn,"f"),e.midBell,"Mid-Bell"),highBell:H0(qt(this,Jn,"f"),e.highBell,"High-Bell"),highShelf:PM(qt(this,Jn,"f"),e.highShelf,"High-Shelf"),lowPass:SM(qt(this,Jn,"f"),e.lowPass,"Low-Pass")}};var J0=F.exponential(20,2e4),$M=F.linear(-24,24),NM=F.exponential(.01,10),SM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,J0,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,F.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,NM,E.numeric({fractionDigits:3}),`${r} Q`)}),PM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,J0,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,$M,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),H0=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"enabled"),frequency:t.createParameter(e.frequency,J0,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,$M,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,NM,E.numeric({fractionDigits:3}),`${r} Q`)});var kM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ax,Fx,vi,ps=class{constructor(e,r){this.type="marker-event",Ax.set(this,new J),Fx.set(this,void 0),vi.set(this,void 0),kM(this,Fx,e,"f"),kM(this,vi,r,"f"),gi(this,Ax,"f").own(gi(this,vi,"f").subscribe(Re.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();gi(this,vi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return gi(this,vi,"f")}get uuid(){return gi(this,vi,"f").address.uuid}get address(){return gi(this,vi,"f").address}get position(){return gi(this,vi,"f").position.getValue()}get plays(){return gi(this,vi,"f").plays.getValue()}get hue(){return gi(this,vi,"f").hue.getValue()}get label(){return gi(this,vi,"f").label.getValue()}get trackAdapter(){return gi(this,vi,"f").track.targetVertex.map(e=>gi(this,Fx,"f").boxAdapters.adapterFor(e.box,Ra).markerTrack)}terminate(){gi(this,Ax,"f").terminate()}toString(){return`{MarkerBoxAdapter ${B.toString(gi(this,vi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Ax=new WeakMap,Fx=new WeakMap,vi=new WeakMap;ps.Comparator=(t,e)=>t.position-e.position;var Cf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zf,Ju,Of,zl,Ex,Sx=class{constructor(e,r){zf.set(this,void 0),Ju.set(this,void 0),Of.set(this,void 0),zl.set(this,void 0),Ex.set(this,void 0),Cf(this,zf,e,"f"),Cf(this,Ju,r,"f"),this.changeNotifier=new fe,Cf(this,Of,B.newSet(n=>n.uuid),"f"),Cf(this,zl,zr.create(ps.Comparator),"f"),Cf(this,Ex,fn(this,Ju,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof jc){let i=fn(this,zf,"f").boxAdapters.adapterFor(n,ps),a=fn(this,Of,"f").add(i);re(a,"Could not add adapter"),fn(this,zl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{fn(this,zl,"f").remove(fn(this,Of,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return fn(this,zf,"f")}get enabled(){return fn(this,Ju,"f").enabled.getValue()}get events(){return fn(this,zl,"f")}get object(){return fn(this,Ju,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){fn(this,zl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){fn(this,Ex,"f").terminate()}};zf=new WeakMap,Ju=new WeakMap,Of=new WeakMap,zl=new WeakMap,Ex=new WeakMap;var BM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Px,Mx,Ui,Ol=class{constructor(e,r){this.type="signature-event",Px.set(this,new J),Mx.set(this,void 0),Ui.set(this,void 0),BM(this,Mx,e,"f"),BM(this,Ui,r,"f"),Vi(this,Px,"f").own(Vi(this,Ui,"f").subscribe(Re.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Vi(this,Ui,"f")}get uuid(){return Vi(this,Ui,"f").address.uuid}get address(){return Vi(this,Ui,"f").address}get index(){return Vi(this,Ui,"f").index.getValue()}get indexField(){return Vi(this,Ui,"f").index}get relativePosition(){return Vi(this,Ui,"f").relativePosition.getValue()}get nominator(){return Vi(this,Ui,"f").nominator.getValue()}get denominator(){return Vi(this,Ui,"f").denominator.getValue()}get trackAdapter(){return Vi(this,Ui,"f").events.targetVertex.map(e=>Vi(this,Mx,"f").boxAdapters.adapterFor(e.box,Ra).signatureTrack)}terminate(){Vi(this,Px,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Px=new WeakMap,Mx=new WeakMap,Ui=new WeakMap;Ol.Comparator=(t,e)=>t.index-e.index;var $x=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fs,Vf,Uf,Vl,Eo,ms,IM,Yu,Nx=class{constructor(e,r,n){fs.add(this),Vf.set(this,new J),Uf.set(this,void 0),Vl.set(this,void 0),Eo.set(this,void 0),ms.set(this,void 0),$x(this,Uf,e,"f"),$x(this,Vl,r,"f"),$x(this,Eo,n,"f"),this.changeNotifier=new fe,$x(this,ms,bt(this,Vf,"f").own(Rt.create(bt(this,Eo,"f").events,i=>e.boxAdapters.adapterFor(i,Ol),l.SignatureAutomation)),"f"),bt(this,Vf,"f").ownAll(bt(this,Vl,"f").subscribe(()=>this.dispatchChange()),bt(this,Eo,"f").enabled.subscribe(()=>this.dispatchChange()),bt(this,ms,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return bt(this,Uf,"f")}get enabled(){return bt(this,Eo,"f").enabled.getValue()}get object(){return bt(this,Eo,"f")}get size(){return bt(this,ms,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=bt(this,Vl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return bt(this,ms,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let r=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:a}of this.iterateAll()){if(n>e)break;r=[i,a]}return r}*iterateAll(){let e=0,r=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i},!!bt(this,Eo,"f").enabled.getValue())for(let a of bt(this,ms,"f").adapters())e+=ke.fromSignature(n,i)*a.relativePosition,r+=a.relativePosition,n=a.nominator,i=a.denominator,yield{index:a.index,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i}}changeSignature(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.map(c=>c.accumulatedPpqn);bt(this,Vl,"f").nominator.setValue(e),bt(this,Vl,"f").denominator.setValue(r);let a=0,o=0,s=ke.fromSignature(e,r);for(let c=0;c<n.length;c++){let d=n[c],f=this.adapterAt(d.index);if(f.isEmpty())continue;let h=(i[c]-a)/s,w=Math.floor(h),A=h-w;o+=A;let N=w;o>=1&&(N++,o--),N=Math.max(1,N),f.unwrap().box.relativePosition.setValue(N),a+=N*s,s=ke.fromSignature(d.nominator,d.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(w=>w.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(w=>w.accumulatedPpqn),s=i>0?n[i-1]:null,[c,d]=s!==null?[s.nominator,s.denominator]:this.storageSignature,f=s!==null?s.accumulatedPpqn:0;e.box.delete();let v=f,h=ke.fromSignature(c,d);for(let w=0;w<a.length;w++){let A=a[w],N=this.adapterAt(A.index);if(N.isEmpty())continue;let O=(o[w]-v)/h,z=Math.max(1,Math.round(O));N.unwrap().box.relativePosition.setValue(z),v+=z*h,h=ke.fromSignature(A.nominator,A.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let N=1;N<i.length&&!(i[N].accumulatedPpqn>e);N++)a=i[N],o=N;let s=ke.fromSignature(a.nominator,a.denominator),c=(e-a.accumulatedPpqn)/s,d=Math.max(1,Math.round(c)),f=a.index+1,v=i.slice(o+1),h=a.accumulatedPpqn+d*s,w=ke.fromSignature(r,n),A=v.map(N=>({event:N,adapter:this.adapterAt(N.index)})).filter(({adapter:N})=>N.nonEmpty()).map(({event:N,adapter:S})=>({event:N,adapter:S.unwrap()}));for(let N=0;N<A.length;N++){let{event:S,adapter:O}=A[N];if(O.box.index.setValue(S.index+1),N===0){let z=(S.accumulatedPpqn-h)/w;O.box.relativePosition.setValue(Math.max(1,Math.round(z)))}}Cc.create(bt(this,Uf,"f").boxGraph,B.generate(),N=>{N.index.setValue(f),N.relativePosition.setValue(d),N.nominator.setValue(r),N.denominator.setValue(n),N.events.refer(bt(this,Eo,"f").events)})}adapterAt(e){return bt(this,ms,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(h=>h.accumulatedBars),s=bt(this,fs,"m",IM).call(this,r,a.index);if(s===a.accumulatedBars)return;let c=[...o];c[i]=s;let d=c.map((h,w)=>({bar:h,i:w})).sort((h,w)=>h.bar-w.bar).map(h=>h.i),f=n.map(h=>this.adapterAt(h.index).unwrap("adapterAt"));for(let h=0;h<d.length;h++)f[d[h]].box.index.setValue(h);let v=0;for(let h=0;h<d.length;h++){let w=d[h],A=f[w],N=c[w],S=Math.max(1,N-v);A.box.relativePosition.setValue(S),v=N}}floorToBar(e){let{event:r,barPpqn:n}=bt(this,fs,"m",Yu).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=bt(this,fs,"m",Yu).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=bt(this,fs,"m",Yu).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=bt(this,fs,"m",Yu).call(this,e),n=ke.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return ke.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=bt(this,fs,"m",Yu).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){bt(this,Vf,"f").terminate()}};Vf=new WeakMap,Uf=new WeakMap,Vl=new WeakMap,Eo=new WeakMap,ms=new WeakMap,fs=new WeakSet,IM=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(Yi(n)){let[o,s]=this.storageSignature,c=ke.fromSignature(o,s);return Math.max(1,Math.round(e/c))}let i=ke.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},Yu=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(Yi(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:ke.fromSignature(n,i)}}return{event:r,barPpqn:ke.fromSignature(r.nominator,r.denominator)}};var jf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Kf,Ca,kx,Bx,So,Wf,Ix,Ra=class{constructor(e,r){Kf.set(this,new J),Ca.set(this,void 0),kx.set(this,void 0),Bx.set(this,void 0),So.set(this,void 0),Wf.set(this,void 0),Ix.set(this,()=>{let{tempoTrack:{enabled:s}}=jt(this,Ca,"f");return s.getValue()?jt(this,So,"f").isEmpty()?b.None:jt(this,So,"f").unwrap().events.isEmpty()?b.None:jt(this,So,"f"):b.None}),jf(this,Ca,r,"f"),jf(this,kx,new Sx(e,r.markerTrack),"f"),jf(this,Bx,new Nx(e,r.signature,r.signatureTrack),"f"),jf(this,So,new Pr,"f"),jf(this,Wf,new fe,"f");let n=jt(this,Kf,"f").own(new J),i=()=>jt(this,Wf,"f").notify(jt(this,Ix,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;jt(this,Kf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>jt(this,So,"f").clear(),some:({box:c})=>{let d=e.boxAdapters.adapterFor(c,$r);jt(this,So,"f").wrap(d),n.ownAll(d.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(jt(this,Ix,"f").call(this)),jt(this,Wf,"f").subscribe(e)}get box(){return jt(this,Ca,"f")}get uuid(){return jt(this,Ca,"f").address.uuid}get address(){return jt(this,Ca,"f").address}get markerTrack(){return jt(this,kx,"f")}get signatureTrack(){return jt(this,Bx,"f")}get tempoTrackEvents(){return jt(this,So,"f")}get signature(){let{nominator:e,denominator:r}=jt(this,Ca,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=jt(this,Ca,"f").signature;return ke.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),jt(this,Ca,"f").signature.subscribe(()=>e(this.signature))}terminate(){jt(this,Kf,"f").terminate()}};Kf=new WeakMap,Ca=new WeakMap,kx=new WeakMap,Bx=new WeakMap,So=new WeakMap,Wf=new WeakMap,Ix=new WeakMap;var YT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Lf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hs,gs=class{constructor(e,r){hs.set(this,void 0),YT(this,hs,r,"f")}get box(){return Lf(this,hs,"f")}get uuid(){return Lf(this,hs,"f").address.uuid}get address(){return Lf(this,hs,"f").address}get source(){return Lf(this,hs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Lf(this,hs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};hs=new WeakMap;var Ul=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},mn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Tx,jl,Kl,Dx,Rx,Zf,hn=class{constructor(e,r){Tx.set(this,void 0),jl.set(this,void 0),Kl.set(this,void 0),Dx.set(this,void 0),Rx.set(this,void 0),Zf.set(this,!1),Ul(this,Tx,e,"f"),Ul(this,jl,r,"f"),Ul(this,Kl,new J,"f"),Ul(this,Dx,r.attributes,"f"),Ul(this,Rx,mn(this,Kl,"f").own(new le(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return mn(this,Kl,"f").own(e)}ownAll(...e){mn(this,Kl,"f").ownAll(...e)}onSelected(){Ul(this,Zf,!0,"f")}onDeselected(){Ul(this,Zf,!1,"f")}isSelected(){return mn(this,Zf,"f")}get box(){return mn(this,jl,"f")}get attributes(){return mn(this,Dx,"f")}get uuid(){return mn(this,jl,"f").address.uuid}get address(){return mn(this,jl,"f").address}get parameters(){return mn(this,Rx,"f")}get modular(){return mn(this,Tx,"f").boxAdapters.adapterFor(mn(this,jl,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,vs)}terminate(){mn(this,Kl,"f").terminate()}};Tx=new WeakMap,jl=new WeakMap,Kl=new WeakMap,Dx=new WeakMap,Rx=new WeakMap,Zf=new WeakMap;var Cx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Po=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zx,xs,Gf,Ox,Vr;(function(t){t.Input="input",t.Output="output"})(Vr||(Vr={}));var Ur=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){zx.set(this,void 0),xs.set(this,void 0),Gf.set(this,void 0),Ox.set(this,void 0),Cx(this,zx,e,"f"),Cx(this,xs,r,"f"),Cx(this,Gf,n,"f"),Cx(this,Ox,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(r=>e.field.pointerRules.accepts.some(n=>n===r))}get connections(){return Po(this,xs,"f").pointerHub.isEmpty()?de.empty():Po(this,xs,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>Po(this,zx,"f").adapterFor(e,gs))}get field(){return Po(this,xs,"f")}get address(){return Po(this,xs,"f").address}get direction(){return Po(this,Gf,"f")}get name(){return Po(this,Ox,"f")}toString(){return`{ModuleConnectorAdapter address: ${Po(this,xs,"f").address.toString()}, direction: ${Po(this,Gf,"f")}}`}};zx=new WeakMap,xs=new WeakMap,Gf=new WeakMap,Ox=new WeakMap;var Y0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Hf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vx,qf,Jf,Xu=class extends hn{constructor(e,r){super(e,r),Vx.set(this,void 0),qf.set(this,void 0),Jf.set(this,void 0),Y0(this,Vx,this.parameters.createParameter(r.time,F.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),Y0(this,qf,Ur.create(e.boxAdapters,r.voltageInput,Vr.Input,"Input"),"f"),Y0(this,Jf,Ur.create(e.boxAdapters,r.voltageOutput,Vr.Output,"Output"),"f")}get parameterTime(){return Hf(this,Vx,"f")}get voltageInput(){return Hf(this,qf,"f")}get voltageOutput(){return Hf(this,Jf,"f")}get inputs(){return[Hf(this,qf,"f")]}get outputs(){return[Hf(this,Jf,"f")]}};Vx=new WeakMap,qf=new WeakMap,Jf=new WeakMap;var XT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},TM=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Yf,Qu=class extends hn{constructor(e,r){super(e,r),Yf.set(this,void 0),XT(this,Yf,Ur.create(e.boxAdapters,r.input,Vr.Input,"Input"),"f")}get voltageInput(){return TM(this,Yf,"f")}get inputs(){return[TM(this,Yf,"f")]}get outputs(){return de.empty()}};Yf=new WeakMap;var X0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xf=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ux,Qf,em,ed=class extends hn{constructor(e,r){super(e,r),Ux.set(this,void 0),Qf.set(this,void 0),em.set(this,void 0),X0(this,Ux,this.parameters.createParameter(r.gain,F.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),X0(this,Qf,Ur.create(e.boxAdapters,r.voltageInput,Vr.Input,"Input"),"f"),X0(this,em,Ur.create(e.boxAdapters,r.voltageOutput,Vr.Output,"Output"),"f")}get parameterGain(){return Xf(this,Ux,"f")}get voltageInput(){return Xf(this,Qf,"f")}get voltageOutput(){return Xf(this,em,"f")}get inputs(){return[Xf(this,Qf,"f")]}get outputs(){return[Xf(this,em,"f")]}};Ux=new WeakMap,Qf=new WeakMap,em=new WeakMap;var Q0=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},e_=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},jx,Kx,Wx,td=class extends hn{constructor(e,r){super(e,r),jx.set(this,void 0),Kx.set(this,void 0),Wx.set(this,void 0),Q0(this,jx,Ur.create(e.boxAdapters,r.voltageInputX,Vr.Input,"X"),"f"),Q0(this,Kx,Ur.create(e.boxAdapters,r.voltageInputY,Vr.Input,"Y"),"f"),Q0(this,Wx,Ur.create(e.boxAdapters,r.voltageOutput,Vr.Output,"Result"),"f")}get inputs(){return[e_(this,jx,"f"),e_(this,Kx,"f")]}get outputs(){return[e_(this,Wx,"f")]}};jx=new WeakMap,Kx=new WeakMap,Wx=new WeakMap;var QT=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},DM=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},tm,rd=class extends hn{constructor(e,r){super(e,r),tm.set(this,void 0),QT(this,tm,Ur.create(e.boxAdapters,r.output,Vr.Output,"Output"),"f")}get voltageOutput(){return DM(this,tm,"f")}get inputs(){return de.empty()}get outputs(){return[DM(this,tm,"f")]}};tm=new WeakMap;var id;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>Ue(r.accept({visitModuleGainBox:n=>e.adapterFor(n,ed),visitModuleDelayBox:n=>e.adapterFor(n,Xu),visitModuleMultiplierBox:n=>e.adapterFor(n,td),visitModularAudioInputBox:n=>e.adapterFor(n,rd),visitModularAudioOutputBox:n=>e.adapterFor(n,Qu)}),`Could not find ModuleAdapter for ${r.name}`)})(id||(id={}));var RM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wl=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Lx,Zx,Ll,t_,nd=class{constructor(e,r){Lx.add(this),Zx.set(this,void 0),Ll.set(this,void 0),RM(this,Zx,e,"f"),RM(this,Ll,r,"f")}get box(){return Wl(this,Ll,"f")}get uuid(){return Wl(this,Ll,"f").address.uuid}get address(){return Wl(this,Ll,"f").address}get moduleAdapter(){return id.adapterFor(Wl(this,Zx,"f").boxAdapters,Wl(this,Lx,"a",t_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Wl(this,Lx,"a",t_).address)}terminate(){}};Zx=new WeakMap,Ll=new WeakMap,Lx=new WeakSet,t_=function(){return Wl(this,Ll,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var CM=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ad,yi,od=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Modular,ad.set(this,void 0),yi.set(this,void 0),CM(this,ad,e,"f"),CM(this,yi,r,"f")}get box(){return xi(this,yi,"f")}get uuid(){return xi(this,yi,"f").address.uuid}get address(){return xi(this,yi,"f").address}get indexField(){return xi(this,yi,"f").index}get labelField(){return xi(this,yi,"f").label}get enabledField(){return xi(this,yi,"f").enabled}get minimizedField(){return xi(this,yi,"f").minimized}get host(){return xi(this,yi,"f").host}parameterAt(e){return j("Not yet implemented")}deviceHost(){return xi(this,ad,"f").boxAdapters.adapterFor(xi(this,yi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return xi(this,ad,"f").boxAdapters.adapterFor(xi(this,yi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,vs)}elements(){return xi(this,yi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>xi(this,ad,"f").boxAdapters.adapterFor(e.box,nd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};ad=new WeakMap,yi=new WeakMap;var rm=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ot=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sd,ys,ld,ji,Zl,Gl,vs=class{constructor(e,r){sd.set(this,new J),ys.set(this,void 0),ld.set(this,void 0),ji.set(this,void 0),Zl.set(this,void 0),Gl.set(this,void 0),rm(this,ld,e,"f"),rm(this,ji,r,"f"),rm(this,ys,ot(this,sd,"f").own(new nr),"f"),rm(this,Zl,B.newSet(s=>s.uuid),"f"),rm(this,Gl,B.newSet(s=>s.uuid),"f");let n=s=>{let c=id.adapterFor(ot(this,ld,"f").boxAdapters,s.box);ot(this,Zl,"f").add(c)&&ot(this,ys,"f").proxy.onModuleAdded(c)},i=s=>ot(this,ys,"f").proxy.onModuleRemoved(ot(this,Zl,"f").removeByKey(s.address.uuid)),a=s=>{let c=ot(this,ld,"f").boxAdapters.adapterFor(s.box,gs);ot(this,Gl,"f").add(c)&&ot(this,ys,"f").proxy.onConnectionAdded(c)},o=s=>ot(this,ys,"f").proxy.onConnectionRemoved(ot(this,Gl,"f").removeByKey(s.address.uuid));ot(this,ji,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,ji,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,sd,"f").own(ot(this,ji,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,sd,"f").own(ot(this,ji,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return w0(e.onModuleAdded,r=>ot(this,Zl,"f").forEach(n=>r(n))),w0(e.onConnectionAdded,r=>ot(this,Gl,"f").forEach(n=>r(n))),ot(this,ys,"f").subscribe(e)}get box(){return ot(this,ji,"f")}get address(){return ot(this,ji,"f").address}get uuid(){return ot(this,ji,"f").address.uuid}get editingField(){return ot(this,ji,"f").editing}get labelField(){return ot(this,ji,"f").label}get modules(){return ot(this,Zl,"f").values()}get connections(){return ot(this,Gl,"f").values()}get device(){return ot(this,ld,"f").boxAdapters.adapterFor(Ue(ot(this,ji,"f").device.pointerHub.incoming().at(0),"No device found").box,od)}terminate(){console.debug(`terminate ${this}`),ot(this,sd,"f").terminate()}};sd=new WeakMap,ys=new WeakMap,ld=new WeakMap,ji=new WeakMap,Zl=new WeakMap,Gl=new WeakMap;var im=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ti=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},r_,ud,nm,Gx,cd,om,Hx,am,qx,zM,za=class{constructor(e,r){r_.add(this),this.type="groove-adapter",nm.set(this,new J),Gx.set(this,void 0),cd.set(this,void 0),om.set(this,void 0),Hx.set(this,new sg({duration:()=>ti(this,qx,"f"),fx:n=>F0(n,ti(this,am,"f")),fy:n=>F0(n,1-ti(this,am,"f"))})),am.set(this,0),qx.set(this,ke.SemiQuaver*2),im(this,Gx,e,"f"),im(this,cd,r,"f"),im(this,om,ti(this,nm,"f").own(new le(ti(this,Gx,"f"))),"f"),this.namedParameter=ti(this,r_,"m",zM).call(this,r),ti(this,nm,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>im(this,qx,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>im(this,am,HP(n.getValue(),.01),"f")))}unwarp(e){return ti(this,Hx,"f").unwarp(e)}warp(e){return ti(this,Hx,"f").warp(e)}get box(){return ti(this,cd,"f")}get uuid(){return ti(this,cd,"f").address.uuid}get address(){return ti(this,cd,"f").address}terminate(){ti(this,nm,"f").terminate()}};ud=za,nm=new WeakMap,Gx=new WeakMap,cd=new WeakMap,om=new WeakMap,Hx=new WeakMap,am=new WeakMap,qx=new WeakMap,r_=new WeakSet,zM=function(e){return{duration:ti(this,om,"f").createParameter(e.duration,F.values(ud.DurationPPQNs),E.values("",ud.DurationPPQNs,ud.DurationStrings),"duration"),amount:ti(this,om,"f").createParameter(e.amount,F.unipolar(),E.percent({fractionDigits:0}),"amount")}};za.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];za.DurationPPQNs=ud.Durations.map(([t,e])=>ke.fromSignature(t,e));za.DurationStrings=ud.Durations.map(([t,e])=>`${t}/${e}`);var dd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Oa,ws,pd,Jx,Yx,sm,lm,i_,bs=class{constructor(e,r,n,i,a){Oa.set(this,void 0),ws.set(this,void 0),pd.set(this,void 0),Jx.set(this,void 0),Yx.set(this,void 0),sm.set(this,new J),lm.set(this,void 0),i_.set(this,b.None),dd(this,Oa,e,"f"),dd(this,ws,r,"f"),dd(this,pd,n,"f"),dd(this,Jx,i,"f"),dd(this,Yx,a??0,"f"),dd(this,lm,Vt(this,sm,"f").own(new fe),"f"),Vt(this,sm,"f").own(Vt(this,Oa,"f").subscribe(()=>Vt(this,lm,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Vt(this,Oa,"f")}get valueMapping(){return Vt(this,ws,"f")}get stringMapping(){return Vt(this,pd,"f")}get name(){return Vt(this,Jx,"f")}get anchor(){return Vt(this,Yx,"f")}get type(){return Vt(this,Oa,"f").type}get address(){return Vt(this,Oa,"f").address}get track(){return Vt(this,i_,"f")}subscribe(e){return Vt(this,lm,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Vt(this,Oa,"f").getValue()}setValue(e){Vt(this,Oa,"f").setValue(Vt(this,ws,"f").clamp(e))}setUnitValue(e){this.setValue(Vt(this,ws,"f").y(e))}getUnitValue(){return Vt(this,ws,"f").x(this.getValue())}getPrintValue(){return Vt(this,pd,"f").x(this.getValue())}setPrintValue(e){let r=Vt(this,pd,"f").y(e);r.type==="unitValue"?this.setUnitValue(He(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Vt(this,ws,"f").clamp(Vt(this,Oa,"f").initValue))}terminate(){Vt(this,sm,"f").terminate()}};Oa=new WeakMap,ws=new WeakMap,pd=new WeakMap,Jx=new WeakMap,Yx=new WeakMap,sm=new WeakMap,lm=new WeakMap,i_=new WeakMap;var fd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Va,Xx,Qx,ey,ty,ry,iy=class{constructor(e){Va.set(this,void 0),Xx.set(this,void 0),Qx.set(this,void 0),ey.set(this,void 0),ty.set(this,void 0),ry.set(this,void 0),fd(this,Va,e,"f"),fd(this,Xx,new bs(gn(this,Va,"f").keyboard,F.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),fd(this,Qx,new bs(gn(this,Va,"f").timeRangeInQuarters,F.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),fd(this,ey,new bs(gn(this,Va,"f").noteScale,F.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),fd(this,ty,new bs(gn(this,Va,"f").noteLabels,F.bool,E.bool,"Note Labels"),"f"),fd(this,ry,new bs(gn(this,Va,"f").transpose,F.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return gn(this,Va,"f").box.subscribe(Re.Children,()=>e(this))}get object(){return gn(this,Va,"f")}get keyboard(){return gn(this,Xx,"f")}get timeRangeInQuarters(){return gn(this,Qx,"f")}get noteScale(){return gn(this,ey,"f")}get noteLabels(){return gn(this,ty,"f")}get transpose(){return gn(this,ry,"f")}};Va=new WeakMap,Xx=new WeakMap,Qx=new WeakMap,ey=new WeakMap,ty=new WeakMap,ry=new WeakMap;var cm=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ur=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hl,Ki,ql,ny,ay,oy=class{constructor(e,r){Hl.set(this,void 0),Ki.set(this,void 0),ql.set(this,void 0),ny.set(this,void 0),ay.set(this,void 0),cm(this,Hl,e,"f"),cm(this,Ki,r,"f"),cm(this,ql,Rt.create(ur(this,Ki,"f").audioUnits,n=>ur(this,Hl,"f").boxAdapters.adapterFor(n,un),l.AudioUnits),"f"),cm(this,ny,new wx(ur(this,Ki,"f").audioBusses.pointerHub,n=>ur(this,Hl,"f").boxAdapters.adapterFor(n,Ti),l.AudioBusses),"f"),cm(this,ay,new iy(ur(this,Ki,"f").pianoMode),"f")}get uuid(){return ur(this,Ki,"f").address.uuid}get address(){return ur(this,Ki,"f").address}get box(){return ur(this,Ki,"f")}get audioBusses(){return ur(this,ny,"f")}get audioUnits(){return ur(this,ql,"f")}get clips(){return ur(this,ql,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return ur(this,Hl,"f").boxAdapters.adapterFor(ur(this,Ki,"f").groove.targetVertex.unwrap("no groove").box,za)}get timeline(){return ur(this,Hl,"f").boxAdapters.adapterFor(ur(this,Ki,"f").timeline.targetVertex.unwrap("no timeline").box,Ra)}get pianoMode(){return ur(this,ay,"f")}get created(){return new Date(ur(this,Ki,"f").created.getValue())}get midiOutputDevices(){return ur(this,Ki,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Te(e,Zo))}*labeledAudioOutputs(){for(let e of ur(this,ql,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ur(this,ql,"f").terminate()}};Hl=new WeakMap,Ki=new WeakMap,ql=new WeakMap,ny=new WeakMap,ay=new WeakMap;var n_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},a_,um,Yn,_s,OM,sy=class{constructor(e,r){a_.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=ne.Tape,um.set(this,void 0),Yn.set(this,void 0),_s.set(this,void 0),n_(this,um,e,"f"),n_(this,Yn,r,"f"),n_(this,_s,new le(jr(this,um,"f")),"f"),this.namedParameter=jr(this,a_,"m",OM).call(this,r)}get box(){return jr(this,Yn,"f")}get uuid(){return jr(this,Yn,"f").address.uuid}get address(){return jr(this,Yn,"f").address}get labelField(){return jr(this,Yn,"f").label}get iconField(){return jr(this,Yn,"f").icon}get defaultTrackType(){return ge.Audio}get enabledField(){return jr(this,Yn,"f").enabled}get minimizedField(){return jr(this,Yn,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return jr(this,um,"f").boxAdapters.adapterFor(jr(this,Yn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){jr(this,_s,"f").terminate()}};um=new WeakMap,Yn=new WeakMap,_s=new WeakMap,a_=new WeakSet,OM=function(e){return{flutter:jr(this,_s,"f").createParameter(e.flutter,F.unipolar(),E.percent(),"flutter"),wow:jr(this,_s,"f").createParameter(e.wow,F.unipolar(),E.percent(),"wow"),noise:jr(this,_s,"f").createParameter(e.noise,F.unipolar(),E.percent(),"noise"),saturation:jr(this,_s,"f").createParameter(e.saturation,F.unipolar(),E.percent(),"saturation")}};var Jl=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[pa.sine,pa.triangle,pa.saw,pa.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:F.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:F.values(r),FILTER_ORDER_STRING_MAPPING:E.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:F.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,a)}})();var o_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},We=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s_,dm,Xn,nt,VM,ly=class{constructor(e,r){s_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ne.Vaporisateur,dm.set(this,void 0),Xn.set(this,void 0),nt.set(this,void 0),o_(this,dm,e,"f"),o_(this,Xn,r,"f"),o_(this,nt,new le(We(this,dm,"f")),"f"),this.namedParameter=We(this,s_,"m",VM).call(this,r)}get box(){return We(this,Xn,"f")}get uuid(){return We(this,Xn,"f").address.uuid}get address(){return We(this,Xn,"f").address}get labelField(){return We(this,Xn,"f").label}get iconField(){return We(this,Xn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return We(this,Xn,"f").enabled}get minimizedField(){return We(this,Xn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return We(this,dm,"f").boxAdapters.adapterFor(We(this,Xn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){We(this,nt,"f").terminate()}};dm=new WeakMap,Xn=new WeakMap,nt=new WeakMap,s_=new WeakSet,VM=function(e){let r=[ha.Monophonic,ha.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:We(this,nt,"f").createParameter(n.waveform,F.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:We(this,nt,"f").createParameter(n.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:We(this,nt,"f").createParameter(n.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:We(this,nt,"f").createParameter(n.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:We(this,nt,"f").createParameter(e.noise.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:We(this,nt,"f").createParameter(e.noise.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:We(this,nt,"f").createParameter(e.noise.hold,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:We(this,nt,"f").createParameter(e.noise.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:We(this,nt,"f").createParameter(e.filterOrder,Jl.FILTER_ORDER_VALUE_MAPPING,Jl.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:We(this,nt,"f").createParameter(e.cutoff,Jl.CUTOFF_VALUE_MAPPING,Jl.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:We(this,nt,"f").createParameter(e.resonance,F.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:We(this,nt,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:We(this,nt,"f").createParameter(e.decay,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:We(this,nt,"f").createParameter(e.sustain,F.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:We(this,nt,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:We(this,nt,"f").createParameter(e.filterEnvelope,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:We(this,nt,"f").createParameter(e.filterKeyboard,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:We(this,nt,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:We(this,nt,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:We(this,nt,"f").createParameter(e.unisonCount,F.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:We(this,nt,"f").createParameter(e.unisonDetune,F.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:We(this,nt,"f").createParameter(e.unisonStereo,F.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:We(this,nt,"f").createParameter(e.lfo.waveform,Jl.LFO_WAVEFORM_VALUE_MAPPING,Jl.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:We(this,nt,"f").createParameter(e.lfo.rate,F.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:We(this,nt,"f").createParameter(e.lfo.targetTune,F.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:We(this,nt,"f").createParameter(e.lfo.targetVolume,F.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:We(this,nt,"f").createParameter(e.lfo.targetCutoff,F.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var l_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},c_,cy,pm,vn,Ua,UM,Yl=class{constructor(e,r){c_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ne.Arpeggio,pm.set(this,void 0),vn.set(this,void 0),Ua.set(this,void 0),l_(this,pm,e,"f"),l_(this,vn,r,"f"),l_(this,Ua,new le(vr(this,pm,"f")),"f"),this.namedParameter=vr(this,c_,"m",UM).call(this,r)}get box(){return vr(this,vn,"f")}get uuid(){return vr(this,vn,"f").address.uuid}get address(){return vr(this,vn,"f").address}get indexField(){return vr(this,vn,"f").index}get labelField(){return vr(this,vn,"f").label}get enabledField(){return vr(this,vn,"f").enabled}get minimizedField(){return vr(this,vn,"f").minimized}get host(){return vr(this,vn,"f").host}deviceHost(){return vr(this,pm,"f").boxAdapters.adapterFor(vr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){vr(this,Ua,"f").terminate()}};cy=Yl,pm=new WeakMap,vn=new WeakMap,Ua=new WeakMap,c_=new WeakSet,UM=function(e){return{modeIndex:vr(this,Ua,"f").createParameter(e.modeIndex,F.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:vr(this,Ua,"f").createParameter(e.numOctaves,F.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:vr(this,Ua,"f").createParameter(e.rateIndex,F.linearInteger(0,cy.RateFractions.length-1),cy.RateStringMapping,"Rate"),gate:vr(this,Ua,"f").createParameter(e.gate,F.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:vr(this,Ua,"f").createParameter(e.repeat,F.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:vr(this,Ua,"f").createParameter(e.velocity,F.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Yl.RateFractions=Co.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();Yl.RateStringMapping=E.indices("",cy.RateFractions.map(([t,e])=>`${t}/${e}`));var u_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Kr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},d_,fm,xn,Xl,jM,uy=class{constructor(e,r){d_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ne.Pitch,fm.set(this,void 0),xn.set(this,void 0),Xl.set(this,void 0),u_(this,fm,e,"f"),u_(this,xn,r,"f"),u_(this,Xl,new le(Kr(this,fm,"f")),"f"),this.namedParameter=Kr(this,d_,"m",jM).call(this,r)}get box(){return Kr(this,xn,"f")}get uuid(){return Kr(this,xn,"f").address.uuid}get address(){return Kr(this,xn,"f").address}get indexField(){return Kr(this,xn,"f").index}get labelField(){return Kr(this,xn,"f").label}get enabledField(){return Kr(this,xn,"f").enabled}get minimizedField(){return Kr(this,xn,"f").minimized}get host(){return Kr(this,xn,"f").host}deviceHost(){return Kr(this,fm,"f").boxAdapters.adapterFor(Kr(this,xn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Kr(this,Xl,"f").terminate()}};fm=new WeakMap,xn=new WeakMap,Xl=new WeakMap,d_=new WeakSet,jM=function(e){return{octaves:Kr(this,Xl,"f").createParameter(e.octaves,F.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Kr(this,Xl,"f").createParameter(e.semiTones,F.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Kr(this,Xl,"f").createParameter(e.cents,F.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"cents")}};var eD=/^\/\/ @label .+$/m,KM=/^\/\/ @param .+$/gm,WM=/^\/\/ @sample .+$/gm;var LM=/^\/\/ @(group|param|sample) .+$/gm,ZM=/^\/\/ @(?:param|sample) \S+/gm,md=1e-6,tD=["linear","exp","int","bool"],rD=new class{x(t){return{value:t>=.5?"On":"Off",unit:""}}y(t){let e=t.trim().toLowerCase();return{type:"explicit",value:e==="on"||e==="true"||e==="yes"?1:0}}},GM=t=>{let e=t.replace(/^\/\/ @param\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(e.length===0)throw new Error(`Malformed @param: '${t}'`);let r=e[0];if(e.length===1)return{label:r,defaultValue:0,min:0,max:1,mapping:"unipolar",unit:""};let n=e[1];if(n==="true"||n==="false")return{label:r,defaultValue:n==="true"?1:0,min:0,max:1,mapping:"bool",unit:""};if(n==="bool")return{label:r,defaultValue:0,min:0,max:1,mapping:"bool",unit:""};let i=parseFloat(n);if(isNaN(i))throw new Error(`Malformed @param: '${t}' \u2014 '${n}' is not a valid number`);if(e.length===2)return{label:r,defaultValue:i,min:0,max:1,mapping:"unipolar",unit:""};if(e.length===3&&e[2]==="bool")return{label:r,defaultValue:i>=.5?1:0,min:0,max:1,mapping:"bool",unit:""};if(e.length===4){let d=parseFloat(e[2]),f=parseFloat(e[3]);if(isNaN(d)||isNaN(f))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(f-d<md)throw new Error(`Malformed @param: '${t}' \u2014 min (${d}) must be less than max (${f})`);if(i<d-md||i>f+md)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${d}, ${f}]`);return{label:r,defaultValue:i,min:d,max:f,mapping:"linear",unit:""}}if(e.length<5)throw new Error(`Malformed @param: '${t}' \u2014 expected: // @param <name> <default> <min> <max> [type] [unit]`);let a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4],c=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!tD.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<md)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-md||i>o+md)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${a}, ${o}]`);return{label:r,defaultValue:i,min:a,max:o,mapping:s,unit:c}},HM=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,iD=(t,e)=>HM(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,Fr;(function(t){t.isEqual=iD,t.parseLabel=e=>{let r=eD.exec(e);if(r===null)return b.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return b.wrap(n)},t.parseParams=e=>{let r=[],n;for(KM.lastIndex=0;(n=KM.exec(e))!==null;)r.push(GM(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(WM.lastIndex=0;(n=WM.exec(e))!==null;){let i=n[0].replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(i.length===0||i[0].length===0)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);if(i.length>1)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);r.push({label:i[0]})}return r},t.parseDeclarationOrder=e=>{let r=new Map,n;ZM.lastIndex=0;let i=0;for(;(n=ZM.exec(e))!==null;){let a=n[0].replace(/^\/\/ @(?:param|sample)\s+/,"").split(/\s+/)[0];r.has(a)||r.set(a,i++)}return r},t.parseGroups=e=>{let r=[],n=null,i=[];LM.lastIndex=0;let a;for(;(a=LM.exec(e))!==null;){let o=a[0],s=a[1];if(s==="group"){(i.length>0||n!==null)&&r.push({group:n,items:i});let c=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:c[0],color:c[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:GM(o)});else if(s==="sample"){let c=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(c.length===0||c[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:c[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return F.unipolar();case"linear":return F.linear(e.min,e.max);case"exp":return F.exponential(e.min,e.max);case"int":return F.linearInteger(e.min,e.max);case"bool":return F.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return E.percent();case"linear":return E.numeric({unit:e.unit,fractionDigits:2});case"exp":return E.numeric({unit:e.unit,fractionDigits:2});case"int":return E.numeric({unit:e.unit,fractionDigits:0});case"bool":return rD}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new fe;return{terminable:pe.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let c=Te(s,ba),d=c.label.getValue(),v=t.parseParams(r.getValue()).find(A=>A.label===d),{valueMapping:h,stringMapping:w}=W(v)?t.resolveParamMappings(v):{valueMapping:F.unipolar(),stringMapping:E.percent({fractionDigits:1})};e.createParameter(c.value,h,w,d,void 0,c.defaultValue.getValue()),W(v)&&i.set(d,v)}),onRemoved:(({box:s})=>{let c=Te(s,ba);i.delete(c.label.getValue()),e.removeParameter(c.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let c of e.parameters()){let d=s.find(w=>w.label===c.name);if(!W(d))continue;let f=i.get(c.name);if(W(f)&&HM(f,d))continue;let{valueMapping:v,stringMapping:h}=t.resolveParamMappings(d);c.updateMappings(v,h),i.set(c.name,d)}a.notify()}),a),codeChanged:a}}})(Fr||(Fr={}));var dy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Br=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},mm,hm,yn,gm,py,fy=class{constructor(e,r){mm.set(this,new J),this.type="midi-effect",this.accepts="midi",this.manualUrl=ne.Spielwerk,hm.set(this,void 0),yn.set(this,void 0),gm.set(this,void 0),py.set(this,void 0),dy(this,hm,e,"f"),dy(this,yn,r,"f"),dy(this,gm,Br(this,mm,"f").own(new le(Br(this,hm,"f"))),"f");let{terminable:n,codeChanged:i}=Fr.subscribeScriptParams(Br(this,gm,"f"),r.code,r.parameters);Br(this,mm,"f").own(n),dy(this,py,i,"f")}get box(){return Br(this,yn,"f")}get uuid(){return Br(this,yn,"f").address.uuid}get address(){return Br(this,yn,"f").address}get indexField(){return Br(this,yn,"f").index}get labelField(){return Br(this,yn,"f").label}get enabledField(){return Br(this,yn,"f").enabled}get minimizedField(){return Br(this,yn,"f").minimized}get host(){return Br(this,yn,"f").host}get parameters(){return Br(this,gm,"f")}get codeChanged(){return Br(this,py,"f")}deviceHost(){return Br(this,hm,"f").boxAdapters.adapterFor(Br(this,yn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Br(this,mm,"f").terminate()}};mm=new WeakMap,hm=new WeakMap,yn=new WeakMap,gm=new WeakMap,py=new WeakMap;var my=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vm,xm,Qn,ym,hy,gy=class{constructor(e,r){vm.set(this,new J),this.type="instrument",this.accepts="midi",this.manualUrl=ne.Apparat,xm.set(this,void 0),Qn.set(this,void 0),ym.set(this,void 0),hy.set(this,void 0),my(this,xm,e,"f"),my(this,Qn,r,"f"),my(this,ym,Wr(this,vm,"f").own(new le(Wr(this,xm,"f"))),"f");let{terminable:n,codeChanged:i}=Fr.subscribeScriptParams(Wr(this,ym,"f"),r.code,r.parameters);Wr(this,vm,"f").own(n),my(this,hy,i,"f")}get box(){return Wr(this,Qn,"f")}get uuid(){return Wr(this,Qn,"f").address.uuid}get address(){return Wr(this,Qn,"f").address}get labelField(){return Wr(this,Qn,"f").label}get iconField(){return Wr(this,Qn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Wr(this,Qn,"f").enabled}get minimizedField(){return Wr(this,Qn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Wr(this,ym,"f")}get codeChanged(){return Wr(this,hy,"f")}deviceHost(){return Wr(this,xm,"f").boxAdapters.adapterFor(Wr(this,Qn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Wr(this,vm,"f").terminate()}};vm=new WeakMap,xm=new WeakMap,Qn=new WeakMap,ym=new WeakMap,hy=new WeakMap;var p_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},_t=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},f_,wm,wn,Ir,qM,As;(function(t){t.Waves=["Saw","Square","Pulse","Double Sine","Saw-Pulse","Res. Saw","Res. Triangle","Res. Trapezoid"],t.LineSelect=["1","2","1+1'","1+2'"],t.Modulation=["Off","Ring","Noise"],t.VibratoWaves=["Triangle","Saw Up","Saw Down","Square"],t.envelopeIndex=(e,r)=>e*3+(r==="pitch"?0:r==="dcw"?1:2)})(As||(As={}));var vy=class{constructor(e,r){f_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ne.Neon,wm.set(this,void 0),wn.set(this,void 0),Ir.set(this,void 0),p_(this,wm,e,"f"),p_(this,wn,r,"f"),p_(this,Ir,new le(_t(this,wm,"f")),"f"),this.namedParameter=_t(this,f_,"m",qM).call(this,r)}get box(){return _t(this,wn,"f")}get uuid(){return _t(this,wn,"f").address.uuid}get address(){return _t(this,wn,"f").address}get labelField(){return _t(this,wn,"f").label}get iconField(){return _t(this,wn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return _t(this,wn,"f").enabled}get minimizedField(){return _t(this,wn,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return _t(this,wn,"f").envelopes.fields()[As.envelopeIndex(e,r)]}deviceHost(){return _t(this,wm,"f").boxAdapters.adapterFor(_t(this,wn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_t(this,Ir,"f").terminate()}};wm=new WeakMap,wn=new WeakMap,Ir=new WeakMap,f_=new WeakSet,qM=function(e){let r=[ha.Monophonic,ha.Polyphonic],n=(i,a)=>_t(this,Ir,"f").createParameter(i,F.linear(0,99),E.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:_t(this,Ir,"f").createParameter(e.lineSelect,F.linearInteger(0,3),E.indices("",As.LineSelect),"Line"),modulation:_t(this,Ir,"f").createParameter(e.modulation,F.linearInteger(0,2),E.indices("",As.Modulation),"Mod"),octave:_t(this,Ir,"f").createParameter(e.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),detune:_t(this,Ir,"f").createParameter(e.detune,F.linear(-4800,4800),E.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:_t(this,Ir,"f").createParameter(e.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:_t(this,Ir,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),voicingMode:_t(this,Ir,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:_t(this,Ir,"f").createParameter(e.vibrato.wave,F.linearInteger(0,3),E.indices("",As.VibratoWaves),"Vib. Wave"),delay:n(e.vibrato.delay,"Vib. Delay"),rate:n(e.vibrato.rate,"Vib. Rate"),depth:n(e.vibrato.depth,"Vib. Depth")},lines:e.lines.fields().map(i=>({wave1:_t(this,Ir,"f").createParameter(i.wave1,F.linearInteger(0,7),E.indices("",As.Waves),"Wave 1"),wave2:_t(this,Ir,"f").createParameter(i.wave2,F.linearInteger(0,8),E.indices("",["Off",...As.Waves]),"Wave 2"),dcwKeyFollow:_t(this,Ir,"f").createParameter(i.dcwKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:_t(this,Ir,"f").createParameter(i.dcaKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};var m_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},h_,bm,ea,hd,JM,xy=class{constructor(e,r){h_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ne.Nano,bm.set(this,void 0),ea.set(this,void 0),hd.set(this,void 0),m_(this,bm,e,"f"),m_(this,ea,r,"f"),m_(this,hd,new le(wi(this,bm,"f")),"f"),this.namedParameter=wi(this,h_,"m",JM).call(this,r)}get box(){return wi(this,ea,"f")}get uuid(){return wi(this,ea,"f").address.uuid}get address(){return wi(this,ea,"f").address}get labelField(){return wi(this,ea,"f").label}get iconField(){return wi(this,ea,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return wi(this,ea,"f").enabled}get minimizedField(){return wi(this,ea,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return wi(this,bm,"f").boxAdapters.adapterFor(wi(this,ea,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wi(this,hd,"f").terminate()}};bm=new WeakMap,ea=new WeakMap,hd=new WeakMap,h_=new WeakSet,JM=function(e){return{volume:wi(this,hd,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"volume"),release:wi(this,hd,"f").createParameter(e.release,F.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"release")}};var gd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},se=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},g_,Ql,Fs,Se,yy,_m,ri,ec,YM,vd=class{constructor(e,r){g_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",Ql.set(this,new J),Fs.set(this,void 0),Se.set(this,void 0),yy.set(this,void 0),_m.set(this,void 0),ri.set(this,void 0),ec.set(this,b.None),gd(this,Fs,e,"f"),gd(this,Se,r,"f"),gd(this,yy,se(this,Ql,"f").own(Rt.create(se(this,Se,"f").midiEffects,n=>se(this,Fs,"f").boxAdapters.adapterFor(n,ie.isMidiEffect),l.MIDIEffectHost)),"f"),gd(this,_m,se(this,Ql,"f").own(Rt.create(se(this,Se,"f").audioEffects,n=>se(this,Fs,"f").boxAdapters.adapterFor(n,ie.isAudioEffect),l.AudioEffectHost)),"f"),gd(this,ri,se(this,Ql,"f").own(new le(se(this,Fs,"f"))),"f"),this.namedParameter=se(this,g_,"m",YM).call(this,r),se(this,Ql,"f").own(se(this,Se,"f").file.catchupAndSubscribe(n=>{gd(this,ec,n.targetVertex.map(({box:i})=>se(this,Fs,"f").boxAdapters.adapterFor(i,Un)),"f"),se(this,ec,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Se,"f")}get uuid(){return se(this,Se,"f").address.uuid}get address(){return se(this,Se,"f").address}get peakAddress(){return se(this,Se,"f").address.append(1001)}get indexField(){return se(this,Se,"f").index}get gate(){return se(this,Se,"f").gate.getValue()}get exclude(){return se(this,Se,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,ec,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,ec,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Se,"f").icon}get defaultTrackType(){return ge.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return b.wrap(se(this,Se,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return b.wrap(se(this,Se,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return se(this,ec,"f")}fileUUID(){return se(this,Se,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,Se,"f").mute.reset(),se(this,Se,"f").solo.reset(),se(this,Se,"f").exclude.reset(),se(this,Se,"f").polyphone.reset(),se(this,Se,"f").pitch.reset(),se(this,Se,"f").attack.reset(),se(this,Se,"f").release.reset(),se(this,Se,"f").sampleStart.reset(),se(this,Se,"f").sampleEnd.reset(),se(this,Se,"f").gate.reset(),se(this,Se,"f").volume.reset(),se(this,Se,"f").panning.reset()}copyToIndex(e){Go.create(se(this,Se,"f").graph,B.generate(),r=>{r.file.refer(se(this,Se,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,Se,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,Se,"f").mute.getValue()),r.solo.setValue(se(this,Se,"f").solo.getValue()),r.sampleStart.setValue(se(this,Se,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,Se,"f").sampleEnd.getValue()),r.attack.setValue(se(this,Se,"f").attack.getValue()),r.release.setValue(se(this,Se,"f").release.getValue()),r.pitch.setValue(se(this,Se,"f").pitch.getValue()),r.exclude.setValue(se(this,Se,"f").exclude.getValue()),r.gate.setValue(se(this,Se,"f").gate.getValue()),r.volume.setValue(se(this,Se,"f").volume.getValue()),r.panning.setValue(se(this,Se,"f").panning.getValue())})}get midiEffects(){return b.wrap(se(this,yy,"f"))}get inputAdapter(){return b.wrap(this)}get audioEffects(){return b.wrap(se(this,_m,"f"))}get labelField(){return Te(se(this,Se,"f").file.targetVertex.unwrap("file.target").box,Qi).fileName}get enabledField(){return se(this,Se,"f").enabled}get minimizedField(){return se(this,Se,"f").minimized}device(){return se(this,Fs,"f").boxAdapters.adapterFor(se(this,Se,"f").device.targetVertex.unwrap("device.target").box,xd)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>b.None};for(let e of se(this,_m,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,Ql,"f").terminate()}};Ql=new WeakMap,Fs=new WeakMap,Se=new WeakMap,yy=new WeakMap,_m=new WeakMap,ri=new WeakMap,ec=new WeakMap,g_=new WeakSet,YM=function(e){return{gate:se(this,ri,"f").createParameter(e.gate,F.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,ri,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:se(this,ri,"f").createParameter(e.solo,F.bool,E.bool,"Solo"),polyphone:se(this,ri,"f").createParameter(e.polyphone,F.bool,E.bool,"Polyphone"),exclude:se(this,ri,"f").createParameter(e.exclude,F.bool,E.bool,"Exclude"),pitch:se(this,ri,"f").createParameter(e.pitch,F.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,ri,"f").createParameter(e.sampleStart,F.unipolar(),E.percent(),"Start",0),sampleEnd:se(this,ri,"f").createParameter(e.sampleEnd,F.unipolar(),E.percent(),"End",1),attack:se(this,ri,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,ri,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:se(this,ri,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:se(this,ri,"f").createParameter(e.panning,F.bipolar(),E.panning,"Pan",.5)}};var wy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yd,ta,wd,by,xd=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=ne.Playfield,yd.set(this,void 0),ta.set(this,void 0),wd.set(this,void 0),by.set(this,void 0),wy(this,yd,e,"f"),wy(this,ta,r,"f"),wy(this,wd,Rt.create(r.samples,n=>e.boxAdapters.adapterFor(n,vd),l.Sample),"f"),wy(this,by,new le(ii(this,yd,"f")),"f")}reset(){ii(this,wd,"f").adapters().forEach(e=>e.box.delete())}get box(){return ii(this,ta,"f")}get uuid(){return ii(this,ta,"f").address.uuid}get address(){return ii(this,ta,"f").address}get labelField(){return ii(this,ta,"f").label}get iconField(){return ii(this,ta,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return ii(this,ta,"f").enabled}get minimizedField(){return ii(this,ta,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return ii(this,wd,"f")}get context(){return ii(this,yd,"f")}deviceHost(){return ii(this,yd,"f").boxAdapters.adapterFor(ii(this,ta,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of ii(this,wd,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ii(this,by,"f").terminate()}};yd=new WeakMap,ta=new WeakMap,wd=new WeakMap,by=new WeakMap;var v_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},xr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},x_,Am,bn,ja,XM,_y=class{constructor(e,r){x_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.StereoTool,Am.set(this,void 0),bn.set(this,void 0),ja.set(this,void 0),v_(this,Am,e,"f"),v_(this,bn,r,"f"),v_(this,ja,new le(xr(this,Am,"f")),"f"),this.namedParameter=xr(this,x_,"m",XM).call(this,r)}get box(){return xr(this,bn,"f")}get uuid(){return xr(this,bn,"f").address.uuid}get address(){return xr(this,bn,"f").address}get indexField(){return xr(this,bn,"f").index}get labelField(){return xr(this,bn,"f").label}get enabledField(){return xr(this,bn,"f").enabled}get minimizedField(){return xr(this,bn,"f").minimized}get host(){return xr(this,bn,"f").host}deviceHost(){return xr(this,Am,"f").boxAdapters.adapterFor(xr(this,bn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){xr(this,ja,"f").terminate()}};Am=new WeakMap,bn=new WeakMap,ja=new WeakMap,x_=new WeakSet,XM=function(e){return{volume:xr(this,ja,"f").createParameter(e.volume,F.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:xr(this,ja,"f").createParameter(e.panning,F.bipolar(),E.panning,"Panning",.5),stereo:xr(this,ja,"f").createParameter(e.stereo,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:xr(this,ja,"f").createParameter(e.invertL,F.bool,E.bool,"Invert Left"),invertR:xr(this,ja,"f").createParameter(e.invertR,F.bool,E.bool,"Invert Right"),swap:xr(this,ja,"f").createParameter(e.swap,F.bool,E.bool,"Swap")}};var Ay=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},st=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},y_,Fm,bd,dr,Em,tc,QM,_d=class{constructor(e,r){y_.add(this),this.class="device-host",Fm.set(this,new J),bd.set(this,void 0),dr.set(this,void 0),Em.set(this,void 0),tc.set(this,void 0),Ay(this,bd,e,"f"),Ay(this,dr,r,"f"),Ay(this,Em,st(this,Fm,"f").own(Rt.create(st(this,dr,"f").audioEffects,n=>st(this,bd,"f").boxAdapters.adapterFor(n,ie.isAudioEffect),l.AudioEffectHost)),"f"),Ay(this,tc,st(this,Fm,"f").own(new le(st(this,bd,"f"))),"f"),this.namedParameter=st(this,y_,"m",QM).call(this,r)}get box(){return st(this,dr,"f")}get uuid(){return st(this,dr,"f").address.uuid}get address(){return st(this,dr,"f").address}get indexField(){return st(this,dr,"f").index}get labelField(){return st(this,dr,"f").label}get minimizedField(){return st(this,dr,"f").minimized}get label(){return st(this,dr,"f").label.getValue()}get audioEffects(){return b.wrap(st(this,Em,"f"))}get midiEffects(){return b.None}get audioEffectsField(){return b.wrap(st(this,dr,"f").audioEffects)}get midiEffectsField(){return b.None}get inputAdapter(){return b.None}get hostsInstrument(){return!1}get isAudioUnit(){return!1}get inputField(){return this.audioUnitBoxAdapter().box.input}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}compositeDevice(){return st(this,bd,"f").boxAdapters.adapterFor(st(this,dr,"f").composite.targetVertex.unwrap("composite.target").box,Ka)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>b.None};for(let e of st(this,Em,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){st(this,Fm,"f").terminate()}copyToIndex(e){tu.create(st(this,dr,"f").graph,B.generate(),r=>{r.composite.refer(st(this,dr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(st(this,dr,"f").label.getValue()),r.gain.setValue(st(this,dr,"f").gain.getValue()),r.pan.setValue(st(this,dr,"f").pan.getValue()),r.mute.setValue(st(this,dr,"f").mute.getValue()),r.solo.setValue(st(this,dr,"f").solo.getValue())})}};Fm=new WeakMap,bd=new WeakMap,dr=new WeakMap,Em=new WeakMap,tc=new WeakMap,y_=new WeakSet,QM=function(e){return{gain:st(this,tc,"f").createParameter(e.gain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:st(this,tc,"f").createParameter(e.pan,F.bipolar(),E.panning,"Pan",.5),mute:st(this,tc,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:st(this,tc,"f").createParameter(e.solo,F.bool,E.bool,"Solo")}};var Fy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Jt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},w_,Sm,Ad,bi,Ey,Pm,e$,Ka=class{constructor(e,r){w_.add(this),this.type="audio-effect",this.accepts="audio",Sm.set(this,new J),Ad.set(this,void 0),bi.set(this,void 0),Ey.set(this,void 0),Pm.set(this,void 0),Fy(this,Ad,e,"f"),Fy(this,bi,r,"f"),Fy(this,Ey,Jt(this,Sm,"f").own(Rt.create(Jt(this,bi,"f").entries,n=>Jt(this,Ad,"f").boxAdapters.adapterFor(n,_d),l.AudioEffectCompositeCell)),"f"),Fy(this,Pm,Jt(this,Sm,"f").own(new le(Jt(this,Ad,"f"))),"f"),this.namedParameter=Jt(this,w_,"m",e$).call(this,r)}get box(){return Jt(this,bi,"f")}get uuid(){return Jt(this,bi,"f").address.uuid}get address(){return Jt(this,bi,"f").address}get indexField(){return Jt(this,bi,"f").index}get labelField(){return Jt(this,bi,"f").label}get enabledField(){return Jt(this,bi,"f").enabled}get minimizedField(){return Jt(this,bi,"f").minimized}get host(){return Jt(this,bi,"f").host}get entries(){return Jt(this,Ey,"f")}get inputField(){return Jt(this,bi,"f").input}deviceHost(){return Jt(this,Ad,"f").boxAdapters.adapterFor(Jt(this,bi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Jt(this,Sm,"f").terminate()}};Sm=new WeakMap,Ad=new WeakMap,bi=new WeakMap,Ey=new WeakMap,Pm=new WeakMap,w_=new WeakSet,e$=function(e){return{dry:Jt(this,Pm,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:Jt(this,Pm,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var Sy=class extends Ka{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return ne.AudioEffectComposite}};var Py=class extends Ka{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return ne.StereoComposite}};var nD=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},b_=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fd,__=F.exponential(20,2e4),A_=E.numeric({unit:"Hz",fractionDigits:0}),Mm=class extends Ka{constructor(e,r){super(e,r),Fd.set(this,void 0),nD(this,Fd,new le(e),"f"),this.crossover=[b_(this,Fd,"f").createParameter(r.crossover1,__,A_,"Crossover 1"),b_(this,Fd,"f").createParameter(r.crossover2,__,A_,"Crossover 2"),b_(this,Fd,"f").createParameter(r.crossover3,__,A_,"Crossover 3")]}get crossoverCount(){return Math.max(0,this.entries.adapters().length-1)}get spectrum(){return this.address.append(4095)}get entriesFixed(){return!0}get manualUrl(){return ne.FrequencySplit}};Fd=new WeakMap;Mm.MAX_BANDS=4;var $m;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})($m||($m={}));var t$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},_i=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ed,Ai,My=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=ne.Zeitgeist,Ed.set(this,void 0),Ai.set(this,void 0),t$(this,Ed,e,"f"),t$(this,Ai,r,"f"),this.groove()}get box(){return _i(this,Ai,"f")}get uuid(){return _i(this,Ai,"f").address.uuid}get address(){return _i(this,Ai,"f").address}get indexField(){return _i(this,Ai,"f").index}get labelField(){return _i(this,Ai,"f").label}get enabledField(){return _i(this,Ai,"f").enabled}get minimizedField(){return _i(this,Ai,"f").minimized}get host(){return _i(this,Ai,"f").host}deviceHost(){return _i(this,Ed,"f").boxAdapters.adapterFor(_i(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}groove(){return _i(this,Ed,"f").boxAdapters.adapterFor(_i(this,Ai,"f").groove.targetVertex.unwrap("no groove").box,$m.checkType)}catchupAndSubscribeGroove(e){return _i(this,Ai,"f").groove.catchupAndSubscribe(r=>e(_i(this,Ed,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,$m.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ed=new WeakMap,Ai=new WeakMap;var r$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ra=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$y,Wi,Ny=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",$y.set(this,void 0),Wi.set(this,void 0),r$(this,$y,e,"f"),r$(this,Wi,r,"f")}get box(){return ra(this,Wi,"f")}get uuid(){return ra(this,Wi,"f").address.uuid}get address(){return ra(this,Wi,"f").address}get indexField(){return ra(this,Wi,"f").index}get labelField(){return ra(this,Wi,"f").label}get enabledField(){return ra(this,Wi,"f").enabled}get minimizedField(){return ra(this,Wi,"f").minimized}get host(){return ra(this,Wi,"f").host}get commentField(){return ra(this,Wi,"f").comment}deviceHost(){return ra(this,$y,"f").boxAdapters.adapterFor(ra(this,Wi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};$y=new WeakMap,Wi=new WeakMap;var i$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ia=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ky,Li,By=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",ky.set(this,void 0),Li.set(this,void 0),i$(this,ky,e,"f"),i$(this,Li,r,"f")}get box(){return ia(this,Li,"f")}get uuid(){return ia(this,Li,"f").address.uuid}get address(){return ia(this,Li,"f").address}get indexField(){return ia(this,Li,"f").index}get labelField(){return ia(this,Li,"f").label}get enabledField(){return ia(this,Li,"f").enabled}get minimizedField(){return ia(this,Li,"f").minimized}get host(){return ia(this,Li,"f").host}get commentField(){return ia(this,Li,"f").comment}deviceHost(){return ia(this,ky,"f").boxAdapters.adapterFor(ia(this,Li,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};ky=new WeakMap,Li=new WeakMap;var Es=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Le=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},F_,E_,Nm,Fi,Iy,Sd,na,_n,Pd,n$,S_,Ty=class{constructor(e,r){F_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ne.Soundfont,E_.set(this,new J),Nm.set(this,void 0),Fi.set(this,void 0),Iy.set(this,void 0),Sd.set(this,void 0),na.set(this,void 0),_n.set(this,void 0),Pd.set(this,pe.Empty),S_.set(this,n=>n.match({none:()=>{Le(this,_n,"f").clear(),Le(this,na,"f").clear()},some:i=>i.soundfont.match({none:()=>{Le(this,_n,"f").clear(),Le(this,na,"f").clear(),Le(this,Pd,"f").terminate(),Es(this,Pd,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Le(this,_n,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Le(this,na,"f").wrap(o)}else a.type==="error"?(Le(this,_n,"f").clear(),Le(this,na,"f").clear()):a.type==="idle"&&(Le(this,_n,"f").clear(),Le(this,na,"f").clear())}),"f")},some:a=>{Le(this,na,"f").wrap(a),Le(this,_n,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),Es(this,Nm,e,"f"),Es(this,Fi,r,"f"),Es(this,Iy,new le(Le(this,Nm,"f")),"f"),this.namedParameter=Le(this,F_,"m",n$).call(this,r),Es(this,Sd,new Pr,"f"),Es(this,na,new Pr,"f"),Es(this,_n,new Pr,"f"),Le(this,E_,"f").ownAll(Le(this,Sd,"f").subscribe(Le(this,S_,"f")),Le(this,Fi,"f").file.catchupAndSubscribe(({targetVertex:n})=>Le(this,Sd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Le(this,Fi,"f").presetIndex.catchupAndSubscribe(n=>Le(this,na,"f").match({none:()=>Le(this,_n,"f").clear(),some:i=>Le(this,_n,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Le(this,Sd,"f")}get soundfont(){return Le(this,na,"f")}get preset(){return Le(this,_n,"f")}get presetIndex(){return Le(this,Fi,"f").presetIndex.getValue()}get box(){return Le(this,Fi,"f")}get uuid(){return Le(this,Fi,"f").address.uuid}get address(){return Le(this,Fi,"f").address}get labelField(){return Le(this,Fi,"f").label}get iconField(){return Le(this,Fi,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Le(this,Fi,"f").enabled}get minimizedField(){return Le(this,Fi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Le(this,Nm,"f").boxAdapters.adapterFor(Le(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Le(this,Pd,"f").terminate(),Es(this,Pd,pe.Empty,"f"),Le(this,Iy,"f").terminate()}};E_=new WeakMap,Nm=new WeakMap,Fi=new WeakMap,Iy=new WeakMap,Sd=new WeakMap,na=new WeakMap,_n=new WeakMap,Pd=new WeakMap,S_=new WeakMap,F_=new WeakSet,n$=function(e){return{}};var a$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},km=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Dy,rc,Ry=class{constructor(e,r){Dy.set(this,void 0),rc.set(this,void 0),a$(this,Dy,e,"f"),a$(this,rc,r,"f")}get box(){return km(this,rc,"f")}get uuid(){return km(this,rc,"f").address.uuid}get address(){return km(this,rc,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return km(this,Dy,"f").soundfontManager.getOrCreate(km(this,rc,"f").address.uuid)}terminate(){}};Dy=new WeakMap,rc=new WeakMap;var P_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ei=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},M_,Bm,An,Im,o$,Cy=class{constructor(e,r){M_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Maximizer,Bm.set(this,void 0),An.set(this,void 0),Im.set(this,void 0),P_(this,Bm,e,"f"),P_(this,An,r,"f"),P_(this,Im,new le(Ei(this,Bm,"f")),"f"),this.namedParameter=Ei(this,M_,"m",o$).call(this,r)}get box(){return Ei(this,An,"f")}get uuid(){return Ei(this,An,"f").address.uuid}get address(){return Ei(this,An,"f").address}get indexField(){return Ei(this,An,"f").index}get labelField(){return Ei(this,An,"f").label}get enabledField(){return Ei(this,An,"f").enabled}get minimizedField(){return Ei(this,An,"f").minimized}get host(){return Ei(this,An,"f").host}deviceHost(){return Ei(this,Bm,"f").boxAdapters.adapterFor(Ei(this,An,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ei(this,Im,"f").terminate()}};Bm=new WeakMap,An=new WeakMap,Im=new WeakMap,M_=new WeakSet,o$=function(e){return{threshold:Ei(this,Im,"f").createParameter(e.threshold,F.linear(-24,0),E.decible,"Threshold")}};var $_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},At=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},N_,Tm,Zi,Lr,s$,zy=class{constructor(e,r){N_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Compressor,Tm.set(this,void 0),Zi.set(this,void 0),Lr.set(this,void 0),$_(this,Tm,e,"f"),$_(this,Zi,r,"f"),$_(this,Lr,new le(At(this,Tm,"f")),"f"),this.namedParameter=At(this,N_,"m",s$).call(this,r)}get box(){return At(this,Zi,"f")}get uuid(){return At(this,Zi,"f").address.uuid}get address(){return At(this,Zi,"f").address}get indexField(){return At(this,Zi,"f").index}get labelField(){return At(this,Zi,"f").label}get enabledField(){return At(this,Zi,"f").enabled}get minimizedField(){return At(this,Zi,"f").minimized}get host(){return At(this,Zi,"f").host}get sideChain(){return At(this,Zi,"f").sideChain}deviceHost(){return At(this,Tm,"f").boxAdapters.adapterFor(At(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){At(this,Lr,"f").terminate()}};Tm=new WeakMap,Zi=new WeakMap,Lr=new WeakMap,N_=new WeakSet,s$=function(e){return{lookahead:At(this,Lr,"f").createParameter(e.lookahead,F.bool,E.bool,"Lookahead"),automakeup:At(this,Lr,"f").createParameter(e.automakeup,F.bool,E.bool,"Auto Makeup"),autoattack:At(this,Lr,"f").createParameter(e.autoattack,F.bool,E.bool,"Auto Attack"),autorelease:At(this,Lr,"f").createParameter(e.autorelease,F.bool,E.bool,"Auto Release"),inputgain:At(this,Lr,"f").createParameter(e.inputgain,F.linear(-30,30),E.decible,"Input Gain"),threshold:At(this,Lr,"f").createParameter(e.threshold,F.linear(-60,0),E.decible,"Threshold"),ratio:At(this,Lr,"f").createParameter(e.ratio,F.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:At(this,Lr,"f").createParameter(e.knee,F.linear(0,24),E.decible,"Knee"),attack:At(this,Lr,"f").createParameter(e.attack,F.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:At(this,Lr,"f").createParameter(e.release,F.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:At(this,Lr,"f").createParameter(e.makeup,F.linear(-40,40),E.decible,"Makeup Gain"),mix:At(this,Lr,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Dry/Wet")}};var k_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},B_,Dm,Gi,aa,l$,Oy=class{constructor(e,r){B_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Gate,Dm.set(this,void 0),Gi.set(this,void 0),aa.set(this,void 0),k_(this,Dm,e,"f"),k_(this,Gi,r,"f"),k_(this,aa,new le(Yt(this,Dm,"f")),"f"),this.namedParameter=Yt(this,B_,"m",l$).call(this,r)}get box(){return Yt(this,Gi,"f")}get uuid(){return Yt(this,Gi,"f").address.uuid}get address(){return Yt(this,Gi,"f").address}get indexField(){return Yt(this,Gi,"f").index}get labelField(){return Yt(this,Gi,"f").label}get enabledField(){return Yt(this,Gi,"f").enabled}get minimizedField(){return Yt(this,Gi,"f").minimized}get host(){return Yt(this,Gi,"f").host}get sideChain(){return Yt(this,Gi,"f").sideChain}deviceHost(){return Yt(this,Dm,"f").boxAdapters.adapterFor(Yt(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yt(this,aa,"f").terminate()}};Dm=new WeakMap,Gi=new WeakMap,aa=new WeakMap,B_=new WeakSet,l$=function(e){return{inverse:Yt(this,aa,"f").createParameter(e.inverse,F.bool,E.bool,"Inverse"),threshold:Yt(this,aa,"f").createParameter(e.threshold,F.linear(-80,0),E.decible,"Threshold"),return:Yt(this,aa,"f").createParameter(e.return,F.linear(0,24),E.decible,"Return"),attack:Yt(this,aa,"f").createParameter(e.attack,F.linear(0,1e3),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Yt(this,aa,"f").createParameter(e.hold,F.linear(0,500),E.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Yt(this,aa,"f").createParameter(e.release,F.linear(1,2e3),E.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Yt(this,aa,"f").createParameter(e.floor,F.decibel(-72,-12,0),E.decible,"Floor")}};var I_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},T_,Rm,Fn,Wa,c$,Vy=class{constructor(e,r){T_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Autotune,Rm.set(this,void 0),Fn.set(this,void 0),Wa.set(this,void 0),I_(this,Rm,e,"f"),I_(this,Fn,r,"f"),I_(this,Wa,new le(yr(this,Rm,"f")),"f"),this.namedParameter=yr(this,T_,"m",c$).call(this,r)}get box(){return yr(this,Fn,"f")}get uuid(){return yr(this,Fn,"f").address.uuid}get address(){return yr(this,Fn,"f").address}get indexField(){return yr(this,Fn,"f").index}get labelField(){return yr(this,Fn,"f").label}get enabledField(){return yr(this,Fn,"f").enabled}get minimizedField(){return yr(this,Fn,"f").minimized}get host(){return yr(this,Fn,"f").host}deviceHost(){return yr(this,Rm,"f").boxAdapters.adapterFor(yr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yr(this,Wa,"f").terminate()}};Rm=new WeakMap,Fn=new WeakMap,Wa=new WeakMap,T_=new WeakSet,c$=function(e){return{key:yr(this,Wa,"f").createParameter(e.key,F.linearInteger(0,11),E.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:yr(this,Wa,"f").createParameter(e.scale,F.linearInteger(0,7),E.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:yr(this,Wa,"f").createParameter(e.amount,F.unipolar(),E.percent(),"Amount"),retune:yr(this,Wa,"f").createParameter(e.retune,F.unipolar(),E.percent(),"Retune"),smooth:yr(this,Wa,"f").createParameter(e.smooth,F.unipolar(),E.percent(),"Smooth"),shift:yr(this,Wa,"f").createParameter(e.shift,F.linear(-12,12),E.numeric({unit:"st"}),"Shift")}};var D_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},R_,Cm,En,Ss,u$,Uy=class{constructor(e,r){R_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Crusher,Cm.set(this,void 0),En.set(this,void 0),Ss.set(this,void 0),D_(this,Cm,e,"f"),D_(this,En,r,"f"),D_(this,Ss,new le(Tr(this,Cm,"f")),"f"),this.namedParameter=Tr(this,R_,"m",u$).call(this,r)}get box(){return Tr(this,En,"f")}get uuid(){return Tr(this,En,"f").address.uuid}get address(){return Tr(this,En,"f").address}get indexField(){return Tr(this,En,"f").index}get labelField(){return Tr(this,En,"f").label}get enabledField(){return Tr(this,En,"f").enabled}get minimizedField(){return Tr(this,En,"f").minimized}get host(){return Tr(this,En,"f").host}deviceHost(){return Tr(this,Cm,"f").boxAdapters.adapterFor(Tr(this,En,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Tr(this,Ss,"f").terminate()}};Cm=new WeakMap,En=new WeakMap,Ss=new WeakMap,R_=new WeakSet,u$=function(e){return{crush:Tr(this,Ss,"f").createParameter(e.crush,F.unipolar(),E.percent(),"Crush"),bits:Tr(this,Ss,"f").createParameter(e.bits,F.linearInteger(1,16),E.numeric(),"Bits"),boost:Tr(this,Ss,"f").createParameter(e.boost,F.linear(0,24),E.decible,"Boost"),mix:Tr(this,Ss,"f").createParameter(e.mix,F.exponential(.001,1),E.percent(),"Mix")}};var C_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ni=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},z_,zm,Sn,Md,d$,jy=class{constructor(e,r){z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Fold,zm.set(this,void 0),Sn.set(this,void 0),Md.set(this,void 0),C_(this,zm,e,"f"),C_(this,Sn,r,"f"),C_(this,Md,new le(ni(this,zm,"f")),"f"),this.namedParameter=ni(this,z_,"m",d$).call(this,r)}get box(){return ni(this,Sn,"f")}get uuid(){return ni(this,Sn,"f").address.uuid}get address(){return ni(this,Sn,"f").address}get indexField(){return ni(this,Sn,"f").index}get labelField(){return ni(this,Sn,"f").label}get enabledField(){return ni(this,Sn,"f").enabled}get minimizedField(){return ni(this,Sn,"f").minimized}get host(){return ni(this,Sn,"f").host}deviceHost(){return ni(this,zm,"f").boxAdapters.adapterFor(ni(this,Sn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){ni(this,Md,"f").terminate()}};zm=new WeakMap,Sn=new WeakMap,Md=new WeakMap,z_=new WeakSet,d$=function(e){return{drive:ni(this,Md,"f").createParameter(e.drive,F.linear(0,30),E.decible,"Drive"),volume:ni(this,Md,"f").createParameter(e.volume,F.linear(-18,0),E.decible,"Volume")}};var Ky=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},pr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Om,Vm,Pn,$d,Nd,Wy=class{constructor(e,r){Om.set(this,new J),this.type="instrument",this.accepts="midi",this.manualUrl=ne.MIDIOutput,Vm.set(this,void 0),Pn.set(this,void 0),$d.set(this,void 0),Nd.set(this,void 0),Ky(this,Vm,e,"f"),Ky(this,Pn,r,"f"),Ky(this,$d,new Pr,"f"),Ky(this,Nd,pr(this,Om,"f").own(new le(pr(this,Vm,"f"))),"f"),pr(this,Om,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>pr(this,Nd,"f").createParameter(Te(n,il).value,F.unipolar(),E.percent({fractionDigits:1}),"",0)),onRemoved:(({box:n})=>pr(this,Nd,"f").removeParameter(Te(n,il).value.address))}),pr(this,Pn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>pr(this,$d,"f").clear(),some:({box:i})=>pr(this,$d,"f").wrap(Te(i,Zo))})))}get box(){return pr(this,Pn,"f")}get uuid(){return pr(this,Pn,"f").address.uuid}get address(){return pr(this,Pn,"f").address}get labelField(){return pr(this,Pn,"f").label}get iconField(){return pr(this,Pn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return pr(this,Pn,"f").enabled}get minimizedField(){return pr(this,Pn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return pr(this,Nd,"f")}get midiDevice(){return pr(this,$d,"f")}deviceHost(){return pr(this,Vm,"f").boxAdapters.adapterFor(pr(this,Pn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pr(this,Om,"f").terminate()}};Om=new WeakMap,Vm=new WeakMap,Pn=new WeakMap,$d=new WeakMap,Nd=new WeakMap;var Ly=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},O_,Um,Mn,La,jm,p$,Zy=class{constructor(e,r){O_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ne.Velocity,Um.set(this,void 0),Mn.set(this,void 0),La.set(this,void 0),jm.set(this,void 0),Ly(this,Um,e,"f"),Ly(this,Mn,r,"f"),Ly(this,La,new le(Xt(this,Um,"f")),"f"),Ly(this,jm,Qh.create(),"f"),this.namedParameter=Xt(this,O_,"m",p$).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:c}=this.namedParameter;Xt(this,jm,"f").setSeed(a.valueAt(e)+e);let d=r+(n.valueAt(e)-r)*i.valueAt(e),f=(Xt(this,jm,"f").uniform()*2-1)*o.valueAt(e),v=s.valueAt(e),h=c.valueAt(e);return r*(1-h)+GP(d+f+v)*h}get box(){return Xt(this,Mn,"f")}get uuid(){return Xt(this,Mn,"f").address.uuid}get address(){return Xt(this,Mn,"f").address}get indexField(){return Xt(this,Mn,"f").index}get labelField(){return Xt(this,Mn,"f").label}get enabledField(){return Xt(this,Mn,"f").enabled}get minimizedField(){return Xt(this,Mn,"f").minimized}get host(){return Xt(this,Mn,"f").host}deviceHost(){return Xt(this,Um,"f").boxAdapters.adapterFor(Xt(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Xt(this,La,"f").terminate()}};Um=new WeakMap,Mn=new WeakMap,La=new WeakMap,jm=new WeakMap,O_=new WeakSet,p$=function(e){return{magnetPosition:Xt(this,La,"f").createParameter(e.magnetPosition,F.unipolar(),E.percent(),"Position"),magnetStrength:Xt(this,La,"f").createParameter(e.magnetStrength,F.unipolar(),E.percent(),"Strength"),randomSeed:Xt(this,La,"f").createParameter(e.randomSeed,F.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Xt(this,La,"f").createParameter(e.randomAmount,F.unipolar(),E.percent(),"Amount"),offset:Xt(this,La,"f").createParameter(e.offset,F.bipolar(),E.percent(),"Offset"),mix:Xt(this,La,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var V_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},U_,j_,Km,$n,Za,f$,ic=class{constructor(e,r){U_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Tidal,Km.set(this,void 0),$n.set(this,void 0),Za.set(this,void 0),V_(this,Km,e,"f"),V_(this,$n,r,"f"),V_(this,Za,new le(wr(this,Km,"f")),"f"),this.namedParameter=wr(this,U_,"m",f$).call(this,r)}get box(){return wr(this,$n,"f")}get uuid(){return wr(this,$n,"f").address.uuid}get address(){return wr(this,$n,"f").address}get indexField(){return wr(this,$n,"f").index}get labelField(){return wr(this,$n,"f").label}get enabledField(){return wr(this,$n,"f").enabled}get minimizedField(){return wr(this,$n,"f").minimized}get host(){return wr(this,$n,"f").host}deviceHost(){return wr(this,Km,"f").boxAdapters.adapterFor(wr(this,$n,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wr(this,Za,"f").terminate()}};j_=ic,Km=new WeakMap,$n=new WeakMap,Za=new WeakMap,U_=new WeakSet,f$=function(e){let{RateFractions:r,RateStringMapping:n}=j_;return{slope:wr(this,Za,"f").createParameter(e.slope,F.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:wr(this,Za,"f").createParameter(e.symmetry,F.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:wr(this,Za,"f").createParameter(e.rate,F.values(r.map((i,a)=>a)),n,"Rate",0),depth:wr(this,Za,"f").createParameter(e.depth,F.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:wr(this,Za,"f").createParameter(e.offset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:wr(this,Za,"f").createParameter(e.channelOffset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};ic.RateFractions=Co.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();ic.RateStringMapping=E.indices("",j_.RateFractions.map(([t,e])=>`${t}/${e}`));var K_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ft=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},W_,Wm,ai,Si,m$,Gy=class{constructor(e,r){W_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Vocoder,Wm.set(this,void 0),ai.set(this,void 0),Si.set(this,void 0),K_(this,Wm,e,"f"),K_(this,ai,r,"f"),K_(this,Si,new le(Ft(this,Wm,"f")),"f"),this.namedParameter=Ft(this,W_,"m",m$).call(this,r)}get box(){return Ft(this,ai,"f")}get uuid(){return Ft(this,ai,"f").address.uuid}get address(){return Ft(this,ai,"f").address}get indexField(){return Ft(this,ai,"f").index}get labelField(){return Ft(this,ai,"f").label}get enabledField(){return Ft(this,ai,"f").enabled}get minimizedField(){return Ft(this,ai,"f").minimized}get host(){return Ft(this,ai,"f").host}get sideChain(){return Ft(this,ai,"f").sideChain}get modulatorSpectrum(){return Ft(this,ai,"f").address.append(4094)}get carrierSpectrum(){return Ft(this,ai,"f").address.append(4095)}deviceHost(){return Ft(this,Wm,"f").boxAdapters.adapterFor(Ft(this,ai,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ft(this,Si,"f").terminate()}};Wm=new WeakMap,ai=new WeakMap,Si=new WeakMap,W_=new WeakSet,m$=function(e){let r=F.exponential(20,2e4),n=E.numeric({unit:"Hz",fractionDigits:0}),i=F.exponential(1,60),a=E.numeric({fractionDigits:1});return{carrierMinFreq:Ft(this,Si,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:Ft(this,Si,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:Ft(this,Si,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:Ft(this,Si,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:Ft(this,Si,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:Ft(this,Si,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:Ft(this,Si,"f").createParameter(e.envAttack,F.exponential(.1,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:Ft(this,Si,"f").createParameter(e.envRelease,F.exponential(1,1e3),E.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:Ft(this,Si,"f").createParameter(e.gain,F.linear(-20,20),E.decible,"Gain"),mix:Ft(this,Si,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var L_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Z_,Lm,Nn,Zr,h$,Hy=class{constructor(e,r){Z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.DattorroReverb,Lm.set(this,void 0),Nn.set(this,void 0),Zr.set(this,void 0),L_(this,Lm,e,"f"),L_(this,Nn,r,"f"),L_(this,Zr,new le(Mt(this,Lm,"f")),"f"),this.namedParameter=Mt(this,Z_,"m",h$).call(this,r)}get box(){return Mt(this,Nn,"f")}get uuid(){return Mt(this,Nn,"f").address.uuid}get address(){return Mt(this,Nn,"f").address}get indexField(){return Mt(this,Nn,"f").index}get labelField(){return Mt(this,Nn,"f").label}get enabledField(){return Mt(this,Nn,"f").enabled}get minimizedField(){return Mt(this,Nn,"f").minimized}get host(){return Mt(this,Nn,"f").host}deviceHost(){return Mt(this,Lm,"f").boxAdapters.adapterFor(Mt(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Mt(this,Zr,"f").terminate()}};Lm=new WeakMap,Nn=new WeakMap,Zr=new WeakMap,Z_=new WeakSet,h$=function(e){return{preDelay:Mt(this,Zr,"f").createParameter(e.preDelay,F.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Mt(this,Zr,"f").createParameter(e.bandwidth,F.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:Mt(this,Zr,"f").createParameter(e.inputDiffusion1,F.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:Mt(this,Zr,"f").createParameter(e.inputDiffusion2,F.unipolar(),E.percent(),"Tank 2"),decay:Mt(this,Zr,"f").createParameter(e.decay,F.unipolar(),E.percent(),"Decay"),decayDiffusion1:Mt(this,Zr,"f").createParameter(e.decayDiffusion1,F.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:Mt(this,Zr,"f").createParameter(e.decayDiffusion2,F.unipolar(),E.percent(),"Tank 2"),damping:Mt(this,Zr,"f").createParameter(e.damping,F.unipolar(),E.percent(),"Damping"),excursionRate:Mt(this,Zr,"f").createParameter(e.excursionRate,F.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Mt(this,Zr,"f").createParameter(e.excursionDepth,F.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Mt(this,Zr,"f").createParameter(e.wet,F.DefaultDecibel,E.decible,"Wet"),dry:Mt(this,Zr,"f").createParameter(e.dry,F.DefaultDecibel,E.decible,"Dry")}};var g$=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},G_,Mo,Bd=class{constructor(e,r){G_.set(this,void 0),Mo.set(this,void 0),g$(this,G_,e,"f"),g$(this,Mo,r,"f")}get box(){return kd(this,Mo,"f")}get uuid(){return kd(this,Mo,"f").address.uuid}get address(){return kd(this,Mo,"f").address}get labelField(){return kd(this,Mo,"f").label}get modelField(){return kd(this,Mo,"f").model}getModelJson(){return kd(this,Mo,"f").model.getValue()}terminate(){}};G_=new WeakMap,Mo=new WeakMap;var H_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Kt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},q_,Id,Dr,nc,v$,qy=class{constructor(e,r){q_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.NeuralAmp,Id.set(this,void 0),Dr.set(this,void 0),nc.set(this,void 0),H_(this,Id,e,"f"),H_(this,Dr,r,"f"),H_(this,nc,new le(Kt(this,Id,"f")),"f"),this.namedParameter=Kt(this,q_,"m",v$).call(this,r)}get box(){return Kt(this,Dr,"f")}get uuid(){return Kt(this,Dr,"f").address.uuid}get address(){return Kt(this,Dr,"f").address}get indexField(){return Kt(this,Dr,"f").index}get labelField(){return Kt(this,Dr,"f").label}get enabledField(){return Kt(this,Dr,"f").enabled}get minimizedField(){return Kt(this,Dr,"f").minimized}get host(){return Kt(this,Dr,"f").host}get modelField(){return Kt(this,Dr,"f").model}get monoField(){return Kt(this,Dr,"f").mono}get spectrum(){return Kt(this,Dr,"f").address.append(4095)}getModelAdapter(){let e=Kt(this,Dr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Kt(this,Id,"f").boxAdapters.adapterFor(e.unwrap().box,Bd))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Kt(this,Dr,"f").modelJson.getValue()}deviceHost(){return Kt(this,Id,"f").boxAdapters.adapterFor(Kt(this,Dr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Kt(this,nc,"f").terminate()}};Id=new WeakMap,Dr=new WeakMap,nc=new WeakMap,q_=new WeakSet,v$=function(e){return{inputGain:Kt(this,nc,"f").createParameter(e.inputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Kt(this,nc,"f").createParameter(e.outputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Kt(this,nc,"f").createParameter(e.mix,F.linear(0,1),E.percent(),"Mix")}};var J_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Gr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Y_,Zm,kn,ac,x$,Jy=class{constructor(e,r){Y_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Waveshaper,Zm.set(this,void 0),kn.set(this,void 0),ac.set(this,void 0),J_(this,Zm,e,"f"),J_(this,kn,r,"f"),J_(this,ac,new le(Gr(this,Zm,"f")),"f"),this.namedParameter=Gr(this,Y_,"m",x$).call(this,r)}get box(){return Gr(this,kn,"f")}get uuid(){return Gr(this,kn,"f").address.uuid}get address(){return Gr(this,kn,"f").address}get indexField(){return Gr(this,kn,"f").index}get labelField(){return Gr(this,kn,"f").label}get enabledField(){return Gr(this,kn,"f").enabled}get minimizedField(){return Gr(this,kn,"f").minimized}get host(){return Gr(this,kn,"f").host}deviceHost(){return Gr(this,Zm,"f").boxAdapters.adapterFor(Gr(this,kn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Gr(this,ac,"f").terminate()}};Zm=new WeakMap,kn=new WeakMap,ac=new WeakMap,Y_=new WeakSet,x$=function(e){return{inputGain:Gr(this,ac,"f").createParameter(e.inputGain,F.linear(0,40),E.decible,"Input"),outputGain:Gr(this,ac,"f").createParameter(e.outputGain,F.linear(-24,24),E.decible,"Output"),mix:Gr(this,ac,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var Yy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gm,Hm,Bn,qm,Xy,Qy=class{constructor(e,r){Gm.set(this,new J),this.type="audio-effect",this.accepts="audio",this.manualUrl=ne.Werkstatt,Hm.set(this,void 0),Bn.set(this,void 0),qm.set(this,void 0),Xy.set(this,void 0),Yy(this,Hm,e,"f"),Yy(this,Bn,r,"f"),Yy(this,qm,Rr(this,Gm,"f").own(new le(Rr(this,Hm,"f"))),"f");let{terminable:n,codeChanged:i}=Fr.subscribeScriptParams(Rr(this,qm,"f"),r.code,r.parameters);Rr(this,Gm,"f").own(n),Yy(this,Xy,i,"f")}get box(){return Rr(this,Bn,"f")}get uuid(){return Rr(this,Bn,"f").address.uuid}get address(){return Rr(this,Bn,"f").address}get indexField(){return Rr(this,Bn,"f").index}get labelField(){return Rr(this,Bn,"f").label}get enabledField(){return Rr(this,Bn,"f").enabled}get minimizedField(){return Rr(this,Bn,"f").minimized}get host(){return Rr(this,Bn,"f").host}get parameters(){return Rr(this,qm,"f")}get codeChanged(){return Rr(this,Xy,"f")}deviceHost(){return Rr(this,Hm,"f").boxAdapters.adapterFor(Rr(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Rr(this,Gm,"f").terminate()}};Gm=new WeakMap,Hm=new WeakMap,Bn=new WeakMap,qm=new WeakMap,Xy=new WeakMap;var ue=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},aD,ce,oD,sD,lD,cD;ce=new WeakMap,oD=new WeakMap,sD=new WeakMap,lD=new WeakMap,aD=new WeakSet,cD=function(e){return Ue(e.accept({visitArpeggioDeviceBox:r=>new Yl(ue(this,ce,"f"),r),visitAudioBusBox:r=>new Ti(ue(this,ce,"f"),r),visitAudioClipBox:r=>new gu(ue(this,ce,"f"),r),visitAudioFileBox:r=>new Un(ue(this,ce,"f"),r),visitAudioTimeStretchBox:r=>new Sa(ue(this,ce,"f"),r),visitAudioPitchStretchBox:r=>new Ea(ue(this,ce,"f"),r),visitAudioSignalsmithBox:r=>new Pa(ue(this,ce,"f"),r),visitTransientMarkerBox:r=>new ou(r),visitWarpMarkerBox:r=>new Aa(ue(this,ce,"f"),r),visitApparatDeviceBox:r=>new gy(ue(this,ce,"f"),r),visitAudioRegionBox:r=>new Bu(ue(this,ce,"f"),r),visitAudioUnitBox:r=>new un(ue(this,ce,"f"),r),visitAuxSendBox:r=>new Lu(ue(this,ce,"f"),r),visitMaximizerDeviceBox:r=>new Cy(ue(this,ce,"f"),r),visitCompressorDeviceBox:r=>new zy(ue(this,ce,"f"),r),visitGateDeviceBox:r=>new Oy(ue(this,ce,"f"),r),visitAutotuneDeviceBox:r=>new Vy(ue(this,ce,"f"),r),visitCrusherDeviceBox:r=>new Uy(ue(this,ce,"f"),r),visitDattorroReverbDeviceBox:r=>new Hy(ue(this,ce,"f"),r),visitDelayDeviceBox:r=>new qn(ue(this,ce,"f"),r),visitDeviceInterfaceKnobBox:r=>new nd(ue(this,ce,"f"),r),visitTidalDeviceBox:r=>new ic(ue(this,ce,"f"),r),visitFoldDeviceBox:r=>new jy(ue(this,ce,"f"),r),visitGrooveShuffleBox:r=>new za(ue(this,ce,"f"),r),visitMarkerBox:r=>new ps(ue(this,ce,"f"),r),visitSignatureEventBox:r=>new Ol(ue(this,ce,"f"),r),visitMIDIOutputDeviceBox:r=>new Wy(ue(this,ce,"f"),r),visitModularAudioInputBox:r=>new rd(ue(this,ce,"f"),r),visitModularAudioOutputBox:r=>new Qu(ue(this,ce,"f"),r),visitModularBox:r=>new vs(ue(this,ce,"f"),r),visitModularDeviceBox:r=>new od(ue(this,ce,"f"),r),visitModuleConnectionBox:r=>new gs(ue(this,ce,"f"),r),visitModuleDelayBox:r=>new Xu(ue(this,ce,"f"),r),visitModuleGainBox:r=>new ed(ue(this,ce,"f"),r),visitModuleMultiplierBox:r=>new td(ue(this,ce,"f"),r),visitNeonDeviceBox:r=>new vy(ue(this,ce,"f"),r),visitNanoDeviceBox:r=>new xy(ue(this,ce,"f"),r),visitNeuralAmpDeviceBox:r=>new qy(ue(this,ce,"f"),r),visitNeuralAmpModelBox:r=>new Bd(ue(this,ce,"f"),r),visitNoteClipBox:r=>new wu(ue(this,ce,"f"),r),visitNoteEventBox:r=>new yl(ue(this,ce,"f"),r),visitNoteEventCollectionBox:r=>new an(ue(this,ce,"f"),r),visitNoteRegionBox:r=>new Tu(ue(this,ce,"f"),r),visitPitchDeviceBox:r=>new uy(ue(this,ce,"f"),r),visitPlayfieldDeviceBox:r=>new xd(ue(this,ce,"f"),r),visitPlayfieldSampleBox:r=>new vd(ue(this,ce,"f"),r),visitAudioEffectCompositeBox:r=>new Sy(ue(this,ce,"f"),r),visitAudioEffectCompositeCellBox:r=>new _d(ue(this,ce,"f"),r),visitStereoCompositeBox:r=>new Py(ue(this,ce,"f"),r),visitFrequencySplitBox:r=>new Mm(ue(this,ce,"f"),r),visitRevampDeviceBox:r=>new _x(ue(this,ce,"f"),r),visitReverbDeviceBox:r=>new bx(ue(this,ce,"f"),r),visitRootBox:r=>new oy(ue(this,ce,"f"),r),visitSoundfontDeviceBox:r=>new Ty(ue(this,ce,"f"),r),visitSoundfontFileBox:r=>new Ry(ue(this,ce,"f"),r),visitSpielwerkDeviceBox:r=>new fy(ue(this,ce,"f"),r),visitStereoToolDeviceBox:r=>new _y(ue(this,ce,"f"),r),visitTapeDeviceBox:r=>new sy(ue(this,ce,"f"),r),visitTimelineBox:r=>new Ra(ue(this,ce,"f"),r),visitTrackBox:r=>new or(ue(this,ce,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Ny(ue(this,ce,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new By(ue(this,ce,"f"),r),visitValueClipBox:r=>new Qo(ue(this,ce,"f"),r),visitValueEventBox:r=>new po(ue(this,ce,"f"),r),visitValueEventCollectionBox:r=>new $r(ue(this,ce,"f"),r),visitValueRegionBox:r=>new yo(ue(this,ce,"f"),r),visitVaporisateurDeviceBox:r=>new ly(ue(this,ce,"f"),r),visitVocoderDeviceBox:r=>new Gy(ue(this,ce,"f"),r),visitWaveshaperDeviceBox:r=>new Jy(ue(this,ce,"f"),r),visitWerkstattDeviceBox:r=>new Qy(ue(this,ce,"f"),r),visitVelocityDeviceBox:r=>new Zy(ue(this,ce,"f"),r),visitZeitgeistDeviceBox:r=>new My(ue(this,ce,"f"),r)}),`Could not find factory for ${e}`)};var Ga;(function(t){t.PEAKS=De.compose(B.Lowest).append(0),t.SPECTRUM=De.compose(B.Lowest).append(1),t.WAVEFORM=De.compose(B.Lowest).append(2),t.STEREO=De.compose(B.Lowest).append(3),t.GONIO=De.compose(B.Lowest).append(4),t.LOUDNESS=De.compose(B.Lowest).append(5),t.HEAP=De.compose(B.Lowest).append(6)})(Ga||(Ga={}));var y$;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>W(r.stems)?Object.keys(r.stems).length+(W(r.metronome?.stem)?1:0):1}),t.isMetronomeAudible=e=>e.match({none:()=>!1,some:r=>W(r.stems)?W(r.metronome?.stem):r.metronome?.includeInMixdown===!0}),t.stemFileNames=e=>{let r=Object.values(e.stems??{}).map(({fileName:i})=>i),n=e.metronome?.stem;return W(n)&&r.push(n.fileName),r},t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{let r=e.metronome?.stem;if(!W(e.stems)&&!W(r))return;let n=e.stems??{},i=new Map,a=o=>{let s=i.get(o)??0,c=o;for(;i.has(c);)s++,c=`${o} ${s}`;return i.set(o,s),i.set(c,1),c};Object.keys(n).forEach(o=>{let s=n[o];s.fileName=a(t.sanitizeFileName(s.fileName))}),W(r)&&(r.fileName=a(t.sanitizeFileName(r.fileName)))}})(y$||(y$={}));var ew=512,w$=Ni.createBuilder({position:Ni.float,bpm:Ni.float,playbackTimestamp:Ni.float,countInBeatsRemaining:Ni.float,isPlaying:Ni.bool,isCountingIn:Ni.bool,isRecording:Ni.bool,perfIndex:Ni.int32,perfBuffer:Ni.floats(ew)});var b$;(function(t){t.store=(e,r,n)=>{if(n==="")return j("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof Cn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};x0(i)?a(i):Cn.create(e.graph,B.generate(),a)},t.read=(e,r)=>{if(r==="")return j("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof Cn&&i.origin.getValue()===r);if(x0(n)){let{status:i,value:a,error:o}=Lt(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return j("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof Cn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return j("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=B.newSet(s=>s.uuid),a=s=>{let{status:c,value:d,error:f}=Lt(()=>JSON.parse(s.value.getValue()));c==="success"?n(b.wrap(d)):(console.warn(f),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof Cn)||s.origin.getValue()!==r)return;let c=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:c})},onRemoved:({box:s})=>{if(!(s instanceof Cn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(b.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(b$||(b$={}));var uD,dD,pD,fD;uD=new WeakMap,dD=new WeakMap,pD=new WeakMap,fD=new WeakMap;var Ps;(function(t){let e;(function(r){r[r.NoteOn=144]="NoteOn",r[r.NoteOff=128]="NoteOff",r[r.PitchBend=224]="PitchBend",r[r.Controller=176]="Controller",r[r.Start=250]="Start",r[r.Continue=251]="Continue",r[r.Stop=252]="Stop",r[r.Clock=248]="Clock",r[r.Position=242]="Position"})(e=t.Command||(t.Command={})),t.readCommand=r=>r[0]&240,t.readChannel=r=>r[0]&15,t.readParam1=r=>r.length>1?r[1]&255:0,t.readParam2=r=>r.length>2?r[2]&255:0,t.readPitch=r=>r[1],t.readVelocity=r=>r[2]/127,t.isNoteOn=r=>t.readCommand(r)===e.NoteOn&&t.readVelocity(r)>0,t.isNoteOff=r=>t.readCommand(r)===e.NoteOff||t.readCommand(r)===e.NoteOn&&t.readVelocity(r)===0,t.isPitchWheel=r=>t.readCommand(r)===e.PitchBend,t.isController=r=>t.readCommand(r)===e.Controller,t.isClock=r=>r[0]===e.Clock,t.isStart=r=>r[0]===e.Start,t.isContinue=r=>r[0]===e.Continue,t.isStop=r=>r[0]===e.Stop,t.isPosition=r=>r[0]===e.Position,t.asPitchBend=r=>{let n=t.readParam1(r)&127,i=t.readParam2(r)&127,a=n|i<<7;return 8192>=a?a/8192-1:(a-8191)/8192},t.asValue=r=>{let n=t.readParam2(r);return n>64?.5+(n-63)/128:n<64?n/128:.5},t.Clock=new Uint8Array([e.Clock]),t.Start=new Uint8Array([e.Start]),t.Continue=new Uint8Array([e.Continue]),t.Stop=new Uint8Array([e.Stop]),t.noteOn=(r,n,i)=>new Uint8Array([e.NoteOn|r,n,i]),t.noteOff=(r,n)=>new Uint8Array([e.NoteOff|r,n,0]),t.control=(r,n,i)=>new Uint8Array([e.Controller|r,n&127,i&127]),t.position=(r,n)=>new Uint8Array([e.Position,r&127,n&127]),t.positionInPPQN=r=>{let n=Math.floor(r/96),i=n&127,a=n>>7&127;return new Uint8Array([e.Position,i,a])},t.accept=(r,n)=>{Yi(r)||(t.isNoteOn(r)?$(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?$(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?$(n.pitchBend,t.asPitchBend(r)):t.isController(r)?$(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?$(n.clock):t.isStart(r)?$(n.start):t.isContinue(r)?$(n.continue):t.isStop(r)?$(n.stop):t.isPosition(r)&&$(n.songPos,t.readParam1(r)|t.readParam2(r)<<7))},t.debug=r=>r===null?"null":t.isNoteOn(r)?`NoteOn #${t.readChannel(r)} ${t.readPitch(r)} : ${t.readVelocity(r).toFixed(2)}`:t.isNoteOff(r)?`NoteOff #${t.readChannel(r)} ${t.readPitch(r)}`:t.isPitchWheel(r)?`PitchWheel #${t.readChannel(r)} ${t.asPitchBend(r)}`:t.isController(r)?`Control #${t.readChannel(r)} ${t.asValue(r)}`:t.isClock(r)?"Clock":t.isStart(r)?"Start":t.isContinue(r)?"Continue":t.isStop(r)?"Stop":t.isPosition(r)?`SongPosition ${t.readParam1(r)|t.readParam2(r)<<7}`:"Unknown"})(Ps||(Ps={}));var $o;(function(t){t.on=(e,r,n)=>({type:"note-on",uuid:e,pitch:r,velocity:n}),t.off=(e,r)=>({type:"note-off",uuid:e,pitch:r}),t.audition=(e,r,n,i)=>({type:"note-audition",uuid:e,pitch:r,duration:n,velocity:i}),t.isOn=e=>e.type==="note-on",t.isOff=e=>e.type==="note-off",t.isAudition=e=>e.type==="note-audition",t.fromEvent=(e,r)=>{let n=e.data;if(Ps.isNoteOn(n)){let i=Ps.readPitch(n),a=Ps.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Ps.isNoteOff(n)){let i=Ps.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return j("Unknown MIDI event")}})($o||($o={}));var _$;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e($o.on(r,n,i)),{terminate:()=>{a&&(e($o.off(r,n)),a=!1)}}}})(_$||(_$={}));var A$=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},mD,hD,F$,E$,gD,vD;hD=new WeakMap,F$=new WeakMap,E$=new WeakMap,gD=new WeakMap,mD=new WeakSet,vD=function(e,r){return e.subscribeIntegers(r,n=>{A$(this,F$,"f").replace(n.buffer)&&A$(this,E$,"f").notify(this)})};var xD,yD,wD,bD,_D,AD;xD=new WeakMap,yD=new WeakMap,wD=new WeakMap,bD=new WeakMap,_D=new WeakMap,AD=new WeakMap;var oa={isClipBox:t=>t.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:t=>t.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??j("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var tw={min:30,max:1e3,default:120};var rw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Er.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Er.err("Denominator must be a power of two between 1 and 32"):Er.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?He(e,tw.min,tw.max):tw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?He(e,xx.min,xx.max):xx.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of de.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>oa.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof Lo&&i.timeBase.getValue()===Jr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(rw||(rw={}));var S$;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return rw.isTimeSignatureValid(i,a)}})(S$||(S$={}));var P$;(function(t){t.reader=(e,r)=>{let n=`
4
4
  onmessage = (event) => {