@opendaw/studio-core-wasm 0.0.4 → 0.0.5

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,6 +1,6 @@
1
- var vB=Object.defineProperty;var Va=(t,e)=>{for(var r in e)vB(t,r,{get:e[r],enumerable:!0})};var CE=globalThis;CE.self??=globalThis;CE.location??={href:"/"};var W=t=>t!=null,ta=t=>t===null,zE=t=>t!==null,fh=t=>t===void 0,Sb=t=>t!==void 0,Eb=t=>t==null,Pb=(t,e)=>t!=null?e(t):void 0,ze=(t,e="asDefined failed")=>t??V(ra(e)),mt=(t,e)=>t instanceof e,Ie=(t,e)=>t instanceof e?t:V(`${t} is not instance of ${e}`),$b=(t,e)=>{t instanceof e||V(`${t} is not instance of ${e}`)};var ra=t=>t instanceof Function?t():t;var P=(t,...e)=>t?.apply(null,e),mh=t=>W(t)&&typeof t=="object";var hh=t=>{throw new Error(`Unhandled ${t}`)},V=t=>{throw typeof t=="string"?new Error(t):t},te=(t,e)=>t?void 0:V(ra(e));var Gd=t=>new Proxy({},{get(){return V(t)}});var Ab=class{value;status="success";constructor(e){this.value=e}error=Gd("Cannot access error when succeeded")},Fb=class{error;status="failure";constructor(e){this.error=e}value=Gd("Cannot access value when failed")},Ct=t=>{try{return new Ab(t())}catch(e){return new Fb(e)}};var ja=(t,e)=>Object.keys(e).length===0?V("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:V(`Invalid enum value: ${String(t)}`),Hd=()=>{};var kb;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(kb||(kb={}));var ce=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)=>ze(e.at(0),r);static getLast=(e,r)=>ze(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>ze(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 V(`${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=kb.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=ze(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=>V(W(r)?ra(r):"unwrap failed");unwrapOrElse=r=>ra(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)=>ra(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>V(ra(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var wr;(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=()=>V(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>ra(n);unwrapOrElse=r=>ra(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)})(wr||(wr={}));var ht;(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,u=n(i(e[s]),r);if(u===0)return s;u<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)]})(ht||(ht={}));var gh=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 qt=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=u=>(u+e/30)%12,a=r*Math.min(n,1-n),o=u=>n-a*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),s=u=>Math.round(u*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),u=(o+s)/2,d=0,m=0;if(o!==s){let x=o-s;switch(m=u>.5?x/(2-o-s):x/(o+s),o){case n:d=((i-a)/x+(i<a?6:0))*60;break;case i:d=((a-n)/x+2)*60;break;case a:d=((n-i)/x+4)*60;break}}return{h:d,s:m,l:u}}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),u=i+(o-i)*r,d=a+(s-a)*r,m=(Math.atan2(d,u)/n+360)%360,x=Math.sqrt(u*u+d*d),g=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(m,x,g,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 bo=(t,e)=>t-e;var dC=Math.PI*2,pC=Math.PI/2,fC=Math.PI/4,mC=1/Math.sqrt(2),at=(t,e,r)=>Math.max(e,Math.min(t,r)),OE=t=>Math.max(0,Math.min(t,1)),UE=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),Mb=(t,e)=>Math.floor(t/e)*e;var VE=(t,e,r)=>t+(e-t)*r;var $s=(t,e)=>xB(t/e)*e,xB=t=>t-Math.floor(t),vh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var Nb=(t,e)=>t*e/((2*e-1)*(t-1)+e);var Jt;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},u)=>t.normalizedAt(u/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=at(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=at(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),u=a-s*i.y0;return{m:s,q:u}};function*r(i,a,o,s){let{m:u,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let m=0,x=o;m<a;m++)yield x=u*x+d}t.walk=r,t.run=(i,a,o,s,u)=>{let{m:d,q:m}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let x=0,g=o;x<a;x++)u(g=d*g+m)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let m=0,x=0;m<a;m++)yield x=d*x+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)})(Jt||(Jt={}));var ia=new DataView(new ArrayBuffer(8)),br;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ia.setInt8(0,e),ia.getInt8(0)),t.toShort=e=>(ia.setInt16(0,e),ia.getInt16(0)),t.toInt=e=>(ia.setInt32(0,e),ia.getInt32(0))})(br||(br={}));var Ka;(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=>(ia.setFloat32(0,o),ia.getFloat32(0))})(Ka||(Ka={}));var jE;(function(t){t.floatToIntBits=e=>{let r=Ka.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 Ka.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 Ka.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(jE||(jE={}));var xh;(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=>(ia.setFloat64(0,o),ia.getFloat64(0))})(xh||(xh={}));var Xt=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){te(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 Yt=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?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`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(vh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},uu=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}},yh=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(Ka.floatToIntBits(e))}writeDouble(e){this.writeLong(xh.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(Xt.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},rt=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?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`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 yB=t=>W(t)?t.value!==void 0?"value":t.get!==void 0?"get":V(`Cannot resolve method key of ${t}`):V("Cannot resolve method key of undefined descriptor"),cu=(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 V(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=yB(r),i=ze(r[n]);return{[n]:function(...a){if(a.length>0)return V("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 Wa;(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})(Wa||(Wa={}));var Qt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?P(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 qd=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var Jd=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var wh=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 Xt.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return Xt.includes(this.map.keys(),e)}containsValue(e){return Xt.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??Jd.empty()}isEmpty(){return this.keyCount()===0}add(e,r){qd.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=qd.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??Jd.empty()}forEach(e){Xt.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:Hd},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),X=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:()=>ce.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 bh;(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 V(`'${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)})(bh||(bh={}));var KE;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return pe.Empty}catchupAndSubscribe(r){return r(this),pe.Empty}}})(KE||(KE={}));var WE;(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)}}})(WE||(WE={}));var _r=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 Wi=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 Ib=class{#e;#t;constructor(e,r){te(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 at(e,this.#e,this.#t)}floating(){return!0}},Bb=class{#e;#t;#r;constructor(e,r){this.#e=at(Math.round(e),br.MIN_VALUE,br.MAX_VALUE),this.#t=at(Math.round(r),br.MIN_VALUE,br.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(at(e,0,1)*this.#r)}clamp(e){return at(Math.round(e),this.#e,this.#t)}floating(){return!1}},Tb=class{#e;#t;constructor(e,r){te(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}},_h=class{#e;#t;#r;#i;constructor(e,r,n){te(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}},Db=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?V(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(at(e,0,1)*(this.#e.length-1));return r>-1?ze(this.#e.at(r),`Could not find value for ${e}`):V(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},Rb=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,u=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(u*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-u/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}},E;(function(t){t.linear=(a,o)=>new Ib(a,o),t.linearInteger=(a,o)=>new Bb(a,o),t.exponential=(a,o)=>new Tb(a,o),t.power=(a,o,s)=>new _h(a,o,s),t.powerByCenter=(a,o,s)=>{let u=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(u))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new _h(u,o,s)},t.values=a=>new Db(a),t.decibel=(a,o,s)=>new Rb(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})(E||(E={}));var $;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:u}={})=>new e(a,o,s,u),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let u=o.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},t.values=(a,o,s)=>new class{x(u){return{unit:a,value:s.at(o.indexOf(u))??"N/A"}}y(u){let d=s.indexOf(u);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,u,d){this.#e=o??"",this.#t=s??0,this.#r=u??!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 u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?at(u/200+.5,0,1):at(u/100,0,1)};{let m=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(W(m)){let x=r.indexOf(m);if(x>-1)return{type:"explicit",value:u*Math.pow(10,(x-4)*3)}}return{type:"explicit",value:u}}}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:u}=i(o);return{value:s.toFixed(this.#t),unit:`${u}${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})})($||($={}));var du;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(du||(du={}));var Ah;(function(t){t.create=(e=252854082)=>new Cb(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return V("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let u=Math.floor(n.uniform()*(1+r))+1;e[s]=u,a+=u}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(Ah||(Ah={}));var Cb=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 _i;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,u])=>{u instanceof e?o[s]=u.initialValue():typeof u=="object"&&(o[s]=i(u))}),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(([u,d])=>{let m=s;d instanceof e?m[u]=d.read(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?d.write(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}#i(){let i=new uu;return this.write(i),i.count}}})(_i||(_i={}));var pu=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=ht.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=ht.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 V(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=ht.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):V(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=ht.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 ze(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(){ce.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=ht.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 fu=(()=>{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:Hd}),some:r=>r.progress(e)}),notify:e=>t.match({none:Hd,some:r=>r.notify(e)}),install:e=>{te(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Xd=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 hh(e)}}};var Fh;(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 V("Insufficient memory allocated.");let a=new Uint8Array(n),o=Yt.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 rt(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}}})(Fh||(Fh={}));var M;(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:V(`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=ce.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 V(`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 V("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 pu(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=>(te(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(M||(M={}));var Sh=class{#e=new X;#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 X),n=r.own(new fe),i=()=>e.slice(0,-1).reduce((s,u)=>s[u],this.#i),a=e[e.length-1],o={getValue:()=>e.reduce((s,u)=>s[u],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],u=e[a];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#a(e[a],s,n,o):u!==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 Eh=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#c;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#c=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new Ph(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=Yd.create(Yd.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.#u()}#u(){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.#c)}this.#l=0,this.#n.fill(0),this.decay=!1}};var zb=(t,e)=>Math.floor(3840/e)*t,LE=(t,e=4,r=4)=>{let n=zb(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-zb(a*e,r))%n,u=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:u,ticks:d}},ZE=(t,e)=>t*e/60*960,GE=(t,e)=>t*60/960/e,wB=(t,e)=>e*60/960/t,bB=(t,e,r)=>ZE(t/r,e),_B=(t,e,r)=>GE(t,e)*r,Me={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:zb,toParts:LE,secondsToPulses:ZE,pulsesToSeconds:GE,secondsToBpm:wB,samplesToPulses:bB,pulsesToSamples:_B,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=LE(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var na=128,$h=Me.fromSignature(1,48);var Qd;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Qd||(Qd={}));var ep;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(ep||(ep={}));var La;(function(t){t.globalToLocal=(r,n)=>$s(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{let u=r-i,d=u+a;if(u>=s||d<=o)return b.None;let m=Math.max(u,o),x=Math.min(d,s);return b.wrap({index:0,rawStart:u,rawEnd:d,regionStart:Math.max(u,r),regionEnd:Math.min(d,n),resultStart:m,resultEnd:x,resultStartValue:u<m?(m-u)/a:0,resultEndValue:d>x?(x-u)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){let u=r-i,d=Math.max(r,o),m=Math.min(n,s),x=Math.floor((d-u)/a),g=u+x*a;for(;g<m;){let w=g+a,A=Math.max(g,r),_=Math.min(w,n),C=Math.max(g,d),K=Math.min(w,m),U=g<C?(C-g)/a:0,ee=w>K?(K-g)/a:1;yield{index:x++,rawStart:g,rawEnd:w,regionStart:A,regionEnd:_,resultStart:C,resultEnd:K,resultStartValue:U,resultEndValue:ee},g=w}}t.locateLoops=e})(La||(La={}));var Ir=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 kh(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()?Wa.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?Wa.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()}},_o=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 kh(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()?Wa.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return Wa.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return Wa.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return Wa.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var kh=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=ht.leftMostMapped(this.#e,n,bo,Qd.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,ce.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(),ht.rightMostMapped(this.#e,e,bo,Qd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),ht.leftMostMapped(this.#e,e,bo,Qd.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,br.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,br.MAX_VALUE,r);i--}return this.iterate(n,br.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=du.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 Mh;(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,u=1,d=1;i>0&&e<i&&(u=Jt.normalizedAt(e/i,o));let m=r-a;if(a>0&&e>m){let x=(e-m)/a;d=1-Jt.normalizedAt(x,s)}return Math.min(u,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:u,inSlope:d,outSlope:m}=o;if(e.fill(1,0,a),s<=0&&u<=0)return;let x=i-u;if(r>=s&&n<=x)return;let g=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),A=Math.min(a,Math.ceil((w-r)/g));if(A>0){let _=r/s,C=w/s,K=Jt.walk(d,A,_,C);for(let U=0;U<A;U++)e[U]=K.next().value}}if(u>0&&n>x){let w=Math.max(r,x),A=Math.max(0,Math.floor((w-r)/g)),_=a-A;if(_>0){let C=(w-x)/u,K=(n-x)/u,U=Jt.walk(m,_,1-C,1-K);for(let ee=A;ee<a;ee++)e[ee]=Math.min(e[ee],U.next().value)}}}})(Mh||(Mh={}));var Ph=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,u=this.#i;for(let d=2;d<=this.#e;d<<=1){let m=d>>1,x=this.#e/d;for(n=0;n<this.#e;n+=d){let g=n+m;for(i=n,a=0;i<g;i++,a=a+x|0){let w=i+m|0,A=s[a],_=u[a],C=e[w],K=r[w],U=C*A+K*_,ee=K*A-C*_,re=e[i],me=r[i];e[w]=re-U,r[w]=me-ee,e[i]=re+U,r[i]=me+ee}}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 Ao;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Me.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))}}})(Ao||(Ao={}));var HE;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(HE||(HE={}));var Nh=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=Mb(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var aa;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(aa||(aa={}));var mu;(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=ep.complete(e)-ep.complete(r);return n!==0?n:e.pitch-r.pitch}})(mu||(mu={}));var Ih=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 u=r;u<n;u++){let d=e[u]*e[u];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 Bh=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(),u=this.#n;for(let d=r;d<n;++d){let m=o[d],x=s[d],g=Math.max(Math.abs(m),Math.abs(x));if(u=g>u?i*(u-g)+g:a*(u-g)+g,u>1){let w=1/u;o[d]=m*w,s[d]=x*w}}this.#n=u}};var Lr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Lr||(Lr={}));var ks;(function(t){function e(r,n,i){return new Ob(r,n,i)}t.aware=e})(ks||(ks={}));var Ob=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()===Lr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Lr.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()===Lr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return ja(this.#t.getValue(),Lr)}};var qE=Me.fromSignature(1,384);var ni={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?ni.Linear:{type:"curve",slope:t}},Th;(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:V(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return Xt.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=ht.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:u,value:d}=s.next();if(u)return o;if(d.position<=a){let{done:m,value:x}=s.next();if(m)return d.value;if(a<x.position)return n(d,x,a);if(d.interpolation===ni.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let u=i.iterateFrom(a),{done:d,value:m}=u.next();if(d)return;let x=o/s,g=m;if(g.position>a){for(;a<g.position;)if(yield{position:a,value:g.value},a+=x,a>o)return;g.position<=o&&(yield g)}for(;a<=o;){let{done:w,value:A}=u.next();if(w)break;for(;a<A.position;){if(a>o)return;yield{position:a,value:n(g,A,a)},a+=x}A.position<o&&(g.interpolation===ni.None&&(yield{position:A.position,value:g.value}),yield A),g=A}for(;a<=o;)yield{position:a,value:g.value},a+=x}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,u)=>o.type==="none"?i:o.type==="linear"?i+(u-a)/(s.position-a)*(s.value-i):o.type==="curve"?Jt.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},u-a):V("Unknown interpolation")})(Th||(Th={}));var Yd;(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 u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(o*u)+.07922*Math.cos(s*u);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,u=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(u*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}}}})(Yd||(Yd={}));var En;(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 u of o)u instanceof e?s.push(u.value):(u instanceof MessagePort||typeof ImageBitmap<"u"&&u instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&u instanceof OffscreenCanvas)&&s.push(u);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,...u)=>{let d=r(u);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(Xt.map(u,m=>({value:n(m)})))},d)};dispatchAndReturn=(s,...u)=>new Promise((d,m)=>{let x=Xt.reduce(u,(w,A,_)=>(typeof A=="function"&&w.push([_,A]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:m},callbacks:new Map(x)});let g=r(u);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(Xt.map(u,(w,A)=>typeof w=="function"?{callback:A}:{value:n(w)}))},g),this.#i++});#n=s=>{let u=this.#t.get(s.returnId);W(u)?s.type==="resolve"?(u.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(u.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&u.callbacks?.get(s.funcAt).apply(this,s.args):V(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,u){this.#e=s,this.#t=u,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{te(s.type==="send",()=>"Message type must be 'send'");let u=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=ze(u[s.func],`${s.func.toString()} does not exists on ${this.#t}`),m=s.returnId;if(m===!1)d.apply(this.#t,s.args.map(x=>"value"in x?x.value:V(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(g=>"callback"in g?(...w)=>this.#o(m,g.callback,w):g.value)).then(g=>{try{this.#n(m,g)}catch(w){this.#a(m,w)}},g=>this.#a(m,g))}catch(x){this.#a(m,x)}};#n=(s,u)=>this.#e.send({type:"resolve",returnId:s,resolve:u});#a=(s,u)=>this.#e.send({type:"reject",returnId:s,reject:u});#o=(s,u,d)=>this.#e.send({type:"callback",returnId:s,funcAt:u,args:d})}t.Executor=a})(En||(En={}));var JE={for:t=>new Ub(t)},AB=[],Ub=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??AB)}channel(e){return new Vb(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Vb=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 tp;(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}=Ct(()=>e.next());if(a==="success"){let{done:u,value:d}=o;u&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(tp||(tp={}));var jb=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)}},Dh;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=Gd("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=Gd("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let u=!0;return o.own(pe.create(()=>u=!1)),new Promise((d,m)=>s.then(x=>{u&&d(x)},x=>{u&&m(x)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new jb(3,Xd.seconds(3));t.retry=(o,s=n)=>o().catch(u=>new Promise((d,m)=>{let x=g=>{s.retry(g,()=>o().then(w=>d(w),x))||m(g)};x(u)})),t.guardedRetry=(o,s)=>{let u=async(d=0)=>{try{return await o()}catch(m){if(s(m,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,m),await tp.timeSpan(Xd.seconds(1)),u(d);throw new Error(`Failed after ${d} retries: ${m}`)}};return u()},t.approvedRetry=(o,s)=>{let u=async()=>{try{return await o()}catch(d){if(await fu.approve(s(d)))return u();throw d}};return u()},t.delay=(o,s)=>Promise.all([o,tp.timeSpan(s)]).then(([u])=>u),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,u)=>new Promise((d,m)=>{let x=!0,g=setTimeout(()=>{x=!1,m(new Error(u??"timeout"))},s.millis());o.then(w=>{x&&d(w)},w=>{x&&m(w)}).finally(()=>clearTimeout(g))}),t.sequentialAll=o=>o.reduce((s,u)=>s.then(async d=>[...d,await u()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return u=>{let d=()=>o(u),m=s.then(d,d);return s=m.catch(()=>{}),m}},t.memoizeAsync=(o,s)=>{let u=null,d=Date.now();return()=>{let m=Date.now();return(ta(u)||W(s)&&m-d>s.millis())&&(d=m,u=o(),u.catch(x=>(u=null,x))),u}},t.allWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=!1,x=async()=>{for(;d<o.length&&!m;){let g=d++;try{let w=await o[g]();m||(u[g]=w)}catch(w){throw m=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},x)),u},t.allSettledWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=async()=>{for(;d<o.length;){let x=d++;try{let g=await o[x]();u[x]={status:"fulfilled",value:g}}catch(g){u[x]={status:"rejected",reason:g}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},m)),u};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 u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(te(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:d}]=this.#e.shift();this.#t++,s().then(u,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,u,d){this.#e=s,this.#t=u,this.#r=d}update(s){this.#i=b.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),P(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(Dh||(Dh={}));var Oe=class t{static newSet(e){return new pu(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return te(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 te(r.length>0,"Unable to parse Address"),t.compose(M.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=ht.leftMostMapped(i,r,M.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(M.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=M.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=M.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=M.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 M.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(M.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,M.length),e.buffer}toString(){return[M.toString(this.#t),...this.#r].join("/")}static read(e){let r=M.fromDataInput(e),n=e.readByte();return t.compose(r,...ce.create(()=>e.readShort(),n))}},Ms;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Oe.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Oe.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Oe.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=ht.leftMostMapped(r,e,Oe.LengthComparator,t.AddressReader),i=ht.rightMostMapped(r,e,Oe.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Ms||(Ms={}));var oa=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 Qt}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Oe.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=>{zE(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():Xt.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 V(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 Kb=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},hu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Z=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 P(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 oa(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 ce.empty()}record(){return bh.empty()}getField(e){return V()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return V("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()}`}};Kb([cu,hu("design:type",oa),hu("design:paramtypes",[])],Z.prototype,"pointerHub",null);Kb([cu,hu("design:type",Oe),hu("design:paramtypes",[])],Z.prototype,"address",null);Kb([cu,hu("design:type",String),hu("design:paramtypes",[])],Z.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Rh=class t extends Z{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=ce.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return P(e.visitArrayField,this)}fields(){return this.#e}record(){return ce.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ze(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 V("Type mismatch")}};var Fo;(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=Yt.create();o.write(s);let u=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(u.length),r.writeBytes(u)})},t.readFields=(r,n)=>{te(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(fh(n[o]))continue;let s=r.readInt(),u=new Int8Array(s);r.readBytes(u);let{status:d,error:m}=Ct(()=>n[o]?.read(new rt(u.buffer)));d==="failure"&&console.warn(n,m)}}})(Fo||(Fo={}));var FB=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},XE=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=Oe.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 ze(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 oa(this)}estimateMemory(){let e=new uu;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ie(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Fo.readFields(e,this.#o)}write(e){Fo.writeFields(e,this.#o)}serialize(){let e=Yt.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=Yt.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(mh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];W(n)&&i.fromJSON(n)});else return V("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return ce.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 vB=Object.defineProperty;var Va=(t,e)=>{for(var r in e)vB(t,r,{get:e[r],enumerable:!0})};var CE=globalThis;CE.self??=globalThis;CE.location??={href:"/"};var K=t=>t!=null,ta=t=>t===null,zE=t=>t!==null,fh=t=>t===void 0,Sb=t=>t!==void 0,Eb=t=>t==null,Pb=(t,e)=>t!=null?e(t):void 0,ze=(t,e="asDefined failed")=>t??V(ra(e)),mt=(t,e)=>t instanceof e,Ie=(t,e)=>t instanceof e?t:V(`${t} is not instance of ${e}`),$b=(t,e)=>{t instanceof e||V(`${t} is not instance of ${e}`)};var ra=t=>t instanceof Function?t():t;var P=(t,...e)=>t?.apply(null,e),mh=t=>K(t)&&typeof t=="object";var hh=t=>{throw new Error(`Unhandled ${t}`)},V=t=>{throw typeof t=="string"?new Error(t):t},te=(t,e)=>t?void 0:V(ra(e));var Gd=t=>new Proxy({},{get(){return V(t)}});var Ab=class{value;status="success";constructor(e){this.value=e}error=Gd("Cannot access error when succeeded")},Fb=class{error;status="failure";constructor(e){this.error=e}value=Gd("Cannot access value when failed")},Ct=t=>{try{return new Ab(t())}catch(e){return new Fb(e)}};var ja=(t,e)=>Object.keys(e).length===0?V("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:V(`Invalid enum value: ${String(t)}`),Hd=()=>{};var kb;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(kb||(kb={}));var ce=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)=>ze(e.at(0),r);static getLast=(e,r)=>ze(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?V(`${r} not found in ${e}`):ze(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>ze(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 V(`${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=kb.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=>K(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=ze(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=>V(K(r)?ra(r):"unwrap failed");unwrapOrElse=r=>ra(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)=>ra(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>V(ra(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var wr;(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=()=>V(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>ra(n);unwrapOrElse=r=>ra(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)})(wr||(wr={}));var ht;(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,u=n(i(e[s]),r);if(u===0)return s;u<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)]})(ht||(ht={}));var gh=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 qt=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(K(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=u=>(u+e/30)%12,a=r*Math.min(n,1-n),o=u=>n-a*Math.max(-1,Math.min(i(u)-3,Math.min(9-i(u),1))),s=u=>Math.round(u*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),u=(o+s)/2,d=0,m=0;if(o!==s){let x=o-s;switch(m=u>.5?x/(2-o-s):x/(o+s),o){case n:d=((i-a)/x+(i<a?6:0))*60;break;case i:d=((a-n)/x+2)*60;break;case a:d=((n-i)/x+4)*60;break}}return{h:d,s:m,l:u}}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),u=i+(o-i)*r,d=a+(s-a)*r,m=(Math.atan2(d,u)/n+360)%360,x=Math.sqrt(u*u+d*d),g=this.#r+(e.#r-this.#r)*r,w=this.#i+(e.#i-this.#i)*r;return new t(m,x,g,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 bo=(t,e)=>t-e;var dC=Math.PI*2,pC=Math.PI/2,fC=Math.PI/4,mC=1/Math.sqrt(2),at=(t,e,r)=>Math.max(e,Math.min(t,r)),OE=t=>Math.max(0,Math.min(t,1)),UE=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),Mb=(t,e)=>Math.floor(t/e)*e;var VE=(t,e,r)=>t+(e-t)*r;var $s=(t,e)=>xB(t/e)*e,xB=t=>t-Math.floor(t),vh=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var Nb=(t,e)=>t*e/((2*e-1)*(t-1)+e);var Jt;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},u)=>t.normalizedAt(u/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=at(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=at(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),u=a-s*i.y0;return{m:s,q:u}};function*r(i,a,o,s){let{m:u,q:d}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let m=0,x=o;m<a;m++)yield x=u*x+d}t.walk=r,t.run=(i,a,o,s,u)=>{let{m:d,q:m}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let x=0,g=o;x<a;x++)u(g=d*g+m)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),d=(t.normalizedAt(2*o,i)-s)/s;for(let m=0,x=0;m<a;m++)yield x=d*x+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)})(Jt||(Jt={}));var ia=new DataView(new ArrayBuffer(8)),br;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ia.setInt8(0,e),ia.getInt8(0)),t.toShort=e=>(ia.setInt16(0,e),ia.getInt16(0)),t.toInt=e=>(ia.setInt32(0,e),ia.getInt32(0))})(br||(br={}));var Ka;(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=>(ia.setFloat32(0,o),ia.getFloat32(0))})(Ka||(Ka={}));var jE;(function(t){t.floatToIntBits=e=>{let r=Ka.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 Ka.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 Ka.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(jE||(jE={}));var xh;(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=>(ia.setFloat64(0,o),ia.getFloat64(0))})(xh||(xh={}));var Xt=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){te(K(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=K(r)?e:0,a=K(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);K(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 Yt=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?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`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(vh(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},uu=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}},yh=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(Ka.floatToIntBits(e))}writeDouble(e){this.writeLong(xh.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(Xt.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},rt=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?V(`position(${e}) cannot be negative.`):e>this.#e.byteLength?V(`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 yB=t=>K(t)?t.value!==void 0?"value":t.get!==void 0?"get":V(`Cannot resolve method key of ${t}`):V("Cannot resolve method key of undefined descriptor"),cu=(t,e,r)=>{if(!K(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!K(s?.get))return V(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let n=yB(r),i=ze(r[n]);return{[n]:function(...a){if(a.length>0)return V("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 Wa;(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})(Wa||(Wa={}));var Qt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?P(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 qd=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var Jd=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var wh=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 Xt.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return Xt.includes(this.map.keys(),e)}containsValue(e){return Xt.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??Jd.empty()}isEmpty(){return this.keyCount()===0}add(e,r){qd.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=qd.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??Jd.empty()}forEach(e){Xt.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:Hd},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),X=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:()=>ce.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 bh;(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 V(`'${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)})(bh||(bh={}));var KE;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return pe.Empty}catchupAndSubscribe(r){return r(this),pe.Empty}}})(KE||(KE={}));var WE;(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)}}})(WE||(WE={}));var _r=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()||(K(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 Wi=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 Ib=class{#e;#t;constructor(e,r){te(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 at(e,this.#e,this.#t)}floating(){return!0}},Bb=class{#e;#t;#r;constructor(e,r){this.#e=at(Math.round(e),br.MIN_VALUE,br.MAX_VALUE),this.#t=at(Math.round(r),br.MIN_VALUE,br.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(at(e,0,1)*this.#r)}clamp(e){return at(Math.round(e),this.#e,this.#t)}floating(){return!1}},Tb=class{#e;#t;constructor(e,r){te(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}},_h=class{#e;#t;#r;#i;constructor(e,r,n){te(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}},Db=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?V(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(at(e,0,1)*(this.#e.length-1));return r>-1?ze(this.#e.at(r),`Could not find value for ${e}`):V(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},Rb=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,u=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(u*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-u/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}},E;(function(t){t.linear=(a,o)=>new Ib(a,o),t.linearInteger=(a,o)=>new Bb(a,o),t.exponential=(a,o)=>new Tb(a,o),t.power=(a,o,s)=>new _h(a,o,s),t.powerByCenter=(a,o,s)=>{let u=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(u))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new _h(u,o,s)},t.values=a=>new Db(a),t.decibel=(a,o,s)=>new Rb(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})(E||(E={}));var $;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:u}={})=>new e(a,o,s,u),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let u=o.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},t.values=(a,o,s)=>new class{x(u){return{unit:a,value:s.at(o.indexOf(u))??"N/A"}}y(u){let d=s.indexOf(u);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,u,d){this.#e=o??"",this.#t=s??0,this.#r=u??!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 u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?at(u/200+.5,0,1):at(u/100,0,1)};{let m=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(K(m)){let x=r.indexOf(m);if(x>-1)return{type:"explicit",value:u*Math.pow(10,(x-4)*3)}}return{type:"explicit",value:u}}}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:u}=i(o);return{value:s.toFixed(this.#t),unit:`${u}${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 K(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})})($||($={}));var du;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(du||(du={}));var Ah;(function(t){t.create=(e=252854082)=>new Cb(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return V("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let u=Math.floor(n.uniform()*(1+r))+1;e[s]=u,a+=u}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(Ah||(Ah={}));var Cb=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 _i;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,u])=>{u instanceof e?o[s]=u.initialValue():typeof u=="object"&&(o[s]=i(u))}),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(([u,d])=>{let m=s;d instanceof e?m[u]=d.read(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([u,d])=>{let m=s;d instanceof e?d.write(i,m[u]):typeof d=="object"&&a(d,m[u])})};a(this.#e,this.#t)}#i(){let i=new uu;return this.write(i),i.count}}})(_i||(_i={}));var pu=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=ht.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return K(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=ht.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(K(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 V(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):V(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(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 ze(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(K(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 K(this.#i(e))}hasValue(e){return K(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(){ce.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=ht.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var fu=(()=>{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:Hd}),some:r=>r.progress(e)}),notify:e=>t.match({none:Hd,some:r=>r.notify(e)}),install:e=>{te(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Xd=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 hh(e)}}};var Fh;(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 V("Insufficient memory allocated.");let a=new Uint8Array(n),o=Yt.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 rt(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}}})(Fh||(Fh={}));var M;(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:V(`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=ce.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 V(`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 V("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 pu(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=>(te(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(M||(M={}));var Sh=class{#e=new X;#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 X),n=r.own(new fe),i=()=>e.slice(0,-1).reduce((s,u)=>s[u],this.#i),a=e[e.length-1],o={getValue:()=>e.reduce((s,u)=>s[u],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],u=e[a];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#a(e[a],s,n,o):u!==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 Eh=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#c;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#c=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new Ph(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=Yd.create(Yd.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.#u()}#u(){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.#c)}this.#l=0,this.#n.fill(0),this.decay=!1}};var zb=(t,e)=>Math.floor(3840/e)*t,LE=(t,e=4,r=4)=>{let n=zb(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-zb(a*e,r))%n,u=Math.floor(s/240),d=s%240;return{bars:a,beats:i-a*e,semiquavers:u,ticks:d}},ZE=(t,e)=>t*e/60*960,GE=(t,e)=>t*60/960/e,wB=(t,e)=>e*60/960/t,bB=(t,e,r)=>ZE(t/r,e),_B=(t,e,r)=>GE(t,e)*r,Me={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:zb,toParts:LE,secondsToPulses:ZE,pulsesToSeconds:GE,secondsToBpm:wB,samplesToPulses:bB,pulsesToSamples:_B,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=LE(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var na=128,$h=Me.fromSignature(1,48);var Qd;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Qd||(Qd={}));var ep;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(ep||(ep={}));var La;(function(t){t.globalToLocal=(r,n)=>$s(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{let u=r-i,d=u+a;if(u>=s||d<=o)return b.None;let m=Math.max(u,o),x=Math.min(d,s);return b.wrap({index:0,rawStart:u,rawEnd:d,regionStart:Math.max(u,r),regionEnd:Math.min(d,n),resultStart:m,resultEnd:x,resultStartValue:u<m?(m-u)/a:0,resultEndValue:d>x?(x-u)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){let u=r-i,d=Math.max(r,o),m=Math.min(n,s),x=Math.floor((d-u)/a),g=u+x*a;for(;g<m;){let w=g+a,A=Math.max(g,r),_=Math.min(w,n),C=Math.max(g,d),W=Math.min(w,m),U=g<C?(C-g)/a:0,ee=w>W?(W-g)/a:1;yield{index:x++,rawStart:g,rawEnd:w,regionStart:A,regionEnd:_,resultStart:C,resultEnd:W,resultStartValue:U,resultEndValue:ee},g=w}}t.locateLoops=e})(La||(La={}));var Ir=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 kh(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()?Wa.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?Wa.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()}},_o=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 kh(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()?Wa.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return Wa.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return Wa.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return Wa.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var kh=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=ht.leftMostMapped(this.#e,n,bo,Qd.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,ce.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(),ht.rightMostMapped(this.#e,e,bo,Qd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),ht.leftMostMapped(this.#e,e,bo,Qd.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,br.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,br.MAX_VALUE,r);i--}return this.iterate(n,br.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=du.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 Mh;(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,u=1,d=1;i>0&&e<i&&(u=Jt.normalizedAt(e/i,o));let m=r-a;if(a>0&&e>m){let x=(e-m)/a;d=1-Jt.normalizedAt(x,s)}return Math.min(u,d)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:u,inSlope:d,outSlope:m}=o;if(e.fill(1,0,a),s<=0&&u<=0)return;let x=i-u;if(r>=s&&n<=x)return;let g=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),A=Math.min(a,Math.ceil((w-r)/g));if(A>0){let _=r/s,C=w/s,W=Jt.walk(d,A,_,C);for(let U=0;U<A;U++)e[U]=W.next().value}}if(u>0&&n>x){let w=Math.max(r,x),A=Math.max(0,Math.floor((w-r)/g)),_=a-A;if(_>0){let C=(w-x)/u,W=(n-x)/u,U=Jt.walk(m,_,1-C,1-W);for(let ee=A;ee<a;ee++)e[ee]=Math.min(e[ee],U.next().value)}}}})(Mh||(Mh={}));var Ph=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,u=this.#i;for(let d=2;d<=this.#e;d<<=1){let m=d>>1,x=this.#e/d;for(n=0;n<this.#e;n+=d){let g=n+m;for(i=n,a=0;i<g;i++,a=a+x|0){let w=i+m|0,A=s[a],_=u[a],C=e[w],W=r[w],U=C*A+W*_,ee=W*A-C*_,re=e[i],me=r[i];e[w]=re-U,r[w]=me-ee,e[i]=re+U,r[i]=me+ee}}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 Ao;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Me.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))}}})(Ao||(Ao={}));var HE;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(HE||(HE={}));var Nh=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=Mb(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var aa;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(aa||(aa={}));var mu;(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=ep.complete(e)-ep.complete(r);return n!==0?n:e.pitch-r.pitch}})(mu||(mu={}));var Ih=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 u=r;u<n;u++){let d=e[u]*e[u];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 Bh=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(),u=this.#n;for(let d=r;d<n;++d){let m=o[d],x=s[d],g=Math.max(Math.abs(m),Math.abs(x));if(u=g>u?i*(u-g)+g:a*(u-g)+g,u>1){let w=1/u;o[d]=m*w,s[d]=x*w}}this.#n=u}};var Lr;(function(t){t.Musical="musical",t.Seconds="seconds"})(Lr||(Lr={}));var ks;(function(t){function e(r,n,i){return new Ob(r,n,i)}t.aware=e})(ks||(ks={}));var Ob=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()===Lr.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===Lr.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()===Lr.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return ja(this.#t.getValue(),Lr)}};var qE=Me.fromSignature(1,384);var ni={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?ni.Linear:{type:"curve",slope:t}},Th;(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:V(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return Xt.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=ht.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:u,value:d}=s.next();if(u)return o;if(d.position<=a){let{done:m,value:x}=s.next();if(m)return d.value;if(a<x.position)return n(d,x,a);if(d.interpolation===ni.None)return d.value}return d.value};function*r(i,a,o,s){if(i.isEmpty())return;let u=i.iterateFrom(a),{done:d,value:m}=u.next();if(d)return;let x=o/s,g=m;if(g.position>a){for(;a<g.position;)if(yield{position:a,value:g.value},a+=x,a>o)return;g.position<=o&&(yield g)}for(;a<=o;){let{done:w,value:A}=u.next();if(w)break;for(;a<A.position;){if(a>o)return;yield{position:a,value:n(g,A,a)},a+=x}A.position<o&&(g.interpolation===ni.None&&(yield{position:A.position,value:g.value}),yield A),g=A}for(;a<=o;)yield{position:a,value:g.value},a+=x}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,u)=>o.type==="none"?i:o.type==="linear"?i+(u-a)/(s.position-a)*(s.value-i):o.type==="curve"?Jt.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},u-a):V("Unknown interpolation")})(Th||(Th={}));var Yd;(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 u=0;u<n;++u)i[u]=.42323-.49755*Math.cos(o*u)+.07922*Math.cos(s*u);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,u=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(u*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}}}})(Yd||(Yd={}));var En;(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 u of o)u instanceof e?s.push(u.value):(u instanceof MessagePort||typeof ImageBitmap<"u"&&u instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&u instanceof OffscreenCanvas)&&s.push(u);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,...u)=>{let d=r(u);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(Xt.map(u,m=>({value:n(m)})))},d)};dispatchAndReturn=(s,...u)=>new Promise((d,m)=>{let x=Xt.reduce(u,(w,A,_)=>(typeof A=="function"&&w.push([_,A]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:d,reject:m},callbacks:new Map(x)});let g=r(u);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(Xt.map(u,(w,A)=>typeof w=="function"?{callback:A}:{value:n(w)}))},g),this.#i++});#n=s=>{let u=this.#t.get(s.returnId);K(u)?s.type==="resolve"?(u.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(u.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&u.callbacks?.get(s.funcAt).apply(this,s.args):V(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,u){this.#e=s,this.#t=u,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{te(s.type==="send",()=>"Message type must be 'send'");let u=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),d=ze(u[s.func],`${s.func.toString()} does not exists on ${this.#t}`),m=s.returnId;if(m===!1)d.apply(this.#t,s.args.map(x=>"value"in x?x.value:V(`${s.func.toString()} has no promise.`)));else try{d.apply(this.#t,s.args.map(g=>"callback"in g?(...w)=>this.#o(m,g.callback,w):g.value)).then(g=>{try{this.#n(m,g)}catch(w){this.#a(m,w)}},g=>this.#a(m,g))}catch(x){this.#a(m,x)}};#n=(s,u)=>this.#e.send({type:"resolve",returnId:s,resolve:u});#a=(s,u)=>this.#e.send({type:"reject",returnId:s,reject:u});#o=(s,u,d)=>this.#e.send({type:"callback",returnId:s,funcAt:u,args:d})}t.Executor=a})(En||(En={}));var JE={for:t=>new Ub(t)},AB=[],Ub=class{#e;#t=new fe;constructor(e){if(this.#e=e,K(e.onmessage)||K(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??AB)}channel(e){return new Vb(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Vb=class t{#e;#t;#r=new fe;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{K(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 tp;(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}=Ct(()=>e.next());if(a==="success"){let{done:u,value:d}=o;u&&(clearInterval(i),r(d))}else clearInterval(i),n(s)},0)})})(tp||(tp={}));var jb=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)}},Dh;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=Gd("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=Gd("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let u=!0;return o.own(pe.create(()=>u=!1)),new Promise((d,m)=>s.then(x=>{u&&d(x)},x=>{u&&m(x)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new jb(3,Xd.seconds(3));t.retry=(o,s=n)=>o().catch(u=>new Promise((d,m)=>{let x=g=>{s.retry(g,()=>o().then(w=>d(w),x))||m(g)};x(u)})),t.guardedRetry=(o,s)=>{let u=async(d=0)=>{try{return await o()}catch(m){if(s(m,++d))return console.debug(`retry after failure (online: ${navigator.onLine}):`,m),await tp.timeSpan(Xd.seconds(1)),u(d);throw new Error(`Failed after ${d} retries: ${m}`)}};return u()},t.approvedRetry=(o,s)=>{let u=async()=>{try{return await o()}catch(d){if(await fu.approve(s(d)))return u();throw d}};return u()},t.delay=(o,s)=>Promise.all([o,tp.timeSpan(s)]).then(([u])=>u),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,u)=>new Promise((d,m)=>{let x=!0,g=setTimeout(()=>{x=!1,m(new Error(u??"timeout"))},s.millis());o.then(w=>{x&&d(w)},w=>{x&&m(w)}).finally(()=>clearTimeout(g))}),t.sequentialAll=o=>o.reduce((s,u)=>s.then(async d=>[...d,await u()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return u=>{let d=()=>o(u),m=s.then(d,d);return s=m.catch(()=>{}),m}},t.memoizeAsync=(o,s)=>{let u=null,d=Date.now();return()=>{let m=Date.now();return(ta(u)||K(s)&&m-d>s.millis())&&(d=m,u=o(),u.catch(x=>(u=null,x))),u}},t.allWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=!1,x=async()=>{for(;d<o.length&&!m;){let g=d++;try{let w=await o[g]();m||(u[g]=w)}catch(w){throw m=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},x)),u},t.allSettledWithLimit=async(o,s=1)=>{let u=new Array(o.length),d=0,m=async()=>{for(;d<o.length;){let x=d++;try{let g=await o[x]();u[x]={status:"fulfilled",value:g}}catch(g){u[x]={status:"rejected",reason:g}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},m)),u};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 u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(te(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:d}]=this.#e.shift();this.#t++,s().then(u,d)}}}t.Limit=i;class a{#e;#t;#r;#i=b.None;constructor(s,u,d){this.#e=s,this.#t=u,this.#r=d}update(s){this.#i=b.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),P(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(Dh||(Dh={}));var Oe=class t{static newSet(e){return new pu(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return te(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 te(r.length>0,"Unable to parse Address"),t.compose(M.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=ht.leftMostMapped(i,r,M.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(M.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=M.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=M.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=M.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 M.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(M.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,M.length),e.buffer}toString(){return[M.toString(this.#t),...this.#r].join("/")}static read(e){let r=M.fromDataInput(e),n=e.readByte();return t.compose(r,...ce.create(()=>e.readShort(),n))}},Ms;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Oe.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Oe.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=ht.rangeMapped(r,e,Oe.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=ht.leftMostMapped(r,e,Oe.LengthComparator,t.AddressReader),i=ht.rightMostMapped(r,e,Oe.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Ms||(Ms={}));var oa=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 Qt}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Oe.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=>{zE(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():Xt.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 V(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 Kb=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},hu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Z=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 P(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 oa(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 ce.empty()}record(){return bh.empty()}getField(e){return V()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return V("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()}`}};Kb([cu,hu("design:type",oa),hu("design:paramtypes",[])],Z.prototype,"pointerHub",null);Kb([cu,hu("design:type",Oe),hu("design:paramtypes",[])],Z.prototype,"address",null);Kb([cu,hu("design:type",String),hu("design:paramtypes",[])],Z.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Rh=class t extends Z{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=ce.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return P(e.visitArrayField,this)}fields(){return this.#e}record(){return ce.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ze(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 V("Type mismatch")}};var Fo;(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=Yt.create();o.write(s);let u=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(u.length),r.writeBytes(u)})},t.readFields=(r,n)=>{te(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(fh(n[o]))continue;let s=r.readInt(),u=new Int8Array(s);r.readBytes(u);let{status:d,error:m}=Ct(()=>n[o]?.read(new rt(u.buffer)));d==="failure"&&console.warn(n,m)}}})(Fo||(Fo={}));var FB=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},XE=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=Oe.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 ze(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 oa(this)}estimateMemory(){let e=new uu;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ie(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Fo.readFields(e,this.#o)}write(e){Fo.writeFields(e,this.#o)}serialize(){let e=Yt.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=Yt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return K(i)&&(e[r]=i),e},{})}fromJSON(e){if(mh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];K(n)&&i.fromJSON(n)});else return V("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return ce.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
- `),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()}`}};FB([cu,XE("design:type",oa),XE("design:paramtypes",[])],D.prototype,"pointerHub",null);var rp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(rp||(rp={}));var Te;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Te||(Te={}));var Ch;(function(t){t.create=()=>new Wb})(Ch||(Ch={}));var Wb=class{#e=new ip(Ms.equals);#t=new ip(Ms.startsWith);#r=new ip(Ms.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new Lb(r,e,this.#n++,n);if(this.#a){let a=new Zb(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 Te.This:return this.#e.subscribe(e);case Te.Parent:return this.#t.subscribe(e);case Te.Children:return this.#r.subscribe(e);default:return hh(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Lb=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: ${Te[this.propagation]}, order: ${this.order} }`}},ip=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(Ms.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Zb=class{monitor;propagation;#e=new X;#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 zt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(zt||(zt={}));var Is={[zt.Boolean]:{type:zt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[zt.Float32]:{type:zt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[zt.Int32]:{type:zt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[zt.String]:{type:zt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[zt.Bytes]:{type:zt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},Ns=class extends Z{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return P(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Te.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){te(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){te(!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)?V("not implemented"):e}fromJSON(e){return V("Type mismatch")}reset(){this.setValue(this.#t)}},R=class t extends Ns{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,zt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return Is[zt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){te(!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()))}},S=class t extends Ns{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Float32,i),this.#e=r,this.#t=n}serialization(){return Is[zt.Float32]}equals(e){return this.getValue()===e}clamp(e){return rp.clampFloat32(this.#e,Ka.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){te(!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()))}},k=class t extends Ns{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Int32,i),this.#e=r,this.#t=n}serialization(){return Is[zt.Int32]}equals(e){return this.getValue()===e}clamp(e){return rp.clampInt32(this.#e,br.toInt(e))}read(e){this.setValue(e.readInt())}write(e){te(!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>=br.MIN_VALUE&&e<=br.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},B=class t extends Ns{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,zt.String,r)}serialization(){return Is[zt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){te(!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()))}},YE=class t extends Ns{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,zt.Bytes,r)}serialization(){return Is[zt.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){te(!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 eP=t=>{let e=M.newSet(i=>i),r=M.newSet(i=>i);for(let i of t)i instanceof Bs?e.add(i.uuid):i instanceof Rs&&r.add(i.uuid);let n=M.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof Bs||i instanceof Rs?!n.hasKey(i.uuid):i instanceof Ds||i instanceof Ts?!n.hasKey(i.address.uuid):!0)},QE;(function(t){t.decode=e=>{let r=e.readInt();return ce.create(()=>{switch(e.readString()){case"new":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Bs(i,a,o.buffer)}case"pointer":{let i=Oe.read(e),a=e.readBoolean()?b.wrap(Oe.read(e)):b.None,o=e.readBoolean()?b.wrap(Oe.read(e)):b.None;return new Ds(i,a,o)}case"primitive":{let i=Oe.read(e),a=e.readString(),o=Is[a],s=o.decode(e),u=o.decode(e);return new Ts(i,o,s,u)}case"delete":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Rs(i,a,o.buffer)}}},r)}})(QE||(QE={}));var Bs=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 rt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Ts=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}`}},Ds=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()}`}},Rs=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 rt(this.#r)))}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var c4=Symbol("Unreferenceable"),N=class t extends Z{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){te(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Ct(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){te(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Ct(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 V(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return P(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Te.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=oa.validate(this,e.unwrap());r.nonEmpty()&&V(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(Oe.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){te(!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(ta(e)||typeof e=="string"){let r=b.wrap(ta(e)?null:Oe.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return V(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var zh=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Oe.newSet(e=>e.address),this.#t=Oe.newSet(e=>e.address),this.#r=Oe.newSet(e=>e.address),this.#i=Oe.newSet(([e])=>e),this.#n=Oe.newSet(([e])=>e.address),this.#a=M.newSet(e=>e)}watchVertex(e){if(mt(e,N)){if(!e.mandatory)return V("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return V("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 V(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return V(`${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");ce.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,ce.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.`),V(`Pointer ${e.toString()} requires an edge.`)):V(`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.`),V(`Target ${e.toString()} requires an edge.`)):V(`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.`),V(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Oe.boxRange(e,r,n);return W(i)?e.values().slice(i[0],i[1]):ce.empty()}#s(e,r,n){let i=Oe.boxRange(e,r,n);W(i)&&e.removeRange(i[0],i[1])}};var Za=class{#e;#t;#r;#i;#n;#a;#o;#s;#c;#l;#u;#p;#d;#v=!1;#f=!1;#m=!1;constructor(e=b.None){this.#e=e,this.#t=M.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#c=Ch.create(),this.#a=new Qt,this.#o=new Qt,this.#s=new Qt,this.#l=new zh,this.#u=Oe.newSet(({pointer:r})=>r.address),this.#p=[],this.#d=M.newSet(r=>r.uuid)}beginTransaction(){te(!this.#v,"Transaction already in progress"),this.#v=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){te(this.#v,"No transaction in progress"),this.#_(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#w(e,r)),this.#r.length=0),this.#g()}endTransaction(){te(this.#v,"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.#_(),this.#g(),e}),this.#x(),this.#g()}inTransaction(){return this.#v}constructingBox(){return this.#f}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#b(),te(!this.#f,"Cannot construct box while other box is constructing"),W(r)){this.#f=!0;let a=Ct(()=>r(e));if(this.#f=!1,a.status==="failure")throw this.#A(e),a.error}if(!this.#t.add(e))return this.#A(e),V(`${e.name} ${e.address.toString()} already staged`);let i=new Bs(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.#c.subscribe(e,r,n)}subscribeEndTransaction(e){this.#p.push(e)}subscribeDeletion(e,r){let n=this.#d.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#d.removeByKeyIfExist(e)}}}unstageBox(e){this.#b();let r=this.#t.removeByKey(e.address.uuid);te(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new Rs(e.address.uuid,e.name,e.toArrayBuffer());this.#m||this.#n.push(n),this.#d.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 yh;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#b(),e.isAttached()&&!this.#f){let i=new Ts(e.address,e.serialization(),r,n);this.#m||this.#n.push(i),this.#c.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#b(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new Ds(e.address,r,n);this.#f?this.#r.push({pointerField:e,update:i}):(this.#m||this.#n.push(i),this.#w(e,i),this.#o.proxy.onUpdate(i))}#w(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#c.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.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#c.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#g(){for(this.#u.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.#u.clear(),this.#v=!1;this.#p.length>0;)this.#p.splice(0).forEach(e=>e()),this.#p.length>0&&console.debug(`${this.#p.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#m),this.#m=!1}#_(){this.#m=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=eP(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof Ds||n instanceof Ts)&&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.#u.clear(),this.#n.length=0}#A(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.#F(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}#F(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:du.alwaysFalse,i=W(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=W(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,u=(m,x=!1)=>{if(!(o.has(m)||!x&&n(m))){if(o.add(m),a&&W(m.resource)){m.incomingEdges().forEach(g=>{s.add(g);let w=g.targetAddress.mapOr(A=>!A.isBox(),!1);if(g.mandatory&&w){if(m.resource==="shared"&&g.targetAddress.flatMap(_=>this.findVertex(_)).mapOr(_=>_.pointerRules.mandatory,!1))return;u(g.box)}});return}m.outgoingEdges().filter(([g])=>!s.has(g)).forEach(([g,w])=>{let A=this.findVertex(w).unwrap(`Could not find target of ${g.toString()}`);if(s.add(g),A.pointerRules.mandatory&&(i||A.pointerHub.incoming().filter(_=>_.targetAddress.mapOr(C=>C.equals(w),!1)).every(_=>s.has(_))))return u(A.box)}),m.incomingEdges().forEach(g=>{s.add(g),g.mandatory&&u(g.box)})}},d=Array.isArray(e)?e:[e];return d.forEach(m=>u(m,!0)),d.forEach(m=>o.delete(m)),{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();te(o,`pointer ${a.address} is broken`),te(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[M.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:V("Unknown address"))))}toArrayBuffer(){let e=Yt.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){te(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new rt(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),u=new Int8Array(s);n.readBytes(u);let d=new rt(u.buffer),m=d.readInt(),x=d.readString(),g=M.fromDataInput(d);a.push({creationIndex:m,name:x,uuid:g,boxStream:d})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:u})=>this.createBox(o,s,d=>d.read(u))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#w(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#g())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:ze(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return V("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,M.parse(i),s=>{let u=Ct(()=>s.fromJSON(o));u.status==="failure"&&console.warn(u.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#w(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#g())}#b(){te(this.#v,()=>"Modification only prohibited in transaction mode.")}};var ai;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=at(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=at(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=at(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,u=s,d=s+r.length,m=0,x=0,g=0;for(let w=0;w<i.length;w++){let A=i[w],_=a.has(w)?u+x++:w<n?m++:d+g++;A.index.setValue(_)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof k,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:V(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(ai||(ai={}));var Je=class extends Z{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return P(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ze(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Te.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Fo.readFields(e,this.#e)}write(e){Fo.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(mh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];W(n)&&i.fromJSON(n)});else return V("Type mismatch")}};var So;(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"})(So||(So={}));var np;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(np||(np={}));var gu;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(gu||(gu={}));var Oh=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Yt.create(0);#a=b.None;#o=b.None;#s=b.None;#c=-1;#l=-1;#u=!1;#p=!1;#d=0;constructor(e){this.#i=En.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.#v();if(e.nonEmpty()){this.#p||(this.#i.sendShareLock(this.#t),this.#p=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#f(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#d){let o=vh(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=Yt.use(s,r),this.#a=b.wrap(s),this.#d=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===np.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,np.READ))}broadcastFloat(e,r){return this.#h(new class{type=So.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=So.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=So.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=So.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=So.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#v(){if(this.#u){try{this.#s=b.wrap(this.#g())}catch(e){throw e}this.#u=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#f(){return this.#l===-1&&(this.#l=this.#w()+12),this.#l}terminate(){ce.clear(this.#e),this.#s=b.None,this.#u=!1,this.#l=0}#m(e){te(!this.#u&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#f();te(e.remaining>=r,"Insufficient data"),e.writeInt(this.#c),e.writeInt(gu.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(gu.END)}#w(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{ce.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#u=!0}#g(){let e=Yt.create();e.writeInt(gu.ID),e.writeInt(++this.#c),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var ap=class{#e=new X;#t;constructor(e,r){this.#t=this.#e.own(new Sh(r)),this.#e.own(En.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 tP;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(tP||(tP={}));var rP;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(rP||(rP={}));var Ft;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Ft||(Ft={}));var Eo={white:new qt(0,0,100),blue:new qt(189,100,65),green:new qt(150,77,69),yellow:new qt(60,100,84),cream:new qt(65,20,83),orange:new qt(31,100,73),red:new qt(354,100,65),purple:new qt(314,100,78),bright:new qt(197,5,95),gray:new qt(197,31,88),dark:new qt(197,15,70),shadow:new qt(197,10,55),black:new qt(197,10,25),background:new qt(197,8,9),panelBackground:new qt(197,14,12),panelBackgroundBright:new qt(197,13,19),panelBackgroundDark:new qt(197,14,11)};var Le;(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"})(Le||(Le={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Le||(Le={}));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"})(l||(l={}));var Uh;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Uh||(Uh={}));var Cs;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(Cs||(Cs={}));var iP=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?V(`Indices cannot be equal (${t}, ${e})`):r};var Ga=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)},Vh,Pn,Po,jh,Ha,cr=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){Vh.set(this,void 0),Pn.set(this,void 0),Po.set(this,void 0),jh.set(this,void 0),Ha.set(this,null),Ga(this,Vh,e,"f"),Ga(this,Pn,M.newSet(i=>i.adapter.uuid),"f"),Ga(this,Po,new Qt,"f"),Ga(this,jh,e.pointerHub.catchupAndSubscribe({onAdded:i=>{Ga(this,Ha,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{Ga(this,Ha,null,"f"),Ar(this,Po,"f").proxy.onReorder(a)}),s=Ar(this,Pn,"f").add({adapter:a,subscription:o});te(s,`Could not add ${a}`),Ar(this,Po,"f").proxy.onAdd(a)},onRemoved:i=>{Ga(this,Ha,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=Ar(this,Pn,"f").removeByKey(a);s.terminate(),Ar(this,Po,"f").proxy.onRemove(o)}},n),"f")}field(){return Ar(this,Vh,"f")}subscribe(e){return Ar(this,Po,"f").subscribe(e)}catchupAndSubscribe(e){return Ar(this,Pn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=ht.exactMapped(this.adapters(),e,iP,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return Ar(this,Pn,"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 Ar(this,Ha,"f")===null&&Ga(this,Ha,Ar(this,Pn,"f").values().map(({adapter:e})=>e).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),Ar(this,Ha,"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=at(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 Ar(this,Pn,"f").size()}isEmpty(){return this.size()===0}terminate(){Ga(this,Ha,null,"f"),Ar(this,Pn,"f").forEach(({subscription:e})=>e.terminate()),Ar(this,Pn,"f").clear(),Ar(this,Po,"f").terminate(),Ar(this,jh,"f").terminate()}};Vh=new WeakMap,Pn=new WeakMap,Po=new WeakMap,jh=new WeakMap,Ha=new WeakMap;var qa;(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","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return $n.create(r,n,i);case"ProjectMetaBox":return Kh.create(r,n,i);case"RootBox":return $o.create(r,n,i);case"SelectionBox":return sa.create(r,n,i);case"UserInterfaceBox":return Ja.create(r,n,i);case"UploadFileBox":return Wh.create(r,n,i);case"ShadertoyBox":return Lh.create(r,n,i);case"MIDIControllerBox":return Zh.create(r,n,i);case"TimelineBox":return zs.create(r,n,i);case"TrackBox":return Br.create(r,n,i);case"NoteEventBox":return ko.create(r,n,i);case"NoteEventRepeatBox":return Gh.create(r,n,i);case"NoteEventCollectionBox":return Xa.create(r,n,i);case"NoteRegionBox":return Os.create(r,n,i);case"NoteClipBox":return vu.create(r,n,i);case"ValueEventBox":return kn.create(r,n,i);case"ValueEventCollectionBox":return Mn.create(r,n,i);case"ValueEventCurveBox":return Mo.create(r,n,i);case"ValueRegionBox":return Us.create(r,n,i);case"ValueClipBox":return xu.create(r,n,i);case"SignatureEventBox":return yu.create(r,n,i);case"AudioRegionBox":return No.create(r,n,i);case"AudioClipBox":return wu.create(r,n,i);case"AudioPitchStretchBox":return bu.create(r,n,i);case"AudioTimeStretchBox":return _u.create(r,n,i);case"AudioSignalsmithBox":return Au.create(r,n,i);case"TransientMarkerBox":return Hh.create(r,n,i);case"WarpMarkerBox":return la.create(r,n,i);case"MarkerBox":return Fu.create(r,n,i);case"AudioFileBox":return Li.create(r,n,i);case"SoundfontFileBox":return ua.create(r,n,i);case"NeuralAmpModelBox":return qh.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return ca.create(r,n,i);case"CaptureMidiBox":return da.create(r,n,i);case"AudioBusBox":return Nn.create(r,n,i);case"AuxSendBox":return Su.create(r,n,i);case"GrooveShuffleBox":return Eu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Jh.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Xh.create(r,n,i);case"DeviceInterfaceKnobBox":return Yh.create(r,n,i);case"ModularDeviceBox":return Qh.create(r,n,i);case"StereoToolDeviceBox":return eg.create(r,n,i);case"MaximizerDeviceBox":return Pu.create(r,n,i);case"CompressorDeviceBox":return tg.create(r,n,i);case"GateDeviceBox":return rg.create(r,n,i);case"DelayDeviceBox":return ig.create(r,n,i);case"CrusherDeviceBox":return ng.create(r,n,i);case"DattorroReverbDeviceBox":return ag.create(r,n,i);case"VelocityDeviceBox":return og.create(r,n,i);case"FoldDeviceBox":return sg.create(r,n,i);case"TidalDeviceBox":return lg.create(r,n,i);case"RevampDeviceBox":return ug.create(r,n,i);case"ReverbDeviceBox":return cg.create(r,n,i);case"VaporisateurDeviceBox":return $u.create(r,n,i);case"MIDIOutputDeviceBox":return ku.create(r,n,i);case"MIDIOutputBox":return Io.create(r,n,i);case"MIDIOutputParameterBox":return Vs.create(r,n,i);case"SoundfontDeviceBox":return Mu.create(r,n,i);case"NanoDeviceBox":return Nu.create(r,n,i);case"PlayfieldDeviceBox":return Iu.create(r,n,i);case"PlayfieldSampleBox":return Bo.create(r,n,i);case"TapeDeviceBox":return Bu.create(r,n,i);case"ArpeggioDeviceBox":return dg.create(r,n,i);case"PitchDeviceBox":return pg.create(r,n,i);case"ZeitgeistDeviceBox":return fg.create(r,n,i);case"NeuralAmpDeviceBox":return mg.create(r,n,i);case"VocoderDeviceBox":return hg.create(r,n,i);case"WaveshaperDeviceBox":return gg.create(r,n,i);case"WerkstattDeviceBox":return vg.create(r,n,i);case"WerkstattParameterBox":return pa.create(r,n,i);case"WerkstattSampleBox":return js.create(r,n,i);case"SpielwerkDeviceBox":return xg.create(r,n,i);case"ApparatDeviceBox":return Tu.create(r,n,i);case"NoopInstrumentBox":return Du.create(r,n,i);case"CompositeDeviceBox":return yg.create(r,n,i);case"CompositeCellBox":return wg.create(r,n,i);case"ModularBox":return bg.create(r,n,i);case"ModuleConnectionBox":return _g.create(r,n,i);case"ModularAudioInputBox":return Ag.create(r,n,i);case"ModularAudioOutputBox":return Fg.create(r,n,i);case"ModuleDelayBox":return Sg.create(r,n,i);case"ModuleMultiplierBox":return Eg.create(r,n,i);case"ModuleGainBox":return Pg.create(r,n,i);default:return V(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new rt(r),i=n.readString(),a=M.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(qa||(qa={}));var $n=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:B.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};var Kh=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:B.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:B.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};var $g=class t extends Je{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:k.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:S.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:S.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:R.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:k.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var $o=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:S.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:Z.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:Z.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:Z.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:$g.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:N.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:N.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:N.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var sa=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 P(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var Ja=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:N.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:N.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:N.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:Z.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Wh=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 P(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var Lh=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 P(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:R.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var Zh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:B.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:k.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var kg=class t extends Je{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:k.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:k.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Mg=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:k.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:k.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Ng=class t extends Je{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:Z.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Ig=class t extends Je{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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:k.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:k.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Bg=class t extends Je{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:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var zs=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 P(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:Z.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:kg.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Mg.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:Z.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Ng.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:Ig.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Bg.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:k.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:S.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var Br=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:k.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:R.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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:k.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:S.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:k.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:S.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:S.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:k.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Gh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:k.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:S.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:S.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var Xa=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 P(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var Os=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:k.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:k.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:k.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:R.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:B.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:k.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var To=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:R.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:R.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:k.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:k.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var vu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:k.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var kn=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:k.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:S.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:S.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var Mn=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 P(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Mo=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 P(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:S.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var Us=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:k.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:k.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:k.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var xu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:k.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var yu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:k.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:k.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:k.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:k.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var Tg=class t extends Je{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:S.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:S.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:S.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:S.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var No=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:B.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:S.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:k.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:S.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Tg.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var wu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:S.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:S.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:S.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:B.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};var bu=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 P(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var _u=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 P(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:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:k.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:S.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Au=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 P(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:S.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Hh=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 P(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:S.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var la=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:k.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:S.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var Fu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:k.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:k.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Li=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 P(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:S.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:S.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:B.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var ua=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 P(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var qh=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"packId",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 P(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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:N.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:k.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:S.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:S.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:Z.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:Z.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:Z.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:N.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:N.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1)}}};var ca=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:k.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:S.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:S.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var da=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:k.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Nn=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:N.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:R.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Su=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:N.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:k.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:S.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:S.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Eu=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:S.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:k.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 Jh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Xh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Yh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:S.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:B.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var Dg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Qh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Dg.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var eg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:S.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:R.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:R.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:k.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Pu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:S.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 tg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:R.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:R.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:R.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:S.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:S.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:S.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:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var rg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.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:S.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:S.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:S.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:S.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:R.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var ig=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:S.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:S.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:S.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:S.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:S.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:S.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:S.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:S.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:S.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:S.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:S.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:S.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:k.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var ng=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:k.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:S.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:S.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 ag=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:S.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:S.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:S.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:S.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:S.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:S.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:S.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:S.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:S.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:S.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 og=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:S.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:k.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:S.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:S.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:S.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var sg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:S.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 lg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:S.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:S.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:S.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:S.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:S.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 op=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:S.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 sp=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:S.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 Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:S.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:S.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 ug=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:op.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:sp.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:sp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:op.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:S.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 cg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:S.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:S.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:S.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:S.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:S.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 Rg=class t extends Je{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:k.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:S.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:k.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:S.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 Cg=class t extends Je{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:k.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:S.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:R.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:S.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:S.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:S.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var zg=class t extends Je{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:S.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:S.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:S.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:S.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 $u=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:S.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:k.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:S.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:S.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:S.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:k.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:k.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:S.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:S.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:k.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:S.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:Cg.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Rh.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>Rg.create(e),2),50:zg.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:k.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Og=class t extends Je{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:B.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var ku=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Og.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:k.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:k.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:Z.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:N.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Io=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:R.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var Vs=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:S.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var Mu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:k.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var Nu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:N.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:S.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 Iu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Bo=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 P(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)}initializeFields(){return{10:N.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:N.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:Z.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:Z.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:B.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:R.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:R.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:R.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:R.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:R.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:R.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:k.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:S.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:S.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:S.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:S.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:S.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)}}};var Bu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:S.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:S.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:S.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var dg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.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:k.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:k.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:S.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:k.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:S.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var pg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.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:S.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:k.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 fg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var mg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:S.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:S.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:R.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:S.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:N.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var hg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.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:S.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:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:k.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:B.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:S.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:S.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:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var gg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:S.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:S.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:S.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var vg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var pa=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:S.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:S.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var js=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:N.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var xg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Tu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Du=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var yg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var wg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:k.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};var bg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:B.create({parent:this,fieldKey:13,fieldName:"label",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:"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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var Zi=class t extends Je{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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:k.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:k.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:R.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:R.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var Ag=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 P(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var Fg=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 P(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var Sg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.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 Eg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};var Pg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var oi;(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)?($b(n,Mo),n.slope.setValue(r.slope)):Mo.create(e.box.graph,M.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)?($b(r,Mo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?ni.None:e.getValue()===1?ni.Linear:V("Unknown Interpolation value")}})(oi||(oi={}));var Do=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)},lp,Cu,Tt,up,Ro,cp,Ya=class t{constructor(e,r){this.type="value-event",lp.set(this,new X),Cu.set(this,void 0),Tt.set(this,void 0),up.set(this,void 0),Ro.set(this,void 0),cp.set(this,!1),Do(this,Cu,e,"f"),Do(this,Tt,r,"f"),Do(this,up,Qe(this,lp,"f").own(new gh(()=>oi.read(Qe(this,Tt,"f").interpolation))),"f");let n=()=>{Qe(this,up,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Qe(this,lp,"f").ownAll(Qe(this,Tt,"f").subscribe(Te.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=ce.equals(Qe(this,Tt,"f").index.address.fieldKeys,o),u=ce.equals(Qe(this,Tt,"f").position.address.fieldKeys,o);s||u?a.requestSorting():a.onEventPropertyChanged()}}),Qe(this,Tt,"f").interpolation.subscribe(n),Qe(this,Tt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Qe(this,Ro,"f").terminate(),Do(this,Ro,i.subscribe(Te.Children,n),"f"),n()},onRemoved:()=>{Qe(this,Ro,"f").terminate(),Do(this,Ro,pe.Empty,"f"),n()}})),Do(this,Ro,Qe(this,Tt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Te.Children,n)??pe.Empty,"f")}onSelected(){Do(this,cp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Do(this,cp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Qe(this,Ro,"f").terminate(),Qe(this,lp,"f").terminate()}get box(){return Qe(this,Tt,"f")}get uuid(){return Qe(this,Tt,"f").address.uuid}get address(){return Qe(this,Tt,"f").address}get position(){return Qe(this,Tt,"f").position.getValue()}get index(){return Qe(this,Tt,"f").index.getValue()}set interpolation(e){oi.write(Qe(this,Tt,"f").interpolation,e)}get interpolation(){return Qe(this,up,"f").get()}get value(){return Qe(this,Tt,"f").value.getValue()}get isSelected(){return Qe(this,cp,"f")}get collection(){return Qe(this,Tt,"f").events.targetVertex.map(e=>Qe(this,Cu,"f").boxAdapters.adapterFor(e.box,Fr))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=kn.create(Qe(this,Cu,"f").boxGraph,M.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 oi.write(i.interpolation,e?.interpolation??this.interpolation),Qe(this,Cu,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return Qe(this,Tt,"f").position.setValue(e?.position??this.position),Qe(this,Tt,"f").index.setValue(e?.index??this.index),Qe(this,Tt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),Qe(this,Tt,"f").value.setValue(e?.value??this.value),oi.write(Qe(this,Tt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};lp=new WeakMap,Cu=new WeakMap,Tt=new WeakMap,up=new WeakMap,Ro=new WeakMap,cp=new WeakMap;Ya.Comparator=(t,e)=>{if(t===e)return V(`${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:V(`${t} and ${e} are identical in terms of comparison`)};var dp=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)},pp,fp,Co,Gi,Ks,zu,Qa,Ug,Fr=class t{constructor(e,r){pp.add(this),fp.set(this,new X),Co.set(this,void 0),Gi.set(this,void 0),Ks.set(this,void 0),zu.set(this,void 0),Qa.set(this,void 0),dp(this,Co,e,"f"),dp(this,Gi,r,"f"),dp(this,Ks,new fe,"f"),dp(this,zu,M.newSet(i=>i.uuid),"f"),dp(this,Qa,Ir.create(Ya.Comparator),"f");let n=i=>{let a=ze(i.accept({visitValueEventBox:o=>Ye(this,Co,"f").boxAdapters.adapterFor(o,Ya)}),`Could not find adapter for ${i}`);Ye(this,zu,"f").add(a)&&(Ye(this,Qa,"f").add(a),Ye(this,pp,"m",Ug).call(this))};Ye(this,Gi,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Ye(this,fp,"f").own(Ye(this,Gi,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Ye(this,Qa,"f").remove(Ye(this,zu,"f").removeByKey(i)),Ye(this,pp,"m",Ug).call(this)}})),Ye(this,fp,"f").own(Ye(this,Gi,"f").owners.pointerHub.subscribe({onAdded:()=>Ye(this,Ks,"f").notify(this),onRemoved:()=>Ye(this,Ks,"f").notify(this)}))}valueAt(e,r){return Th.valueAt(Ye(this,Qa,"f"),e,r)}copy(){let e=Ye(this,Co,"f").boxGraph,r=Mn.create(e,M.generate());return Ye(this,Qa,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ye(this,Co,"f").boxAdapters.adapterFor(r,t)}cut(e,r=E.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),u=r.x(i.value),d=VE(s,u,(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),u=r.x(i.value),d=o-a,m=e-a,x=Jt.byHalf(d,s,Jt.valueAt({slope:n.interpolation.slope,steps:d,y0:s,y1:u},d*.5),u),g=Jt.valueAt(x,m),w=Jt.slopeByHalf(s,Jt.valueAt(x,m*.5),g);return oi.write(n.box.interpolation,ni.Curve(w)),b.wrap(this.createEvent({position:e,value:r.y(g),index:0,interpolation:ni.Curve(Jt.slopeByHalf(g,Jt.valueAt(x,(m+d)*.5),u))}))}return V("Unknown interpolation type")}subscribeChange(e){return Ye(this,Ks,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Ye(this,zu,"f").values().find(u=>u.position===a&&u.index===r);if(W(o)&&o.box.isAttached())return o.box.value.setValue(n),oi.write(o.box.interpolation,i),o;let s=kn.create(Ye(this,Co,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.index.setValue(r),u.value.setValue(n),u.events.refer(Ye(this,Gi,"f").events)});return oi.write(s.interpolation,i),Ye(this,Co,"f").boxAdapters.adapterFor(s,Ya)}requestSorting(){Ye(this,Qa,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ye(this,pp,"m",Ug).call(this)}terminate(){Ye(this,fp,"f").terminate()}get box(){return Ye(this,Gi,"f")}get uuid(){return Ye(this,Gi,"f").address.uuid}get address(){return Ye(this,Gi,"f").address}get numOwners(){return Ye(this,Gi,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Ye(this,Qa,"f")}toString(){return`{ValueEventCollectionBox ${M.toString(Ye(this,Gi,"f").address.uuid)}}`}};fp=new WeakMap,Co=new WeakMap,Gi=new WeakMap,Ks=new WeakMap,zu=new WeakMap,Qa=new WeakMap,pp=new WeakSet,Ug=function(){Ye(this,Ks,"f").notify(this)};var Ws=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},Ce=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)},Ls,zo,Zs,er,Gs,gp,mp,hp,Ou,Oo=class{constructor(e,r){Ls.add(this),this.type="value-clip",zo.set(this,new X),Zs.set(this,void 0),er.set(this,void 0),Gs.set(this,void 0),gp.set(this,void 0),mp.set(this,void 0),hp.set(this,pe.Empty),Ws(this,Zs,e,"f"),Ws(this,er,r,"f"),Ws(this,mp,!0,"f"),Ws(this,Gs,Ce(this,zo,"f").own(new Wi(!1)),"f"),Ws(this,gp,Ce(this,zo,"f").own(new fe),"f"),Ce(this,zo,"f").own(Ce(this,er,"f").pointerHub.subscribe({onAdded:()=>Ce(this,Ls,"m",Ou).call(this),onRemoved:()=>Ce(this,Ls,"m",Ou).call(this)})),Ce(this,zo,"f").own(Ce(this,er,"f").subscribe(Te.Children,n=>Ce(this,Ls,"m",Ou).call(this))),Ce(this,zo,"f").own(Ce(this,er,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ce(this,hp,"f").terminate(),Ws(this,hp,n.match({none:()=>pe.Empty,some:({box:i})=>Ce(this,Zs,"f").boxAdapters.adapterFor(i,Fr).subscribeChange(()=>Ce(this,Ls,"m",Ou).call(this))}),"f"),Ce(this,Ls,"m",Ou).call(this)})),Ws(this,mp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ce(this,Gs,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ce(this,gp,"f").subscribe(e)}accept(e){return P(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ce(this,er,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ce(this,er,"f").events.targetVertex.unwrap("events.target");xu.create(Ce(this,Zs,"f").boxGraph,M.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(Ce(this,er,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ce(this,Gs,"f").setValue(!0)}onDeselected(){Ce(this,Gs,"f").setValue(!1)}get isSelected(){return Ce(this,Gs,"f").getValue()}terminate(){Ce(this,hp,"f").terminate(),Ce(this,zo,"f").terminate()}get box(){return Ce(this,er,"f")}get uuid(){return Ce(this,er,"f").address.uuid}get address(){return Ce(this,er,"f").address}get indexField(){return Ce(this,er,"f").index}get duration(){return Ce(this,er,"f").duration.getValue()}get mute(){return Ce(this,er,"f").mute.getValue()}get hue(){return Ce(this,er,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ce(this,er,"f").events.targetVertex.map(e=>Ce(this,Zs,"f").boxAdapters.adapterFor(e.box,Fr))}get label(){return Ce(this,er,"f").label.getValue()}get trackBoxAdapter(){return Ce(this,mp,"f")?b.None:Ce(this,er,"f").clips.targetVertex.map(e=>Ce(this,Zs,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${M.toString(Ce(this,er,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};zo=new WeakMap,Zs=new WeakMap,er=new WeakMap,Gs=new WeakMap,gp=new WeakMap,mp=new WeakMap,hp=new WeakMap,Ls=new WeakSet,Ou=function(){Ce(this,gp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Vg=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},Hi=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,jg,Hs,yp,xp,Kg,Uu=class{constructor(e){vp.add(this),this.type="transient-marker",jg.set(this,new X),Hs.set(this,void 0),yp.set(this,void 0),xp.set(this,!1),Vg(this,Hs,e,"f"),Vg(this,yp,new fe,"f"),Hi(this,jg,"f").own(e.subscribe(Te.Children,()=>Hi(this,vp,"m",Kg).call(this)))}onSelected(){Vg(this,xp,!0,"f"),Hi(this,vp,"m",Kg).call(this)}onDeselected(){Vg(this,xp,!1,"f"),Hi(this,vp,"m",Kg).call(this)}get box(){return Hi(this,Hs,"f")}get uuid(){return Hi(this,Hs,"f").address.uuid}get address(){return Hi(this,Hs,"f").address}get position(){return Hi(this,Hs,"f").position.getValue()}get isSelected(){return Hi(this,xp,"f")}subscribe(e){return Hi(this,yp,"f").subscribe(e)}terminate(){Hi(this,jg,"f").terminate()}};jg=new WeakMap,Hs=new WeakMap,yp=new WeakMap,xp=new WeakMap,vp=new WeakSet,Kg=function(){Hi(this,yp,"f").notify()};var wp=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)},Wg,bp,fa,_p,Vu,Lg,In=class t{constructor(e,r){Wg.set(this,new X),bp.set(this,void 0),fa.set(this,void 0),_p.set(this,void 0),Vu.set(this,void 0),Lg.set(this,void 0),wp(this,bp,e,"f"),wp(this,fa,r,"f"),wp(this,_p,M.newSet(({uuid:n})=>n),"f"),wp(this,Vu,Ir.create(t.Comparator),"f"),wp(this,Lg,Dh.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(u=>{u.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):u.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(u.reason)))});return n}),"f"),Sr(this,Wg,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Sr(this,bp,"f").boxAdapters.adapterFor(n.box,Uu);Sr(this,_p,"f").add(i)&&Sr(this,Vu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Sr(this,Vu,"f").remove(Sr(this,_p,"f").removeByKey(n))}}))}get box(){return Sr(this,fa,"f")}get uuid(){return Sr(this,fa,"f").address.uuid}get address(){return Sr(this,fa,"f").address}get startInSeconds(){return Sr(this,fa,"f").startInSeconds.getValue()}get endInSeconds(){return Sr(this,fa,"f").endInSeconds.getValue()}get transients(){return Sr(this,Vu,"f")}get fileName(){return Sr(this,fa,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Sr(this,Lg,"f").call(this)}getOrCreateLoader(){return Sr(this,bp,"f").sampleManager.getOrCreate(Sr(this,fa,"f").address.uuid)}terminate(){Sr(this,Wg,"f").terminate()}};Wg=new WeakMap,bp=new WeakMap,fa=new WeakMap,_p=new WeakMap,Vu=new WeakMap,Lg=new WeakMap;In.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var Ap=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},Zr=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)},Fp,Zg,Gg,eo,Ep,Sp,Hg,ma=class{constructor(e,r){Fp.add(this),this.type="warp-marker",Zg.set(this,new X),Gg.set(this,void 0),eo.set(this,void 0),Ep.set(this,void 0),Sp.set(this,!1),Ap(this,Gg,e,"f"),Ap(this,eo,r,"f"),Ap(this,Ep,new fe,"f"),Zr(this,Zg,"f").own(r.subscribe(Te.Children,()=>Zr(this,Fp,"m",Hg).call(this)))}onSelected(){Ap(this,Sp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Zr(this,Fp,"m",Hg).call(this)}onDeselected(){Ap(this,Sp,!1,"f"),Zr(this,Fp,"m",Hg).call(this)}get box(){return Zr(this,eo,"f")}get uuid(){return Zr(this,eo,"f").address.uuid}get address(){return Zr(this,eo,"f").address}get position(){return Zr(this,eo,"f").position.getValue()}get seconds(){return Zr(this,eo,"f").seconds.getValue()}get isSelected(){return Zr(this,Sp,"f")}get optWarping(){return Zr(this,eo,"f").owner.targetVertex.map(e=>Zr(this,Gg,"f").boxAdapters.adapterFor(e.box,ha.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Zr(this,Ep,"f").subscribe(e)}terminate(){Zr(this,Zg,"f").terminate()}};Zg=new WeakMap,Gg=new WeakMap,eo=new WeakMap,Ep=new WeakMap,Sp=new WeakMap,Fp=new WeakSet,Hg=function(){Zr(this,Ep,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var ju=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var Pp=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)},qg,Jg,qs,Js,$p,Ku,ga=class{constructor(e,r){qg.set(this,new X),Jg.set(this,void 0),qs.set(this,void 0),Js.set(this,void 0),$p.set(this,void 0),Ku.set(this,void 0),Pp(this,Jg,e,"f"),Pp(this,qs,r,"f"),Pp(this,Js,new fe,"f"),Pp(this,$p,M.newSet(({uuid:n})=>n),"f"),Pp(this,Ku,Ir.create(ju),"f"),Tr(this,qg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Tr(this,Jg,"f").boxAdapters.adapterFor(n.box,ma);Tr(this,$p,"f").add(i)&&(Tr(this,Ku,"f").add(i),Tr(this,Js,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Tr(this,Ku,"f").remove(Tr(this,$p,"f").removeByKey(n)),Tr(this,Js,"f").notify()}}))}get box(){return Tr(this,qs,"f")}get uuid(){return Tr(this,qs,"f").address.uuid}get address(){return Tr(this,qs,"f").address}get warpMarkers(){return Tr(this,Ku,"f")}clone(){let e=bu.create(Tr(this,qs,"f").graph,M.generate());return this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Tr(this,Js,"f").subscribe(e)}onChanged(){Tr(this,Js,"f").notify()}terminate(){Tr(this,qg,"f").terminate()}};qg=new WeakMap,Jg=new WeakMap,qs=new WeakMap,Js=new WeakMap,$p=new WeakMap,Ku=new WeakMap;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},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)},Xg,Yg,Bn,Xs,Mp,Wu,va=class{constructor(e,r){Xg.set(this,new X),Yg.set(this,void 0),Bn.set(this,void 0),Xs.set(this,void 0),Mp.set(this,void 0),Wu.set(this,void 0),kp(this,Yg,e,"f"),kp(this,Bn,r,"f"),kp(this,Xs,new fe,"f"),kp(this,Mp,M.newSet(({uuid:n})=>n),"f"),kp(this,Wu,Ir.create(ju),"f"),rr(this,Xg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=rr(this,Yg,"f").boxAdapters.adapterFor(n.box,ma);rr(this,Mp,"f").add(i)&&(rr(this,Wu,"f").add(i),rr(this,Xs,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{rr(this,Wu,"f").remove(rr(this,Mp,"f").removeByKey(n)),rr(this,Xs,"f").notify()}}))}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 warpMarkers(){return rr(this,Wu,"f")}get playbackRate(){return rr(this,Bn,"f").playbackRate.getValue()}get cents(){return Math.log2(rr(this,Bn,"f").playbackRate.getValue())*1200}set cents(e){rr(this,Bn,"f").playbackRate.setValue(at(2**(e/1200),.5,2))}get transientPlayMode(){return ja(rr(this,Bn,"f").transientPlayMode.getValue(),Uh)}clone(){let e=_u.create(rr(this,Bn,"f").graph,M.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return rr(this,Xs,"f").subscribe(e)}onChanged(){rr(this,Xs,"f").notify()}terminate(){rr(this,Xg,"f").terminate()}};Xg=new WeakMap,Yg=new WeakMap,Bn=new WeakMap,Xs=new WeakMap,Mp=new WeakMap,Wu=new WeakMap;var Np=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)},Qg,ev,qi,Ys,Ip,Lu,xa=class{constructor(e,r){Qg.set(this,new X),ev.set(this,void 0),qi.set(this,void 0),Ys.set(this,void 0),Ip.set(this,void 0),Lu.set(this,void 0),Np(this,ev,e,"f"),Np(this,qi,r,"f"),Np(this,Ys,new fe,"f"),Np(this,Ip,M.newSet(({uuid:n})=>n),"f"),Np(this,Lu,Ir.create(ju),"f"),Wt(this,Qg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Wt(this,ev,"f").boxAdapters.adapterFor(n.box,ma);Wt(this,Ip,"f").add(i)&&(Wt(this,Lu,"f").add(i),Wt(this,Ys,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Wt(this,Lu,"f").remove(Wt(this,Ip,"f").removeByKey(n)),Wt(this,Ys,"f").notify()}}))}get box(){return Wt(this,qi,"f")}get uuid(){return Wt(this,qi,"f").address.uuid}get address(){return Wt(this,qi,"f").address}get warpMarkers(){return Wt(this,Lu,"f")}get transpose(){return Wt(this,qi,"f").transpose.getValue()}set transpose(e){Wt(this,qi,"f").transpose.setValue(e)}get cents(){return Wt(this,qi,"f").transpose.getValue()*100}set cents(e){Wt(this,qi,"f").transpose.setValue(e/100)}clone(){let e=Au.create(Wt(this,qi,"f").graph,M.generate());return e.transpose.setValue(Wt(this,qi,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Wt(this,Ys,"f").subscribe(e)}onChanged(){Wt(this,Ys,"f").notify()}terminate(){Wt(this,Qg,"f").terminate()}};Qg=new WeakMap,ev=new WeakMap,qi=new WeakMap,Ys=new WeakMap,Ip=new WeakMap,Lu=new WeakMap;var ha;(function(t){t.isAudioPlayMode=e=>e instanceof ga||e instanceof va||e instanceof xa})(ha||(ha={}));var Ai=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},ge=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)},Qs,Zu,el,Dt,tl,rl,Bp,Dp,Tp,Uo,Gu,Hu,qu,Ju=class{constructor(e,r){Qs.add(this),this.type="audio-clip",Zu.set(this,new X),el.set(this,void 0),Dt.set(this,void 0),tl.set(this,void 0),rl.set(this,void 0),Bp.set(this,void 0),Dp.set(this,void 0),Tp.set(this,void 0),Uo.set(this,b.None),Gu.set(this,b.None),Hu.set(this,pe.Empty),Ai(this,el,e,"f"),Ai(this,Dt,r,"f"),Ai(this,Tp,!0,"f"),Ai(this,tl,new _r,"f"),Ai(this,rl,ge(this,Zu,"f").own(new Wi(!1)),"f"),Ai(this,Bp,ks.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ai(this,Dp,ge(this,Zu,"f").own(new fe),"f"),ge(this,Zu,"f").ownAll(ge(this,Dt,"f").pointerHub.subscribe({onAdded:()=>ge(this,Qs,"m",qu).call(this),onRemoved:()=>ge(this,Qs,"m",qu).call(this)}),ge(this,Dt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ge(this,Hu,"f").terminate(),n.match({none:()=>ge(this,tl,"f").clear(),some:({box:i})=>{let a=ge(this,el,"f").boxAdapters.adapterFor(i,ha.isAudioPlayMode);Ai(this,Hu,a.subscribe(()=>ge(this,Qs,"m",qu).call(this)),"f"),ge(this,tl,"f").wrap(a)}})}),ge(this,Dt,"f").file.catchupAndSubscribe(n=>{Ai(this,Uo,n.targetVertex.map(i=>ge(this,el,"f").boxAdapters.adapterFor(i.box,In)),"f"),ge(this,Gu,"f").ifSome(i=>i.terminate()),Ai(this,Gu,ge(this,Uo,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ge(this,Qs,"m",qu).call(this))),"f")}),ge(this,Dt,"f").subscribe(Te.Children,n=>ge(this,Qs,"m",qu).call(this))),Ai(this,Tp,!1,"f")}catchupAndSubscribeSelected(e){return ge(this,rl,"f").catchupAndSubscribe(e)}subscribeChange(e){return ge(this,Dp,"f").subscribe(e)}accept(e){return P(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());wu.create(ge(this,el,"f").boxGraph,M.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(ge(this,Dt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(ge(this,Dt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(ge(this,Dt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){ge(this,rl,"f").setValue(!0)}onDeselected(){ge(this,rl,"f").setValue(!1)}get isSelected(){return ge(this,rl,"f").getValue()}get box(){return ge(this,Dt,"f")}get uuid(){return ge(this,Dt,"f").address.uuid}get address(){return ge(this,Dt,"f").address}get indexField(){return ge(this,Dt,"f").index}get duration(){return ge(this,Bp,"f").toPPQN(0)}set duration(e){ge(this,Bp,"f").fromPPQN(e,0)}get mute(){return ge(this,Dt,"f").mute.getValue()}get hue(){return ge(this,Dt,"f").hue.getValue()}get gain(){return ge(this,Dt,"f").gain}get file(){return ge(this,Uo,"f").unwrap("Cannot access file.")}get optFile(){return ge(this,Uo,"f")}get observableOptPlayMode(){return ge(this,tl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return ja(ge(this,Dt,"f").timeBase.getValue(),Lr)}get waveformOffset(){return ge(this,Dt,"f").waveformOffset}get isPlayModeNoStretch(){return ge(this,Dt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>mt(e,ga)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>mt(e,va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>mt(e,xa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ha.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ge(this,Uo,"f").isEmpty())return"No Audio File";let e=ge(this,Uo,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ge(this,Dt,"f").label.getValue()}get trackBoxAdapter(){return ge(this,Tp,"f")?b.None:ge(this,Dt,"f").clips.targetVertex.map(e=>ge(this,el,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ge(this,tl,"f").nonEmpty()}terminate(){ge(this,Gu,"f").ifSome(e=>e.terminate()),Ai(this,Gu,b.None,"f"),ge(this,Hu,"f").terminate(),Ai(this,Hu,pe.Empty,"f"),ge(this,Zu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${M.toString(ge(this,Dt,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Zu=new WeakMap,el=new WeakMap,Dt=new WeakMap,tl=new WeakMap,rl=new WeakMap,Bp=new WeakMap,Dp=new WeakMap,Tp=new WeakMap,Uo=new WeakMap,Gu=new WeakMap,Hu=new WeakMap,Qs=new WeakSet,qu=function(){ge(this,Dp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Rp=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},Lt=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)},Xu,dr,tv,Cp,il=class t{constructor(e,r){this.type="note-event",Xu.set(this,void 0),dr.set(this,void 0),tv.set(this,void 0),Cp.set(this,!1),Rp(this,Xu,e,"f"),Rp(this,dr,r,"f"),Rp(this,tv,Lt(this,dr,"f").subscribe(Te.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=ce.equals(Lt(this,dr,"f").pitch.address.fieldKeys,a),s=ce.equals(Lt(this,dr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Rp(this,Cp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Rp(this,Cp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Lt(this,tv,"f").terminate()}get box(){return Lt(this,dr,"f")}get uuid(){return Lt(this,dr,"f").address.uuid}get address(){return Lt(this,dr,"f").address}get position(){return Lt(this,dr,"f").position.getValue()}get duration(){return Lt(this,dr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Lt(this,dr,"f").velocity.getValue()}get pitch(){return Lt(this,dr,"f").pitch.getValue()}get cent(){return Lt(this,dr,"f").cent.getValue()}get chance(){return Lt(this,dr,"f").chance.getValue()}get playCount(){return Lt(this,dr,"f").playCount.getValue()}get playCurve(){return Lt(this,dr,"f").playCurve.getValue()}get isSelected(){return Lt(this,Cp,"f")}get collection(){return Lt(this,dr,"f").events.targetVertex.map(e=>Lt(this,Xu,"f").boxAdapters.adapterFor(e.box,Ji))}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 Lt(this,Xu,"f").boxAdapters.adapterFor(ko.create(Lt(this,Xu,"f").boxGraph,M.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 mu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=ce.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 Lt(this,dr,"f").delete(),n}};Xu=new WeakMap,dr=new WeakMap,tv=new WeakMap,Cp=new WeakMap;var ya=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)},to,zp,Vo,Tn,nl,Op,si,iv,nv,av,jo,rv,Up,Ji=class t{constructor(e,r){to.add(this),zp.set(this,new X),Vo.set(this,void 0),Tn.set(this,void 0),nl.set(this,void 0),Op.set(this,void 0),si.set(this,void 0),iv.set(this,60),nv.set(this,60),av.set(this,0),jo.set(this,!1),ya(this,Vo,e,"f"),ya(this,Tn,r,"f"),ya(this,nl,new fe,"f"),ya(this,Op,M.newSet(n=>n.uuid),"f"),ya(this,si,Ir.create(mu.Comparator),"f"),Fe(this,zp,"f").own(Fe(this,Tn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Fe(this,Vo,"f").boxAdapters.adapterFor(n,il);Fe(this,Op,"f").add(i)&&(Fe(this,si,"f").add(i),Fe(this,to,"m",rv).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Fe(this,si,"f").remove(Fe(this,Op,"f").removeByKey(n)),Fe(this,to,"m",rv).call(this)}})),Fe(this,zp,"f").own(Fe(this,Tn,"f").owners.pointerHub.subscribe({onAdded:()=>Fe(this,nl,"f").notify(this),onRemoved:()=>Fe(this,nl,"f").notify(this)}))}copy(){let e=Fe(this,Vo,"f").boxGraph,r=Xa.create(e,M.generate());return Fe(this,si,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Fe(this,Vo,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Fe(this,Vo,"f").boxAdapters.adapterFor(ko.create(Fe(this,Vo,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.duration.setValue(r),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(a),u.playCount.setValue(o),u.cent.setValue(s),u.events.refer(Fe(this,Tn,"f").events)}),il)}subscribeChange(e){return Fe(this,nl,"f").subscribe(e)}selectable(){return Fe(this,si,"f").asArray()}selectableAt(e){for(let r of Fe(this,si,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return Xt.one(r);return Xt.empty()}selectablesBetween(e,r){let n=[],i=Fe(this,si,"f").asArray(),a=Fe(this,si,"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 Fe(this,si,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Fe(this,si,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Fe(this,to,"m",rv).call(this)}terminate(){Fe(this,zp,"f").terminate()}get box(){return Fe(this,Tn,"f")}get uuid(){return Fe(this,Tn,"f").address.uuid}get address(){return Fe(this,Tn,"f").address}get numOwners(){return Fe(this,Tn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,si,"f")}get minPitch(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,iv,"f")}get maxPitch(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,nv,"f")}get maxDuration(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,av,"f")}toString(){return`{NoteEventCollectionBox ${M.toString(Fe(this,Tn,"f").address.uuid)}}`}};zp=new WeakMap,Vo=new WeakMap,Tn=new WeakMap,nl=new WeakMap,Op=new WeakMap,si=new WeakMap,iv=new WeakMap,nv=new WeakMap,av=new WeakMap,jo=new WeakMap,to=new WeakSet,rv=function(){ya(this,jo,!1,"f"),Fe(this,nl,"f").notify(this)},Up=function(){let e=127,r=0,n=0;Fe(this,si,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),ya(this,iv,e,"f"),ya(this,nv,r,"f"),ya(this,av,n,"f"),ya(this,jo,!0,"f")};var al=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},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)},ol,Yu,sl,ir,ll,Kp,Vp,jp,Qu,ec=class{constructor(e,r){ol.add(this),this.type="note-clip",Yu.set(this,new X),sl.set(this,void 0),ir.set(this,void 0),ll.set(this,void 0),Kp.set(this,void 0),Vp.set(this,void 0),jp.set(this,pe.Empty),al(this,sl,e,"f"),al(this,ir,r,"f"),al(this,Vp,!0,"f"),al(this,ll,Ue(this,Yu,"f").own(new Wi(!1)),"f"),al(this,Kp,Ue(this,Yu,"f").own(new fe),"f"),Ue(this,Yu,"f").ownAll(Ue(this,ir,"f").pointerHub.subscribe({onAdded:()=>Ue(this,ol,"m",Qu).call(this),onRemoved:()=>Ue(this,ol,"m",Qu).call(this)}),Ue(this,ir,"f").subscribe(Te.Children,n=>Ue(this,ol,"m",Qu).call(this)),Ue(this,ir,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ue(this,jp,"f").terminate(),al(this,jp,n.match({none:()=>pe.Empty,some:({box:i})=>Ue(this,sl,"f").boxAdapters.adapterFor(i,Ji).subscribeChange(()=>Ue(this,ol,"m",Qu).call(this))}),"f"),Ue(this,ol,"m",Qu).call(this)})),al(this,Vp,!1,"f")}catchupAndSubscribeSelected(e){return Ue(this,ll,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ue(this,Kp,"f").subscribe(e)}accept(e){return P(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ue(this,ir,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ue(this,ir,"f").events.targetVertex.unwrap("events.target");vu.create(Ue(this,sl,"f").boxGraph,M.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(Ue(this,ir,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ue(this,ll,"f").setValue(!0)}onDeselected(){Ue(this,ll,"f").setValue(!1)}get isSelected(){return Ue(this,ll,"f").getValue()}terminate(){Ue(this,jp,"f").terminate(),Ue(this,Yu,"f").terminate()}get box(){return Ue(this,ir,"f")}get uuid(){return Ue(this,ir,"f").address.uuid}get address(){return Ue(this,ir,"f").address}get indexField(){return Ue(this,ir,"f").index}get duration(){return Ue(this,ir,"f").duration.getValue()}get mute(){return Ue(this,ir,"f").mute.getValue()}get hue(){return Ue(this,ir,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ue(this,ir,"f").events.targetVertex.map(e=>Ue(this,sl,"f").boxAdapters.adapterFor(e.box,Ji))}get label(){return Ue(this,ir,"f").label.getValue()}get trackBoxAdapter(){return Ue(this,Vp,"f")?b.None:Ue(this,ir,"f").clips.targetVertex.map(e=>Ue(this,sl,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${M.toString(Ue(this,ir,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Yu=new WeakMap,sl=new WeakMap,ir=new WeakMap,ll=new WeakMap,Kp=new WeakMap,Vp=new WeakMap,jp=new WeakMap,ol=new WeakSet,Qu=function(){Ue(this,Kp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var nP={for:(t,e)=>ze(e.accept({visitNoteClipBox:r=>t.adapterFor(r,ec),visitValueClipBox:r=>t.adapterFor(r,Oo),visitAudioClipBox:r=>t.adapterFor(r,Ju)}),"")};var ov=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},Ko=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)},sv,tc,Wp,Lp,lv=class{constructor(e,r){sv.set(this,void 0),tc.set(this,void 0),Wp.set(this,void 0),Lp.set(this,void 0),ov(this,sv,e,"f"),ov(this,tc,new X,"f"),ov(this,Wp,Ko(this,tc,"f").own(new fe),"f"),ov(this,Lp,Ko(this,tc,"f").own(cr.create(e.box.clips,n=>nP.for(r,n),l.ClipCollection)),"f"),Ko(this,Lp,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Ko(this,sv,"f")}get collection(){return Ko(this,Lp,"f")}dispatchChange(){Ko(this,Wp,"f").notify()}subscribeChanges(e){return Ko(this,Wp,"f").subscribe(e)}terminate(){Ko(this,tc,"f").terminate()}};sv=new WeakMap,tc=new WeakMap,Wp=new WeakMap,Lp=new WeakMap;var SB=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)},Gr,uv=class{constructor(e){Gr.set(this,void 0),SB(this,Gr,e,"f")}get inField(){return Xi(this,Gr,"f").in}get outField(){return Xi(this,Gr,"f").out}get inSlopeField(){return Xi(this,Gr,"f").inSlope}get outSlopeField(){return Xi(this,Gr,"f").outSlope}get in(){return Xi(this,Gr,"f").in.getValue()}get out(){return Xi(this,Gr,"f").out.getValue()}get inSlope(){return Xi(this,Gr,"f").inSlope.getValue()}get outSlope(){return Xi(this,Gr,"f").outSlope.getValue()}get hasFading(){return Mh.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(){Xi(this,Gr,"f").in.setValue(0),Xi(this,Gr,"f").out.setValue(0),Xi(this,Gr,"f").inSlope.setValue(.75),Xi(this,Gr,"f").outSlope.setValue(.25)}};Gr=new WeakMap;var gt=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},Y=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)},Fi,Zp,Yi,et,rc,ic,nc,Gp,Dn,Hp,Wo,ac,oc,sc,lc,uc,cc,dc,Qi,pc=class t{constructor(e,r){Fi.add(this),this.type="audio-region",Zp.set(this,void 0),Yi.set(this,void 0),et.set(this,void 0),rc.set(this,void 0),ic.set(this,void 0),nc.set(this,void 0),Gp.set(this,void 0),Dn.set(this,void 0),Hp.set(this,void 0),Wo.set(this,b.None),ac.set(this,pe.Empty),oc.set(this,pe.Empty),sc.set(this,pe.Empty),lc.set(this,pe.Empty),uc.set(this,void 0),cc.set(this,Number.NaN),dc.set(this,Number.NaN),gt(this,Yi,e,"f"),gt(this,et,r,"f"),gt(this,Zp,new X,"f");let{timeBase:n,duration:i,loopDuration:a}=r;gt(this,rc,ks.aware(e.tempoMap,n,i),"f"),gt(this,ic,ks.aware(e.tempoMap,n,a),"f"),gt(this,nc,new _r,"f"),gt(this,Gp,new fe,"f"),gt(this,Dn,new uv(r.fading),"f"),gt(this,uc,!1,"f"),gt(this,Hp,!0,"f"),Y(this,Zp,"f").ownAll(Y(this,et,"f").pointerHub.subscribe({onAdded:()=>Y(this,Fi,"m",Qi).call(this),onRemoved:()=>Y(this,Fi,"m",Qi).call(this)}),Y(this,et,"f").file.catchupAndSubscribe(o=>{gt(this,Wo,o.targetVertex.map(s=>Y(this,Yi,"f").boxAdapters.adapterFor(s.box,In)),"f"),Y(this,ac,"f").terminate(),gt(this,ac,Y(this,Wo,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Y(this,Fi,"m",Qi).call(this)),pe.Empty),"f")}),Y(this,et,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Y(this,oc,"f").terminate(),o.match({none:()=>Y(this,nc,"f").clear(),some:({box:s})=>{let u=Y(this,Yi,"f").boxAdapters.adapterFor(s,ha.isAudioPlayMode);gt(this,oc,u.subscribe(()=>Y(this,Fi,"m",Qi).call(this)),"f"),Y(this,nc,"f").wrap(u)}})}),Y(this,et,"f").timeBase.catchupAndSubscribe(o=>{Y(this,sc,"f").terminate(),ja(o.getValue(),Lr)===Lr.Seconds&&gt(this,sc,e.tempoMap.subscribe(()=>Y(this,Fi,"m",Qi).call(this)),"f")}),Y(this,et,"f").subscribe(Te.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Y(this,et,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Y(this,Fi,"m",Qi).call(this)):Y(this,Fi,"m",Qi).call(this)}}),Y(this,et,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Y(this,lc,"f").terminate(),gt(this,lc,o.match({none:()=>pe.Empty,some:({box:s})=>Y(this,Yi,"f").boxAdapters.adapterFor(s,Fr).subscribeChange(()=>Y(this,Fi,"m",Qi).call(this))}),"f"),Y(this,Fi,"m",Qi).call(this)})),gt(this,Hp,!1,"f")}subscribeChange(e){return Y(this,Gp,"f").subscribe(e)}accept(e){return P(e.visitAudioRegionBoxAdapter,this)}onSelected(){gt(this,uc,!0,"f"),Y(this,Fi,"m",Qi).call(this)}onDeselected(){gt(this,uc,!1,"f"),Y(this,Fi,"m",Qi).call(this)}get isSelected(){return Y(this,uc,"f")}get box(){return Y(this,et,"f")}get uuid(){return Y(this,et,"f").address.uuid}get address(){return Y(this,et,"f").address}get position(){return Y(this,et,"f").position.getValue()}get duration(){return Number.isNaN(Y(this,cc,"f"))&&gt(this,cc,Y(this,rc,"f").toPPQN(this.position),"f"),Y(this,cc,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Y(this,et,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Y(this,dc,"f"))&&gt(this,dc,Y(this,ic,"f").toPPQN(this.position),"f"),Y(this,dc,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Y(this,rc,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Y(this,ic,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Y(this,et,"f").mute.getValue()}get hue(){return Y(this,et,"f").hue.getValue()}get gain(){return Y(this,et,"f").gain}get fading(){return Y(this,Dn,"f")}get file(){return Y(this,Wo,"f").unwrap("Cannot access file.")}get optFile(){return Y(this,Wo,"f")}get observableOptPlayMode(){return Y(this,nc,"f")}get timeBase(){return ja(Y(this,et,"f").timeBase.getValue(),Lr)}get waveformOffset(){return Y(this,et,"f").waveformOffset}get isPlayModeNoStretch(){return Y(this,et,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>mt(e,ga)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>mt(e,va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>mt(e,xa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ha.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Y(this,Wo,"f").isEmpty())return"No Audio File";let e=Y(this,Wo,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Y(this,et,"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 Y(this,et,"f").regions.targetVertex.map(e=>Y(this,Yi,"f").boxAdapters.adapterFor(e.box,tr))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Y(this,et,"f").events.targetVertex.map(e=>Y(this,Yi,"f").boxAdapters.adapterFor(e.box,Fr))}set position(e){Y(this,et,"f").position.setValue(e)}set duration(e){Y(this,rc,"f").fromPPQN(e,this.position);let r=Y(this,Dn,"f").in+Y(this,Dn,"f").out;if(r>e){let n=e/r;Y(this,Dn,"f").inField.setValue(Y(this,Dn,"f").in*n),Y(this,Dn,"f").outField.setValue(Y(this,Dn,"f").out*n)}}set loopOffset(e){Y(this,et,"f").loopOffset.setValue($s(e,this.loopDuration))}set loopDuration(e){Y(this,ic,"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===Lr.Seconds){let i=e>=0?Y(this,Yi,"f").tempoMap.intervalToSeconds(r,n):-Y(this,Yi,"f").tempoMap.intervalToSeconds(n,r);Y(this,et,"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=Y(this,Yi,"f").boxAdapters.adapterFor(No.create(Y(this,Yi,"f").boxGraph,M.generate(),o=>{o.timeBase.setValue(Y(this,et,"f").timeBase.getValue()),o.position.setValue(e?.position??Y(this,et,"f").position.getValue()),o.regions.refer(e?.target??Y(this,et,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Y(this,et,"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)),Y(this,Dn,"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&&ce.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(){Y(this,ac,"f").terminate(),gt(this,ac,pe.Empty,"f"),Y(this,sc,"f").terminate(),gt(this,sc,pe.Empty,"f"),Y(this,oc,"f").terminate(),gt(this,oc,pe.Empty,"f"),Y(this,lc,"f").terminate(),gt(this,lc,pe.Empty,"f"),Y(this,Zp,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${M.toString(Y(this,et,"f").address.uuid)}}`}};Zp=new WeakMap,Yi=new WeakMap,et=new WeakMap,rc=new WeakMap,ic=new WeakMap,nc=new WeakMap,Gp=new WeakMap,Dn=new WeakMap,Hp=new WeakMap,Wo=new WeakMap,ac=new WeakMap,oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,uc=new WeakMap,cc=new WeakMap,dc=new WeakMap,Fi=new WeakSet,Qi=function(){gt(this,cc,Number.NaN,"f"),gt(this,dc,Number.NaN,"f"),!Y(this,Hp,"f")&&(Y(this,Gp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var ro=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)},wa,cv,ba,vt,Xp,qp,fc,Jp,io,mc=class t{constructor(e,r){wa.add(this),this.type="note-region",cv.set(this,new X),ba.set(this,void 0),vt.set(this,void 0),Xp.set(this,void 0),qp.set(this,void 0),fc.set(this,void 0),Jp.set(this,pe.Empty),ro(this,ba,e,"f"),ro(this,vt,r,"f"),ro(this,Xp,new fe,"f"),ro(this,fc,!1,"f"),ro(this,qp,!0,"f"),Ee(this,cv,"f").ownAll(Ee(this,vt,"f").pointerHub.subscribe({onAdded:()=>Ee(this,wa,"m",io).call(this),onRemoved:()=>Ee(this,wa,"m",io).call(this)}),Ee(this,vt,"f").subscribe(Te.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ee(this,vt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ee(this,wa,"m",io).call(this)):Ee(this,wa,"m",io).call(this)}}),Ee(this,vt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ee(this,Jp,"f").terminate(),ro(this,Jp,n.match({none:()=>pe.Empty,some:({box:i})=>Ee(this,ba,"f").boxAdapters.adapterFor(i,Ji).subscribeChange(()=>Ee(this,wa,"m",io).call(this))}),"f"),Ee(this,wa,"m",io).call(this)})),ro(this,qp,!1,"f")}set position(e){Ee(this,vt,"f").position.setValue(e)}set duration(e){Ee(this,vt,"f").duration.setValue(e)}set loopOffset(e){Ee(this,vt,"f").loopOffset.setValue(e)}set loopDuration(e){Ee(this,vt,"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 Ee(this,Xp,"f").subscribe(e)}accept(e){return P(e.visitNoteRegionBoxAdapter,this)}onSelected(){ro(this,fc,!0,"f"),Ee(this,wa,"m",io).call(this)}onDeselected(){ro(this,fc,!1,"f"),Ee(this,wa,"m",io).call(this)}get isSelected(){return Ee(this,fc,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=La.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(){Ee(this,Jp,"f").terminate(),Ee(this,cv,"f").terminate()}get box(){return Ee(this,vt,"f")}get uuid(){return Ee(this,vt,"f").address.uuid}get address(){return Ee(this,vt,"f").address}get position(){return Ee(this,vt,"f").position.getValue()}get duration(){return Ee(this,vt,"f").duration.getValue()}get loopOffset(){return Ee(this,vt,"f").loopOffset.getValue()}get loopDuration(){return Ee(this,vt,"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 Ee(this,vt,"f").mute.getValue()}get hue(){return Ee(this,vt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Ee(this,vt,"f").events.targetVertex.map(e=>Ee(this,ba,"f").boxAdapters.adapterFor(e.box,Ji))}get label(){return Ee(this,vt,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,qp,"f")?b.None:Ee(this,vt,"f").regions.targetVertex.map(e=>Ee(this,ba,"f").boxAdapters.adapterFor(e.box,tr))}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 Ee(this,ba,"f").boxAdapters.adapterFor(Os.create(Ee(this,ba,"f").boxGraph,M.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??Ee(this,vt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Ee(this,ba,"f").boxGraph,n=Xa.create(r,M.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Ee(this,vt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ce.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=Ee(this,ba,"f").boxGraph,n=e.toSorted(_o.Comparator),i=ce.getFirst(n,"Internal error (no first)"),a=ce.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Xa.create(r,M.generate()),m=Array.from(u.regions.collection.iterateRange(o,s));return m.filter(x=>x.isSelected).forEach(x=>{let g=x;for(let{resultStart:w,resultEnd:A,rawStart:_}of La.locateLoops(g,g.position,g.complete)){let C=Math.floor(w-_),K=Math.floor(A-_);for(let U of g.optCollection.unwrap("optCollection").events.iterateRange(C,K))U.copyTo({position:U.position+_-i.position,events:d.events})}}),m.forEach(({box:x})=>x.delete()),b.wrap(Os.create(r,M.generate(),x=>{x.position.setValue(o),x.duration.setValue(s-o),x.loopDuration.setValue(s-o),x.loopOffset.setValue(0),x.hue.setValue(this.hue),x.mute.setValue(this.mute),x.label.setValue(this.label),x.events.refer(d.owners),x.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${M.toString(Ee(this,vt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};cv=new WeakMap,ba=new WeakMap,vt=new WeakMap,Xp=new WeakMap,qp=new WeakMap,fc=new WeakMap,Jp=new WeakMap,wa=new WeakSet,io=function(){Ee(this,Xp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var no=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},Ae=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)},Rn,hc,_a,xt,ef,gc,Yp,Qp,Aa,ao=class t{constructor(e,r){Rn.add(this),this.type="value-region",hc.set(this,new X),_a.set(this,void 0),xt.set(this,void 0),ef.set(this,void 0),gc.set(this,void 0),Yp.set(this,void 0),Qp.set(this,pe.Empty),no(this,_a,e,"f"),no(this,xt,r,"f"),no(this,Yp,!0,"f"),no(this,ef,new fe,"f"),no(this,gc,!1,"f"),Ae(this,hc,"f").own(Ae(this,xt,"f").pointerHub.subscribe({onAdded:()=>Ae(this,Rn,"m",Aa).call(this),onRemoved:()=>Ae(this,Rn,"m",Aa).call(this)})),Ae(this,hc,"f").own(Ae(this,xt,"f").subscribe(Te.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ae(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ae(this,Rn,"m",Aa).call(this)):Ae(this,Rn,"m",Aa).call(this)}})),Ae(this,hc,"f").own(Ae(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ae(this,Qp,"f").terminate(),no(this,Qp,n.match({none:()=>pe.Empty,some:({box:i})=>Ae(this,_a,"f").boxAdapters.adapterFor(i,Fr).subscribeChange(()=>Ae(this,Rn,"m",Aa).call(this))}),"f"),Ae(this,Rn,"m",Aa).call(this)})),no(this,Yp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(La.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(La.globalToLocal(this,this.complete),e)}subscribeChange(e){return Ae(this,ef,"f").subscribe(e)}accept(e){return P(e.visitValueRegionBoxAdapter,this)}onSelected(){no(this,gc,!0,"f"),Ae(this,Rn,"m",Aa).call(this)}onDeselected(){no(this,gc,!1,"f"),Ae(this,Rn,"m",Aa).call(this)}get isSelected(){return Ae(this,gc,"f")}onValuesPropertyChanged(){Ae(this,Rn,"m",Aa).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Ae(this,Qp,"f").terminate(),Ae(this,hc,"f").terminate()}get box(){return Ae(this,xt,"f")}get uuid(){return Ae(this,xt,"f").address.uuid}get address(){return Ae(this,xt,"f").address}get position(){return Ae(this,xt,"f").position.getValue()}get duration(){return Ae(this,xt,"f").duration.getValue()}get loopOffset(){return Ae(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Ae(this,xt,"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 Ae(this,xt,"f").mute.getValue()}get hue(){return Ae(this,xt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ae(this,xt,"f").events.targetVertex.map(e=>Ae(this,_a,"f").boxAdapters.adapterFor(e.box,Fr))}get label(){return Ae(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Ae(this,Yp,"f")?b.None:Ae(this,xt,"f").regions.targetVertex.map(e=>Ae(this,_a,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Ae(this,xt,"f").position.setValue(e)}set duration(e){Ae(this,xt,"f").duration.setValue(e)}set loopOffset(e){Ae(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Ae(this,xt,"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 Ae(this,_a,"f").boxAdapters.adapterFor(Us.create(Ae(this,_a,"f").boxGraph,M.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??Ae(this,xt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Ae(this,_a,"f").boxGraph,n=Mn.create(r,M.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Ae(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ce.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=Ae(this,_a,"f").boxGraph,n=e.toSorted(_o.Comparator),i=ce.getFirst(n,"Internal error (no first)"),a=ce.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Array.from(u.regions.collection.iterateRange(o,s)),m=[];d.filter(A=>A.isSelected).forEach(A=>{let _=A,C=_.optCollection.unwrap("optCollection"),K=C.events;for(let{rawStart:U,regionStart:ee,regionEnd:re}of La.locateLoops(_,_.position,_.complete)){let me=ee-U,$e=re-U,Q=K.greaterEqual(me);if(!W(Q)||Q.position!==me){let Ge=K.lowerEqual(me);W(Ge)&&m.push({position:ee-o,value:C.valueAt(me,0),interpolation:Ge.interpolation})}let we=!1;for(let Ge of K.iterateRange(me,br.MAX_VALUE)){let It=Ge.position+U;if(It<re)m.push({position:It-o,value:Ge.value,interpolation:Ge.interpolation});else if(It===re){m.push({position:It-o,value:Ge.value,interpolation:ni.None}),we=!0;break}else{m.push({position:re-o,value:C.valueAt($e,0),interpolation:ni.None}),we=!0;break}}we||m.push({position:re-o,value:C.valueAt($e,0),interpolation:ni.None})}});let x=[];for(let A of m){let _=x.length>0?x[x.length-1]:void 0;W(_)&&_.position===A.position&&_.value===A.value?x[x.length-1]=A:x.push(A)}let g=Mn.create(r,M.generate()),w=0;for(;w<x.length;){let A=w+1;for(;A<x.length&&x[A].position===x[w].position;)A++;let _=x[w],C=x[A-1],K=kn.create(r,M.generate(),U=>{U.position.setValue(_.position),U.index.setValue(0),U.value.setValue(_.value),U.events.refer(g.events)});if(oi.write(K.interpolation,A-w>1?ni.None:_.interpolation),A-w>1){let U=kn.create(r,M.generate(),ee=>{ee.position.setValue(C.position),ee.index.setValue(1),ee.value.setValue(C.value),ee.events.refer(g.events)});oi.write(U.interpolation,C.interpolation)}w=A}return d.forEach(({box:A})=>A.delete()),b.wrap(Us.create(r,M.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(g.owners),A.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${M.toString(Ae(this,xt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};hc=new WeakMap,_a=new WeakMap,xt=new WeakMap,ef=new WeakMap,gc=new WeakMap,Yp=new WeakMap,Qp=new WeakMap,Rn=new WeakSet,Aa=function(){Ae(this,ef,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var aP=(t,e)=>t.position-e.position,oP={for:(t,e)=>ze(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,mc),visitAudioRegionBox:r=>t.adapterFor(r,pc),visitValueRegionBox:r=>t.adapterFor(r,ao)}),"")};var vc=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)},xc,ul,tf,yc,Lo,wc,dv=class{constructor(e,r){xc.set(this,void 0),ul.set(this,void 0),tf.set(this,void 0),yc.set(this,void 0),Lo.set(this,void 0),wc.set(this,void 0),vc(this,xc,e,"f"),vc(this,ul,new X,"f"),vc(this,tf,nr(this,ul,"f").own(new fe),"f"),vc(this,yc,nr(this,ul,"f").own(new Qt),"f"),vc(this,Lo,_o.create(aP),"f"),vc(this,wc,M.newSet(n=>n.uuid),"f"),nr(this,ul,"f").ownAll(nr(this,xc,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=oP.for(r,n),a=nr(this,wc,"f").add(i);te(a,`Cannot add ${n}`),nr(this,Lo,"f").add(i);for(let o of nr(this,Lo,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:nr(this,xc,"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}nr(this,yc,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=nr(this,wc,"f").removeByKey(n);nr(this,Lo,"f").remove(i),nr(this,yc,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return nr(this,xc,"f")}get collection(){return nr(this,Lo,"f")}get adapters(){return nr(this,wc,"f")}onIndexingChanged(){nr(this,Lo,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),nr(this,yc,"f").subscribe(e)}subscribeChanges(e){return nr(this,tf,"f").subscribe(e)}dispatchChange(){nr(this,tf,"f").notify()}terminate(){nr(this,ul,"f").terminate()}};xc=new WeakMap,ul=new WeakMap,tf=new WeakMap,yc=new WeakMap,Lo=new WeakMap,wc=new WeakMap;var ve;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ve||(ve={}));(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 Le.Waveform;case t.Notes:return Le.Piano;case t.Value:return Le.Automation;case t.Undefined:return Le.AudioBus;default:return Le.Unknown}}})(ve||(ve={}));var pv;(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&&mt(e.host,N)?e.host:V(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>W(e)&&"label"in e&&mt(e.label,B)?e.label:V(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>W(e)&&"enabled"in e&&mt(e.enabled,R)?e.enabled:V(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>W(e)&&"minimized"in e&&mt(e.minimized,R)?e.minimized:V(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>W(e)&&"index"in e&&mt(e.index,k)?e.index:V(`Could not find 'index' field in '${e?.name}'`)})(pv||(pv={}));var sP;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ve.Notes;case"audio":return ve.Audio;default:return V()}}})(sP||(sP={}));var ae;(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;te(ce.satisfy(e,(i,a)=>i.deviceHost().address.equals(a.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];(r.accepts==="audio"?r.deviceHost().audioEffects.field().pointerHub.filter(l.AudioEffectHost):r.accepts==="midi"?r.deviceHost().midiEffects.field().pointerHub.filter(l.MIDIEffectHost):V("unknown type")).map(({box:i})=>pv.lookupIndexField(i)).filter(i=>e.some(a=>M.Comparator(a.uuid,i.address.uuid)!==0)).sort((i,a)=>i.getValue()-a.getValue()).forEach((i,a)=>i.setValue(a)),e.forEach(i=>i.box.delete())}})(ae||(ae={}));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},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)},bc,mv,Cn,cl,hv,gv=class{constructor(e,r){bc.set(this,void 0),mv.set(this,new fe),Cn.set(this,void 0),cl.set(this,void 0),hv.set(this,void 0),fv(this,bc,e,"f"),fv(this,Cn,cr.create(e.box.tracks,n=>r.adapterFor(n,tr),l.TrackCollection),"f"),fv(this,cl,M.newSet(({uuid:n})=>n),"f"),fv(this,hv,xr(this,Cn,"f").catchupAndSubscribe({onAdd:n=>xr(this,cl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>xr(this,mv,"f").notify())}),onRemove:({uuid:n})=>xr(this,cl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=xr(this,bc,"f").box.graph,a=xr(this,bc,"f").box.tracks;Br.create(i,M.generate(),o=>{o.index.setValue(n??xr(this,Cn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(xr(this,Cn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=xr(this,Cn,"f").adapters(),n=r.indexOf(e);if(n===-1)return V(`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 xr(this,bc,"f").box}get collection(){return xr(this,Cn,"f")}values(){return xr(this,Cn,"f").adapters()}catchupAndSubscribe(e){return xr(this,Cn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return xr(this,mv,"f").subscribe(e)}terminate(){xr(this,Cn,"f").terminate(),xr(this,hv,"f").terminate(),xr(this,cl,"f").forEach(({subscription:e})=>e.terminate()),xr(this,cl,"f").clear()}};bc=new WeakMap,mv=new WeakMap,Cn=new WeakMap,cl=new WeakMap,hv=new WeakMap;var oe;(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.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.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.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont"})(oe||(oe={}));var lP=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},zn=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)},vv,Si,Ei=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=oe.AudioBus,vv.set(this,void 0),Si.set(this,void 0),lP(this,vv,e,"f"),lP(this,Si,r,"f")}catchupAndSubscribe(e){return e(this),zn(this,Si,"f").subscribe(Te.Children,()=>e(this))}get uuid(){return zn(this,Si,"f").address.uuid}get address(){return zn(this,Si,"f").address}get box(){return zn(this,Si,"f")}get enabledField(){return zn(this,Si,"f").enabled}get minimizedField(){return zn(this,Si,"f").minimized}get iconField(){return zn(this,Si,"f").icon}get labelField(){return zn(this,Si,"f").label}get colorField(){return zn(this,Si,"f").color}get iconSymbol(){return Le.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return zn(this,vv,"f").boxAdapters.adapterFor(zn(this,Si,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};vv=new WeakMap,Si=new WeakMap;var rf=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)},oo,_c,Ac,Pi,nf,xv=class{constructor(e,r){oo.set(this,void 0),_c.set(this,void 0),Ac.set(this,void 0),Pi.set(this,void 0),nf.set(this,pe.Empty),rf(this,oo,new X,"f"),rf(this,_c,kt(this,oo,"f").own(new fe),"f"),rf(this,Ac,kt(this,oo,"f").own(new Wi(Le.Unknown)),"f"),rf(this,Pi,kt(this,oo,"f").own(new _r),"f"),kt(this,oo,"f").own(kt(this,Pi,"f").subscribe(n=>{kt(this,nf,"f").terminate(),rf(this,nf,n.match({none:()=>(kt(this,_c,"f").notify(b.None),pe.Empty),some:({labelField:i,iconField:a})=>pe.many(a.catchupAndSubscribe(o=>kt(this,Ac,"f").setValue(Le.fromName(o.getValue()))),i.catchupAndSubscribe(o=>kt(this,_c,"f").notify(b.wrap(o.getValue()))))}),"f")})),kt(this,oo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(kt(this,Pi,"f").nonEmpty()){let o=kt(this,Pi,"f").unwrap();V(`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 Nn?r.adapterFor(n,Ei):r.adapterFor(n,ae.isInstrument);kt(this,Pi,"f").unwrapOrNull()!==a&&kt(this,Pi,"f").wrap(a)},onRemoved:({box:n})=>{te(kt(this,Pi,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),kt(this,Pi,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return kt(this,Pi,"f")}subscribe(e){return kt(this,Pi,"f").subscribe(e)}catchupAndSubscribe(e){return e(kt(this,Pi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),kt(this,_c,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return kt(this,Ac,"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(Le.toName(e)))}get icon(){return this.adapter().match({none:()=>Le.Unknown,some:e=>Le.fromName(e.iconField.getValue())})}get iconValue(){return kt(this,Ac,"f")}terminate(){kt(this,oo,"f").terminate(),kt(this,nf,"f").terminate()}};oo=new WeakMap,_c=new WeakMap,Ac=new WeakMap,Pi=new WeakMap,nf=new WeakMap;var uP=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},dl=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)},yv,so,de=class{constructor(e){yv.set(this,void 0),so.set(this,void 0),uP(this,yv,e,"f"),uP(this,so,Oe.newSet(r=>r.address),"f")}terminate(){dl(this,so,"f").forEach(e=>e.terminate()),dl(this,so,"f").clear()}parameters(){return dl(this,so,"f").values()}parameterAt(e){return dl(this,so,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new pl(dl(this,yv,"f"),e,r,n,i,a,o),u=dl(this,so,"f").add(s);return te(u,`Could not add adapter for ${e}`),s}removeParameter(e){return dl(this,so,"f").removeByKey(e)}};yv=new WeakMap,so=new WeakMap;var fl=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)},ml,en,Zo,Fc,wv,bv,af,Sc=class{constructor(e,r){ml.set(this,void 0),en.set(this,void 0),Zo.set(this,void 0),Fc.set(this,void 0),wv.set(this,void 0),bv.set(this,void 0),af.set(this,pe.Empty),fl(this,ml,e,"f"),fl(this,en,r,"f"),fl(this,Zo,new X,"f"),fl(this,Fc,St(this,Zo,"f").own(new fe),"f"),St(this,Zo,"f").own(r.targetBus.catchupAndSubscribe(()=>{St(this,af,"f").terminate(),fl(this,af,this.optTargetBus.match({none:()=>(St(this,Fc,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>St(this,Fc,"f").notify(b.wrap(i)))}),"f")})),fl(this,wv,St(this,Zo,"f").own(new pl(St(this,ml,"f"),St(this,en,"f").sendPan,E.bipolar(),$.percent({unit:"%",fractionDigits:0}),"panning")),"f"),fl(this,bv,St(this,Zo,"f").own(new pl(St(this,ml,"f"),St(this,en,"f").sendGain,E.DefaultDecibel,$.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),St(this,Fc,"f").subscribe(e)}get uuid(){return St(this,en,"f").address.uuid}get address(){return St(this,en,"f").address}get box(){return St(this,en,"f")}get indexField(){return St(this,en,"f").index}get sendPan(){return St(this,wv,"f")}get sendGain(){return St(this,bv,"f")}get targetBus(){return St(this,ml,"f").boxAdapters.adapterFor(St(this,en,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Ei)}get optTargetBus(){return St(this,en,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>St(this,ml,"f").boxAdapters.adapterFor(r,Ei)})))}delete(){St(this,en,"f").delete()}terminate(){St(this,Zo,"f").terminate(),St(this,af,"f").terminate()}};ml=new WeakMap,en=new WeakMap,Zo=new WeakMap,Fc=new WeakMap,wv=new WeakMap,bv=new WeakMap,af=new WeakMap;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},Fa=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)},_v,Av,Ec,Pc,sf,Fv=class{constructor(e,r){_v.set(this,void 0),Av.set(this,void 0),Ec.set(this,void 0),Pc.set(this,void 0),sf.set(this,pe.Empty),of(this,_v,e,"f"),of(this,Av,r,"f"),of(this,Ec,new X,"f"),of(this,Pc,Fa(this,Ec,"f").own(new fe),"f"),Fa(this,Ec,"f").own(e.catchupAndSubscribe(()=>{Fa(this,sf,"f").terminate(),of(this,sf,this.adapter.match({none:()=>(Fa(this,Pc,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Fa(this,Pc,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return Fa(this,Pc,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Fa(this,_v,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Fa(this,Av,"f").adapterFor(r,Ei)})))}terminate(){Fa(this,Ec,"f").terminate(),Fa(this,sf,"f").terminate()}};_v=new WeakMap,Av=new WeakMap,Ec=new WeakMap,Pc=new WeakMap,sf=new WeakMap;var lo=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},xe=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)},Sv,cP,Sa,$i,Ot,gl,$c,hl,Ev,lf,Pv,$v,dP,pP,tn=class{constructor(e,r){Sv.add(this),this.class="device-host",Sa.set(this,new X),$i.set(this,void 0),Ot.set(this,void 0),gl.set(this,void 0),$c.set(this,void 0),hl.set(this,void 0),Ev.set(this,void 0),lf.set(this,void 0),Pv.set(this,void 0),$v.set(this,void 0),lo(this,$i,e,"f"),lo(this,Ot,r,"f"),lo(this,gl,xe(this,Sa,"f").own(new de(xe(this,$i,"f"))),"f"),lo(this,$c,xe(this,Sa,"f").own(new gv(this,xe(this,$i,"f").boxAdapters)),"f"),lo(this,hl,xe(this,Sa,"f").own(new xv(xe(this,Ot,"f").input.pointerHub,xe(this,$i,"f").boxAdapters)),"f"),lo(this,Ev,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").midiEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,ae.isMidiEffect),l.MIDIEffectHost)),"f"),lo(this,lf,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").audioEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,ae.isAudioEffect),l.AudioEffectHost)),"f"),lo(this,Pv,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").auxSends,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,Sc),l.AuxSend)),"f"),lo(this,$v,xe(this,Sa,"f").own(new Fv(xe(this,Ot,"f").output,xe(this,$i,"f").boxAdapters)),"f"),this.namedParameter=xe(this,Sv,"m",dP).call(this,r),xe(this,Sv,"m",pP).call(this)}get box(){return xe(this,Ot,"f")}get uuid(){return xe(this,Ot,"f").address.uuid}get address(){return xe(this,Ot,"f").address}get indexField(){return xe(this,Ot,"f").index}get type(){return xe(this,Ot,"f").type.getValue()}get captureBox(){return xe(this,Ot,"f").capture.targetVertex}get tracks(){return xe(this,$c,"f")}get input(){return xe(this,hl,"f")}get midiEffects(){return xe(this,Ev,"f")}get audioEffects(){return xe(this,lf,"f")}get inputAdapter(){return xe(this,hl,"f").adapter()}get auxSends(){return xe(this,Pv,"f")}get output(){return xe(this,$v,"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 xe(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(xe(this,$i,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return xe(this,Ot,"f").midiEffects}get inputField(){return xe(this,Ot,"f").input}get audioEffectsField(){return xe(this,Ot,"f").audioEffects}get tracksField(){return xe(this,Ot,"f").tracks}get minimizedField(){return xe(this,hl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get label(){return xe(this,hl,"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 xe(this,lf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=xe(this,$i,"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){xe(this,$i,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){xe(this,$c,"f").collection.move(e,r)}deleteTrack(e){xe(this,$c,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){xe(this,Sa,"f").terminate()}};cP=tn,Sa=new WeakMap,$i=new WeakMap,Ot=new WeakMap,gl=new WeakMap,$c=new WeakMap,hl=new WeakMap,Ev=new WeakMap,lf=new WeakMap,Pv=new WeakMap,$v=new WeakMap,Sv=new WeakSet,dP=function(e){return{volume:xe(this,gl,"f").createParameter(e.volume,cP.VolumeMapper,$.decible,"volume"),panning:xe(this,gl,"f").createParameter(e.panning,E.bipolar(),$.panning,"panning",.5),mute:xe(this,gl,"f").createParameter(e.mute,E.bool,$.bool,"mute"),solo:xe(this,gl,"f").createParameter(e.solo,E.bool,$.bool,"solo")}},pP=function(){let e=this.address.toString(),r=xe(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${xe(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;te(this.type!==Ft.Instrument||xe(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};tn.VolumeMapper=E.decibel(-96,-9,6);var kc=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},Ze=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)},xl,qr,Hr,vl,kv,Mv,uf,fP,mP,Nv,tr=class{constructor(e,r){xl.add(this),qr.set(this,void 0),Hr.set(this,void 0),vl.set(this,void 0),kv.set(this,void 0),Mv.set(this,void 0),uf.set(this,void 0),kc(this,qr,e,"f"),kc(this,Hr,r,"f"),kc(this,vl,new X,"f"),kc(this,uf,Ze(this,vl,"f").own(new Wi(-1)),"f"),kc(this,kv,Ze(this,vl,"f").own(new lv(this,e.boxAdapters)),"f"),kc(this,Mv,Ze(this,vl,"f").own(new dv(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(Ze(this,xl,"m",fP).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Ze(this,xl,"m",mP).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Ze(this,qr,"f")}set targetName(e){Ze(this,Hr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){Ze(this,qr,"f").boxAdapters.adapterFor(n,tn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Ze(this,qr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)}),Ze(this,xl,"m",Nv).call(this,n).flatMap(i=>Ze(this,qr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)})})}get targetName(){return Ze(this,Hr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return Ze(this,qr,"f").boxAdapters.adapterFor(r,tn).input.label;let n=Ze(this,qr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}let i=Ze(this,xl,"m",Nv).call(this,r).flatMap(a=>Ze(this,qr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){Ze(this,vl,"f").terminate()}get audioUnit(){return Ie(Ze(this,Hr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return Ze(this,Hr,"f").target}get clips(){return Ze(this,kv,"f")}get regions(){return Ze(this,Mv,"f")}get enabled(){return Ze(this,Hr,"f").enabled}get indexField(){return Ze(this,Hr,"f").index}get type(){return Ze(this,Hr,"f").type.getValue()}get box(){return Ze(this,Hr,"f")}get uuid(){return Ze(this,Hr,"f").address.uuid}get address(){return Ze(this,Hr,"f").address}get listIndex(){return Ze(this,uf,"f").getValue()}set listIndex(e){Ze(this,uf,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ve.Audio;case"note-clip":return this.type===ve.Notes;case"value-clip":return this.type===ve.Value;case"audio-region":return this.type===ve.Audio;case"note-region":return this.type===ve.Notes;case"value-region":return this.type===ve.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Ze(this,qr,"f").clipSequencing.iterate(this.uuid,e,e+qE);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,u=>!u.mute);if(s===null){let u=this.regions.collection.optAt(0);return mt(u,ao)?u.incomingValue(r):r}else if(mt(s,ao))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&mt(s,Oo)&&!s.mute?s.valueAt(e,r):r});return n}};qr=new WeakMap,Hr=new WeakMap,vl=new WeakMap,kv=new WeakMap,Mv=new WeakMap,uf=new WeakMap,xl=new WeakSet,fP=function(e){let r=Ze(this,Hr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return Ze(this,qr,"f").boxAdapters.adapterFor(n,tn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Ze(this,qr,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}let a=Ze(this,xl,"m",Nv).call(this,n).flatMap(o=>Ze(this,qr,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}return e(b.wrap(n.name)),pe.Empty}return e(b.None),pe.Empty},mP=function(e){let r=this.type;switch(r){case ve.Audio:case ve.Notes:return e(b.wrap(ve[r])),pe.Empty;case ve.Value:{let n=Ze(this,Hr,"f").target.targetVertex.unwrap("target.target");if(n.isField())e(Ze(this,qr,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(b.wrap(n.name));else return V("Illegal State. Vertex is not a field nor box.");return pe.Empty}case ve.Undefined:return e(b.wrap("")),pe.Empty;default:return e(b.None),pe.Empty}},Nv=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var ar=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)},ki,Mi,Iv,Bv,Tv,yl,Go,Ho,qo,Jo,Xo,wl,Mc,cf,hP=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],pl=class{constructor(e,r,n,i,a,o,s){ki.set(this,void 0),Mi.set(this,void 0),Iv.set(this,void 0),Bv.set(this,void 0),Tv.set(this,void 0),yl.set(this,new X),Go.set(this,void 0),Ho.set(this,void 0),qo.set(this,void 0),Jo.set(this,void 0),Xo.set(this,b.None),wl.set(this,b.None),Mc.set(this,null),cf.set(this,!1),ar(this,ki,e,"f"),ar(this,Mi,r,"f"),ar(this,qo,n,"f"),ar(this,Jo,i,"f"),ar(this,Iv,a,"f"),ar(this,Bv,o??0,"f"),ar(this,Tv,b.wrap(s),"f"),ye(this,yl,"f").own(ye(this,ki,"f").parameterFieldAdapters.register(this)),ar(this,Go,ye(this,yl,"f").own(new fe),"f"),ar(this,Ho,new Qt,"f"),ye(this,yl,"f").own(ye(this,Mi,"f").subscribe(()=>ye(this,Go,"f").notify(this))),ye(this,yl,"f").own(ye(this,Mi,"f").pointerHub.catchupAndSubscribe({onAdded:u=>{ye(this,Ho,"f").proxy.onControlSourceAdd(Gb(u.pointerType)),u.box.accept({visitTrackBox:d=>{te(ye(this,Xo,"f").isEmpty(),"Already assigned");let m=ye(this,ki,"f").boxAdapters.adapterFor(d,tr);ar(this,Xo,b.wrap(m),"f"),ye(this,ki,"f").isMainThread&&ar(this,wl,b.wrap(ye(this,ki,"f").liveStreamReceiver.subscribeFloat(ye(this,Mi,"f").address,x=>{ye(this,Mc,"f")!==x&&(ar(this,Mc,x,"f"),ye(this,Go,"f").notify(this))})),"f")}})},onRemoved:u=>{ye(this,Ho,"f").proxy.onControlSourceRemove(Gb(u.pointerType)),u.box.accept({visitTrackBox:d=>{te(ye(this,Xo,"f").unwrapOrNull()?.address?.equals(d.address)===!0,`Unknown ${d}`),ar(this,Xo,b.None,"f"),ye(this,ki,"f").isMainThread&&(ye(this,wl,"f").ifSome(m=>m.terminate()),ar(this,wl,b.None,"f"),ar(this,Mc,null,"f"),ye(this,Go,"f").notify(this))}})}},...hP)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return ye(this,Ho,"f").proxy.onControlSourceAdd("midi"),ar(this,cf,!0,"f"),{terminate:()=>{ar(this,cf,!1,"f"),ye(this,Ho,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ye(this,Mi,"f")}get valueMapping(){return ye(this,qo,"f")}get stringMapping(){return ye(this,Jo,"f")}get name(){return ye(this,Iv,"f")}get anchor(){return ye(this,Bv,"f")}get type(){return ye(this,Mi,"f").type}get address(){return ye(this,Mi,"f").address}get track(){return ye(this,Xo,"f")}registerTracks(e){return ye(this,ki,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){ye(this,ki,"f").parameterFieldAdapters.touchStart(this.address),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){ye(this,ki,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){ar(this,qo,e,"f"),ar(this,Jo,r,"f"),ye(this,Go,"f").notify(this)}valueAt(e){let r=ye(this,Xo,"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 ye(this,Go,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ye(this,cf,"f")&&e.onControlSourceAdd("midi"),ye(this,Mi,"f").pointerHub.filter(...hP).forEach(r=>e.onControlSourceAdd(Gb(r.pointerType))),ye(this,Ho,"f").subscribe(e)}getValue(){return ye(this,Mi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();ye(this,Mi,"f").setValue(e),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(ye(this,qo,"f").y(e))}getUnitValue(){return ye(this,qo,"f").x(this.getValue())}getControlledValue(){return ye(this,qo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ye(this,Mc,"f")??this.getUnitValue()}getControlledPrintValue(){return ye(this,Jo,"f").x(this.getControlledValue())}getPrintValue(){return ye(this,Jo,"f").x(this.getValue())}setPrintValue(e){let r=ye(this,Jo,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(ye(this,Tv,"f").unwrapOrElse(ye(this,Mi,"f").initValue))}terminate(){ye(this,wl,"f").ifSome(e=>e.terminate()),ar(this,wl,b.None,"f"),ye(this,yl,"f").terminate()}};ki=new WeakMap,Mi=new WeakMap,Iv=new WeakMap,Bv=new WeakMap,Tv=new WeakMap,yl=new WeakMap,Go=new WeakMap,Ho=new WeakMap,qo=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,wl=new WeakMap,Mc=new WeakMap,cf=new WeakMap;var Gb=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 V(`${t.toString()} is an unknown pointer type`)}};var Dv={min:400,max:480,default:440};var Hb=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)},uo,bl,Rv,Cv=class{constructor(e,r,n){uo.set(this,void 0),bl.set(this,void 0),Rv.set(this,void 0),Hb(this,uo,M.newSet(i=>i.uuid),"f"),Hb(this,bl,new Qt,"f"),Hb(this,Rv,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=On(this,uo,"f").add(a);te(o,`Could not add ${a}`),On(this,bl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;On(this,bl,"f").proxy.onRemove(On(this,uo,"f").removeByKey(a))}},n),"f")}subscribe(e){return On(this,bl,"f").subscribe(e)}catchupAndSubscribe(e){return On(this,uo,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return On(this,uo,"f").values()}size(){return On(this,uo,"f").size()}isEmpty(){return this.size()===0}terminate(){On(this,uo,"f").clear(),On(this,bl,"f").terminate(),On(this,Rv,"f").terminate()}};uo=new WeakMap,bl=new WeakMap,Rv=new WeakMap;var qb=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)},Jb,li,df,rn,Er,gP,Un=class{constructor(e,r){Jb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Delay,df.set(this,void 0),rn.set(this,void 0),Er.set(this,void 0),qb(this,df,e,"f"),qb(this,rn,r,"f"),qb(this,Er,new de(yt(this,df,"f")),"f"),this.namedParameter=yt(this,Jb,"m",gP).call(this,r)}get box(){return yt(this,rn,"f")}get uuid(){return yt(this,rn,"f").address.uuid}get address(){return yt(this,rn,"f").address}get indexField(){return yt(this,rn,"f").index}get labelField(){return yt(this,rn,"f").label}get enabledField(){return yt(this,rn,"f").enabled}get minimizedField(){return yt(this,rn,"f").minimized}get host(){return yt(this,rn,"f").host}deviceHost(){return yt(this,df,"f").boxAdapters.adapterFor(yt(this,rn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yt(this,Er,"f").terminate()}};li=Un,df=new WeakMap,rn=new WeakMap,Er=new WeakMap,Jb=new WeakSet,gP=function(e){return{preSyncTimeLeft:yt(this,Er,"f").createParameter(e.preSyncTimeLeft,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:yt(this,Er,"f").createParameter(e.preMillisTimeLeft,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:yt(this,Er,"f").createParameter(e.preSyncTimeRight,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync R"),preMillisTimeRight:yt(this,Er,"f").createParameter(e.preMillisTimeRight,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:yt(this,Er,"f").createParameter(e.delayMusical,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"delay"),millisTime:yt(this,Er,"f").createParameter(e.delayMillis,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:yt(this,Er,"f").createParameter(e.feedback,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:yt(this,Er,"f").createParameter(e.cross,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:yt(this,Er,"f").createParameter(e.lfoSpeed,E.exponential(li.LFO_SPEED_MIN,li.LFO_SPEED_MAX),$.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:yt(this,Er,"f").createParameter(e.lfoDepth,E.power(4,0,li.LFO_DEPTH_MAX),$.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:yt(this,Er,"f").createParameter(e.filter,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:yt(this,Er,"f").createParameter(e.dry,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"dry"),wet:yt(this,Er,"f").createParameter(e.wet,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"wet")}};Un.Fractions=Ao.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();Un.FractionsStringMapping=$.indices("",li.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));Un.MAX_MILLIS_TIME=1e3;Un.LFO_SPEED_MIN=.1;Un.LFO_SPEED_MAX=5;Un.LFO_DEPTH_MAX=50;var Xb=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)},Yb,pf,nn,Ea,vP,zv=class{constructor(e,r){Yb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Reverb,pf.set(this,void 0),nn.set(this,void 0),Ea.set(this,void 0),Xb(this,pf,e,"f"),Xb(this,nn,r,"f"),Xb(this,Ea,new de(pr(this,pf,"f")),"f"),this.namedParameter=pr(this,Yb,"m",vP).call(this,r)}get box(){return pr(this,nn,"f")}get uuid(){return pr(this,nn,"f").address.uuid}get address(){return pr(this,nn,"f").address}get indexField(){return pr(this,nn,"f").index}get labelField(){return pr(this,nn,"f").label}get enabledField(){return pr(this,nn,"f").enabled}get minimizedField(){return pr(this,nn,"f").minimized}get host(){return pr(this,nn,"f").host}deviceHost(){return pr(this,pf,"f").boxAdapters.adapterFor(pr(this,nn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pr(this,Ea,"f").terminate()}};pf=new WeakMap,nn=new WeakMap,Ea=new WeakMap,Yb=new WeakSet,vP=function(e){return{decay:pr(this,Ea,"f").createParameter(e.decay,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:pr(this,Ea,"f").createParameter(e.preDelay,E.exponential(.001,.5),$.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:pr(this,Ea,"f").createParameter(e.damp,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"damping"),filter:pr(this,Ea,"f").createParameter(e.filter,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"filter"),dry:pr(this,Ea,"f").createParameter(e.dry,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"dry"),wet:pr(this,Ea,"f").createParameter(e.wet,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"wet")}};var Qb=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)},t_,ff,Ni,Vn,wP,Ov=class{constructor(e,r){t_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Revamp,ff.set(this,void 0),Ni.set(this,void 0),Vn.set(this,void 0),Qb(this,ff,e,"f"),Qb(this,Ni,r,"f"),Qb(this,Vn,new de(Zt(this,ff,"f")),"f"),this.namedParameter=Zt(this,t_,"m",wP).call(this,r)}get box(){return Zt(this,Ni,"f")}get uuid(){return Zt(this,Ni,"f").address.uuid}get address(){return Zt(this,Ni,"f").address}get indexField(){return Zt(this,Ni,"f").index}get labelField(){return Zt(this,Ni,"f").label}get enabledField(){return Zt(this,Ni,"f").enabled}get minimizedField(){return Zt(this,Ni,"f").minimized}get host(){return Zt(this,Ni,"f").host}get spectrum(){return Zt(this,Ni,"f").address.append(4095)}deviceHost(){return Zt(this,ff,"f").boxAdapters.adapterFor(Zt(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Zt(this,Vn,"f").terminate()}};ff=new WeakMap,Ni=new WeakMap,Vn=new WeakMap,t_=new WeakSet,wP=function(e){return{highPass:xP(Zt(this,Vn,"f"),e.highPass,"High-Pass"),lowShelf:yP(Zt(this,Vn,"f"),e.lowShelf,"Low-Shelf"),lowBell:e_(Zt(this,Vn,"f"),e.lowBell,"Low-Bell"),midBell:e_(Zt(this,Vn,"f"),e.midBell,"Mid-Bell"),highBell:e_(Zt(this,Vn,"f"),e.highBell,"High-Bell"),highShelf:yP(Zt(this,Vn,"f"),e.highShelf,"High-Shelf"),lowPass:xP(Zt(this,Vn,"f"),e.lowPass,"Low-Pass")}};var r_=E.exponential(20,2e4),bP=E.linear(-24,24),_P=E.exponential(.01,10),xP=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,E.linearInteger(0,3),$.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,_P,$.numeric({fractionDigits:3}),`${r} Q`)}),yP=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,bP,$.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),e_=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,bP,$.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,_P,$.numeric({fractionDigits:3}),`${r} Q`)});var AP=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},ui=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)},Uv,Vv,ci,Yo=class{constructor(e,r){this.type="marker-event",Uv.set(this,new X),Vv.set(this,void 0),ci.set(this,void 0),AP(this,Vv,e,"f"),AP(this,ci,r,"f"),ui(this,Uv,"f").own(ui(this,ci,"f").subscribe(Te.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();ui(this,ci,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return ui(this,ci,"f")}get uuid(){return ui(this,ci,"f").address.uuid}get address(){return ui(this,ci,"f").address}get position(){return ui(this,ci,"f").position.getValue()}get plays(){return ui(this,ci,"f").plays.getValue()}get hue(){return ui(this,ci,"f").hue.getValue()}get label(){return ui(this,ci,"f").label.getValue()}get trackAdapter(){return ui(this,ci,"f").track.targetVertex.map(e=>ui(this,Vv,"f").boxAdapters.adapterFor(e.box,Pa).markerTrack)}terminate(){ui(this,Uv,"f").terminate()}toString(){return`{MarkerBoxAdapter ${M.toString(ui(this,ci,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Uv=new WeakMap,Vv=new WeakMap,ci=new WeakMap;Yo.Comparator=(t,e)=>t.position-e.position;var mf=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},an=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)},hf,Nc,gf,_l,jv,Kv=class{constructor(e,r){hf.set(this,void 0),Nc.set(this,void 0),gf.set(this,void 0),_l.set(this,void 0),jv.set(this,void 0),mf(this,hf,e,"f"),mf(this,Nc,r,"f"),this.changeNotifier=new fe,mf(this,gf,M.newSet(n=>n.uuid),"f"),mf(this,_l,Ir.create(Yo.Comparator),"f"),mf(this,jv,an(this,Nc,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof Fu){let i=an(this,hf,"f").boxAdapters.adapterFor(n,Yo),a=an(this,gf,"f").add(i);te(a,"Could not add adapter"),an(this,_l,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{an(this,_l,"f").remove(an(this,gf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return an(this,hf,"f")}get enabled(){return an(this,Nc,"f").enabled.getValue()}get events(){return an(this,_l,"f")}get object(){return an(this,Nc,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){an(this,_l,"f").onIndexingChanged(),this.dispatchChange()}terminate(){an(this,jv,"f").terminate()}};hf=new WeakMap,Nc=new WeakMap,gf=new WeakMap,_l=new WeakMap,jv=new WeakMap;var FP=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)},Wv,Lv,Bi,Al=class{constructor(e,r){this.type="signature-event",Wv.set(this,new X),Lv.set(this,void 0),Bi.set(this,void 0),FP(this,Lv,e,"f"),FP(this,Bi,r,"f"),Ii(this,Wv,"f").own(Ii(this,Bi,"f").subscribe(Te.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ii(this,Bi,"f")}get uuid(){return Ii(this,Bi,"f").address.uuid}get address(){return Ii(this,Bi,"f").address}get index(){return Ii(this,Bi,"f").index.getValue()}get indexField(){return Ii(this,Bi,"f").index}get relativePosition(){return Ii(this,Bi,"f").relativePosition.getValue()}get nominator(){return Ii(this,Bi,"f").nominator.getValue()}get denominator(){return Ii(this,Bi,"f").denominator.getValue()}get trackAdapter(){return Ii(this,Bi,"f").events.targetVertex.map(e=>Ii(this,Lv,"f").boxAdapters.adapterFor(e.box,Pa).signatureTrack)}terminate(){Ii(this,Wv,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Wv=new WeakMap,Lv=new WeakMap,Bi=new WeakMap;Al.Comparator=(t,e)=>t.index-e.index;var Zv=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)},Qo,vf,xf,Fl,co,es,SP,Ic,Gv=class{constructor(e,r,n){Qo.add(this),vf.set(this,new X),xf.set(this,void 0),Fl.set(this,void 0),co.set(this,void 0),es.set(this,void 0),Zv(this,xf,e,"f"),Zv(this,Fl,r,"f"),Zv(this,co,n,"f"),this.changeNotifier=new fe,Zv(this,es,wt(this,vf,"f").own(cr.create(wt(this,co,"f").events,i=>e.boxAdapters.adapterFor(i,Al),l.SignatureAutomation)),"f"),wt(this,vf,"f").ownAll(wt(this,Fl,"f").subscribe(()=>this.dispatchChange()),wt(this,co,"f").enabled.subscribe(()=>this.dispatchChange()),wt(this,es,"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 wt(this,xf,"f")}get enabled(){return wt(this,co,"f").enabled.getValue()}get object(){return wt(this,co,"f")}get size(){return wt(this,es,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=wt(this,Fl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return wt(this,es,"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},!!wt(this,co,"f").enabled.getValue())for(let a of wt(this,es,"f").adapters())e+=Me.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(u=>u.accumulatedPpqn);wt(this,Fl,"f").nominator.setValue(e),wt(this,Fl,"f").denominator.setValue(r);let a=0,o=0,s=Me.fromSignature(e,r);for(let u=0;u<n.length;u++){let d=n[u],m=this.adapterAt(d.index);if(m.isEmpty())continue;let g=(i[u]-a)/s,w=Math.floor(g),A=g-w;o+=A;let _=w;o>=1&&(_++,o--),_=Math.max(1,_),m.unwrap().box.relativePosition.setValue(_),a+=_*s,s=Me.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,[u,d]=s!==null?[s.nominator,s.denominator]:this.storageSignature,m=s!==null?s.accumulatedPpqn:0;e.box.delete();let x=m,g=Me.fromSignature(u,d);for(let w=0;w<a.length;w++){let A=a[w],_=this.adapterAt(A.index);if(_.isEmpty())continue;let K=(o[w]-x)/g,U=Math.max(1,Math.round(K));_.unwrap().box.relativePosition.setValue(U),x+=U*g,g=Me.fromSignature(A.nominator,A.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let _=1;_<i.length&&!(i[_].accumulatedPpqn>e);_++)a=i[_],o=_;let s=Me.fromSignature(a.nominator,a.denominator),u=(e-a.accumulatedPpqn)/s,d=Math.max(1,Math.round(u)),m=a.index+1,x=i.slice(o+1),g=a.accumulatedPpqn+d*s,w=Me.fromSignature(r,n),A=x.map(_=>({event:_,adapter:this.adapterAt(_.index)})).filter(({adapter:_})=>_.nonEmpty()).map(({event:_,adapter:C})=>({event:_,adapter:C.unwrap()}));for(let _=0;_<A.length;_++){let{event:C,adapter:K}=A[_];if(K.box.index.setValue(C.index+1),_===0){let U=(C.accumulatedPpqn-g)/w;K.box.relativePosition.setValue(Math.max(1,Math.round(U)))}}yu.create(wt(this,xf,"f").boxGraph,M.generate(),_=>{_.index.setValue(m),_.relativePosition.setValue(d),_.nominator.setValue(r),_.denominator.setValue(n),_.events.refer(wt(this,co,"f").events)})}adapterAt(e){return wt(this,es,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(g=>g.accumulatedBars),s=wt(this,Qo,"m",SP).call(this,r,a.index);if(s===a.accumulatedBars)return;let u=[...o];u[i]=s;let d=u.map((g,w)=>({bar:g,i:w})).sort((g,w)=>g.bar-w.bar).map(g=>g.i),m=n.map(g=>this.adapterAt(g.index).unwrap("adapterAt"));for(let g=0;g<d.length;g++)m[d[g]].box.index.setValue(g);let x=0;for(let g=0;g<d.length;g++){let w=d[g],A=m[w],_=u[w],C=Math.max(1,_-x);A.box.relativePosition.setValue(C),x=_}}floorToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=wt(this,Qo,"m",Ic).call(this,e),n=Me.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Me.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){wt(this,vf,"f").terminate()}};vf=new WeakMap,xf=new WeakMap,Fl=new WeakMap,co=new WeakMap,es=new WeakMap,Qo=new WeakSet,SP=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(ta(n)){let[o,s]=this.storageSignature,u=Me.fromSignature(o,s);return Math.max(1,Math.round(e/u))}let i=Me.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},Ic=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(ta(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Me.fromSignature(n,i)}}return{event:r,barPpqn:Me.fromSignature(r.nominator,r.denominator)}};var yf=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},Ut=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)},wf,$a,Hv,qv,po,bf,Jv,Pa=class{constructor(e,r){wf.set(this,new X),$a.set(this,void 0),Hv.set(this,void 0),qv.set(this,void 0),po.set(this,void 0),bf.set(this,void 0),Jv.set(this,()=>{let{tempoTrack:{enabled:s}}=Ut(this,$a,"f");return s.getValue()?Ut(this,po,"f").isEmpty()?b.None:Ut(this,po,"f").unwrap().events.isEmpty()?b.None:Ut(this,po,"f"):b.None}),yf(this,$a,r,"f"),yf(this,Hv,new Kv(e,r.markerTrack),"f"),yf(this,qv,new Gv(e,r.signature,r.signatureTrack),"f"),yf(this,po,new _r,"f"),yf(this,bf,new fe,"f");let n=Ut(this,wf,"f").own(new X),i=()=>Ut(this,bf,"f").notify(Ut(this,Jv,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Ut(this,wf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Ut(this,po,"f").clear(),some:({box:u})=>{let d=e.boxAdapters.adapterFor(u,Fr);Ut(this,po,"f").wrap(d),n.ownAll(d.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Ut(this,Jv,"f").call(this)),Ut(this,bf,"f").subscribe(e)}get box(){return Ut(this,$a,"f")}get uuid(){return Ut(this,$a,"f").address.uuid}get address(){return Ut(this,$a,"f").address}get markerTrack(){return Ut(this,Hv,"f")}get signatureTrack(){return Ut(this,qv,"f")}get tempoTrackEvents(){return Ut(this,po,"f")}get signature(){let{nominator:e,denominator:r}=Ut(this,$a,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Ut(this,$a,"f").signature;return Me.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Ut(this,$a,"f").signature.subscribe(()=>e(this.signature))}terminate(){Ut(this,wf,"f").terminate()}};wf=new WeakMap,$a=new WeakMap,Hv=new WeakMap,qv=new WeakMap,po=new WeakMap,bf=new WeakMap,Jv=new WeakMap;var EB=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},_f=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)},ts,rs=class{constructor(e,r){ts.set(this,void 0),EB(this,ts,r,"f")}get box(){return _f(this,ts,"f")}get uuid(){return _f(this,ts,"f").address.uuid}get address(){return _f(this,ts,"f").address}get source(){return _f(this,ts,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return _f(this,ts,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};ts=new WeakMap;var Sl=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)},Xv,El,Pl,Yv,Qv,Af,sn=class{constructor(e,r){Xv.set(this,void 0),El.set(this,void 0),Pl.set(this,void 0),Yv.set(this,void 0),Qv.set(this,void 0),Af.set(this,!1),Sl(this,Xv,e,"f"),Sl(this,El,r,"f"),Sl(this,Pl,new X,"f"),Sl(this,Yv,r.attributes,"f"),Sl(this,Qv,on(this,Pl,"f").own(new de(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return on(this,Pl,"f").own(e)}ownAll(...e){on(this,Pl,"f").ownAll(...e)}onSelected(){Sl(this,Af,!0,"f")}onDeselected(){Sl(this,Af,!1,"f")}isSelected(){return on(this,Af,"f")}get box(){return on(this,El,"f")}get attributes(){return on(this,Yv,"f")}get uuid(){return on(this,El,"f").address.uuid}get address(){return on(this,El,"f").address}get parameters(){return on(this,Qv,"f")}get modular(){return on(this,Xv,"f").boxAdapters.adapterFor(on(this,El,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,is)}terminate(){on(this,Pl,"f").terminate()}};Xv=new WeakMap,El=new WeakMap,Pl=new WeakMap,Yv=new WeakMap,Qv=new WeakMap,Af=new WeakMap;var ex=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},fo=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,ns,Ff,rx,Dr;(function(t){t.Input="input",t.Output="output"})(Dr||(Dr={}));var Rr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){tx.set(this,void 0),ns.set(this,void 0),Ff.set(this,void 0),rx.set(this,void 0),ex(this,tx,e,"f"),ex(this,ns,r,"f"),ex(this,Ff,n,"f"),ex(this,rx,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 fo(this,ns,"f").pointerHub.isEmpty()?ce.empty():fo(this,ns,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>fo(this,tx,"f").adapterFor(e,rs))}get field(){return fo(this,ns,"f")}get address(){return fo(this,ns,"f").address}get direction(){return fo(this,Ff,"f")}get name(){return fo(this,rx,"f")}toString(){return`{ModuleConnectorAdapter address: ${fo(this,ns,"f").address.toString()}, direction: ${fo(this,Ff,"f")}}`}};tx=new WeakMap,ns=new WeakMap,Ff=new WeakMap,rx=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},Sf=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)},ix,Ef,Pf,Bc=class extends sn{constructor(e,r){super(e,r),ix.set(this,void 0),Ef.set(this,void 0),Pf.set(this,void 0),i_(this,ix,this.parameters.createParameter(r.time,E.exponential(1,1e4),$.numeric({unit:"ms"}),"Time"),"f"),i_(this,Ef,Rr.create(e.boxAdapters,r.voltageInput,Dr.Input,"Input"),"f"),i_(this,Pf,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Output"),"f")}get parameterTime(){return Sf(this,ix,"f")}get voltageInput(){return Sf(this,Ef,"f")}get voltageOutput(){return Sf(this,Pf,"f")}get inputs(){return[Sf(this,Ef,"f")]}get outputs(){return[Sf(this,Pf,"f")]}};ix=new WeakMap,Ef=new WeakMap,Pf=new WeakMap;var PB=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},EP=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,Tc=class extends sn{constructor(e,r){super(e,r),$f.set(this,void 0),PB(this,$f,Rr.create(e.boxAdapters,r.input,Dr.Input,"Input"),"f")}get voltageInput(){return EP(this,$f,"f")}get inputs(){return[EP(this,$f,"f")]}get outputs(){return ce.empty()}};$f=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},kf=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)},nx,Mf,Nf,Dc=class extends sn{constructor(e,r){super(e,r),nx.set(this,void 0),Mf.set(this,void 0),Nf.set(this,void 0),n_(this,nx,this.parameters.createParameter(r.gain,E.DefaultDecibel,$.numeric({unit:"db"}),"Gain"),"f"),n_(this,Mf,Rr.create(e.boxAdapters,r.voltageInput,Dr.Input,"Input"),"f"),n_(this,Nf,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Output"),"f")}get parameterGain(){return kf(this,nx,"f")}get voltageInput(){return kf(this,Mf,"f")}get voltageOutput(){return kf(this,Nf,"f")}get inputs(){return[kf(this,Mf,"f")]}get outputs(){return[kf(this,Nf,"f")]}};nx=new WeakMap,Mf=new WeakMap,Nf=new WeakMap;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},o_=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,sx,Rc=class extends sn{constructor(e,r){super(e,r),ax.set(this,void 0),ox.set(this,void 0),sx.set(this,void 0),a_(this,ax,Rr.create(e.boxAdapters,r.voltageInputX,Dr.Input,"X"),"f"),a_(this,ox,Rr.create(e.boxAdapters,r.voltageInputY,Dr.Input,"Y"),"f"),a_(this,sx,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Result"),"f")}get inputs(){return[o_(this,ax,"f"),o_(this,ox,"f")]}get outputs(){return[o_(this,sx,"f")]}};ax=new WeakMap,ox=new WeakMap,sx=new WeakMap;var $B=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},PP=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)},If,Cc=class extends sn{constructor(e,r){super(e,r),If.set(this,void 0),$B(this,If,Rr.create(e.boxAdapters,r.output,Dr.Output,"Output"),"f")}get voltageOutput(){return PP(this,If,"f")}get inputs(){return ce.empty()}get outputs(){return[PP(this,If,"f")]}};If=new WeakMap;var zc;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>ze(r.accept({visitModuleGainBox:n=>e.adapterFor(n,Dc),visitModuleDelayBox:n=>e.adapterFor(n,Bc),visitModuleMultiplierBox:n=>e.adapterFor(n,Rc),visitModularAudioInputBox:n=>e.adapterFor(n,Cc),visitModularAudioOutputBox:n=>e.adapterFor(n,Tc)}),`Could not find ModuleAdapter for ${r.name}`)})(zc||(zc={}));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},$l=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,ux,kl,s_,Oc=class{constructor(e,r){lx.add(this),ux.set(this,void 0),kl.set(this,void 0),$P(this,ux,e,"f"),$P(this,kl,r,"f")}get box(){return $l(this,kl,"f")}get uuid(){return $l(this,kl,"f").address.uuid}get address(){return $l(this,kl,"f").address}get moduleAdapter(){return zc.adapterFor($l(this,ux,"f").boxAdapters,$l(this,lx,"a",s_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt($l(this,lx,"a",s_).address)}terminate(){}};ux=new WeakMap,kl=new WeakMap,lx=new WeakSet,s_=function(){return $l(this,kl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};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},di=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)},Uc,pi,Vc=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Modular,Uc.set(this,void 0),pi.set(this,void 0),kP(this,Uc,e,"f"),kP(this,pi,r,"f")}get box(){return di(this,pi,"f")}get uuid(){return di(this,pi,"f").address.uuid}get address(){return di(this,pi,"f").address}get indexField(){return di(this,pi,"f").index}get labelField(){return di(this,pi,"f").label}get enabledField(){return di(this,pi,"f").enabled}get minimizedField(){return di(this,pi,"f").minimized}get host(){return di(this,pi,"f").host}parameterAt(e){return V("Not yet implemented")}deviceHost(){return di(this,Uc,"f").boxAdapters.adapterFor(di(this,pi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return di(this,Uc,"f").boxAdapters.adapterFor(di(this,pi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,is)}elements(){return di(this,pi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>di(this,Uc,"f").boxAdapters.adapterFor(e.box,Oc))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Uc=new WeakMap,pi=new WeakMap;var Bf=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)},jc,as,Kc,Ti,Ml,Nl,is=class{constructor(e,r){jc.set(this,new X),as.set(this,void 0),Kc.set(this,void 0),Ti.set(this,void 0),Ml.set(this,void 0),Nl.set(this,void 0),Bf(this,Kc,e,"f"),Bf(this,Ti,r,"f"),Bf(this,as,ot(this,jc,"f").own(new Qt),"f"),Bf(this,Ml,M.newSet(s=>s.uuid),"f"),Bf(this,Nl,M.newSet(s=>s.uuid),"f");let n=s=>{let u=zc.adapterFor(ot(this,Kc,"f").boxAdapters,s.box);ot(this,Ml,"f").add(u)&&ot(this,as,"f").proxy.onModuleAdded(u)},i=s=>ot(this,as,"f").proxy.onModuleRemoved(ot(this,Ml,"f").removeByKey(s.address.uuid)),a=s=>{let u=ot(this,Kc,"f").boxAdapters.adapterFor(s.box,rs);ot(this,Nl,"f").add(u)&&ot(this,as,"f").proxy.onConnectionAdded(u)},o=s=>ot(this,as,"f").proxy.onConnectionRemoved(ot(this,Nl,"f").removeByKey(s.address.uuid));ot(this,Ti,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,Ti,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,jc,"f").own(ot(this,Ti,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,jc,"f").own(ot(this,Ti,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return Pb(e.onModuleAdded,r=>ot(this,Ml,"f").forEach(n=>r(n))),Pb(e.onConnectionAdded,r=>ot(this,Nl,"f").forEach(n=>r(n))),ot(this,as,"f").subscribe(e)}get box(){return ot(this,Ti,"f")}get address(){return ot(this,Ti,"f").address}get uuid(){return ot(this,Ti,"f").address.uuid}get editingField(){return ot(this,Ti,"f").editing}get labelField(){return ot(this,Ti,"f").label}get modules(){return ot(this,Ml,"f").values()}get connections(){return ot(this,Nl,"f").values()}get device(){return ot(this,Kc,"f").boxAdapters.adapterFor(ze(ot(this,Ti,"f").device.pointerHub.incoming().at(0),"No device found").box,Vc)}terminate(){console.debug(`terminate ${this}`),ot(this,jc,"f").terminate()}};jc=new WeakMap,as=new WeakMap,Kc=new WeakMap,Ti=new WeakMap,Ml=new WeakMap,Nl=new WeakMap;var Tf=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)},l_,Lc,Df,cx,Wc,Cf,dx,Rf,px,MP,ka=class{constructor(e,r){l_.add(this),this.type="groove-adapter",Df.set(this,new X),cx.set(this,void 0),Wc.set(this,void 0),Cf.set(this,void 0),dx.set(this,new Nh({duration:()=>Jr(this,px,"f"),fx:n=>Nb(n,Jr(this,Rf,"f")),fy:n=>Nb(n,1-Jr(this,Rf,"f"))})),Rf.set(this,0),px.set(this,Me.SemiQuaver*2),Tf(this,cx,e,"f"),Tf(this,Wc,r,"f"),Tf(this,Cf,Jr(this,Df,"f").own(new de(Jr(this,cx,"f"))),"f"),this.namedParameter=Jr(this,l_,"m",MP).call(this,r),Jr(this,Df,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Tf(this,px,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Tf(this,Rf,UE(n.getValue(),.01),"f")))}unwarp(e){return Jr(this,dx,"f").unwarp(e)}warp(e){return Jr(this,dx,"f").warp(e)}get box(){return Jr(this,Wc,"f")}get uuid(){return Jr(this,Wc,"f").address.uuid}get address(){return Jr(this,Wc,"f").address}terminate(){Jr(this,Df,"f").terminate()}};Lc=ka,Df=new WeakMap,cx=new WeakMap,Wc=new WeakMap,Cf=new WeakMap,dx=new WeakMap,Rf=new WeakMap,px=new WeakMap,l_=new WeakSet,MP=function(e){return{duration:Jr(this,Cf,"f").createParameter(e.duration,E.values(Lc.DurationPPQNs),$.values("",Lc.DurationPPQNs,Lc.DurationStrings),"duration"),amount:Jr(this,Cf,"f").createParameter(e.amount,E.unipolar(),$.percent({fractionDigits:0}),"amount")}};ka.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];ka.DurationPPQNs=Lc.Durations.map(([t,e])=>Me.fromSignature(t,e));ka.DurationStrings=Lc.Durations.map(([t,e])=>`${t}/${e}`);var Zc=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},Rt=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)},Ma,os,Gc,fx,mx,zf,Of,u_,ss=class{constructor(e,r,n,i,a){Ma.set(this,void 0),os.set(this,void 0),Gc.set(this,void 0),fx.set(this,void 0),mx.set(this,void 0),zf.set(this,new X),Of.set(this,void 0),u_.set(this,b.None),Zc(this,Ma,e,"f"),Zc(this,os,r,"f"),Zc(this,Gc,n,"f"),Zc(this,fx,i,"f"),Zc(this,mx,a??0,"f"),Zc(this,Of,Rt(this,zf,"f").own(new fe),"f"),Rt(this,zf,"f").own(Rt(this,Ma,"f").subscribe(()=>Rt(this,Of,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Rt(this,Ma,"f")}get valueMapping(){return Rt(this,os,"f")}get stringMapping(){return Rt(this,Gc,"f")}get name(){return Rt(this,fx,"f")}get anchor(){return Rt(this,mx,"f")}get type(){return Rt(this,Ma,"f").type}get address(){return Rt(this,Ma,"f").address}get track(){return Rt(this,u_,"f")}subscribe(e){return Rt(this,Of,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Rt(this,Ma,"f").getValue()}setValue(e){Rt(this,Ma,"f").setValue(Rt(this,os,"f").clamp(e))}setUnitValue(e){this.setValue(Rt(this,os,"f").y(e))}getUnitValue(){return Rt(this,os,"f").x(this.getValue())}getPrintValue(){return Rt(this,Gc,"f").x(this.getValue())}setPrintValue(e){let r=Rt(this,Gc,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Rt(this,os,"f").clamp(Rt(this,Ma,"f").initValue))}terminate(){Rt(this,zf,"f").terminate()}};Ma=new WeakMap,os=new WeakMap,Gc=new WeakMap,fx=new WeakMap,mx=new WeakMap,zf=new WeakMap,Of=new WeakMap,u_=new WeakMap;var Hc=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},ln=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)},Na,hx,gx,vx,xx,yx,wx=class{constructor(e){Na.set(this,void 0),hx.set(this,void 0),gx.set(this,void 0),vx.set(this,void 0),xx.set(this,void 0),yx.set(this,void 0),Hc(this,Na,e,"f"),Hc(this,hx,new ss(ln(this,Na,"f").keyboard,E.values([88,76,61,49]),$.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Hc(this,gx,new ss(ln(this,Na,"f").timeRangeInQuarters,E.exponential(1,64),$.numeric({fractionDigits:1}),"Time-Range"),"f"),Hc(this,vx,new ss(ln(this,Na,"f").noteScale,E.exponential(.5,2),$.numeric({fractionDigits:1}),"Note Scale"),"f"),Hc(this,xx,new ss(ln(this,Na,"f").noteLabels,E.bool,$.bool,"Note Labels"),"f"),Hc(this,yx,new ss(ln(this,Na,"f").transpose,E.linearInteger(-48,48),$.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return ln(this,Na,"f").box.subscribe(Te.Children,()=>e(this))}get object(){return ln(this,Na,"f")}get keyboard(){return ln(this,hx,"f")}get timeRangeInQuarters(){return ln(this,gx,"f")}get noteScale(){return ln(this,vx,"f")}get noteLabels(){return ln(this,xx,"f")}get transpose(){return ln(this,yx,"f")}};Na=new WeakMap,hx=new WeakMap,gx=new WeakMap,vx=new WeakMap,xx=new WeakMap,yx=new WeakMap;var Uf=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)},Il,Di,Bl,bx,_x,Ax=class{constructor(e,r){Il.set(this,void 0),Di.set(this,void 0),Bl.set(this,void 0),bx.set(this,void 0),_x.set(this,void 0),Uf(this,Il,e,"f"),Uf(this,Di,r,"f"),Uf(this,Bl,cr.create(or(this,Di,"f").audioUnits,n=>or(this,Il,"f").boxAdapters.adapterFor(n,tn),l.AudioUnits),"f"),Uf(this,bx,new Cv(or(this,Di,"f").audioBusses.pointerHub,n=>or(this,Il,"f").boxAdapters.adapterFor(n,Ei),l.AudioBusses),"f"),Uf(this,_x,new wx(or(this,Di,"f").pianoMode),"f")}get uuid(){return or(this,Di,"f").address.uuid}get address(){return or(this,Di,"f").address}get box(){return or(this,Di,"f")}get audioBusses(){return or(this,bx,"f")}get audioUnits(){return or(this,Bl,"f")}get clips(){return or(this,Bl,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return or(this,Il,"f").boxAdapters.adapterFor(or(this,Di,"f").groove.targetVertex.unwrap("no groove").box,ka)}get timeline(){return or(this,Il,"f").boxAdapters.adapterFor(or(this,Di,"f").timeline.targetVertex.unwrap("no timeline").box,Pa)}get pianoMode(){return or(this,_x,"f")}get created(){return new Date(or(this,Di,"f").created.getValue())}get midiOutputDevices(){return or(this,Di,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ie(e,Io))}*labeledAudioOutputs(){for(let e of or(this,Bl,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){or(this,Bl,"f").terminate()}};Il=new WeakMap,Di=new WeakMap,Bl=new WeakMap,bx=new WeakMap,_x=new WeakMap;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},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)},d_,Vf,jn,ls,NP,Fx=class{constructor(e,r){d_.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=oe.Tape,Vf.set(this,void 0),jn.set(this,void 0),ls.set(this,void 0),c_(this,Vf,e,"f"),c_(this,jn,r,"f"),c_(this,ls,new de(Cr(this,Vf,"f")),"f"),this.namedParameter=Cr(this,d_,"m",NP).call(this,r)}get box(){return Cr(this,jn,"f")}get uuid(){return Cr(this,jn,"f").address.uuid}get address(){return Cr(this,jn,"f").address}get labelField(){return Cr(this,jn,"f").label}get iconField(){return Cr(this,jn,"f").icon}get defaultTrackType(){return ve.Audio}get enabledField(){return Cr(this,jn,"f").enabled}get minimizedField(){return Cr(this,jn,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Cr(this,Vf,"f").boxAdapters.adapterFor(Cr(this,jn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Cr(this,ls,"f").terminate()}};Vf=new WeakMap,jn=new WeakMap,ls=new WeakMap,d_=new WeakSet,NP=function(e){return{flutter:Cr(this,ls,"f").createParameter(e.flutter,E.unipolar(),$.percent(),"flutter"),wow:Cr(this,ls,"f").createParameter(e.wow,E.unipolar(),$.percent(),"wow"),noise:Cr(this,ls,"f").createParameter(e.noise,E.unipolar(),$.percent(),"noise"),saturation:Cr(this,ls,"f").createParameter(e.saturation,E.unipolar(),$.percent(),"saturation")}};var Tl=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[aa.sine,aa.triangle,aa.saw,aa.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:$.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:E.values(r),FILTER_ORDER_STRING_MAPPING:$.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:E.values(i),LFO_WAVEFORM_STRING_MAPPING:$.values("",i,a)}})();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},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)},f_,jf,Kn,it,IP,Sx=class{constructor(e,r){f_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Vaporisateur,jf.set(this,void 0),Kn.set(this,void 0),it.set(this,void 0),p_(this,jf,e,"f"),p_(this,Kn,r,"f"),p_(this,it,new de(Ve(this,jf,"f")),"f"),this.namedParameter=Ve(this,f_,"m",IP).call(this,r)}get box(){return Ve(this,Kn,"f")}get uuid(){return Ve(this,Kn,"f").address.uuid}get address(){return Ve(this,Kn,"f").address}get labelField(){return Ve(this,Kn,"f").label}get iconField(){return Ve(this,Kn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Ve(this,Kn,"f").enabled}get minimizedField(){return Ve(this,Kn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ve(this,jf,"f").boxAdapters.adapterFor(Ve(this,Kn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ve(this,it,"f").terminate()}};jf=new WeakMap,Kn=new WeakMap,it=new WeakMap,f_=new WeakSet,IP=function(e){let r=[Cs.Monophonic,Cs.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ve(this,it,"f").createParameter(n.waveform,E.linearInteger(0,3),$.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ve(this,it,"f").createParameter(n.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ve(this,it,"f").createParameter(n.octave,E.linearInteger(-3,3),$.numeric({unit:"oct"}),"Octave",.5),tune:Ve(this,it,"f").createParameter(n.tune,E.linear(-1200,1200),$.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ve(this,it,"f").createParameter(e.noise.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ve(this,it,"f").createParameter(e.noise.attack,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ve(this,it,"f").createParameter(e.noise.hold,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ve(this,it,"f").createParameter(e.noise.release,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ve(this,it,"f").createParameter(e.filterOrder,Tl.FILTER_ORDER_VALUE_MAPPING,Tl.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ve(this,it,"f").createParameter(e.cutoff,Tl.CUTOFF_VALUE_MAPPING,Tl.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ve(this,it,"f").createParameter(e.resonance,E.exponential(.01,10),$.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ve(this,it,"f").createParameter(e.attack,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ve(this,it,"f").createParameter(e.decay,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ve(this,it,"f").createParameter(e.sustain,E.unipolar(),$.percent({fractionDigits:1}),"Sustain"),release:Ve(this,it,"f").createParameter(e.release,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ve(this,it,"f").createParameter(e.filterEnvelope,E.bipolar(),$.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ve(this,it,"f").createParameter(e.filterKeyboard,E.bipolar(),$.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ve(this,it,"f").createParameter(e.voicingMode,E.values(r),$.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ve(this,it,"f").createParameter(e.glideTime,E.unipolar(),$.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ve(this,it,"f").createParameter(e.unisonCount,E.values([1,3,5]),$.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ve(this,it,"f").createParameter(e.unisonDetune,E.exponential(1,1200),$.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ve(this,it,"f").createParameter(e.unisonStereo,E.unipolar(),$.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ve(this,it,"f").createParameter(e.lfo.waveform,Tl.LFO_WAVEFORM_VALUE_MAPPING,Tl.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ve(this,it,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),$.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ve(this,it,"f").createParameter(e.lfo.targetTune,E.bipolar(),$.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ve(this,it,"f").createParameter(e.lfo.targetVolume,E.bipolar(),$.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ve(this,it,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),$.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};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},fr=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_,Ex,Kf,un,Ia,BP,Dl=class{constructor(e,r){h_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Arpeggio,Kf.set(this,void 0),un.set(this,void 0),Ia.set(this,void 0),m_(this,Kf,e,"f"),m_(this,un,r,"f"),m_(this,Ia,new de(fr(this,Kf,"f")),"f"),this.namedParameter=fr(this,h_,"m",BP).call(this,r)}get box(){return fr(this,un,"f")}get uuid(){return fr(this,un,"f").address.uuid}get address(){return fr(this,un,"f").address}get indexField(){return fr(this,un,"f").index}get labelField(){return fr(this,un,"f").label}get enabledField(){return fr(this,un,"f").enabled}get minimizedField(){return fr(this,un,"f").minimized}get host(){return fr(this,un,"f").host}deviceHost(){return fr(this,Kf,"f").boxAdapters.adapterFor(fr(this,un,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){fr(this,Ia,"f").terminate()}};Ex=Dl,Kf=new WeakMap,un=new WeakMap,Ia=new WeakMap,h_=new WeakSet,BP=function(e){return{modeIndex:fr(this,Ia,"f").createParameter(e.modeIndex,E.linearInteger(0,2),$.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:fr(this,Ia,"f").createParameter(e.numOctaves,E.linearInteger(1,5),$.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:fr(this,Ia,"f").createParameter(e.rateIndex,E.linearInteger(0,Ex.RateFractions.length-1),Ex.RateStringMapping,"Rate"),gate:fr(this,Ia,"f").createParameter(e.gate,E.linear(0,2),$.percent({fractionDigits:0}),"Gate"),repeat:fr(this,Ia,"f").createParameter(e.repeat,E.linearInteger(1,16),$.numeric({fractionDigits:0}),"Repeat"),velocity:fr(this,Ia,"f").createParameter(e.velocity,E.bipolar(),$.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Dl.RateFractions=Ao.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();Dl.RateStringMapping=$.indices("",Ex.RateFractions.map(([t,e])=>`${t}/${e}`));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},zr=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)},v_,Wf,cn,Rl,TP,Px=class{constructor(e,r){v_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Pitch,Wf.set(this,void 0),cn.set(this,void 0),Rl.set(this,void 0),g_(this,Wf,e,"f"),g_(this,cn,r,"f"),g_(this,Rl,new de(zr(this,Wf,"f")),"f"),this.namedParameter=zr(this,v_,"m",TP).call(this,r)}get box(){return zr(this,cn,"f")}get uuid(){return zr(this,cn,"f").address.uuid}get address(){return zr(this,cn,"f").address}get indexField(){return zr(this,cn,"f").index}get labelField(){return zr(this,cn,"f").label}get enabledField(){return zr(this,cn,"f").enabled}get minimizedField(){return zr(this,cn,"f").minimized}get host(){return zr(this,cn,"f").host}deviceHost(){return zr(this,Wf,"f").boxAdapters.adapterFor(zr(this,cn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){zr(this,Rl,"f").terminate()}};Wf=new WeakMap,cn=new WeakMap,Rl=new WeakMap,v_=new WeakSet,TP=function(e){return{octaves:zr(this,Rl,"f").createParameter(e.octaves,E.linearInteger(-7,7),$.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:zr(this,Rl,"f").createParameter(e.semiTones,E.linearInteger(-36,36),$.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:zr(this,Rl,"f").createParameter(e.cents,E.linear(-50,50),$.numeric({unit:"cents",fractionDigits:1}),"cents")}};var kB=/^\/\/ @label .+$/m,DP=/^\/\/ @param .+$/gm,RP=/^\/\/ @sample .+$/gm;var CP=/^\/\/ @(group|param|sample) .+$/gm,zP=/^\/\/ @(?:param|sample) \S+/gm,qc=1e-6,MB=["linear","exp","int","bool"],NB=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}}},OP=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]),m=parseFloat(e[3]);if(isNaN(d)||isNaN(m))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(m-d<qc)throw new Error(`Malformed @param: '${t}' \u2014 min (${d}) must be less than max (${m})`);if(i<d-qc||i>m+qc)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${d}, ${m}]`);return{label:r,defaultValue:i,min:d,max:m,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],u=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!MB.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<qc)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-qc||i>o+qc)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:u}},UP=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,IB=(t,e)=>UP(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,yr;(function(t){t.isEqual=IB,t.parseLabel=e=>{let r=kB.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(DP.lastIndex=0;(n=DP.exec(e))!==null;)r.push(OP(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(RP.lastIndex=0;(n=RP.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;zP.lastIndex=0;let i=0;for(;(n=zP.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=[];CP.lastIndex=0;let a;for(;(a=CP.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 u=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:u[0],color:u[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:OP(o)});else if(s==="sample"){let u=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(u.length===0||u[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:u[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(e.min,e.max);case"exp":return E.exponential(e.min,e.max);case"int":return E.linearInteger(e.min,e.max);case"bool":return E.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return $.percent();case"linear":return $.numeric({unit:e.unit,fractionDigits:2});case"exp":return $.numeric({unit:e.unit,fractionDigits:2});case"int":return $.numeric({unit:e.unit,fractionDigits:0});case"bool":return NB}},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 u=Ie(s,pa),d=u.label.getValue(),x=t.parseParams(r.getValue()).find(A=>A.label===d),{valueMapping:g,stringMapping:w}=W(x)?t.resolveParamMappings(x):{valueMapping:E.unipolar(),stringMapping:$.percent({fractionDigits:1})};e.createParameter(u.value,g,w,d,void 0,u.defaultValue.getValue()),W(x)&&i.set(d,x)}),onRemoved:(({box:s})=>{let u=Ie(s,pa);i.delete(u.label.getValue()),e.removeParameter(u.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let u of e.parameters()){let d=s.find(w=>w.label===u.name);if(!W(d))continue;let m=i.get(u.name);if(W(m)&&UP(m,d))continue;let{valueMapping:x,stringMapping:g}=t.resolveParamMappings(d);u.updateMappings(x,g),i.set(u.name,d)}a.notify()}),a),codeChanged:a}}})(yr||(yr={}));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},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)},Lf,Zf,dn,Gf,kx,Mx=class{constructor(e,r){Lf.set(this,new X),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Spielwerk,Zf.set(this,void 0),dn.set(this,void 0),Gf.set(this,void 0),kx.set(this,void 0),$x(this,Zf,e,"f"),$x(this,dn,r,"f"),$x(this,Gf,Pr(this,Lf,"f").own(new de(Pr(this,Zf,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Pr(this,Gf,"f"),r.code,r.parameters);Pr(this,Lf,"f").own(n),$x(this,kx,i,"f")}get box(){return Pr(this,dn,"f")}get uuid(){return Pr(this,dn,"f").address.uuid}get address(){return Pr(this,dn,"f").address}get indexField(){return Pr(this,dn,"f").index}get labelField(){return Pr(this,dn,"f").label}get enabledField(){return Pr(this,dn,"f").enabled}get minimizedField(){return Pr(this,dn,"f").minimized}get host(){return Pr(this,dn,"f").host}get parameters(){return Pr(this,Gf,"f")}get codeChanged(){return Pr(this,kx,"f")}deviceHost(){return Pr(this,Zf,"f").boxAdapters.adapterFor(Pr(this,dn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pr(this,Lf,"f").terminate()}};Lf=new WeakMap,Zf=new WeakMap,dn=new WeakMap,Gf=new WeakMap,kx=new WeakMap;var Nx=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)},Hf,qf,Wn,Jf,Ix,Bx=class{constructor(e,r){Hf.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Apparat,qf.set(this,void 0),Wn.set(this,void 0),Jf.set(this,void 0),Ix.set(this,void 0),Nx(this,qf,e,"f"),Nx(this,Wn,r,"f"),Nx(this,Jf,Or(this,Hf,"f").own(new de(Or(this,qf,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Or(this,Jf,"f"),r.code,r.parameters);Or(this,Hf,"f").own(n),Nx(this,Ix,i,"f")}get box(){return Or(this,Wn,"f")}get uuid(){return Or(this,Wn,"f").address.uuid}get address(){return Or(this,Wn,"f").address}get labelField(){return Or(this,Wn,"f").label}get iconField(){return Or(this,Wn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Or(this,Wn,"f").enabled}get minimizedField(){return Or(this,Wn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Or(this,Jf,"f")}get codeChanged(){return Or(this,Ix,"f")}deviceHost(){return Or(this,qf,"f").boxAdapters.adapterFor(Or(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Or(this,Hf,"f").terminate()}};Hf=new WeakMap,qf=new WeakMap,Wn=new WeakMap,Jf=new WeakMap,Ix=new WeakMap;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},fi=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_,Xf,Ln,Jc,VP,Tx=class{constructor(e,r){y_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Nano,Xf.set(this,void 0),Ln.set(this,void 0),Jc.set(this,void 0),x_(this,Xf,e,"f"),x_(this,Ln,r,"f"),x_(this,Jc,new de(fi(this,Xf,"f")),"f"),this.namedParameter=fi(this,y_,"m",VP).call(this,r)}get box(){return fi(this,Ln,"f")}get uuid(){return fi(this,Ln,"f").address.uuid}get address(){return fi(this,Ln,"f").address}get labelField(){return fi(this,Ln,"f").label}get iconField(){return fi(this,Ln,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return fi(this,Ln,"f").enabled}get minimizedField(){return fi(this,Ln,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return fi(this,Xf,"f").boxAdapters.adapterFor(fi(this,Ln,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){fi(this,Jc,"f").terminate()}};Xf=new WeakMap,Ln=new WeakMap,Jc=new WeakMap,y_=new WeakSet,VP=function(e){return{volume:fi(this,Jc,"f").createParameter(e.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"volume"),release:fi(this,Jc,"f").createParameter(e.release,E.exponential(.001,8),$.numeric({unit:"s",fractionDigits:3}),"release")}};var Xc=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)},w_,Cl,us,Be,Dx,Yf,Ri,zl,jP,Yc=class{constructor(e,r){w_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",Cl.set(this,new X),us.set(this,void 0),Be.set(this,void 0),Dx.set(this,void 0),Yf.set(this,void 0),Ri.set(this,void 0),zl.set(this,b.None),Xc(this,us,e,"f"),Xc(this,Be,r,"f"),Xc(this,Dx,se(this,Cl,"f").own(cr.create(se(this,Be,"f").midiEffects,n=>se(this,us,"f").boxAdapters.adapterFor(n,ae.isMidiEffect),l.MIDIEffectHost)),"f"),Xc(this,Yf,se(this,Cl,"f").own(cr.create(se(this,Be,"f").audioEffects,n=>se(this,us,"f").boxAdapters.adapterFor(n,ae.isAudioEffect),l.AudioEffectHost)),"f"),Xc(this,Ri,se(this,Cl,"f").own(new de(se(this,us,"f"))),"f"),this.namedParameter=se(this,w_,"m",jP).call(this,r),se(this,Cl,"f").own(se(this,Be,"f").file.catchupAndSubscribe(n=>{Xc(this,zl,n.targetVertex.map(({box:i})=>se(this,us,"f").boxAdapters.adapterFor(i,In)),"f"),se(this,zl,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Be,"f")}get uuid(){return se(this,Be,"f").address.uuid}get address(){return se(this,Be,"f").address}get peakAddress(){return se(this,Be,"f").address.append(1001)}get indexField(){return se(this,Be,"f").index}get gate(){return se(this,Be,"f").gate.getValue()}get exclude(){return se(this,Be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,zl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,zl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Be,"f").icon}get defaultTrackType(){return ve.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return se(this,Be,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return se(this,Be,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return se(this,zl,"f")}fileUUID(){return se(this,Be,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,Be,"f").mute.reset(),se(this,Be,"f").solo.reset(),se(this,Be,"f").exclude.reset(),se(this,Be,"f").polyphone.reset(),se(this,Be,"f").pitch.reset(),se(this,Be,"f").attack.reset(),se(this,Be,"f").release.reset(),se(this,Be,"f").sampleStart.reset(),se(this,Be,"f").sampleEnd.reset(),se(this,Be,"f").gate.reset()}copyToIndex(e){Bo.create(se(this,Be,"f").graph,M.generate(),r=>{r.file.refer(se(this,Be,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,Be,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,Be,"f").mute.getValue()),r.solo.setValue(se(this,Be,"f").solo.getValue()),r.sampleStart.setValue(se(this,Be,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,Be,"f").sampleEnd.getValue()),r.attack.setValue(se(this,Be,"f").attack.getValue()),r.release.setValue(se(this,Be,"f").release.getValue()),r.pitch.setValue(se(this,Be,"f").pitch.getValue()),r.exclude.setValue(se(this,Be,"f").exclude.getValue()),r.gate.setValue(se(this,Be,"f").gate.getValue())})}get midiEffects(){return se(this,Dx,"f")}get inputAdapter(){return b.wrap(this)}get audioEffects(){return se(this,Yf,"f")}get labelField(){return Ie(se(this,Be,"f").file.targetVertex.unwrap("file.target").box,Li).fileName}get enabledField(){return se(this,Be,"f").enabled}get minimizedField(){return se(this,Be,"f").minimized}device(){return se(this,us,"f").boxAdapters.adapterFor(se(this,Be,"f").device.targetVertex.unwrap("device.target").box,Qc)}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,Yf,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,Cl,"f").terminate()}};Cl=new WeakMap,us=new WeakMap,Be=new WeakMap,Dx=new WeakMap,Yf=new WeakMap,Ri=new WeakMap,zl=new WeakMap,w_=new WeakSet,jP=function(e){return{gate:se(this,Ri,"f").createParameter(e.gate,E.linearInteger(0,2),$.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,Ri,"f").createParameter(e.mute,E.bool,$.bool,"Mute"),solo:se(this,Ri,"f").createParameter(e.solo,E.bool,$.bool,"Solo"),polyphone:se(this,Ri,"f").createParameter(e.polyphone,E.bool,$.bool,"Polyphone"),exclude:se(this,Ri,"f").createParameter(e.exclude,E.bool,$.bool,"Exclude"),pitch:se(this,Ri,"f").createParameter(e.pitch,E.linear(-1200,1200),$.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,Ri,"f").createParameter(e.sampleStart,E.unipolar(),$.percent(),"Start",0),sampleEnd:se(this,Ri,"f").createParameter(e.sampleEnd,E.unipolar(),$.percent(),"End",1),attack:se(this,Ri,"f").createParameter(e.attack,E.exponential(.001,5),$.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,Ri,"f").createParameter(e.release,E.exponential(.001,5),$.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Rx=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)},ed,Zn,td,Cx,Qc=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=oe.Playfield,ed.set(this,void 0),Zn.set(this,void 0),td.set(this,void 0),Cx.set(this,void 0),Rx(this,ed,e,"f"),Rx(this,Zn,r,"f"),Rx(this,td,cr.create(r.samples,n=>e.boxAdapters.adapterFor(n,Yc),l.Sample),"f"),Rx(this,Cx,new de(Xr(this,ed,"f")),"f")}reset(){Xr(this,td,"f").adapters().forEach(e=>e.box.delete())}get box(){return Xr(this,Zn,"f")}get uuid(){return Xr(this,Zn,"f").address.uuid}get address(){return Xr(this,Zn,"f").address}get labelField(){return Xr(this,Zn,"f").label}get iconField(){return Xr(this,Zn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Xr(this,Zn,"f").enabled}get minimizedField(){return Xr(this,Zn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Xr(this,td,"f")}get context(){return Xr(this,ed,"f")}deviceHost(){return Xr(this,ed,"f").boxAdapters.adapterFor(Xr(this,Zn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of Xr(this,td,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){Xr(this,Cx,"f").terminate()}};ed=new WeakMap,Zn=new WeakMap,td=new WeakMap,Cx=new WeakMap;var b_=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)},__,Qf,pn,Ba,KP,zx=class{constructor(e,r){__.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.StereoTool,Qf.set(this,void 0),pn.set(this,void 0),Ba.set(this,void 0),b_(this,Qf,e,"f"),b_(this,pn,r,"f"),b_(this,Ba,new de(mr(this,Qf,"f")),"f"),this.namedParameter=mr(this,__,"m",KP).call(this,r)}get box(){return mr(this,pn,"f")}get uuid(){return mr(this,pn,"f").address.uuid}get address(){return mr(this,pn,"f").address}get indexField(){return mr(this,pn,"f").index}get labelField(){return mr(this,pn,"f").label}get enabledField(){return mr(this,pn,"f").enabled}get minimizedField(){return mr(this,pn,"f").minimized}get host(){return mr(this,pn,"f").host}deviceHost(){return mr(this,Qf,"f").boxAdapters.adapterFor(mr(this,pn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){mr(this,Ba,"f").terminate()}};Qf=new WeakMap,pn=new WeakMap,Ba=new WeakMap,__=new WeakSet,KP=function(e){return{volume:mr(this,Ba,"f").createParameter(e.volume,E.decibel(-72,0,12),$.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:mr(this,Ba,"f").createParameter(e.panning,E.bipolar(),$.panning,"Panning",.5),stereo:mr(this,Ba,"f").createParameter(e.stereo,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:mr(this,Ba,"f").createParameter(e.invertL,E.bool,$.bool,"Invert Left"),invertR:mr(this,Ba,"f").createParameter(e.invertR,E.bool,$.bool,"Invert Right"),swap:mr(this,Ba,"f").createParameter(e.swap,E.bool,$.bool,"Swap")}};var em;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(em||(em={}));var WP=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},mi=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)},rd,hi,Ox=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Zeitgeist,rd.set(this,void 0),hi.set(this,void 0),WP(this,rd,e,"f"),WP(this,hi,r,"f"),this.groove()}get box(){return mi(this,hi,"f")}get uuid(){return mi(this,hi,"f").address.uuid}get address(){return mi(this,hi,"f").address}get indexField(){return mi(this,hi,"f").index}get labelField(){return mi(this,hi,"f").label}get enabledField(){return mi(this,hi,"f").enabled}get minimizedField(){return mi(this,hi,"f").minimized}get host(){return mi(this,hi,"f").host}deviceHost(){return mi(this,rd,"f").boxAdapters.adapterFor(mi(this,hi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}groove(){return mi(this,rd,"f").boxAdapters.adapterFor(mi(this,hi,"f").groove.targetVertex.unwrap("no groove").box,em.checkType)}catchupAndSubscribeGroove(e){return mi(this,hi,"f").groove.catchupAndSubscribe(r=>e(mi(this,rd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,em.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};rd=new WeakMap,hi=new WeakMap;var LP=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)},Ux,Ci,Vx=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Ux.set(this,void 0),Ci.set(this,void 0),LP(this,Ux,e,"f"),LP(this,Ci,r,"f")}get box(){return Gn(this,Ci,"f")}get uuid(){return Gn(this,Ci,"f").address.uuid}get address(){return Gn(this,Ci,"f").address}get indexField(){return Gn(this,Ci,"f").index}get labelField(){return Gn(this,Ci,"f").label}get enabledField(){return Gn(this,Ci,"f").enabled}get minimizedField(){return Gn(this,Ci,"f").minimized}get host(){return Gn(this,Ci,"f").host}get commentField(){return Gn(this,Ci,"f").comment}deviceHost(){return Gn(this,Ux,"f").boxAdapters.adapterFor(Gn(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Ux=new WeakMap,Ci=new WeakMap;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},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)},jx,zi,Kx=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",jx.set(this,void 0),zi.set(this,void 0),ZP(this,jx,e,"f"),ZP(this,zi,r,"f")}get box(){return Hn(this,zi,"f")}get uuid(){return Hn(this,zi,"f").address.uuid}get address(){return Hn(this,zi,"f").address}get indexField(){return Hn(this,zi,"f").index}get labelField(){return Hn(this,zi,"f").label}get enabledField(){return Hn(this,zi,"f").enabled}get minimizedField(){return Hn(this,zi,"f").minimized}get host(){return Hn(this,zi,"f").host}get commentField(){return Hn(this,zi,"f").comment}deviceHost(){return Hn(this,jx,"f").boxAdapters.adapterFor(Hn(this,zi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};jx=new WeakMap,zi=new WeakMap;var cs=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},je=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_,F_,tm,gi,Wx,id,qn,fn,nd,GP,S_,Lx=class{constructor(e,r){A_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Soundfont,F_.set(this,new X),tm.set(this,void 0),gi.set(this,void 0),Wx.set(this,void 0),id.set(this,void 0),qn.set(this,void 0),fn.set(this,void 0),nd.set(this,pe.Empty),S_.set(this,n=>n.match({none:()=>{je(this,fn,"f").clear(),je(this,qn,"f").clear()},some:i=>i.soundfont.match({none:()=>{je(this,fn,"f").clear(),je(this,qn,"f").clear(),je(this,nd,"f").terminate(),cs(this,nd,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");je(this,fn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),je(this,qn,"f").wrap(o)}else a.type==="error"?(je(this,fn,"f").clear(),je(this,qn,"f").clear()):a.type==="idle"&&(je(this,fn,"f").clear(),je(this,qn,"f").clear())}),"f")},some:a=>{je(this,qn,"f").wrap(a),je(this,fn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),cs(this,tm,e,"f"),cs(this,gi,r,"f"),cs(this,Wx,new de(je(this,tm,"f")),"f"),this.namedParameter=je(this,A_,"m",GP).call(this,r),cs(this,id,new _r,"f"),cs(this,qn,new _r,"f"),cs(this,fn,new _r,"f"),je(this,F_,"f").ownAll(je(this,id,"f").subscribe(je(this,S_,"f")),je(this,gi,"f").file.catchupAndSubscribe(({targetVertex:n})=>je(this,id,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),je(this,gi,"f").presetIndex.catchupAndSubscribe(n=>je(this,qn,"f").match({none:()=>je(this,fn,"f").clear(),some:i=>je(this,fn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return je(this,id,"f")}get soundfont(){return je(this,qn,"f")}get preset(){return je(this,fn,"f")}get presetIndex(){return je(this,gi,"f").presetIndex.getValue()}get box(){return je(this,gi,"f")}get uuid(){return je(this,gi,"f").address.uuid}get address(){return je(this,gi,"f").address}get labelField(){return je(this,gi,"f").label}get iconField(){return je(this,gi,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return je(this,gi,"f").enabled}get minimizedField(){return je(this,gi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return je(this,tm,"f").boxAdapters.adapterFor(je(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){je(this,nd,"f").terminate(),cs(this,nd,pe.Empty,"f"),je(this,Wx,"f").terminate()}};F_=new WeakMap,tm=new WeakMap,gi=new WeakMap,Wx=new WeakMap,id=new WeakMap,qn=new WeakMap,fn=new WeakMap,nd=new WeakMap,S_=new WeakMap,A_=new WeakSet,GP=function(e){return{}};var HP=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},rm=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,Ol,Gx=class{constructor(e,r){Zx.set(this,void 0),Ol.set(this,void 0),HP(this,Zx,e,"f"),HP(this,Ol,r,"f")}get box(){return rm(this,Ol,"f")}get uuid(){return rm(this,Ol,"f").address.uuid}get address(){return rm(this,Ol,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return rm(this,Zx,"f").soundfontManager.getOrCreate(rm(this,Ol,"f").address.uuid)}terminate(){}};Zx=new WeakMap,Ol=new WeakMap;var E_=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)},P_,im,mn,nm,qP,Hx=class{constructor(e,r){P_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Maximizer,im.set(this,void 0),mn.set(this,void 0),nm.set(this,void 0),E_(this,im,e,"f"),E_(this,mn,r,"f"),E_(this,nm,new de(vi(this,im,"f")),"f"),this.namedParameter=vi(this,P_,"m",qP).call(this,r)}get box(){return vi(this,mn,"f")}get uuid(){return vi(this,mn,"f").address.uuid}get address(){return vi(this,mn,"f").address}get indexField(){return vi(this,mn,"f").index}get labelField(){return vi(this,mn,"f").label}get enabledField(){return vi(this,mn,"f").enabled}get minimizedField(){return vi(this,mn,"f").minimized}get host(){return vi(this,mn,"f").host}deviceHost(){return vi(this,im,"f").boxAdapters.adapterFor(vi(this,mn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){vi(this,nm,"f").terminate()}};im=new WeakMap,mn=new WeakMap,nm=new WeakMap,P_=new WeakSet,qP=function(e){return{threshold:vi(this,nm,"f").createParameter(e.threshold,E.linear(-24,0),$.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},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)},k_,am,Oi,Ur,JP,qx=class{constructor(e,r){k_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Compressor,am.set(this,void 0),Oi.set(this,void 0),Ur.set(this,void 0),$_(this,am,e,"f"),$_(this,Oi,r,"f"),$_(this,Ur,new de(bt(this,am,"f")),"f"),this.namedParameter=bt(this,k_,"m",JP).call(this,r)}get box(){return bt(this,Oi,"f")}get uuid(){return bt(this,Oi,"f").address.uuid}get address(){return bt(this,Oi,"f").address}get indexField(){return bt(this,Oi,"f").index}get labelField(){return bt(this,Oi,"f").label}get enabledField(){return bt(this,Oi,"f").enabled}get minimizedField(){return bt(this,Oi,"f").minimized}get host(){return bt(this,Oi,"f").host}get sideChain(){return bt(this,Oi,"f").sideChain}deviceHost(){return bt(this,am,"f").boxAdapters.adapterFor(bt(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bt(this,Ur,"f").terminate()}};am=new WeakMap,Oi=new WeakMap,Ur=new WeakMap,k_=new WeakSet,JP=function(e){return{lookahead:bt(this,Ur,"f").createParameter(e.lookahead,E.bool,$.bool,"Lookahead"),automakeup:bt(this,Ur,"f").createParameter(e.automakeup,E.bool,$.bool,"Auto Makeup"),autoattack:bt(this,Ur,"f").createParameter(e.autoattack,E.bool,$.bool,"Auto Attack"),autorelease:bt(this,Ur,"f").createParameter(e.autorelease,E.bool,$.bool,"Auto Release"),inputgain:bt(this,Ur,"f").createParameter(e.inputgain,E.linear(-30,30),$.decible,"Input Gain"),threshold:bt(this,Ur,"f").createParameter(e.threshold,E.linear(-60,0),$.decible,"Threshold"),ratio:bt(this,Ur,"f").createParameter(e.ratio,E.exponential(1,24),$.numeric({fractionDigits:1}),"Ratio"),knee:bt(this,Ur,"f").createParameter(e.knee,E.linear(0,24),$.decible,"Knee"),attack:bt(this,Ur,"f").createParameter(e.attack,E.linear(0,100),$.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:bt(this,Ur,"f").createParameter(e.release,E.linear(5,1500),$.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:bt(this,Ur,"f").createParameter(e.makeup,E.linear(-40,40),$.decible,"Makeup Gain"),mix:bt(this,Ur,"f").createParameter(e.mix,E.unipolar(),$.percent(),"Dry/Wet")}};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},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)},N_,om,Ui,Jn,XP,Jx=class{constructor(e,r){N_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Gate,om.set(this,void 0),Ui.set(this,void 0),Jn.set(this,void 0),M_(this,om,e,"f"),M_(this,Ui,r,"f"),M_(this,Jn,new de(Gt(this,om,"f")),"f"),this.namedParameter=Gt(this,N_,"m",XP).call(this,r)}get box(){return Gt(this,Ui,"f")}get uuid(){return Gt(this,Ui,"f").address.uuid}get address(){return Gt(this,Ui,"f").address}get indexField(){return Gt(this,Ui,"f").index}get labelField(){return Gt(this,Ui,"f").label}get enabledField(){return Gt(this,Ui,"f").enabled}get minimizedField(){return Gt(this,Ui,"f").minimized}get host(){return Gt(this,Ui,"f").host}get sideChain(){return Gt(this,Ui,"f").sideChain}deviceHost(){return Gt(this,om,"f").boxAdapters.adapterFor(Gt(this,Ui,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Gt(this,Jn,"f").terminate()}};om=new WeakMap,Ui=new WeakMap,Jn=new WeakMap,N_=new WeakSet,XP=function(e){return{inverse:Gt(this,Jn,"f").createParameter(e.inverse,E.bool,$.bool,"Inverse"),threshold:Gt(this,Jn,"f").createParameter(e.threshold,E.linear(-80,0),$.decible,"Threshold"),return:Gt(this,Jn,"f").createParameter(e.return,E.linear(0,24),$.decible,"Return"),attack:Gt(this,Jn,"f").createParameter(e.attack,E.linear(0,1e3),$.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Gt(this,Jn,"f").createParameter(e.hold,E.linear(0,500),$.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Gt(this,Jn,"f").createParameter(e.release,E.linear(1,2e3),$.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Gt(this,Jn,"f").createParameter(e.floor,E.decibel(-72,-12,0),$.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},$r=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_,sm,hn,ds,YP,Xx=class{constructor(e,r){B_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Crusher,sm.set(this,void 0),hn.set(this,void 0),ds.set(this,void 0),I_(this,sm,e,"f"),I_(this,hn,r,"f"),I_(this,ds,new de($r(this,sm,"f")),"f"),this.namedParameter=$r(this,B_,"m",YP).call(this,r)}get box(){return $r(this,hn,"f")}get uuid(){return $r(this,hn,"f").address.uuid}get address(){return $r(this,hn,"f").address}get indexField(){return $r(this,hn,"f").index}get labelField(){return $r(this,hn,"f").label}get enabledField(){return $r(this,hn,"f").enabled}get minimizedField(){return $r(this,hn,"f").minimized}get host(){return $r(this,hn,"f").host}deviceHost(){return $r(this,sm,"f").boxAdapters.adapterFor($r(this,hn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){$r(this,ds,"f").terminate()}};sm=new WeakMap,hn=new WeakMap,ds=new WeakMap,B_=new WeakSet,YP=function(e){return{crush:$r(this,ds,"f").createParameter(e.crush,E.unipolar(),$.percent(),"Crush"),bits:$r(this,ds,"f").createParameter(e.bits,E.linearInteger(1,16),$.numeric(),"Bits"),boost:$r(this,ds,"f").createParameter(e.boost,E.linear(0,24),$.decible,"Boost"),mix:$r(this,ds,"f").createParameter(e.mix,E.exponential(.001,1),$.percent(),"Mix")}};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},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)},D_,lm,gn,ad,QP,Yx=class{constructor(e,r){D_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Fold,lm.set(this,void 0),gn.set(this,void 0),ad.set(this,void 0),T_(this,lm,e,"f"),T_(this,gn,r,"f"),T_(this,ad,new de(Yr(this,lm,"f")),"f"),this.namedParameter=Yr(this,D_,"m",QP).call(this,r)}get box(){return Yr(this,gn,"f")}get uuid(){return Yr(this,gn,"f").address.uuid}get address(){return Yr(this,gn,"f").address}get indexField(){return Yr(this,gn,"f").index}get labelField(){return Yr(this,gn,"f").label}get enabledField(){return Yr(this,gn,"f").enabled}get minimizedField(){return Yr(this,gn,"f").minimized}get host(){return Yr(this,gn,"f").host}deviceHost(){return Yr(this,lm,"f").boxAdapters.adapterFor(Yr(this,gn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yr(this,ad,"f").terminate()}};lm=new WeakMap,gn=new WeakMap,ad=new WeakMap,D_=new WeakSet,QP=function(e){return{drive:Yr(this,ad,"f").createParameter(e.drive,E.linear(0,30),$.decible,"Drive"),volume:Yr(this,ad,"f").createParameter(e.volume,E.linear(-18,0),$.decible,"Volume")}};var Qx=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)},um,cm,vn,od,sd,ey=class{constructor(e,r){um.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=oe.MIDIOutput,cm.set(this,void 0),vn.set(this,void 0),od.set(this,void 0),sd.set(this,void 0),Qx(this,cm,e,"f"),Qx(this,vn,r,"f"),Qx(this,od,new _r,"f"),Qx(this,sd,sr(this,um,"f").own(new de(sr(this,cm,"f"))),"f"),sr(this,um,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>sr(this,sd,"f").createParameter(Ie(n,Vs).value,E.unipolar(),$.percent({fractionDigits:1}),"",0)),onRemoved:(({box:n})=>sr(this,sd,"f").removeParameter(Ie(n,Vs).value.address))}),sr(this,vn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>sr(this,od,"f").clear(),some:({box:i})=>sr(this,od,"f").wrap(Ie(i,Io))})))}get box(){return sr(this,vn,"f")}get uuid(){return sr(this,vn,"f").address.uuid}get address(){return sr(this,vn,"f").address}get labelField(){return sr(this,vn,"f").label}get iconField(){return sr(this,vn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return sr(this,vn,"f").enabled}get minimizedField(){return sr(this,vn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return sr(this,sd,"f")}get midiDevice(){return sr(this,od,"f")}deviceHost(){return sr(this,cm,"f").boxAdapters.adapterFor(sr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){sr(this,um,"f").terminate()}};um=new WeakMap,cm=new WeakMap,vn=new WeakMap,od=new WeakMap,sd=new WeakMap;var ty=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},Ht=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_,dm,xn,Ta,pm,e$,ry=class{constructor(e,r){R_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Velocity,dm.set(this,void 0),xn.set(this,void 0),Ta.set(this,void 0),pm.set(this,void 0),ty(this,dm,e,"f"),ty(this,xn,r,"f"),ty(this,Ta,new de(Ht(this,dm,"f")),"f"),ty(this,pm,Ah.create(),"f"),this.namedParameter=Ht(this,R_,"m",e$).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:u}=this.namedParameter;Ht(this,pm,"f").setSeed(a.valueAt(e)+e);let d=r+(n.valueAt(e)-r)*i.valueAt(e),m=(Ht(this,pm,"f").uniform()*2-1)*o.valueAt(e),x=s.valueAt(e),g=u.valueAt(e);return r*(1-g)+OE(d+m+x)*g}get box(){return Ht(this,xn,"f")}get uuid(){return Ht(this,xn,"f").address.uuid}get address(){return Ht(this,xn,"f").address}get indexField(){return Ht(this,xn,"f").index}get labelField(){return Ht(this,xn,"f").label}get enabledField(){return Ht(this,xn,"f").enabled}get minimizedField(){return Ht(this,xn,"f").minimized}get host(){return Ht(this,xn,"f").host}deviceHost(){return Ht(this,dm,"f").boxAdapters.adapterFor(Ht(this,xn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ht(this,Ta,"f").terminate()}};dm=new WeakMap,xn=new WeakMap,Ta=new WeakMap,pm=new WeakMap,R_=new WeakSet,e$=function(e){return{magnetPosition:Ht(this,Ta,"f").createParameter(e.magnetPosition,E.unipolar(),$.percent(),"Position"),magnetStrength:Ht(this,Ta,"f").createParameter(e.magnetStrength,E.unipolar(),$.percent(),"Strength"),randomSeed:Ht(this,Ta,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),$.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Ht(this,Ta,"f").createParameter(e.randomAmount,E.unipolar(),$.percent(),"Amount"),offset:Ht(this,Ta,"f").createParameter(e.offset,E.bipolar(),$.percent(),"Offset"),mix:Ht(this,Ta,"f").createParameter(e.mix,E.unipolar(),$.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},hr=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_,O_,fm,yn,Da,t$,Ul=class{constructor(e,r){z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Tidal,fm.set(this,void 0),yn.set(this,void 0),Da.set(this,void 0),C_(this,fm,e,"f"),C_(this,yn,r,"f"),C_(this,Da,new de(hr(this,fm,"f")),"f"),this.namedParameter=hr(this,z_,"m",t$).call(this,r)}get box(){return hr(this,yn,"f")}get uuid(){return hr(this,yn,"f").address.uuid}get address(){return hr(this,yn,"f").address}get indexField(){return hr(this,yn,"f").index}get labelField(){return hr(this,yn,"f").label}get enabledField(){return hr(this,yn,"f").enabled}get minimizedField(){return hr(this,yn,"f").minimized}get host(){return hr(this,yn,"f").host}deviceHost(){return hr(this,fm,"f").boxAdapters.adapterFor(hr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){hr(this,Da,"f").terminate()}};O_=Ul,fm=new WeakMap,yn=new WeakMap,Da=new WeakMap,z_=new WeakSet,t$=function(e){let{RateFractions:r,RateStringMapping:n}=O_;return{slope:hr(this,Da,"f").createParameter(e.slope,E.bipolar(),$.percent({fractionDigits:1}),"Slope",.5),symmetry:hr(this,Da,"f").createParameter(e.symmetry,E.unipolar(),$.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:hr(this,Da,"f").createParameter(e.rate,E.values(r.map((i,a)=>a)),n,"Rate",0),depth:hr(this,Da,"f").createParameter(e.depth,E.unipolar(),$.percent({fractionDigits:1}),"Depth",0),offset:hr(this,Da,"f").createParameter(e.offset,E.linear(-180,180),$.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:hr(this,Da,"f").createParameter(e.channelOffset,E.linear(-180,180),$.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Ul.RateFractions=Ao.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();Ul.RateStringMapping=$.indices("",O_.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},_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)},V_,mm,Qr,xi,r$,iy=class{constructor(e,r){V_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Vocoder,mm.set(this,void 0),Qr.set(this,void 0),xi.set(this,void 0),U_(this,mm,e,"f"),U_(this,Qr,r,"f"),U_(this,xi,new de(_t(this,mm,"f")),"f"),this.namedParameter=_t(this,V_,"m",r$).call(this,r)}get box(){return _t(this,Qr,"f")}get uuid(){return _t(this,Qr,"f").address.uuid}get address(){return _t(this,Qr,"f").address}get indexField(){return _t(this,Qr,"f").index}get labelField(){return _t(this,Qr,"f").label}get enabledField(){return _t(this,Qr,"f").enabled}get minimizedField(){return _t(this,Qr,"f").minimized}get host(){return _t(this,Qr,"f").host}get sideChain(){return _t(this,Qr,"f").sideChain}get modulatorSpectrum(){return _t(this,Qr,"f").address.append(4094)}get carrierSpectrum(){return _t(this,Qr,"f").address.append(4095)}deviceHost(){return _t(this,mm,"f").boxAdapters.adapterFor(_t(this,Qr,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_t(this,xi,"f").terminate()}};mm=new WeakMap,Qr=new WeakMap,xi=new WeakMap,V_=new WeakSet,r$=function(e){let r=E.exponential(20,2e4),n=$.numeric({unit:"Hz",fractionDigits:0}),i=E.exponential(1,60),a=$.numeric({fractionDigits:1});return{carrierMinFreq:_t(this,xi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:_t(this,xi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:_t(this,xi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:_t(this,xi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:_t(this,xi,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:_t(this,xi,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:_t(this,xi,"f").createParameter(e.envAttack,E.exponential(.1,100),$.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:_t(this,xi,"f").createParameter(e.envRelease,E.exponential(1,1e3),$.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:_t(this,xi,"f").createParameter(e.gain,E.linear(-20,20),$.decible,"Gain"),mix:_t(this,xi,"f").createParameter(e.mix,E.unipolar(),$.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},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)},K_,hm,wn,Vr,i$,ny=class{constructor(e,r){K_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.DattorroReverb,hm.set(this,void 0),wn.set(this,void 0),Vr.set(this,void 0),j_(this,hm,e,"f"),j_(this,wn,r,"f"),j_(this,Vr,new de(Et(this,hm,"f")),"f"),this.namedParameter=Et(this,K_,"m",i$).call(this,r)}get box(){return Et(this,wn,"f")}get uuid(){return Et(this,wn,"f").address.uuid}get address(){return Et(this,wn,"f").address}get indexField(){return Et(this,wn,"f").index}get labelField(){return Et(this,wn,"f").label}get enabledField(){return Et(this,wn,"f").enabled}get minimizedField(){return Et(this,wn,"f").minimized}get host(){return Et(this,wn,"f").host}deviceHost(){return Et(this,hm,"f").boxAdapters.adapterFor(Et(this,wn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Et(this,Vr,"f").terminate()}};hm=new WeakMap,wn=new WeakMap,Vr=new WeakMap,K_=new WeakSet,i$=function(e){return{preDelay:Et(this,Vr,"f").createParameter(e.preDelay,E.linear(0,1e3),$.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Et(this,Vr,"f").createParameter(e.bandwidth,E.unipolar(),$.percent(),"Bandwidth"),inputDiffusion1:Et(this,Vr,"f").createParameter(e.inputDiffusion1,E.unipolar(),$.percent(),"Tank 1"),inputDiffusion2:Et(this,Vr,"f").createParameter(e.inputDiffusion2,E.unipolar(),$.percent(),"Tank 2"),decay:Et(this,Vr,"f").createParameter(e.decay,E.unipolar(),$.percent(),"Decay"),decayDiffusion1:Et(this,Vr,"f").createParameter(e.decayDiffusion1,E.unipolar(),$.percent(),"Tank 1"),decayDiffusion2:Et(this,Vr,"f").createParameter(e.decayDiffusion2,E.unipolar(),$.percent(),"Tank 2"),damping:Et(this,Vr,"f").createParameter(e.damping,E.unipolar(),$.percent(),"Damping"),excursionRate:Et(this,Vr,"f").createParameter(e.excursionRate,E.unipolar(),$.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Et(this,Vr,"f").createParameter(e.excursionDepth,E.unipolar(),$.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Et(this,Vr,"f").createParameter(e.wet,E.DefaultDecibel,$.decible,"Wet"),dry:Et(this,Vr,"f").createParameter(e.dry,E.DefaultDecibel,$.decible,"Dry")}};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},ld=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_,mo,ud=class{constructor(e,r){W_.set(this,void 0),mo.set(this,void 0),n$(this,W_,e,"f"),n$(this,mo,r,"f")}get box(){return ld(this,mo,"f")}get uuid(){return ld(this,mo,"f").address.uuid}get address(){return ld(this,mo,"f").address}get labelField(){return ld(this,mo,"f").label}get modelField(){return ld(this,mo,"f").model}getModelJson(){return ld(this,mo,"f").model.getValue()}terminate(){}};W_=new WeakMap,mo=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},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)},Z_,cd,kr,Vl,a$,ay=class{constructor(e,r){Z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.NeuralAmp,cd.set(this,void 0),kr.set(this,void 0),Vl.set(this,void 0),L_(this,cd,e,"f"),L_(this,kr,r,"f"),L_(this,Vl,new de(Vt(this,cd,"f")),"f"),this.namedParameter=Vt(this,Z_,"m",a$).call(this,r)}get box(){return Vt(this,kr,"f")}get uuid(){return Vt(this,kr,"f").address.uuid}get address(){return Vt(this,kr,"f").address}get indexField(){return Vt(this,kr,"f").index}get labelField(){return Vt(this,kr,"f").label}get enabledField(){return Vt(this,kr,"f").enabled}get minimizedField(){return Vt(this,kr,"f").minimized}get host(){return Vt(this,kr,"f").host}get modelField(){return Vt(this,kr,"f").model}get monoField(){return Vt(this,kr,"f").mono}get spectrum(){return Vt(this,kr,"f").address.append(4095)}getModelAdapter(){let e=Vt(this,kr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Vt(this,cd,"f").boxAdapters.adapterFor(e.unwrap().box,ud))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Vt(this,kr,"f").modelJson.getValue()}deviceHost(){return Vt(this,cd,"f").boxAdapters.adapterFor(Vt(this,kr,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Vt(this,Vl,"f").terminate()}};cd=new WeakMap,kr=new WeakMap,Vl=new WeakMap,Z_=new WeakSet,a$=function(e){return{inputGain:Vt(this,Vl,"f").createParameter(e.inputGain,E.decibel(-72,0,12),$.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Vt(this,Vl,"f").createParameter(e.outputGain,E.decibel(-72,0,12),$.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Vt(this,Vl,"f").createParameter(e.mix,E.linear(0,1),$.percent(),"Mix")}};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},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)},H_,gm,bn,jl,o$,oy=class{constructor(e,r){H_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Waveshaper,gm.set(this,void 0),bn.set(this,void 0),jl.set(this,void 0),G_(this,gm,e,"f"),G_(this,bn,r,"f"),G_(this,jl,new de(jr(this,gm,"f")),"f"),this.namedParameter=jr(this,H_,"m",o$).call(this,r)}get box(){return jr(this,bn,"f")}get uuid(){return jr(this,bn,"f").address.uuid}get address(){return jr(this,bn,"f").address}get indexField(){return jr(this,bn,"f").index}get labelField(){return jr(this,bn,"f").label}get enabledField(){return jr(this,bn,"f").enabled}get minimizedField(){return jr(this,bn,"f").minimized}get host(){return jr(this,bn,"f").host}deviceHost(){return jr(this,gm,"f").boxAdapters.adapterFor(jr(this,bn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){jr(this,jl,"f").terminate()}};gm=new WeakMap,bn=new WeakMap,jl=new WeakMap,H_=new WeakSet,o$=function(e){return{inputGain:jr(this,jl,"f").createParameter(e.inputGain,E.linear(0,40),$.decible,"Input"),outputGain:jr(this,jl,"f").createParameter(e.outputGain,E.linear(-24,24),$.decible,"Output"),mix:jr(this,jl,"f").createParameter(e.mix,E.unipolar(),$.percent(),"Mix")}};var sy=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)},vm,xm,_n,ym,ly,uy=class{constructor(e,r){vm.set(this,new X),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Werkstatt,xm.set(this,void 0),_n.set(this,void 0),ym.set(this,void 0),ly.set(this,void 0),sy(this,xm,e,"f"),sy(this,_n,r,"f"),sy(this,ym,Mr(this,vm,"f").own(new de(Mr(this,xm,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Mr(this,ym,"f"),r.code,r.parameters);Mr(this,vm,"f").own(n),sy(this,ly,i,"f")}get box(){return Mr(this,_n,"f")}get uuid(){return Mr(this,_n,"f").address.uuid}get address(){return Mr(this,_n,"f").address}get indexField(){return Mr(this,_n,"f").index}get labelField(){return Mr(this,_n,"f").label}get enabledField(){return Mr(this,_n,"f").enabled}get minimizedField(){return Mr(this,_n,"f").minimized}get host(){return Mr(this,_n,"f").host}get parameters(){return Mr(this,ym,"f")}get codeChanged(){return Mr(this,ly,"f")}deviceHost(){return Mr(this,xm,"f").boxAdapters.adapterFor(Mr(this,_n,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Mr(this,vm,"f").terminate()}};vm=new WeakMap,xm=new WeakMap,_n=new WeakMap,ym=new WeakMap,ly=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)},BB,le,TB,DB,RB,CB;le=new WeakMap,TB=new WeakMap,DB=new WeakMap,RB=new WeakMap,BB=new WeakSet,CB=function(e){return ze(e.accept({visitArpeggioDeviceBox:r=>new Dl(ue(this,le,"f"),r),visitAudioBusBox:r=>new Ei(ue(this,le,"f"),r),visitAudioClipBox:r=>new Ju(ue(this,le,"f"),r),visitAudioFileBox:r=>new In(ue(this,le,"f"),r),visitAudioTimeStretchBox:r=>new va(ue(this,le,"f"),r),visitAudioPitchStretchBox:r=>new ga(ue(this,le,"f"),r),visitAudioSignalsmithBox:r=>new xa(ue(this,le,"f"),r),visitTransientMarkerBox:r=>new Uu(r),visitWarpMarkerBox:r=>new ma(ue(this,le,"f"),r),visitApparatDeviceBox:r=>new Bx(ue(this,le,"f"),r),visitAudioRegionBox:r=>new pc(ue(this,le,"f"),r),visitAudioUnitBox:r=>new tn(ue(this,le,"f"),r),visitAuxSendBox:r=>new Sc(ue(this,le,"f"),r),visitMaximizerDeviceBox:r=>new Hx(ue(this,le,"f"),r),visitCompressorDeviceBox:r=>new qx(ue(this,le,"f"),r),visitGateDeviceBox:r=>new Jx(ue(this,le,"f"),r),visitCrusherDeviceBox:r=>new Xx(ue(this,le,"f"),r),visitDattorroReverbDeviceBox:r=>new ny(ue(this,le,"f"),r),visitDelayDeviceBox:r=>new Un(ue(this,le,"f"),r),visitDeviceInterfaceKnobBox:r=>new Oc(ue(this,le,"f"),r),visitTidalDeviceBox:r=>new Ul(ue(this,le,"f"),r),visitFoldDeviceBox:r=>new Yx(ue(this,le,"f"),r),visitGrooveShuffleBox:r=>new ka(ue(this,le,"f"),r),visitMarkerBox:r=>new Yo(ue(this,le,"f"),r),visitSignatureEventBox:r=>new Al(ue(this,le,"f"),r),visitMIDIOutputDeviceBox:r=>new ey(ue(this,le,"f"),r),visitModularAudioInputBox:r=>new Cc(ue(this,le,"f"),r),visitModularAudioOutputBox:r=>new Tc(ue(this,le,"f"),r),visitModularBox:r=>new is(ue(this,le,"f"),r),visitModularDeviceBox:r=>new Vc(ue(this,le,"f"),r),visitModuleConnectionBox:r=>new rs(ue(this,le,"f"),r),visitModuleDelayBox:r=>new Bc(ue(this,le,"f"),r),visitModuleGainBox:r=>new Dc(ue(this,le,"f"),r),visitModuleMultiplierBox:r=>new Rc(ue(this,le,"f"),r),visitNanoDeviceBox:r=>new Tx(ue(this,le,"f"),r),visitNeuralAmpDeviceBox:r=>new ay(ue(this,le,"f"),r),visitNeuralAmpModelBox:r=>new ud(ue(this,le,"f"),r),visitNoteClipBox:r=>new ec(ue(this,le,"f"),r),visitNoteEventBox:r=>new il(ue(this,le,"f"),r),visitNoteEventCollectionBox:r=>new Ji(ue(this,le,"f"),r),visitNoteRegionBox:r=>new mc(ue(this,le,"f"),r),visitPitchDeviceBox:r=>new Px(ue(this,le,"f"),r),visitPlayfieldDeviceBox:r=>new Qc(ue(this,le,"f"),r),visitPlayfieldSampleBox:r=>new Yc(ue(this,le,"f"),r),visitRevampDeviceBox:r=>new Ov(ue(this,le,"f"),r),visitReverbDeviceBox:r=>new zv(ue(this,le,"f"),r),visitRootBox:r=>new Ax(ue(this,le,"f"),r),visitSoundfontDeviceBox:r=>new Lx(ue(this,le,"f"),r),visitSoundfontFileBox:r=>new Gx(ue(this,le,"f"),r),visitSpielwerkDeviceBox:r=>new Mx(ue(this,le,"f"),r),visitStereoToolDeviceBox:r=>new zx(ue(this,le,"f"),r),visitTapeDeviceBox:r=>new Fx(ue(this,le,"f"),r),visitTimelineBox:r=>new Pa(ue(this,le,"f"),r),visitTrackBox:r=>new tr(ue(this,le,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Vx(ue(this,le,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Kx(ue(this,le,"f"),r),visitValueClipBox:r=>new Oo(ue(this,le,"f"),r),visitValueEventBox:r=>new Ya(ue(this,le,"f"),r),visitValueEventCollectionBox:r=>new Fr(ue(this,le,"f"),r),visitValueRegionBox:r=>new ao(ue(this,le,"f"),r),visitVaporisateurDeviceBox:r=>new Sx(ue(this,le,"f"),r),visitVocoderDeviceBox:r=>new iy(ue(this,le,"f"),r),visitWaveshaperDeviceBox:r=>new oy(ue(this,le,"f"),r),visitWerkstattDeviceBox:r=>new uy(ue(this,le,"f"),r),visitVelocityDeviceBox:r=>new ry(ue(this,le,"f"),r),visitZeitgeistDeviceBox:r=>new Ox(ue(this,le,"f"),r)}),`Could not find factory for ${e}`)};var dd;(function(t){t.PEAKS=Oe.compose(M.Lowest).append(0),t.SPECTRUM=Oe.compose(M.Lowest).append(1),t.WAVEFORM=Oe.compose(M.Lowest).append(2)})(dd||(dd={}));var s$;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>W(r.stems)?Object.keys(r.stems).length:1}),t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{if(!W(e.stems))return;let r=e.stems,n=new Map,i=a=>{let o=n.get(a)??0,s=a;for(;n.has(s);)o++,s=`${a} ${o}`;return n.set(a,o),n.set(s,1),s};Object.keys(r).forEach(a=>{let o=r[a];o.fileName=i(t.sanitizeFileName(o.fileName))})}})(s$||(s$={}));var cy=512,l$=_i.createBuilder({position:_i.float,bpm:_i.float,playbackTimestamp:_i.float,countInBeatsRemaining:_i.float,isPlaying:_i.bool,isCountingIn:_i.bool,isRecording:_i.bool,perfIndex:_i.int32,perfBuffer:_i.floats(cy)});var u$;(function(t){t.store=(e,r,n)=>{if(n==="")return V("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof $n&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};Sb(i)?a(i):$n.create(e.graph,M.generate(),a)},t.read=(e,r)=>{if(r==="")return V("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof $n&&i.origin.getValue()===r);if(Sb(n)){let{status:i,value:a,error:o}=Ct(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return V("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof $n&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return V("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=M.newSet(s=>s.uuid),a=s=>{let{status:u,value:d,error:m}=Ct(()=>JSON.parse(s.value.getValue()));u==="success"?n(b.wrap(d)):(console.warn(m),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof $n)||s.origin.getValue()!==r)return;let u=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:u})},onRemoved:({box:s})=>{if(!(s instanceof $n)||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()}}}})(u$||(u$={}));var zB,OB,UB,VB;zB=new WeakMap,OB=new WeakMap,UB=new WeakMap,VB=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)=>{ta(r)||(t.isNoteOn(r)?P(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?P(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?P(n.pitchBend,t.asPitchBend(r)):t.isController(r)?P(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?P(n.clock):t.isStart(r)?P(n.start):t.isContinue(r)?P(n.continue):t.isStop(r)?P(n.stop):t.isPosition(r)&&P(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 ho;(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 V("Unknown MIDI event")}})(ho||(ho={}));var c$;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(ho.on(r,n,i)),{terminate:()=>{a&&(e(ho.off(r,n)),a=!1)}}}})(c$||(c$={}));var d$=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)},jB,KB,p$,f$,WB,LB;KB=new WeakMap,p$=new WeakMap,f$=new WeakMap,WB=new WeakMap,jB=new WeakSet,LB=function(e,r){return e.subscribeIntegers(r,n=>{d$(this,p$,"f").replace(n.buffer)&&d$(this,f$,"f").notify(this)})};var ZB,GB,HB,qB,JB,XB;ZB=new WeakMap,GB=new WeakMap,HB=new WeakMap,qB=new WeakMap,JB=new WeakMap,XB=new WeakMap;var Xn={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})??V("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var dy={min:30,max:1e3,default:120};var py;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?wr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?wr.err("Denominator must be a power of two between 1 and 32"):wr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?at(e,dy.min,dy.max):dy.default,t.clampBaseFrequency=e=>Number.isFinite(e)?at(e,Dv.min,Dv.max):Dv.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of ce.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>Xn.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof No&&i.timeBase.getValue()===Lr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(py||(py={}));var m$;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return py.isTimeSignatureValid(i,a)}})(m$||(m$={}));var h$;(function(t){t.reader=(e,r)=>{let n=`
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()}`}};FB([cu,XE("design:type",oa),XE("design:paramtypes",[])],D.prototype,"pointerHub",null);var rp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(rp||(rp={}));var Te;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Te||(Te={}));var Ch;(function(t){t.create=()=>new Wb})(Ch||(Ch={}));var Wb=class{#e=new ip(Ms.equals);#t=new ip(Ms.startsWith);#r=new ip(Ms.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new Lb(r,e,this.#n++,n);if(this.#a){let a=new Zb(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 Te.This:return this.#e.subscribe(e);case Te.Parent:return this.#t.subscribe(e);case Te.Children:return this.#r.subscribe(e);default:return hh(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Lb=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: ${Te[this.propagation]}, order: ${this.order} }`}},ip=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(Ms.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Zb=class{monitor;propagation;#e=new X;#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 zt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(zt||(zt={}));var Is={[zt.Boolean]:{type:zt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[zt.Float32]:{type:zt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[zt.Int32]:{type:zt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[zt.String]:{type:zt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[zt.Bytes]:{type:zt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},Ns=class extends Z{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return P(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Te.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){te(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){te(!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)?V("not implemented"):e}fromJSON(e){return V("Type mismatch")}reset(){this.setValue(this.#t)}},R=class t extends Ns{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,zt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return Is[zt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){te(!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()))}},S=class t extends Ns{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Float32,i),this.#e=r,this.#t=n}serialization(){return Is[zt.Float32]}equals(e){return this.getValue()===e}clamp(e){return rp.clampFloat32(this.#e,Ka.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){te(!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()))}},k=class t extends Ns{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,zt.Int32,i),this.#e=r,this.#t=n}serialization(){return Is[zt.Int32]}equals(e){return this.getValue()===e}clamp(e){return rp.clampInt32(this.#e,br.toInt(e))}read(e){this.setValue(e.readInt())}write(e){te(!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>=br.MIN_VALUE&&e<=br.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},B=class t extends Ns{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,zt.String,r)}serialization(){return Is[zt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){te(!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()))}},YE=class t extends Ns{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,zt.Bytes,r)}serialization(){return Is[zt.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){te(!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 eP=t=>{let e=M.newSet(i=>i),r=M.newSet(i=>i);for(let i of t)i instanceof Bs?e.add(i.uuid):i instanceof Rs&&r.add(i.uuid);let n=M.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof Bs||i instanceof Rs?!n.hasKey(i.uuid):i instanceof Ds||i instanceof Ts?!n.hasKey(i.address.uuid):!0)},QE;(function(t){t.decode=e=>{let r=e.readInt();return ce.create(()=>{switch(e.readString()){case"new":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Bs(i,a,o.buffer)}case"pointer":{let i=Oe.read(e),a=e.readBoolean()?b.wrap(Oe.read(e)):b.None,o=e.readBoolean()?b.wrap(Oe.read(e)):b.None;return new Ds(i,a,o)}case"primitive":{let i=Oe.read(e),a=e.readString(),o=Is[a],s=o.decode(e),u=o.decode(e);return new Ts(i,o,s,u)}case"delete":{let i=M.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new Rs(i,a,o.buffer)}}},r)}})(QE||(QE={}));var Bs=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 rt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Ts=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}`}},Ds=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()}`}},Rs=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 rt(this.#r)))}write(e){e.writeString(this.type),M.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${M.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var c4=Symbol("Unreferenceable"),N=class t extends Z{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){te(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Ct(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){te(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Ct(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 V(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return P(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Te.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=oa.validate(this,e.unwrap());r.nonEmpty()&&V(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(Oe.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){te(!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(ta(e)||typeof e=="string"){let r=b.wrap(ta(e)?null:Oe.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return V(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var zh=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Oe.newSet(e=>e.address),this.#t=Oe.newSet(e=>e.address),this.#r=Oe.newSet(e=>e.address),this.#i=Oe.newSet(([e])=>e),this.#n=Oe.newSet(([e])=>e.address),this.#a=M.newSet(e=>e)}watchVertex(e){if(mt(e,N)){if(!e.mandatory)return V("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return V("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 V(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return V(`${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");ce.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,ce.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.`),V(`Pointer ${e.toString()} requires an edge.`)):V(`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.`),V(`Target ${e.toString()} requires an edge.`)):V(`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.`),V(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Oe.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):ce.empty()}#s(e,r,n){let i=Oe.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var Za=class{#e;#t;#r;#i;#n;#a;#o;#s;#c;#l;#u;#p;#d;#v=!1;#f=!1;#m=!1;constructor(e=b.None){this.#e=e,this.#t=M.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#c=Ch.create(),this.#a=new Qt,this.#o=new Qt,this.#s=new Qt,this.#l=new zh,this.#u=Oe.newSet(({pointer:r})=>r.address),this.#p=[],this.#d=M.newSet(r=>r.uuid)}beginTransaction(){te(!this.#v,"Transaction already in progress"),this.#v=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){te(this.#v,"No transaction in progress"),this.#_(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#w(e,r)),this.#r.length=0),this.#g()}endTransaction(){te(this.#v,"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.#_(),this.#g(),e}),this.#x(),this.#g()}inTransaction(){return this.#v}constructingBox(){return this.#f}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#b(),te(!this.#f,"Cannot construct box while other box is constructing"),K(r)){this.#f=!0;let a=Ct(()=>r(e));if(this.#f=!1,a.status==="failure")throw this.#A(e),a.error}if(!this.#t.add(e))return this.#A(e),V(`${e.name} ${e.address.toString()} already staged`);let i=new Bs(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.#c.subscribe(e,r,n)}subscribeEndTransaction(e){this.#p.push(e)}subscribeDeletion(e,r){let n=this.#d.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#d.removeByKeyIfExist(e)}}}unstageBox(e){this.#b();let r=this.#t.removeByKey(e.address.uuid);te(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new Rs(e.address.uuid,e.name,e.toArrayBuffer());this.#m||this.#n.push(n),this.#d.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 yh;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#b(),e.isAttached()&&!this.#f){let i=new Ts(e.address,e.serialization(),r,n);this.#m||this.#n.push(i),this.#c.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#b(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new Ds(e.address,r,n);this.#f?this.#r.push({pointerField:e,update:i}):(this.#m||this.#n.push(i),this.#w(e,i),this.#o.proxy.onUpdate(i))}#w(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#c.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.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#c.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#g(){for(this.#u.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.#u.clear(),this.#v=!1;this.#p.length>0;)this.#p.splice(0).forEach(e=>e()),this.#p.length>0&&console.debug(`${this.#p.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#m),this.#m=!1}#_(){this.#m=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=eP(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof Ds||n instanceof Ts)&&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.#u.clear(),this.#n.length=0}#A(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.#F(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}#F(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=K(r.excludeBox)?r.excludeBox:du.alwaysFalse,i=K(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=K(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,u=(m,x=!1)=>{if(!(o.has(m)||!x&&n(m))){if(o.add(m),a&&K(m.resource)){m.incomingEdges().forEach(g=>{s.add(g);let w=g.targetAddress.mapOr(A=>!A.isBox(),!1);if(g.mandatory&&w){if(m.resource==="shared"&&g.targetAddress.flatMap(_=>this.findVertex(_)).mapOr(_=>_.pointerRules.mandatory,!1))return;u(g.box)}});return}m.outgoingEdges().filter(([g])=>!s.has(g)).forEach(([g,w])=>{let A=this.findVertex(w).unwrap(`Could not find target of ${g.toString()}`);if(s.add(g),A.pointerRules.mandatory&&(i||A.pointerHub.incoming().filter(_=>_.targetAddress.mapOr(C=>C.equals(w),!1)).every(_=>s.has(_))))return u(A.box)}),m.incomingEdges().forEach(g=>{s.add(g),g.mandatory&&u(g.box)})}},d=Array.isArray(e)?e:[e];return d.forEach(m=>u(m,!0)),d.forEach(m=>o.delete(m)),{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();te(o,`pointer ${a.address} is broken`),te(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[M.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:V("Unknown address"))))}toArrayBuffer(){let e=Yt.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){te(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new rt(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),u=new Int8Array(s);n.readBytes(u);let d=new rt(u.buffer),m=d.readInt(),x=d.readString(),g=M.fromDataInput(d);a.push({creationIndex:m,name:x,uuid:g,boxStream:d})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:u})=>this.createBox(o,s,d=>d.read(u))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#w(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#g())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:ze(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return V("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,M.parse(i),s=>{let u=Ct(()=>s.fromJSON(o));u.status==="failure"&&console.warn(u.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#w(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#g())}#b(){te(this.#v,()=>"Modification only prohibited in transaction mode.")}};var ai;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=at(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=at(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=at(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,u=s,d=s+r.length,m=0,x=0,g=0;for(let w=0;w<i.length;w++){let A=i[w],_=a.has(w)?u+x++:w<n?m++:d+g++;A.index.setValue(_)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof k,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:V(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(ai||(ai={}));var Je=class extends Z{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return P(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ze(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Te.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Fo.readFields(e,this.#e)}write(e){Fo.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(mh(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return V("Type mismatch")}};var So;(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"})(So||(So={}));var np;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(np||(np={}));var gu;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(gu||(gu={}));var Oh=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Yt.create(0);#a=b.None;#o=b.None;#s=b.None;#c=-1;#l=-1;#u=!1;#p=!1;#d=0;constructor(e){this.#i=En.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.#v();if(e.nonEmpty()){this.#p||(this.#i.sendShareLock(this.#t),this.#p=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#f(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#d){let o=vh(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=Yt.use(s,r),this.#a=b.wrap(s),this.#d=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===np.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,np.READ))}broadcastFloat(e,r){return this.#h(new class{type=So.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=So.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=So.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=So.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=So.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#v(){if(this.#u){try{this.#s=b.wrap(this.#g())}catch(e){throw e}this.#u=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#f(){return this.#l===-1&&(this.#l=this.#w()+12),this.#l}terminate(){ce.clear(this.#e),this.#s=b.None,this.#u=!1,this.#l=0}#m(e){te(!this.#u&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#f();te(e.remaining>=r,"Insufficient data"),e.writeInt(this.#c),e.writeInt(gu.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(gu.END)}#w(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{ce.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#u=!0}#g(){let e=Yt.create();e.writeInt(gu.ID),e.writeInt(++this.#c),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var ap=class{#e=new X;#t;constructor(e,r){this.#t=this.#e.own(new Sh(r)),this.#e.own(En.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 tP;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(tP||(tP={}));var rP;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(rP||(rP={}));var Ft;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Ft||(Ft={}));var Eo={white:new qt(0,0,100),blue:new qt(189,100,65),green:new qt(150,77,69),yellow:new qt(60,100,84),cream:new qt(65,20,83),orange:new qt(31,100,73),red:new qt(354,100,65),purple:new qt(314,100,78),bright:new qt(197,5,95),gray:new qt(197,31,88),dark:new qt(197,15,70),shadow:new qt(197,10,55),black:new qt(197,10,25),background:new qt(197,8,9),panelBackground:new qt(197,14,12),panelBackgroundBright:new qt(197,13,19),panelBackgroundDark:new qt(197,14,11)};var Le;(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"})(Le||(Le={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Le||(Le={}));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"})(l||(l={}));var Uh;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Uh||(Uh={}));var Cs;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(Cs||(Cs={}));var iP=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?V(`Indices cannot be equal (${t}, ${e})`):r};var Ga=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)},Vh,Pn,Po,jh,Ha,cr=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){Vh.set(this,void 0),Pn.set(this,void 0),Po.set(this,void 0),jh.set(this,void 0),Ha.set(this,null),Ga(this,Vh,e,"f"),Ga(this,Pn,M.newSet(i=>i.adapter.uuid),"f"),Ga(this,Po,new Qt,"f"),Ga(this,jh,e.pointerHub.catchupAndSubscribe({onAdded:i=>{Ga(this,Ha,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{Ga(this,Ha,null,"f"),Ar(this,Po,"f").proxy.onReorder(a)}),s=Ar(this,Pn,"f").add({adapter:a,subscription:o});te(s,`Could not add ${a}`),Ar(this,Po,"f").proxy.onAdd(a)},onRemoved:i=>{Ga(this,Ha,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=Ar(this,Pn,"f").removeByKey(a);s.terminate(),Ar(this,Po,"f").proxy.onRemove(o)}},n),"f")}field(){return Ar(this,Vh,"f")}subscribe(e){return Ar(this,Po,"f").subscribe(e)}catchupAndSubscribe(e){return Ar(this,Pn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=ht.exactMapped(this.adapters(),e,iP,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return Ar(this,Pn,"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 Ar(this,Ha,"f")===null&&Ga(this,Ha,Ar(this,Pn,"f").values().map(({adapter:e})=>e).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),Ar(this,Ha,"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=at(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 Ar(this,Pn,"f").size()}isEmpty(){return this.size()===0}terminate(){Ga(this,Ha,null,"f"),Ar(this,Pn,"f").forEach(({subscription:e})=>e.terminate()),Ar(this,Pn,"f").clear(),Ar(this,Po,"f").terminate(),Ar(this,jh,"f").terminate()}};Vh=new WeakMap,Pn=new WeakMap,Po=new WeakMap,jh=new WeakMap,Ha=new WeakMap;var qa;(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","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return $n.create(r,n,i);case"ProjectMetaBox":return Kh.create(r,n,i);case"RootBox":return $o.create(r,n,i);case"SelectionBox":return sa.create(r,n,i);case"UserInterfaceBox":return Ja.create(r,n,i);case"UploadFileBox":return Wh.create(r,n,i);case"ShadertoyBox":return Lh.create(r,n,i);case"MIDIControllerBox":return Zh.create(r,n,i);case"TimelineBox":return zs.create(r,n,i);case"TrackBox":return Br.create(r,n,i);case"NoteEventBox":return ko.create(r,n,i);case"NoteEventRepeatBox":return Gh.create(r,n,i);case"NoteEventCollectionBox":return Xa.create(r,n,i);case"NoteRegionBox":return Os.create(r,n,i);case"NoteClipBox":return vu.create(r,n,i);case"ValueEventBox":return kn.create(r,n,i);case"ValueEventCollectionBox":return Mn.create(r,n,i);case"ValueEventCurveBox":return Mo.create(r,n,i);case"ValueRegionBox":return Us.create(r,n,i);case"ValueClipBox":return xu.create(r,n,i);case"SignatureEventBox":return yu.create(r,n,i);case"AudioRegionBox":return No.create(r,n,i);case"AudioClipBox":return wu.create(r,n,i);case"AudioPitchStretchBox":return bu.create(r,n,i);case"AudioTimeStretchBox":return _u.create(r,n,i);case"AudioSignalsmithBox":return Au.create(r,n,i);case"TransientMarkerBox":return Hh.create(r,n,i);case"WarpMarkerBox":return la.create(r,n,i);case"MarkerBox":return Fu.create(r,n,i);case"AudioFileBox":return Li.create(r,n,i);case"SoundfontFileBox":return ua.create(r,n,i);case"NeuralAmpModelBox":return qh.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return ca.create(r,n,i);case"CaptureMidiBox":return da.create(r,n,i);case"AudioBusBox":return Nn.create(r,n,i);case"AuxSendBox":return Su.create(r,n,i);case"GrooveShuffleBox":return Eu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Jh.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Xh.create(r,n,i);case"DeviceInterfaceKnobBox":return Yh.create(r,n,i);case"ModularDeviceBox":return Qh.create(r,n,i);case"StereoToolDeviceBox":return eg.create(r,n,i);case"MaximizerDeviceBox":return Pu.create(r,n,i);case"CompressorDeviceBox":return tg.create(r,n,i);case"GateDeviceBox":return rg.create(r,n,i);case"DelayDeviceBox":return ig.create(r,n,i);case"CrusherDeviceBox":return ng.create(r,n,i);case"DattorroReverbDeviceBox":return ag.create(r,n,i);case"VelocityDeviceBox":return og.create(r,n,i);case"FoldDeviceBox":return sg.create(r,n,i);case"TidalDeviceBox":return lg.create(r,n,i);case"RevampDeviceBox":return ug.create(r,n,i);case"ReverbDeviceBox":return cg.create(r,n,i);case"VaporisateurDeviceBox":return $u.create(r,n,i);case"MIDIOutputDeviceBox":return ku.create(r,n,i);case"MIDIOutputBox":return Io.create(r,n,i);case"MIDIOutputParameterBox":return Vs.create(r,n,i);case"SoundfontDeviceBox":return Mu.create(r,n,i);case"NanoDeviceBox":return Nu.create(r,n,i);case"PlayfieldDeviceBox":return Iu.create(r,n,i);case"PlayfieldSampleBox":return Bo.create(r,n,i);case"TapeDeviceBox":return Bu.create(r,n,i);case"ArpeggioDeviceBox":return dg.create(r,n,i);case"PitchDeviceBox":return pg.create(r,n,i);case"ZeitgeistDeviceBox":return fg.create(r,n,i);case"NeuralAmpDeviceBox":return mg.create(r,n,i);case"VocoderDeviceBox":return hg.create(r,n,i);case"WaveshaperDeviceBox":return gg.create(r,n,i);case"WerkstattDeviceBox":return vg.create(r,n,i);case"WerkstattParameterBox":return pa.create(r,n,i);case"WerkstattSampleBox":return js.create(r,n,i);case"SpielwerkDeviceBox":return xg.create(r,n,i);case"ApparatDeviceBox":return Tu.create(r,n,i);case"NoopInstrumentBox":return Du.create(r,n,i);case"CompositeDeviceBox":return yg.create(r,n,i);case"CompositeCellBox":return wg.create(r,n,i);case"ModularBox":return bg.create(r,n,i);case"ModuleConnectionBox":return _g.create(r,n,i);case"ModularAudioInputBox":return Ag.create(r,n,i);case"ModularAudioOutputBox":return Fg.create(r,n,i);case"ModuleDelayBox":return Sg.create(r,n,i);case"ModuleMultiplierBox":return Eg.create(r,n,i);case"ModuleGainBox":return Pg.create(r,n,i);default:return V(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new rt(r),i=n.readString(),a=M.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(qa||(qa={}));var $n=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:B.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};var Kh=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:B.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:B.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};var $g=class t extends Je{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:k.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:S.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:S.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:R.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:k.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var $o=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:S.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:Z.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:Z.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:Z.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:$g.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:N.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:N.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:N.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var sa=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 P(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var Ja=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:N.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:N.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:N.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:Z.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Wh=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 P(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var Lh=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 P(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:R.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var Zh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:B.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:k.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var kg=class t extends Je{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:k.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:k.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Mg=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:k.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:k.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Ng=class t extends Je{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:Z.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Ig=class t extends Je{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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:k.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:k.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Bg=class t extends Je{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:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var zs=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 P(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:Z.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:kg.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Mg.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:Z.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Ng.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:Ig.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Bg.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:k.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:S.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var Br=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:k.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:k.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:R.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:R.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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:k.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:S.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:k.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:S.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:S.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:k.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Gh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:k.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:S.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:S.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var Xa=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 P(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var Os=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:k.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:k.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:k.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:R.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:B.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:k.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var To=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:R.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:R.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:k.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:k.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:k.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var vu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:k.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var kn=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:k.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:S.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:S.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var Mn=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 P(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Mo=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 P(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:S.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var Us=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:k.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:k.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:k.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var xu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:k.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var yu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:k.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:k.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:k.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:k.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var Tg=class t extends Je{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:S.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:S.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:S.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:S.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var No=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:B.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:S.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:k.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:B.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:k.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:S.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Tg.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var wu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:N.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:S.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:N.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:S.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:R.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:B.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:k.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:S.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:B.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};var bu=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 P(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var _u=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 P(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:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:k.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:S.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Au=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 P(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:S.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Hh=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 P(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:S.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var la=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:k.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:S.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var Fu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:k.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:k.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Li=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 P(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:S.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:S.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:B.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var ua=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 P(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};var qh=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"packId",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 P(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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:N.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:k.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:S.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:S.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:R.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:Z.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:Z.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:Z.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:N.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:N.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1)}}};var ca=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:k.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:S.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:S.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var da=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:k.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Nn=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:N.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:B.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:B.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:R.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Su=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:N.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:k.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:S.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:S.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Eu=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 P(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:B.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:S.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:k.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 Jh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Xh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};var Yh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:N.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:S.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:B.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};var Dg=class t extends Je{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var Qh=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Dg.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var eg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:S.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:R.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:R.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:R.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:k.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Pu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:S.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 tg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:R.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:R.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:R.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:R.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:S.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:S.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:S.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:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var rg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.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:S.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:S.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:S.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:S.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:R.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var ig=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:S.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:S.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:S.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:S.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:S.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:S.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:S.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:S.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:S.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:S.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:S.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:S.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:k.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var ng=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:k.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:S.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:S.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 ag=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:S.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:S.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:S.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:S.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:S.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:S.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:S.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:S.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:S.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:S.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 og=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:S.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:k.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:S.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:S.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:S.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var sg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:S.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 lg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:S.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:S.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:S.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:S.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:S.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 op=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:S.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 sp=class t extends Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:S.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 Je{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:R.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:S.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:S.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:S.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 ug=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:op.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:sp.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:sp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:op.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:S.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 cg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:S.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:S.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:S.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:S.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:S.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 Rg=class t extends Je{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:k.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:S.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:k.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:S.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 Cg=class t extends Je{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:k.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:S.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:R.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:S.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:S.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:S.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var zg=class t extends Je{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:S.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:S.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:S.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:S.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 $u=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:k.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:S.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:k.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:S.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:S.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:S.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:k.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:k.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:S.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:S.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:k.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:S.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:Cg.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Rh.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>Rg.create(e),2),50:zg.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:k.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Og=class t extends Je{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:B.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var ku=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Og.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:k.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:k.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:Z.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:N.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Io=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:B.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:R.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var Vs=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:S.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var Mu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:k.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var Nu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:N.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:S.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 Iu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Bo=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 P(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)}initializeFields(){return{10:N.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:N.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:Z.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:Z.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:B.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:B.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:R.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:R.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:R.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:R.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:R.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:R.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:k.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:S.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:S.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:S.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:S.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:S.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)}}};var Bu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:S.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:S.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:S.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var dg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.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:k.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:k.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:S.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:k.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:S.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var pg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.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:S.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:k.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 fg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var mg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:S.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:S.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:R.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:S.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:N.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var hg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:S.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:S.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:S.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:S.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:S.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:S.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:S.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:S.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:k.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:B.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:S.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:S.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:N.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var gg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:S.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:S.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:S.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var vg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var pa=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:S.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:S.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var js=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:k.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:N.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var xg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:k.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:B.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Tu=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Du=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var yg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:R.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:R.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var wg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:k.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};var bg=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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:B.create({parent:this,fieldKey:13,fieldName:"label",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:"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 P(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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:N.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var Zi=class t extends Je{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:N.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:k.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:k.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:R.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:R.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var Ag=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 P(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var Fg=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 P(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var Sg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.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 Eg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};var Pg=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 P(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:Zi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var oi;(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;K(n)?($b(n,Mo),n.slope.setValue(r.slope)):Mo.create(e.box.graph,M.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return K(r)?($b(r,Mo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?ni.None:e.getValue()===1?ni.Linear:V("Unknown Interpolation value")}})(oi||(oi={}));var Do=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)},lp,Cu,Tt,up,Ro,cp,Ya=class t{constructor(e,r){this.type="value-event",lp.set(this,new X),Cu.set(this,void 0),Tt.set(this,void 0),up.set(this,void 0),Ro.set(this,void 0),cp.set(this,!1),Do(this,Cu,e,"f"),Do(this,Tt,r,"f"),Do(this,up,Qe(this,lp,"f").own(new gh(()=>oi.read(Qe(this,Tt,"f").interpolation))),"f");let n=()=>{Qe(this,up,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Qe(this,lp,"f").ownAll(Qe(this,Tt,"f").subscribe(Te.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=ce.equals(Qe(this,Tt,"f").index.address.fieldKeys,o),u=ce.equals(Qe(this,Tt,"f").position.address.fieldKeys,o);s||u?a.requestSorting():a.onEventPropertyChanged()}}),Qe(this,Tt,"f").interpolation.subscribe(n),Qe(this,Tt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Qe(this,Ro,"f").terminate(),Do(this,Ro,i.subscribe(Te.Children,n),"f"),n()},onRemoved:()=>{Qe(this,Ro,"f").terminate(),Do(this,Ro,pe.Empty,"f"),n()}})),Do(this,Ro,Qe(this,Tt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Te.Children,n)??pe.Empty,"f")}onSelected(){Do(this,cp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Do(this,cp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Qe(this,Ro,"f").terminate(),Qe(this,lp,"f").terminate()}get box(){return Qe(this,Tt,"f")}get uuid(){return Qe(this,Tt,"f").address.uuid}get address(){return Qe(this,Tt,"f").address}get position(){return Qe(this,Tt,"f").position.getValue()}get index(){return Qe(this,Tt,"f").index.getValue()}set interpolation(e){oi.write(Qe(this,Tt,"f").interpolation,e)}get interpolation(){return Qe(this,up,"f").get()}get value(){return Qe(this,Tt,"f").value.getValue()}get isSelected(){return Qe(this,cp,"f")}get collection(){return Qe(this,Tt,"f").events.targetVertex.map(e=>Qe(this,Cu,"f").boxAdapters.adapterFor(e.box,Fr))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=kn.create(Qe(this,Cu,"f").boxGraph,M.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 oi.write(i.interpolation,e?.interpolation??this.interpolation),Qe(this,Cu,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return Qe(this,Tt,"f").position.setValue(e?.position??this.position),Qe(this,Tt,"f").index.setValue(e?.index??this.index),Qe(this,Tt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),Qe(this,Tt,"f").value.setValue(e?.value??this.value),oi.write(Qe(this,Tt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};lp=new WeakMap,Cu=new WeakMap,Tt=new WeakMap,up=new WeakMap,Ro=new WeakMap,cp=new WeakMap;Ya.Comparator=(t,e)=>{if(t===e)return V(`${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:V(`${t} and ${e} are identical in terms of comparison`)};var dp=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)},pp,fp,Co,Gi,Ks,zu,Qa,Ug,Fr=class t{constructor(e,r){pp.add(this),fp.set(this,new X),Co.set(this,void 0),Gi.set(this,void 0),Ks.set(this,void 0),zu.set(this,void 0),Qa.set(this,void 0),dp(this,Co,e,"f"),dp(this,Gi,r,"f"),dp(this,Ks,new fe,"f"),dp(this,zu,M.newSet(i=>i.uuid),"f"),dp(this,Qa,Ir.create(Ya.Comparator),"f");let n=i=>{let a=ze(i.accept({visitValueEventBox:o=>Ye(this,Co,"f").boxAdapters.adapterFor(o,Ya)}),`Could not find adapter for ${i}`);Ye(this,zu,"f").add(a)&&(Ye(this,Qa,"f").add(a),Ye(this,pp,"m",Ug).call(this))};Ye(this,Gi,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Ye(this,fp,"f").own(Ye(this,Gi,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Ye(this,Qa,"f").remove(Ye(this,zu,"f").removeByKey(i)),Ye(this,pp,"m",Ug).call(this)}})),Ye(this,fp,"f").own(Ye(this,Gi,"f").owners.pointerHub.subscribe({onAdded:()=>Ye(this,Ks,"f").notify(this),onRemoved:()=>Ye(this,Ks,"f").notify(this)}))}valueAt(e,r){return Th.valueAt(Ye(this,Qa,"f"),e,r)}copy(){let e=Ye(this,Co,"f").boxGraph,r=Mn.create(e,M.generate());return Ye(this,Qa,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ye(this,Co,"f").boxAdapters.adapterFor(r,t)}cut(e,r=E.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),u=r.x(i.value),d=VE(s,u,(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),u=r.x(i.value),d=o-a,m=e-a,x=Jt.byHalf(d,s,Jt.valueAt({slope:n.interpolation.slope,steps:d,y0:s,y1:u},d*.5),u),g=Jt.valueAt(x,m),w=Jt.slopeByHalf(s,Jt.valueAt(x,m*.5),g);return oi.write(n.box.interpolation,ni.Curve(w)),b.wrap(this.createEvent({position:e,value:r.y(g),index:0,interpolation:ni.Curve(Jt.slopeByHalf(g,Jt.valueAt(x,(m+d)*.5),u))}))}return V("Unknown interpolation type")}subscribeChange(e){return Ye(this,Ks,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Ye(this,zu,"f").values().find(u=>u.position===a&&u.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),oi.write(o.box.interpolation,i),o;let s=kn.create(Ye(this,Co,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.index.setValue(r),u.value.setValue(n),u.events.refer(Ye(this,Gi,"f").events)});return oi.write(s.interpolation,i),Ye(this,Co,"f").boxAdapters.adapterFor(s,Ya)}requestSorting(){Ye(this,Qa,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ye(this,pp,"m",Ug).call(this)}terminate(){Ye(this,fp,"f").terminate()}get box(){return Ye(this,Gi,"f")}get uuid(){return Ye(this,Gi,"f").address.uuid}get address(){return Ye(this,Gi,"f").address}get numOwners(){return Ye(this,Gi,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Ye(this,Qa,"f")}toString(){return`{ValueEventCollectionBox ${M.toString(Ye(this,Gi,"f").address.uuid)}}`}};fp=new WeakMap,Co=new WeakMap,Gi=new WeakMap,Ks=new WeakMap,zu=new WeakMap,Qa=new WeakMap,pp=new WeakSet,Ug=function(){Ye(this,Ks,"f").notify(this)};var Ws=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},Ce=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)},Ls,zo,Zs,er,Gs,gp,mp,hp,Ou,Oo=class{constructor(e,r){Ls.add(this),this.type="value-clip",zo.set(this,new X),Zs.set(this,void 0),er.set(this,void 0),Gs.set(this,void 0),gp.set(this,void 0),mp.set(this,void 0),hp.set(this,pe.Empty),Ws(this,Zs,e,"f"),Ws(this,er,r,"f"),Ws(this,mp,!0,"f"),Ws(this,Gs,Ce(this,zo,"f").own(new Wi(!1)),"f"),Ws(this,gp,Ce(this,zo,"f").own(new fe),"f"),Ce(this,zo,"f").own(Ce(this,er,"f").pointerHub.subscribe({onAdded:()=>Ce(this,Ls,"m",Ou).call(this),onRemoved:()=>Ce(this,Ls,"m",Ou).call(this)})),Ce(this,zo,"f").own(Ce(this,er,"f").subscribe(Te.Children,n=>Ce(this,Ls,"m",Ou).call(this))),Ce(this,zo,"f").own(Ce(this,er,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ce(this,hp,"f").terminate(),Ws(this,hp,n.match({none:()=>pe.Empty,some:({box:i})=>Ce(this,Zs,"f").boxAdapters.adapterFor(i,Fr).subscribeChange(()=>Ce(this,Ls,"m",Ou).call(this))}),"f"),Ce(this,Ls,"m",Ou).call(this)})),Ws(this,mp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ce(this,Gs,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ce(this,gp,"f").subscribe(e)}accept(e){return P(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ce(this,er,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ce(this,er,"f").events.targetVertex.unwrap("events.target");xu.create(Ce(this,Zs,"f").boxGraph,M.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(Ce(this,er,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ce(this,Gs,"f").setValue(!0)}onDeselected(){Ce(this,Gs,"f").setValue(!1)}get isSelected(){return Ce(this,Gs,"f").getValue()}terminate(){Ce(this,hp,"f").terminate(),Ce(this,zo,"f").terminate()}get box(){return Ce(this,er,"f")}get uuid(){return Ce(this,er,"f").address.uuid}get address(){return Ce(this,er,"f").address}get indexField(){return Ce(this,er,"f").index}get duration(){return Ce(this,er,"f").duration.getValue()}get mute(){return Ce(this,er,"f").mute.getValue()}get hue(){return Ce(this,er,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ce(this,er,"f").events.targetVertex.map(e=>Ce(this,Zs,"f").boxAdapters.adapterFor(e.box,Fr))}get label(){return Ce(this,er,"f").label.getValue()}get trackBoxAdapter(){return Ce(this,mp,"f")?b.None:Ce(this,er,"f").clips.targetVertex.map(e=>Ce(this,Zs,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${M.toString(Ce(this,er,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};zo=new WeakMap,Zs=new WeakMap,er=new WeakMap,Gs=new WeakMap,gp=new WeakMap,mp=new WeakMap,hp=new WeakMap,Ls=new WeakSet,Ou=function(){Ce(this,gp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Vg=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},Hi=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,jg,Hs,yp,xp,Kg,Uu=class{constructor(e){vp.add(this),this.type="transient-marker",jg.set(this,new X),Hs.set(this,void 0),yp.set(this,void 0),xp.set(this,!1),Vg(this,Hs,e,"f"),Vg(this,yp,new fe,"f"),Hi(this,jg,"f").own(e.subscribe(Te.Children,()=>Hi(this,vp,"m",Kg).call(this)))}onSelected(){Vg(this,xp,!0,"f"),Hi(this,vp,"m",Kg).call(this)}onDeselected(){Vg(this,xp,!1,"f"),Hi(this,vp,"m",Kg).call(this)}get box(){return Hi(this,Hs,"f")}get uuid(){return Hi(this,Hs,"f").address.uuid}get address(){return Hi(this,Hs,"f").address}get position(){return Hi(this,Hs,"f").position.getValue()}get isSelected(){return Hi(this,xp,"f")}subscribe(e){return Hi(this,yp,"f").subscribe(e)}terminate(){Hi(this,jg,"f").terminate()}};jg=new WeakMap,Hs=new WeakMap,yp=new WeakMap,xp=new WeakMap,vp=new WeakSet,Kg=function(){Hi(this,yp,"f").notify()};var wp=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)},Wg,bp,fa,_p,Vu,Lg,In=class t{constructor(e,r){Wg.set(this,new X),bp.set(this,void 0),fa.set(this,void 0),_p.set(this,void 0),Vu.set(this,void 0),Lg.set(this,void 0),wp(this,bp,e,"f"),wp(this,fa,r,"f"),wp(this,_p,M.newSet(({uuid:n})=>n),"f"),wp(this,Vu,Ir.create(t.Comparator),"f"),wp(this,Lg,Dh.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(u=>{u.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):u.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(u.reason)))});return n}),"f"),Sr(this,Wg,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Sr(this,bp,"f").boxAdapters.adapterFor(n.box,Uu);Sr(this,_p,"f").add(i)&&Sr(this,Vu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Sr(this,Vu,"f").remove(Sr(this,_p,"f").removeByKey(n))}}))}get box(){return Sr(this,fa,"f")}get uuid(){return Sr(this,fa,"f").address.uuid}get address(){return Sr(this,fa,"f").address}get startInSeconds(){return Sr(this,fa,"f").startInSeconds.getValue()}get endInSeconds(){return Sr(this,fa,"f").endInSeconds.getValue()}get transients(){return Sr(this,Vu,"f")}get fileName(){return Sr(this,fa,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Sr(this,Lg,"f").call(this)}getOrCreateLoader(){return Sr(this,bp,"f").sampleManager.getOrCreate(Sr(this,fa,"f").address.uuid)}terminate(){Sr(this,Wg,"f").terminate()}};Wg=new WeakMap,bp=new WeakMap,fa=new WeakMap,_p=new WeakMap,Vu=new WeakMap,Lg=new WeakMap;In.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var Ap=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},Zr=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)},Fp,Zg,Gg,eo,Ep,Sp,Hg,ma=class{constructor(e,r){Fp.add(this),this.type="warp-marker",Zg.set(this,new X),Gg.set(this,void 0),eo.set(this,void 0),Ep.set(this,void 0),Sp.set(this,!1),Ap(this,Gg,e,"f"),Ap(this,eo,r,"f"),Ap(this,Ep,new fe,"f"),Zr(this,Zg,"f").own(r.subscribe(Te.Children,()=>Zr(this,Fp,"m",Hg).call(this)))}onSelected(){Ap(this,Sp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Zr(this,Fp,"m",Hg).call(this)}onDeselected(){Ap(this,Sp,!1,"f"),Zr(this,Fp,"m",Hg).call(this)}get box(){return Zr(this,eo,"f")}get uuid(){return Zr(this,eo,"f").address.uuid}get address(){return Zr(this,eo,"f").address}get position(){return Zr(this,eo,"f").position.getValue()}get seconds(){return Zr(this,eo,"f").seconds.getValue()}get isSelected(){return Zr(this,Sp,"f")}get optWarping(){return Zr(this,eo,"f").owner.targetVertex.map(e=>Zr(this,Gg,"f").boxAdapters.adapterFor(e.box,ha.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Zr(this,Ep,"f").subscribe(e)}terminate(){Zr(this,Zg,"f").terminate()}};Zg=new WeakMap,Gg=new WeakMap,eo=new WeakMap,Ep=new WeakMap,Sp=new WeakMap,Fp=new WeakSet,Hg=function(){Zr(this,Ep,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var ju=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),V("Events at the same position: "+t.position+", "+e.position)):r};var Pp=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)},qg,Jg,qs,Js,$p,Ku,ga=class{constructor(e,r){qg.set(this,new X),Jg.set(this,void 0),qs.set(this,void 0),Js.set(this,void 0),$p.set(this,void 0),Ku.set(this,void 0),Pp(this,Jg,e,"f"),Pp(this,qs,r,"f"),Pp(this,Js,new fe,"f"),Pp(this,$p,M.newSet(({uuid:n})=>n),"f"),Pp(this,Ku,Ir.create(ju),"f"),Tr(this,qg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Tr(this,Jg,"f").boxAdapters.adapterFor(n.box,ma);Tr(this,$p,"f").add(i)&&(Tr(this,Ku,"f").add(i),Tr(this,Js,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Tr(this,Ku,"f").remove(Tr(this,$p,"f").removeByKey(n)),Tr(this,Js,"f").notify()}}))}get box(){return Tr(this,qs,"f")}get uuid(){return Tr(this,qs,"f").address.uuid}get address(){return Tr(this,qs,"f").address}get warpMarkers(){return Tr(this,Ku,"f")}clone(){let e=bu.create(Tr(this,qs,"f").graph,M.generate());return this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Tr(this,Js,"f").subscribe(e)}onChanged(){Tr(this,Js,"f").notify()}terminate(){Tr(this,qg,"f").terminate()}};qg=new WeakMap,Jg=new WeakMap,qs=new WeakMap,Js=new WeakMap,$p=new WeakMap,Ku=new WeakMap;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},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)},Xg,Yg,Bn,Xs,Mp,Wu,va=class{constructor(e,r){Xg.set(this,new X),Yg.set(this,void 0),Bn.set(this,void 0),Xs.set(this,void 0),Mp.set(this,void 0),Wu.set(this,void 0),kp(this,Yg,e,"f"),kp(this,Bn,r,"f"),kp(this,Xs,new fe,"f"),kp(this,Mp,M.newSet(({uuid:n})=>n),"f"),kp(this,Wu,Ir.create(ju),"f"),rr(this,Xg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=rr(this,Yg,"f").boxAdapters.adapterFor(n.box,ma);rr(this,Mp,"f").add(i)&&(rr(this,Wu,"f").add(i),rr(this,Xs,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{rr(this,Wu,"f").remove(rr(this,Mp,"f").removeByKey(n)),rr(this,Xs,"f").notify()}}))}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 warpMarkers(){return rr(this,Wu,"f")}get playbackRate(){return rr(this,Bn,"f").playbackRate.getValue()}get cents(){return Math.log2(rr(this,Bn,"f").playbackRate.getValue())*1200}set cents(e){rr(this,Bn,"f").playbackRate.setValue(at(2**(e/1200),.5,2))}get transientPlayMode(){return ja(rr(this,Bn,"f").transientPlayMode.getValue(),Uh)}clone(){let e=_u.create(rr(this,Bn,"f").graph,M.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return rr(this,Xs,"f").subscribe(e)}onChanged(){rr(this,Xs,"f").notify()}terminate(){rr(this,Xg,"f").terminate()}};Xg=new WeakMap,Yg=new WeakMap,Bn=new WeakMap,Xs=new WeakMap,Mp=new WeakMap,Wu=new WeakMap;var Np=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)},Qg,ev,qi,Ys,Ip,Lu,xa=class{constructor(e,r){Qg.set(this,new X),ev.set(this,void 0),qi.set(this,void 0),Ys.set(this,void 0),Ip.set(this,void 0),Lu.set(this,void 0),Np(this,ev,e,"f"),Np(this,qi,r,"f"),Np(this,Ys,new fe,"f"),Np(this,Ip,M.newSet(({uuid:n})=>n),"f"),Np(this,Lu,Ir.create(ju),"f"),Wt(this,Qg,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Wt(this,ev,"f").boxAdapters.adapterFor(n.box,ma);Wt(this,Ip,"f").add(i)&&(Wt(this,Lu,"f").add(i),Wt(this,Ys,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Wt(this,Lu,"f").remove(Wt(this,Ip,"f").removeByKey(n)),Wt(this,Ys,"f").notify()}}))}get box(){return Wt(this,qi,"f")}get uuid(){return Wt(this,qi,"f").address.uuid}get address(){return Wt(this,qi,"f").address}get warpMarkers(){return Wt(this,Lu,"f")}get transpose(){return Wt(this,qi,"f").transpose.getValue()}set transpose(e){Wt(this,qi,"f").transpose.setValue(e)}get cents(){return Wt(this,qi,"f").transpose.getValue()*100}set cents(e){Wt(this,qi,"f").transpose.setValue(e/100)}clone(){let e=Au.create(Wt(this,qi,"f").graph,M.generate());return e.transpose.setValue(Wt(this,qi,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>la.create(e.graph,M.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Wt(this,Ys,"f").subscribe(e)}onChanged(){Wt(this,Ys,"f").notify()}terminate(){Wt(this,Qg,"f").terminate()}};Qg=new WeakMap,ev=new WeakMap,qi=new WeakMap,Ys=new WeakMap,Ip=new WeakMap,Lu=new WeakMap;var ha;(function(t){t.isAudioPlayMode=e=>e instanceof ga||e instanceof va||e instanceof xa})(ha||(ha={}));var Ai=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},ge=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)},Qs,Zu,el,Dt,tl,rl,Bp,Dp,Tp,Uo,Gu,Hu,qu,Ju=class{constructor(e,r){Qs.add(this),this.type="audio-clip",Zu.set(this,new X),el.set(this,void 0),Dt.set(this,void 0),tl.set(this,void 0),rl.set(this,void 0),Bp.set(this,void 0),Dp.set(this,void 0),Tp.set(this,void 0),Uo.set(this,b.None),Gu.set(this,b.None),Hu.set(this,pe.Empty),Ai(this,el,e,"f"),Ai(this,Dt,r,"f"),Ai(this,Tp,!0,"f"),Ai(this,tl,new _r,"f"),Ai(this,rl,ge(this,Zu,"f").own(new Wi(!1)),"f"),Ai(this,Bp,ks.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ai(this,Dp,ge(this,Zu,"f").own(new fe),"f"),ge(this,Zu,"f").ownAll(ge(this,Dt,"f").pointerHub.subscribe({onAdded:()=>ge(this,Qs,"m",qu).call(this),onRemoved:()=>ge(this,Qs,"m",qu).call(this)}),ge(this,Dt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{ge(this,Hu,"f").terminate(),n.match({none:()=>ge(this,tl,"f").clear(),some:({box:i})=>{let a=ge(this,el,"f").boxAdapters.adapterFor(i,ha.isAudioPlayMode);Ai(this,Hu,a.subscribe(()=>ge(this,Qs,"m",qu).call(this)),"f"),ge(this,tl,"f").wrap(a)}})}),ge(this,Dt,"f").file.catchupAndSubscribe(n=>{Ai(this,Uo,n.targetVertex.map(i=>ge(this,el,"f").boxAdapters.adapterFor(i.box,In)),"f"),ge(this,Gu,"f").ifSome(i=>i.terminate()),Ai(this,Gu,ge(this,Uo,"f").map(i=>i.getOrCreateLoader().subscribe(()=>ge(this,Qs,"m",qu).call(this))),"f")}),ge(this,Dt,"f").subscribe(Te.Children,n=>ge(this,Qs,"m",qu).call(this))),Ai(this,Tp,!1,"f")}catchupAndSubscribeSelected(e){return ge(this,rl,"f").catchupAndSubscribe(e)}subscribeChange(e){return ge(this,Dp,"f").subscribe(e)}accept(e){return P(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());wu.create(ge(this,el,"f").boxGraph,M.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(ge(this,Dt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(ge(this,Dt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(ge(this,Dt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){ge(this,rl,"f").setValue(!0)}onDeselected(){ge(this,rl,"f").setValue(!1)}get isSelected(){return ge(this,rl,"f").getValue()}get box(){return ge(this,Dt,"f")}get uuid(){return ge(this,Dt,"f").address.uuid}get address(){return ge(this,Dt,"f").address}get indexField(){return ge(this,Dt,"f").index}get duration(){return ge(this,Bp,"f").toPPQN(0)}set duration(e){ge(this,Bp,"f").fromPPQN(e,0)}get mute(){return ge(this,Dt,"f").mute.getValue()}get hue(){return ge(this,Dt,"f").hue.getValue()}get gain(){return ge(this,Dt,"f").gain}get file(){return ge(this,Uo,"f").unwrap("Cannot access file.")}get optFile(){return ge(this,Uo,"f")}get observableOptPlayMode(){return ge(this,tl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return ja(ge(this,Dt,"f").timeBase.getValue(),Lr)}get waveformOffset(){return ge(this,Dt,"f").waveformOffset}get isPlayModeNoStretch(){return ge(this,Dt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>mt(e,ga)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>mt(e,va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>mt(e,xa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ha.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ge(this,Uo,"f").isEmpty())return"No Audio File";let e=ge(this,Uo,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ge(this,Dt,"f").label.getValue()}get trackBoxAdapter(){return ge(this,Tp,"f")?b.None:ge(this,Dt,"f").clips.targetVertex.map(e=>ge(this,el,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return ge(this,tl,"f").nonEmpty()}terminate(){ge(this,Gu,"f").ifSome(e=>e.terminate()),Ai(this,Gu,b.None,"f"),ge(this,Hu,"f").terminate(),Ai(this,Hu,pe.Empty,"f"),ge(this,Zu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${M.toString(ge(this,Dt,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Zu=new WeakMap,el=new WeakMap,Dt=new WeakMap,tl=new WeakMap,rl=new WeakMap,Bp=new WeakMap,Dp=new WeakMap,Tp=new WeakMap,Uo=new WeakMap,Gu=new WeakMap,Hu=new WeakMap,Qs=new WeakSet,qu=function(){ge(this,Dp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Rp=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},Lt=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)},Xu,dr,tv,Cp,il=class t{constructor(e,r){this.type="note-event",Xu.set(this,void 0),dr.set(this,void 0),tv.set(this,void 0),Cp.set(this,!1),Rp(this,Xu,e,"f"),Rp(this,dr,r,"f"),Rp(this,tv,Lt(this,dr,"f").subscribe(Te.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=ce.equals(Lt(this,dr,"f").pitch.address.fieldKeys,a),s=ce.equals(Lt(this,dr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Rp(this,Cp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Rp(this,Cp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Lt(this,tv,"f").terminate()}get box(){return Lt(this,dr,"f")}get uuid(){return Lt(this,dr,"f").address.uuid}get address(){return Lt(this,dr,"f").address}get position(){return Lt(this,dr,"f").position.getValue()}get duration(){return Lt(this,dr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Lt(this,dr,"f").velocity.getValue()}get pitch(){return Lt(this,dr,"f").pitch.getValue()}get cent(){return Lt(this,dr,"f").cent.getValue()}get chance(){return Lt(this,dr,"f").chance.getValue()}get playCount(){return Lt(this,dr,"f").playCount.getValue()}get playCurve(){return Lt(this,dr,"f").playCurve.getValue()}get isSelected(){return Lt(this,Cp,"f")}get collection(){return Lt(this,dr,"f").events.targetVertex.map(e=>Lt(this,Xu,"f").boxAdapters.adapterFor(e.box,Ji))}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 Lt(this,Xu,"f").boxAdapters.adapterFor(ko.create(Lt(this,Xu,"f").boxGraph,M.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 mu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=ce.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 Lt(this,dr,"f").delete(),n}};Xu=new WeakMap,dr=new WeakMap,tv=new WeakMap,Cp=new WeakMap;var ya=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)},to,zp,Vo,Tn,nl,Op,si,iv,nv,av,jo,rv,Up,Ji=class t{constructor(e,r){to.add(this),zp.set(this,new X),Vo.set(this,void 0),Tn.set(this,void 0),nl.set(this,void 0),Op.set(this,void 0),si.set(this,void 0),iv.set(this,60),nv.set(this,60),av.set(this,0),jo.set(this,!1),ya(this,Vo,e,"f"),ya(this,Tn,r,"f"),ya(this,nl,new fe,"f"),ya(this,Op,M.newSet(n=>n.uuid),"f"),ya(this,si,Ir.create(mu.Comparator),"f"),Fe(this,zp,"f").own(Fe(this,Tn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Fe(this,Vo,"f").boxAdapters.adapterFor(n,il);Fe(this,Op,"f").add(i)&&(Fe(this,si,"f").add(i),Fe(this,to,"m",rv).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Fe(this,si,"f").remove(Fe(this,Op,"f").removeByKey(n)),Fe(this,to,"m",rv).call(this)}})),Fe(this,zp,"f").own(Fe(this,Tn,"f").owners.pointerHub.subscribe({onAdded:()=>Fe(this,nl,"f").notify(this),onRemoved:()=>Fe(this,nl,"f").notify(this)}))}copy(){let e=Fe(this,Vo,"f").boxGraph,r=Xa.create(e,M.generate());return Fe(this,si,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Fe(this,Vo,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Fe(this,Vo,"f").boxAdapters.adapterFor(ko.create(Fe(this,Vo,"f").boxGraph,M.generate(),u=>{u.position.setValue(e),u.duration.setValue(r),u.velocity.setValue(n),u.pitch.setValue(i),u.chance.setValue(a),u.playCount.setValue(o),u.cent.setValue(s),u.events.refer(Fe(this,Tn,"f").events)}),il)}subscribeChange(e){return Fe(this,nl,"f").subscribe(e)}selectable(){return Fe(this,si,"f").asArray()}selectableAt(e){for(let r of Fe(this,si,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return Xt.one(r);return Xt.empty()}selectablesBetween(e,r){let n=[],i=Fe(this,si,"f").asArray(),a=Fe(this,si,"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 Fe(this,si,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Fe(this,si,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Fe(this,to,"m",rv).call(this)}terminate(){Fe(this,zp,"f").terminate()}get box(){return Fe(this,Tn,"f")}get uuid(){return Fe(this,Tn,"f").address.uuid}get address(){return Fe(this,Tn,"f").address}get numOwners(){return Fe(this,Tn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,si,"f")}get minPitch(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,iv,"f")}get maxPitch(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,nv,"f")}get maxDuration(){return Fe(this,jo,"f")||Fe(this,to,"m",Up).call(this),Fe(this,av,"f")}toString(){return`{NoteEventCollectionBox ${M.toString(Fe(this,Tn,"f").address.uuid)}}`}};zp=new WeakMap,Vo=new WeakMap,Tn=new WeakMap,nl=new WeakMap,Op=new WeakMap,si=new WeakMap,iv=new WeakMap,nv=new WeakMap,av=new WeakMap,jo=new WeakMap,to=new WeakSet,rv=function(){ya(this,jo,!1,"f"),Fe(this,nl,"f").notify(this)},Up=function(){let e=127,r=0,n=0;Fe(this,si,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),ya(this,iv,e,"f"),ya(this,nv,r,"f"),ya(this,av,n,"f"),ya(this,jo,!0,"f")};var al=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},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)},ol,Yu,sl,ir,ll,Kp,Vp,jp,Qu,ec=class{constructor(e,r){ol.add(this),this.type="note-clip",Yu.set(this,new X),sl.set(this,void 0),ir.set(this,void 0),ll.set(this,void 0),Kp.set(this,void 0),Vp.set(this,void 0),jp.set(this,pe.Empty),al(this,sl,e,"f"),al(this,ir,r,"f"),al(this,Vp,!0,"f"),al(this,ll,Ue(this,Yu,"f").own(new Wi(!1)),"f"),al(this,Kp,Ue(this,Yu,"f").own(new fe),"f"),Ue(this,Yu,"f").ownAll(Ue(this,ir,"f").pointerHub.subscribe({onAdded:()=>Ue(this,ol,"m",Qu).call(this),onRemoved:()=>Ue(this,ol,"m",Qu).call(this)}),Ue(this,ir,"f").subscribe(Te.Children,n=>Ue(this,ol,"m",Qu).call(this)),Ue(this,ir,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ue(this,jp,"f").terminate(),al(this,jp,n.match({none:()=>pe.Empty,some:({box:i})=>Ue(this,sl,"f").boxAdapters.adapterFor(i,Ji).subscribeChange(()=>Ue(this,ol,"m",Qu).call(this))}),"f"),Ue(this,ol,"m",Qu).call(this)})),al(this,Vp,!1,"f")}catchupAndSubscribeSelected(e){return Ue(this,ll,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ue(this,Kp,"f").subscribe(e)}accept(e){return P(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ue(this,ir,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ue(this,ir,"f").events.targetVertex.unwrap("events.target");vu.create(Ue(this,sl,"f").boxGraph,M.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(Ue(this,ir,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ue(this,ll,"f").setValue(!0)}onDeselected(){Ue(this,ll,"f").setValue(!1)}get isSelected(){return Ue(this,ll,"f").getValue()}terminate(){Ue(this,jp,"f").terminate(),Ue(this,Yu,"f").terminate()}get box(){return Ue(this,ir,"f")}get uuid(){return Ue(this,ir,"f").address.uuid}get address(){return Ue(this,ir,"f").address}get indexField(){return Ue(this,ir,"f").index}get duration(){return Ue(this,ir,"f").duration.getValue()}get mute(){return Ue(this,ir,"f").mute.getValue()}get hue(){return Ue(this,ir,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ue(this,ir,"f").events.targetVertex.map(e=>Ue(this,sl,"f").boxAdapters.adapterFor(e.box,Ji))}get label(){return Ue(this,ir,"f").label.getValue()}get trackBoxAdapter(){return Ue(this,Vp,"f")?b.None:Ue(this,ir,"f").clips.targetVertex.map(e=>Ue(this,sl,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${M.toString(Ue(this,ir,"f").address.uuid)} d: ${Me.toString(this.duration)}}`}};Yu=new WeakMap,sl=new WeakMap,ir=new WeakMap,ll=new WeakMap,Kp=new WeakMap,Vp=new WeakMap,jp=new WeakMap,ol=new WeakSet,Qu=function(){Ue(this,Kp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var nP={for:(t,e)=>ze(e.accept({visitNoteClipBox:r=>t.adapterFor(r,ec),visitValueClipBox:r=>t.adapterFor(r,Oo),visitAudioClipBox:r=>t.adapterFor(r,Ju)}),"")};var ov=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},Ko=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)},sv,tc,Wp,Lp,lv=class{constructor(e,r){sv.set(this,void 0),tc.set(this,void 0),Wp.set(this,void 0),Lp.set(this,void 0),ov(this,sv,e,"f"),ov(this,tc,new X,"f"),ov(this,Wp,Ko(this,tc,"f").own(new fe),"f"),ov(this,Lp,Ko(this,tc,"f").own(cr.create(e.box.clips,n=>nP.for(r,n),l.ClipCollection)),"f"),Ko(this,Lp,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Ko(this,sv,"f")}get collection(){return Ko(this,Lp,"f")}dispatchChange(){Ko(this,Wp,"f").notify()}subscribeChanges(e){return Ko(this,Wp,"f").subscribe(e)}terminate(){Ko(this,tc,"f").terminate()}};sv=new WeakMap,tc=new WeakMap,Wp=new WeakMap,Lp=new WeakMap;var SB=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)},Gr,uv=class{constructor(e){Gr.set(this,void 0),SB(this,Gr,e,"f")}get inField(){return Xi(this,Gr,"f").in}get outField(){return Xi(this,Gr,"f").out}get inSlopeField(){return Xi(this,Gr,"f").inSlope}get outSlopeField(){return Xi(this,Gr,"f").outSlope}get in(){return Xi(this,Gr,"f").in.getValue()}get out(){return Xi(this,Gr,"f").out.getValue()}get inSlope(){return Xi(this,Gr,"f").inSlope.getValue()}get outSlope(){return Xi(this,Gr,"f").outSlope.getValue()}get hasFading(){return Mh.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(){Xi(this,Gr,"f").in.setValue(0),Xi(this,Gr,"f").out.setValue(0),Xi(this,Gr,"f").inSlope.setValue(.75),Xi(this,Gr,"f").outSlope.setValue(.25)}};Gr=new WeakMap;var gt=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},Y=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)},Fi,Zp,Yi,et,rc,ic,nc,Gp,Dn,Hp,Wo,ac,oc,sc,lc,uc,cc,dc,Qi,pc=class t{constructor(e,r){Fi.add(this),this.type="audio-region",Zp.set(this,void 0),Yi.set(this,void 0),et.set(this,void 0),rc.set(this,void 0),ic.set(this,void 0),nc.set(this,void 0),Gp.set(this,void 0),Dn.set(this,void 0),Hp.set(this,void 0),Wo.set(this,b.None),ac.set(this,pe.Empty),oc.set(this,pe.Empty),sc.set(this,pe.Empty),lc.set(this,pe.Empty),uc.set(this,void 0),cc.set(this,Number.NaN),dc.set(this,Number.NaN),gt(this,Yi,e,"f"),gt(this,et,r,"f"),gt(this,Zp,new X,"f");let{timeBase:n,duration:i,loopDuration:a}=r;gt(this,rc,ks.aware(e.tempoMap,n,i),"f"),gt(this,ic,ks.aware(e.tempoMap,n,a),"f"),gt(this,nc,new _r,"f"),gt(this,Gp,new fe,"f"),gt(this,Dn,new uv(r.fading),"f"),gt(this,uc,!1,"f"),gt(this,Hp,!0,"f"),Y(this,Zp,"f").ownAll(Y(this,et,"f").pointerHub.subscribe({onAdded:()=>Y(this,Fi,"m",Qi).call(this),onRemoved:()=>Y(this,Fi,"m",Qi).call(this)}),Y(this,et,"f").file.catchupAndSubscribe(o=>{gt(this,Wo,o.targetVertex.map(s=>Y(this,Yi,"f").boxAdapters.adapterFor(s.box,In)),"f"),Y(this,ac,"f").terminate(),gt(this,ac,Y(this,Wo,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Y(this,Fi,"m",Qi).call(this)),pe.Empty),"f")}),Y(this,et,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Y(this,oc,"f").terminate(),o.match({none:()=>Y(this,nc,"f").clear(),some:({box:s})=>{let u=Y(this,Yi,"f").boxAdapters.adapterFor(s,ha.isAudioPlayMode);gt(this,oc,u.subscribe(()=>Y(this,Fi,"m",Qi).call(this)),"f"),Y(this,nc,"f").wrap(u)}})}),Y(this,et,"f").timeBase.catchupAndSubscribe(o=>{Y(this,sc,"f").terminate(),ja(o.getValue(),Lr)===Lr.Seconds&&gt(this,sc,e.tempoMap.subscribe(()=>Y(this,Fi,"m",Qi).call(this)),"f")}),Y(this,et,"f").subscribe(Te.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Y(this,et,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Y(this,Fi,"m",Qi).call(this)):Y(this,Fi,"m",Qi).call(this)}}),Y(this,et,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Y(this,lc,"f").terminate(),gt(this,lc,o.match({none:()=>pe.Empty,some:({box:s})=>Y(this,Yi,"f").boxAdapters.adapterFor(s,Fr).subscribeChange(()=>Y(this,Fi,"m",Qi).call(this))}),"f"),Y(this,Fi,"m",Qi).call(this)})),gt(this,Hp,!1,"f")}subscribeChange(e){return Y(this,Gp,"f").subscribe(e)}accept(e){return P(e.visitAudioRegionBoxAdapter,this)}onSelected(){gt(this,uc,!0,"f"),Y(this,Fi,"m",Qi).call(this)}onDeselected(){gt(this,uc,!1,"f"),Y(this,Fi,"m",Qi).call(this)}get isSelected(){return Y(this,uc,"f")}get box(){return Y(this,et,"f")}get uuid(){return Y(this,et,"f").address.uuid}get address(){return Y(this,et,"f").address}get position(){return Y(this,et,"f").position.getValue()}get duration(){return Number.isNaN(Y(this,cc,"f"))&&gt(this,cc,Y(this,rc,"f").toPPQN(this.position),"f"),Y(this,cc,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Y(this,et,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Y(this,dc,"f"))&&gt(this,dc,Y(this,ic,"f").toPPQN(this.position),"f"),Y(this,dc,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Y(this,rc,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Y(this,ic,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Y(this,et,"f").mute.getValue()}get hue(){return Y(this,et,"f").hue.getValue()}get gain(){return Y(this,et,"f").gain}get fading(){return Y(this,Dn,"f")}get file(){return Y(this,Wo,"f").unwrap("Cannot access file.")}get optFile(){return Y(this,Wo,"f")}get observableOptPlayMode(){return Y(this,nc,"f")}get timeBase(){return ja(Y(this,et,"f").timeBase.getValue(),Lr)}get waveformOffset(){return Y(this,et,"f").waveformOffset}get isPlayModeNoStretch(){return Y(this,et,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>mt(e,ga)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>mt(e,va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>mt(e,xa)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>ha.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Y(this,Wo,"f").isEmpty())return"No Audio File";let e=Y(this,Wo,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Y(this,et,"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 Y(this,et,"f").regions.targetVertex.map(e=>Y(this,Yi,"f").boxAdapters.adapterFor(e.box,tr))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Y(this,et,"f").events.targetVertex.map(e=>Y(this,Yi,"f").boxAdapters.adapterFor(e.box,Fr))}set position(e){Y(this,et,"f").position.setValue(e)}set duration(e){Y(this,rc,"f").fromPPQN(e,this.position);let r=Y(this,Dn,"f").in+Y(this,Dn,"f").out;if(r>e){let n=e/r;Y(this,Dn,"f").inField.setValue(Y(this,Dn,"f").in*n),Y(this,Dn,"f").outField.setValue(Y(this,Dn,"f").out*n)}}set loopOffset(e){Y(this,et,"f").loopOffset.setValue($s(e,this.loopDuration))}set loopDuration(e){Y(this,ic,"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===Lr.Seconds){let i=e>=0?Y(this,Yi,"f").tempoMap.intervalToSeconds(r,n):-Y(this,Yi,"f").tempoMap.intervalToSeconds(n,r);Y(this,et,"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=Y(this,Yi,"f").boxAdapters.adapterFor(No.create(Y(this,Yi,"f").boxGraph,M.generate(),o=>{o.timeBase.setValue(Y(this,et,"f").timeBase.getValue()),o.position.setValue(e?.position??Y(this,et,"f").position.getValue()),o.regions.refer(e?.target??Y(this,et,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Y(this,et,"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)),Y(this,Dn,"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&&ce.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(){Y(this,ac,"f").terminate(),gt(this,ac,pe.Empty,"f"),Y(this,sc,"f").terminate(),gt(this,sc,pe.Empty,"f"),Y(this,oc,"f").terminate(),gt(this,oc,pe.Empty,"f"),Y(this,lc,"f").terminate(),gt(this,lc,pe.Empty,"f"),Y(this,Zp,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${M.toString(Y(this,et,"f").address.uuid)}}`}};Zp=new WeakMap,Yi=new WeakMap,et=new WeakMap,rc=new WeakMap,ic=new WeakMap,nc=new WeakMap,Gp=new WeakMap,Dn=new WeakMap,Hp=new WeakMap,Wo=new WeakMap,ac=new WeakMap,oc=new WeakMap,sc=new WeakMap,lc=new WeakMap,uc=new WeakMap,cc=new WeakMap,dc=new WeakMap,Fi=new WeakSet,Qi=function(){gt(this,cc,Number.NaN,"f"),gt(this,dc,Number.NaN,"f"),!Y(this,Hp,"f")&&(Y(this,Gp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var ro=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)},wa,cv,ba,vt,Xp,qp,fc,Jp,io,mc=class t{constructor(e,r){wa.add(this),this.type="note-region",cv.set(this,new X),ba.set(this,void 0),vt.set(this,void 0),Xp.set(this,void 0),qp.set(this,void 0),fc.set(this,void 0),Jp.set(this,pe.Empty),ro(this,ba,e,"f"),ro(this,vt,r,"f"),ro(this,Xp,new fe,"f"),ro(this,fc,!1,"f"),ro(this,qp,!0,"f"),Ee(this,cv,"f").ownAll(Ee(this,vt,"f").pointerHub.subscribe({onAdded:()=>Ee(this,wa,"m",io).call(this),onRemoved:()=>Ee(this,wa,"m",io).call(this)}),Ee(this,vt,"f").subscribe(Te.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ee(this,vt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ee(this,wa,"m",io).call(this)):Ee(this,wa,"m",io).call(this)}}),Ee(this,vt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ee(this,Jp,"f").terminate(),ro(this,Jp,n.match({none:()=>pe.Empty,some:({box:i})=>Ee(this,ba,"f").boxAdapters.adapterFor(i,Ji).subscribeChange(()=>Ee(this,wa,"m",io).call(this))}),"f"),Ee(this,wa,"m",io).call(this)})),ro(this,qp,!1,"f")}set position(e){Ee(this,vt,"f").position.setValue(e)}set duration(e){Ee(this,vt,"f").duration.setValue(e)}set loopOffset(e){Ee(this,vt,"f").loopOffset.setValue(e)}set loopDuration(e){Ee(this,vt,"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 Ee(this,Xp,"f").subscribe(e)}accept(e){return P(e.visitNoteRegionBoxAdapter,this)}onSelected(){ro(this,fc,!0,"f"),Ee(this,wa,"m",io).call(this)}onDeselected(){ro(this,fc,!1,"f"),Ee(this,wa,"m",io).call(this)}get isSelected(){return Ee(this,fc,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=La.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(){Ee(this,Jp,"f").terminate(),Ee(this,cv,"f").terminate()}get box(){return Ee(this,vt,"f")}get uuid(){return Ee(this,vt,"f").address.uuid}get address(){return Ee(this,vt,"f").address}get position(){return Ee(this,vt,"f").position.getValue()}get duration(){return Ee(this,vt,"f").duration.getValue()}get loopOffset(){return Ee(this,vt,"f").loopOffset.getValue()}get loopDuration(){return Ee(this,vt,"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 Ee(this,vt,"f").mute.getValue()}get hue(){return Ee(this,vt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Ee(this,vt,"f").events.targetVertex.map(e=>Ee(this,ba,"f").boxAdapters.adapterFor(e.box,Ji))}get label(){return Ee(this,vt,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,qp,"f")?b.None:Ee(this,vt,"f").regions.targetVertex.map(e=>Ee(this,ba,"f").boxAdapters.adapterFor(e.box,tr))}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 Ee(this,ba,"f").boxAdapters.adapterFor(Os.create(Ee(this,ba,"f").boxGraph,M.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??Ee(this,vt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Ee(this,ba,"f").boxGraph,n=Xa.create(r,M.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Ee(this,vt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ce.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=Ee(this,ba,"f").boxGraph,n=e.toSorted(_o.Comparator),i=ce.getFirst(n,"Internal error (no first)"),a=ce.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Xa.create(r,M.generate()),m=Array.from(u.regions.collection.iterateRange(o,s));return m.filter(x=>x.isSelected).forEach(x=>{let g=x;for(let{resultStart:w,resultEnd:A,rawStart:_}of La.locateLoops(g,g.position,g.complete)){let C=Math.floor(w-_),W=Math.floor(A-_);for(let U of g.optCollection.unwrap("optCollection").events.iterateRange(C,W))U.copyTo({position:U.position+_-i.position,events:d.events})}}),m.forEach(({box:x})=>x.delete()),b.wrap(Os.create(r,M.generate(),x=>{x.position.setValue(o),x.duration.setValue(s-o),x.loopDuration.setValue(s-o),x.loopOffset.setValue(0),x.hue.setValue(this.hue),x.mute.setValue(this.mute),x.label.setValue(this.label),x.events.refer(d.owners),x.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${M.toString(Ee(this,vt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};cv=new WeakMap,ba=new WeakMap,vt=new WeakMap,Xp=new WeakMap,qp=new WeakMap,fc=new WeakMap,Jp=new WeakMap,wa=new WeakSet,io=function(){Ee(this,Xp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var no=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},Ae=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)},Rn,hc,_a,xt,ef,gc,Yp,Qp,Aa,ao=class t{constructor(e,r){Rn.add(this),this.type="value-region",hc.set(this,new X),_a.set(this,void 0),xt.set(this,void 0),ef.set(this,void 0),gc.set(this,void 0),Yp.set(this,void 0),Qp.set(this,pe.Empty),no(this,_a,e,"f"),no(this,xt,r,"f"),no(this,Yp,!0,"f"),no(this,ef,new fe,"f"),no(this,gc,!1,"f"),Ae(this,hc,"f").own(Ae(this,xt,"f").pointerHub.subscribe({onAdded:()=>Ae(this,Rn,"m",Aa).call(this),onRemoved:()=>Ae(this,Rn,"m",Aa).call(this)})),Ae(this,hc,"f").own(Ae(this,xt,"f").subscribe(Te.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ae(this,xt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ae(this,Rn,"m",Aa).call(this)):Ae(this,Rn,"m",Aa).call(this)}})),Ae(this,hc,"f").own(Ae(this,xt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ae(this,Qp,"f").terminate(),no(this,Qp,n.match({none:()=>pe.Empty,some:({box:i})=>Ae(this,_a,"f").boxAdapters.adapterFor(i,Fr).subscribeChange(()=>Ae(this,Rn,"m",Aa).call(this))}),"f"),Ae(this,Rn,"m",Aa).call(this)})),no(this,Yp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(La.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return K(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(La.globalToLocal(this,this.complete),e)}subscribeChange(e){return Ae(this,ef,"f").subscribe(e)}accept(e){return P(e.visitValueRegionBoxAdapter,this)}onSelected(){no(this,gc,!0,"f"),Ae(this,Rn,"m",Aa).call(this)}onDeselected(){no(this,gc,!1,"f"),Ae(this,Rn,"m",Aa).call(this)}get isSelected(){return Ae(this,gc,"f")}onValuesPropertyChanged(){Ae(this,Rn,"m",Aa).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Ae(this,Qp,"f").terminate(),Ae(this,hc,"f").terminate()}get box(){return Ae(this,xt,"f")}get uuid(){return Ae(this,xt,"f").address.uuid}get address(){return Ae(this,xt,"f").address}get position(){return Ae(this,xt,"f").position.getValue()}get duration(){return Ae(this,xt,"f").duration.getValue()}get loopOffset(){return Ae(this,xt,"f").loopOffset.getValue()}get loopDuration(){return Ae(this,xt,"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 Ae(this,xt,"f").mute.getValue()}get hue(){return Ae(this,xt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ae(this,xt,"f").events.targetVertex.map(e=>Ae(this,_a,"f").boxAdapters.adapterFor(e.box,Fr))}get label(){return Ae(this,xt,"f").label.getValue()}get trackBoxAdapter(){return Ae(this,Yp,"f")?b.None:Ae(this,xt,"f").regions.targetVertex.map(e=>Ae(this,_a,"f").boxAdapters.adapterFor(e.box,tr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Ae(this,xt,"f").position.setValue(e)}set duration(e){Ae(this,xt,"f").duration.setValue(e)}set loopOffset(e){Ae(this,xt,"f").loopOffset.setValue(e)}set loopDuration(e){Ae(this,xt,"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 Ae(this,_a,"f").boxAdapters.adapterFor(Us.create(Ae(this,_a,"f").boxGraph,M.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??Ae(this,xt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Ae(this,_a,"f").boxGraph,n=Mn.create(r,M.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Ae(this,xt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ce.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=Ae(this,_a,"f").boxGraph,n=e.toSorted(_o.Comparator),i=ce.getFirst(n,"Internal error (no first)"),a=ce.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,u=i.trackBoxAdapter.unwrap("trackBoxAdapter"),d=Array.from(u.regions.collection.iterateRange(o,s)),m=[];d.filter(A=>A.isSelected).forEach(A=>{let _=A,C=_.optCollection.unwrap("optCollection"),W=C.events;for(let{rawStart:U,regionStart:ee,regionEnd:re}of La.locateLoops(_,_.position,_.complete)){let me=ee-U,$e=re-U,Q=W.greaterEqual(me);if(!K(Q)||Q.position!==me){let Ge=W.lowerEqual(me);K(Ge)&&m.push({position:ee-o,value:C.valueAt(me,0),interpolation:Ge.interpolation})}let we=!1;for(let Ge of W.iterateRange(me,br.MAX_VALUE)){let It=Ge.position+U;if(It<re)m.push({position:It-o,value:Ge.value,interpolation:Ge.interpolation});else if(It===re){m.push({position:It-o,value:Ge.value,interpolation:ni.None}),we=!0;break}else{m.push({position:re-o,value:C.valueAt($e,0),interpolation:ni.None}),we=!0;break}}we||m.push({position:re-o,value:C.valueAt($e,0),interpolation:ni.None})}});let x=[];for(let A of m){let _=x.length>0?x[x.length-1]:void 0;K(_)&&_.position===A.position&&_.value===A.value?x[x.length-1]=A:x.push(A)}let g=Mn.create(r,M.generate()),w=0;for(;w<x.length;){let A=w+1;for(;A<x.length&&x[A].position===x[w].position;)A++;let _=x[w],C=x[A-1],W=kn.create(r,M.generate(),U=>{U.position.setValue(_.position),U.index.setValue(0),U.value.setValue(_.value),U.events.refer(g.events)});if(oi.write(W.interpolation,A-w>1?ni.None:_.interpolation),A-w>1){let U=kn.create(r,M.generate(),ee=>{ee.position.setValue(C.position),ee.index.setValue(1),ee.value.setValue(C.value),ee.events.refer(g.events)});oi.write(U.interpolation,C.interpolation)}w=A}return d.forEach(({box:A})=>A.delete()),b.wrap(Us.create(r,M.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(g.owners),A.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${M.toString(Ae(this,xt,"f").address.uuid)} p: ${Me.toString(this.position)}, c: ${Me.toString(this.complete)}}`}};hc=new WeakMap,_a=new WeakMap,xt=new WeakMap,ef=new WeakMap,gc=new WeakMap,Yp=new WeakMap,Qp=new WeakMap,Rn=new WeakSet,Aa=function(){Ae(this,ef,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var aP=(t,e)=>t.position-e.position,oP={for:(t,e)=>ze(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,mc),visitAudioRegionBox:r=>t.adapterFor(r,pc),visitValueRegionBox:r=>t.adapterFor(r,ao)}),"")};var vc=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)},xc,ul,tf,yc,Lo,wc,dv=class{constructor(e,r){xc.set(this,void 0),ul.set(this,void 0),tf.set(this,void 0),yc.set(this,void 0),Lo.set(this,void 0),wc.set(this,void 0),vc(this,xc,e,"f"),vc(this,ul,new X,"f"),vc(this,tf,nr(this,ul,"f").own(new fe),"f"),vc(this,yc,nr(this,ul,"f").own(new Qt),"f"),vc(this,Lo,_o.create(aP),"f"),vc(this,wc,M.newSet(n=>n.uuid),"f"),nr(this,ul,"f").ownAll(nr(this,xc,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=oP.for(r,n),a=nr(this,wc,"f").add(i);te(a,`Cannot add ${n}`),nr(this,Lo,"f").add(i);for(let o of nr(this,Lo,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:nr(this,xc,"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}nr(this,yc,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=nr(this,wc,"f").removeByKey(n);nr(this,Lo,"f").remove(i),nr(this,yc,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return nr(this,xc,"f")}get collection(){return nr(this,Lo,"f")}get adapters(){return nr(this,wc,"f")}onIndexingChanged(){nr(this,Lo,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),nr(this,yc,"f").subscribe(e)}subscribeChanges(e){return nr(this,tf,"f").subscribe(e)}dispatchChange(){nr(this,tf,"f").notify()}terminate(){nr(this,ul,"f").terminate()}};xc=new WeakMap,ul=new WeakMap,tf=new WeakMap,yc=new WeakMap,Lo=new WeakMap,wc=new WeakMap;var ve;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ve||(ve={}));(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 Le.Waveform;case t.Notes:return Le.Piano;case t.Value:return Le.Automation;case t.Undefined:return Le.AudioBus;default:return Le.Unknown}}})(ve||(ve={}));var pv;(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=>K(e)&&"host"in e&&mt(e.host,N)?e.host:V(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&mt(e.label,B)?e.label:V(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&mt(e.enabled,R)?e.enabled:V(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&mt(e.minimized,R)?e.minimized:V(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&mt(e.index,k)?e.index:V(`Could not find 'index' field in '${e?.name}'`)})(pv||(pv={}));var sP;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ve.Notes;case"audio":return ve.Audio;default:return V()}}})(sP||(sP={}));var ae;(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;te(ce.satisfy(e,(i,a)=>i.deviceHost().address.equals(a.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];(r.accepts==="audio"?r.deviceHost().audioEffects.field().pointerHub.filter(l.AudioEffectHost):r.accepts==="midi"?r.deviceHost().midiEffects.field().pointerHub.filter(l.MIDIEffectHost):V("unknown type")).map(({box:i})=>pv.lookupIndexField(i)).filter(i=>e.some(a=>M.Comparator(a.uuid,i.address.uuid)!==0)).sort((i,a)=>i.getValue()-a.getValue()).forEach((i,a)=>i.setValue(a)),e.forEach(i=>i.box.delete())}})(ae||(ae={}));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},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)},bc,mv,Cn,cl,hv,gv=class{constructor(e,r){bc.set(this,void 0),mv.set(this,new fe),Cn.set(this,void 0),cl.set(this,void 0),hv.set(this,void 0),fv(this,bc,e,"f"),fv(this,Cn,cr.create(e.box.tracks,n=>r.adapterFor(n,tr),l.TrackCollection),"f"),fv(this,cl,M.newSet(({uuid:n})=>n),"f"),fv(this,hv,xr(this,Cn,"f").catchupAndSubscribe({onAdd:n=>xr(this,cl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>xr(this,mv,"f").notify())}),onRemove:({uuid:n})=>xr(this,cl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=xr(this,bc,"f").box.graph,a=xr(this,bc,"f").box.tracks;Br.create(i,M.generate(),o=>{o.index.setValue(n??xr(this,Cn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(xr(this,Cn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=xr(this,Cn,"f").adapters(),n=r.indexOf(e);if(n===-1)return V(`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 xr(this,bc,"f").box}get collection(){return xr(this,Cn,"f")}values(){return xr(this,Cn,"f").adapters()}catchupAndSubscribe(e){return xr(this,Cn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return xr(this,mv,"f").subscribe(e)}terminate(){xr(this,Cn,"f").terminate(),xr(this,hv,"f").terminate(),xr(this,cl,"f").forEach(({subscription:e})=>e.terminate()),xr(this,cl,"f").clear()}};bc=new WeakMap,mv=new WeakMap,Cn=new WeakMap,cl=new WeakMap,hv=new WeakMap;var oe;(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.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.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.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont"})(oe||(oe={}));var lP=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},zn=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)},vv,Si,Ei=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=oe.AudioBus,vv.set(this,void 0),Si.set(this,void 0),lP(this,vv,e,"f"),lP(this,Si,r,"f")}catchupAndSubscribe(e){return e(this),zn(this,Si,"f").subscribe(Te.Children,()=>e(this))}get uuid(){return zn(this,Si,"f").address.uuid}get address(){return zn(this,Si,"f").address}get box(){return zn(this,Si,"f")}get enabledField(){return zn(this,Si,"f").enabled}get minimizedField(){return zn(this,Si,"f").minimized}get iconField(){return zn(this,Si,"f").icon}get labelField(){return zn(this,Si,"f").label}get colorField(){return zn(this,Si,"f").color}get iconSymbol(){return Le.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return zn(this,vv,"f").boxAdapters.adapterFor(zn(this,Si,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};vv=new WeakMap,Si=new WeakMap;var rf=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)},oo,_c,Ac,Pi,nf,xv=class{constructor(e,r){oo.set(this,void 0),_c.set(this,void 0),Ac.set(this,void 0),Pi.set(this,void 0),nf.set(this,pe.Empty),rf(this,oo,new X,"f"),rf(this,_c,kt(this,oo,"f").own(new fe),"f"),rf(this,Ac,kt(this,oo,"f").own(new Wi(Le.Unknown)),"f"),rf(this,Pi,kt(this,oo,"f").own(new _r),"f"),kt(this,oo,"f").own(kt(this,Pi,"f").subscribe(n=>{kt(this,nf,"f").terminate(),rf(this,nf,n.match({none:()=>(kt(this,_c,"f").notify(b.None),pe.Empty),some:({labelField:i,iconField:a})=>pe.many(a.catchupAndSubscribe(o=>kt(this,Ac,"f").setValue(Le.fromName(o.getValue()))),i.catchupAndSubscribe(o=>kt(this,_c,"f").notify(b.wrap(o.getValue()))))}),"f")})),kt(this,oo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(kt(this,Pi,"f").nonEmpty()){let o=kt(this,Pi,"f").unwrap();V(`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 Nn?r.adapterFor(n,Ei):r.adapterFor(n,ae.isInstrument);kt(this,Pi,"f").unwrapOrNull()!==a&&kt(this,Pi,"f").wrap(a)},onRemoved:({box:n})=>{te(kt(this,Pi,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),kt(this,Pi,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return kt(this,Pi,"f")}subscribe(e){return kt(this,Pi,"f").subscribe(e)}catchupAndSubscribe(e){return e(kt(this,Pi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),kt(this,_c,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return kt(this,Ac,"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(Le.toName(e)))}get icon(){return this.adapter().match({none:()=>Le.Unknown,some:e=>Le.fromName(e.iconField.getValue())})}get iconValue(){return kt(this,Ac,"f")}terminate(){kt(this,oo,"f").terminate(),kt(this,nf,"f").terminate()}};oo=new WeakMap,_c=new WeakMap,Ac=new WeakMap,Pi=new WeakMap,nf=new WeakMap;var uP=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},dl=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)},yv,so,de=class{constructor(e){yv.set(this,void 0),so.set(this,void 0),uP(this,yv,e,"f"),uP(this,so,Oe.newSet(r=>r.address),"f")}terminate(){dl(this,so,"f").forEach(e=>e.terminate()),dl(this,so,"f").clear()}parameters(){return dl(this,so,"f").values()}parameterAt(e){return dl(this,so,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new pl(dl(this,yv,"f"),e,r,n,i,a,o),u=dl(this,so,"f").add(s);return te(u,`Could not add adapter for ${e}`),s}removeParameter(e){return dl(this,so,"f").removeByKey(e)}};yv=new WeakMap,so=new WeakMap;var fl=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)},ml,en,Zo,Fc,wv,bv,af,Sc=class{constructor(e,r){ml.set(this,void 0),en.set(this,void 0),Zo.set(this,void 0),Fc.set(this,void 0),wv.set(this,void 0),bv.set(this,void 0),af.set(this,pe.Empty),fl(this,ml,e,"f"),fl(this,en,r,"f"),fl(this,Zo,new X,"f"),fl(this,Fc,St(this,Zo,"f").own(new fe),"f"),St(this,Zo,"f").own(r.targetBus.catchupAndSubscribe(()=>{St(this,af,"f").terminate(),fl(this,af,this.optTargetBus.match({none:()=>(St(this,Fc,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>St(this,Fc,"f").notify(b.wrap(i)))}),"f")})),fl(this,wv,St(this,Zo,"f").own(new pl(St(this,ml,"f"),St(this,en,"f").sendPan,E.bipolar(),$.percent({unit:"%",fractionDigits:0}),"panning")),"f"),fl(this,bv,St(this,Zo,"f").own(new pl(St(this,ml,"f"),St(this,en,"f").sendGain,E.DefaultDecibel,$.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),St(this,Fc,"f").subscribe(e)}get uuid(){return St(this,en,"f").address.uuid}get address(){return St(this,en,"f").address}get box(){return St(this,en,"f")}get indexField(){return St(this,en,"f").index}get sendPan(){return St(this,wv,"f")}get sendGain(){return St(this,bv,"f")}get targetBus(){return St(this,ml,"f").boxAdapters.adapterFor(St(this,en,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Ei)}get optTargetBus(){return St(this,en,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>St(this,ml,"f").boxAdapters.adapterFor(r,Ei)})))}delete(){St(this,en,"f").delete()}terminate(){St(this,Zo,"f").terminate(),St(this,af,"f").terminate()}};ml=new WeakMap,en=new WeakMap,Zo=new WeakMap,Fc=new WeakMap,wv=new WeakMap,bv=new WeakMap,af=new WeakMap;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},Fa=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)},_v,Av,Ec,Pc,sf,Fv=class{constructor(e,r){_v.set(this,void 0),Av.set(this,void 0),Ec.set(this,void 0),Pc.set(this,void 0),sf.set(this,pe.Empty),of(this,_v,e,"f"),of(this,Av,r,"f"),of(this,Ec,new X,"f"),of(this,Pc,Fa(this,Ec,"f").own(new fe),"f"),Fa(this,Ec,"f").own(e.catchupAndSubscribe(()=>{Fa(this,sf,"f").terminate(),of(this,sf,this.adapter.match({none:()=>(Fa(this,Pc,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Fa(this,Pc,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return Fa(this,Pc,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Fa(this,_v,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Fa(this,Av,"f").adapterFor(r,Ei)})))}terminate(){Fa(this,Ec,"f").terminate(),Fa(this,sf,"f").terminate()}};_v=new WeakMap,Av=new WeakMap,Ec=new WeakMap,Pc=new WeakMap,sf=new WeakMap;var lo=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},xe=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)},Sv,cP,Sa,$i,Ot,gl,$c,hl,Ev,lf,Pv,$v,dP,pP,tn=class{constructor(e,r){Sv.add(this),this.class="device-host",Sa.set(this,new X),$i.set(this,void 0),Ot.set(this,void 0),gl.set(this,void 0),$c.set(this,void 0),hl.set(this,void 0),Ev.set(this,void 0),lf.set(this,void 0),Pv.set(this,void 0),$v.set(this,void 0),lo(this,$i,e,"f"),lo(this,Ot,r,"f"),lo(this,gl,xe(this,Sa,"f").own(new de(xe(this,$i,"f"))),"f"),lo(this,$c,xe(this,Sa,"f").own(new gv(this,xe(this,$i,"f").boxAdapters)),"f"),lo(this,hl,xe(this,Sa,"f").own(new xv(xe(this,Ot,"f").input.pointerHub,xe(this,$i,"f").boxAdapters)),"f"),lo(this,Ev,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").midiEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,ae.isMidiEffect),l.MIDIEffectHost)),"f"),lo(this,lf,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").audioEffects,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,ae.isAudioEffect),l.AudioEffectHost)),"f"),lo(this,Pv,xe(this,Sa,"f").own(cr.create(xe(this,Ot,"f").auxSends,n=>xe(this,$i,"f").boxAdapters.adapterFor(n,Sc),l.AuxSend)),"f"),lo(this,$v,xe(this,Sa,"f").own(new Fv(xe(this,Ot,"f").output,xe(this,$i,"f").boxAdapters)),"f"),this.namedParameter=xe(this,Sv,"m",dP).call(this,r),xe(this,Sv,"m",pP).call(this)}get box(){return xe(this,Ot,"f")}get uuid(){return xe(this,Ot,"f").address.uuid}get address(){return xe(this,Ot,"f").address}get indexField(){return xe(this,Ot,"f").index}get type(){return xe(this,Ot,"f").type.getValue()}get captureBox(){return xe(this,Ot,"f").capture.targetVertex}get tracks(){return xe(this,$c,"f")}get input(){return xe(this,hl,"f")}get midiEffects(){return xe(this,Ev,"f")}get audioEffects(){return xe(this,lf,"f")}get inputAdapter(){return xe(this,hl,"f").adapter()}get auxSends(){return xe(this,Pv,"f")}get output(){return xe(this,$v,"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 xe(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(xe(this,$i,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return xe(this,Ot,"f").midiEffects}get inputField(){return xe(this,Ot,"f").input}get audioEffectsField(){return xe(this,Ot,"f").audioEffects}get tracksField(){return xe(this,Ot,"f").tracks}get minimizedField(){return xe(this,hl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get label(){return xe(this,hl,"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 xe(this,lf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=xe(this,$i,"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){xe(this,$i,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){xe(this,$c,"f").collection.move(e,r)}deleteTrack(e){xe(this,$c,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){xe(this,Sa,"f").terminate()}};cP=tn,Sa=new WeakMap,$i=new WeakMap,Ot=new WeakMap,gl=new WeakMap,$c=new WeakMap,hl=new WeakMap,Ev=new WeakMap,lf=new WeakMap,Pv=new WeakMap,$v=new WeakMap,Sv=new WeakSet,dP=function(e){return{volume:xe(this,gl,"f").createParameter(e.volume,cP.VolumeMapper,$.decible,"volume"),panning:xe(this,gl,"f").createParameter(e.panning,E.bipolar(),$.panning,"panning",.5),mute:xe(this,gl,"f").createParameter(e.mute,E.bool,$.bool,"mute"),solo:xe(this,gl,"f").createParameter(e.solo,E.bool,$.bool,"solo")}},pP=function(){let e=this.address.toString(),r=xe(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${xe(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;te(this.type!==Ft.Instrument||xe(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};tn.VolumeMapper=E.decibel(-96,-9,6);var kc=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},Ze=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)},xl,qr,Hr,vl,kv,Mv,uf,fP,mP,Nv,tr=class{constructor(e,r){xl.add(this),qr.set(this,void 0),Hr.set(this,void 0),vl.set(this,void 0),kv.set(this,void 0),Mv.set(this,void 0),uf.set(this,void 0),kc(this,qr,e,"f"),kc(this,Hr,r,"f"),kc(this,vl,new X,"f"),kc(this,uf,Ze(this,vl,"f").own(new Wi(-1)),"f"),kc(this,kv,Ze(this,vl,"f").own(new lv(this,e.boxAdapters)),"f"),kc(this,Mv,Ze(this,vl,"f").own(new dv(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(Ze(this,xl,"m",fP).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Ze(this,xl,"m",mP).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Ze(this,qr,"f")}set targetName(e){Ze(this,Hr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){Ze(this,qr,"f").boxAdapters.adapterFor(n,tn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Ze(this,qr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)}),Ze(this,xl,"m",Nv).call(this,n).flatMap(i=>Ze(this,qr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof B&&i.labelField.setValue(e)})})}get targetName(){return Ze(this,Hr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return Ze(this,qr,"f").boxAdapters.adapterFor(r,tn).input.label;let n=Ze(this,qr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}let i=Ze(this,xl,"m",Nv).call(this,r).flatMap(a=>Ze(this,qr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof B)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){Ze(this,vl,"f").terminate()}get audioUnit(){return Ie(Ze(this,Hr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return Ze(this,Hr,"f").target}get clips(){return Ze(this,kv,"f")}get regions(){return Ze(this,Mv,"f")}get enabled(){return Ze(this,Hr,"f").enabled}get indexField(){return Ze(this,Hr,"f").index}get type(){return Ze(this,Hr,"f").type.getValue()}get box(){return Ze(this,Hr,"f")}get uuid(){return Ze(this,Hr,"f").address.uuid}get address(){return Ze(this,Hr,"f").address}get listIndex(){return Ze(this,uf,"f").getValue()}set listIndex(e){Ze(this,uf,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ve.Audio;case"note-clip":return this.type===ve.Notes;case"value-clip":return this.type===ve.Value;case"audio-region":return this.type===ve.Audio;case"note-region":return this.type===ve.Notes;case"value-region":return this.type===ve.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Ze(this,qr,"f").clipSequencing.iterate(this.uuid,e,e+qE);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,u=>!u.mute);if(s===null){let u=this.regions.collection.optAt(0);return mt(u,ao)?u.incomingValue(r):r}else if(mt(s,ao))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&mt(s,Oo)&&!s.mute?s.valueAt(e,r):r});return n}};qr=new WeakMap,Hr=new WeakMap,vl=new WeakMap,kv=new WeakMap,Mv=new WeakMap,uf=new WeakMap,xl=new WeakSet,fP=function(e){let r=Ze(this,Hr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return Ze(this,qr,"f").boxAdapters.adapterFor(n,tn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Ze(this,qr,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}let a=Ze(this,xl,"m",Nv).call(this,n).flatMap(o=>Ze(this,qr,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof B)return o.labelField.catchupAndSubscribe(s=>e(b.wrap(s.getValue())))}return e(b.wrap(n.name)),pe.Empty}return e(b.None),pe.Empty},mP=function(e){let r=this.type;switch(r){case ve.Audio:case ve.Notes:return e(b.wrap(ve[r])),pe.Empty;case ve.Value:{let n=Ze(this,Hr,"f").target.targetVertex.unwrap("target.target");if(n.isField())e(Ze(this,qr,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(b.wrap(n.name));else return V("Illegal State. Vertex is not a field nor box.");return pe.Empty}case ve.Undefined:return e(b.wrap("")),pe.Empty;default:return e(b.None),pe.Empty}},Nv=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var ar=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)},ki,Mi,Iv,Bv,Tv,yl,Go,Ho,qo,Jo,Xo,wl,Mc,cf,hP=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],pl=class{constructor(e,r,n,i,a,o,s){ki.set(this,void 0),Mi.set(this,void 0),Iv.set(this,void 0),Bv.set(this,void 0),Tv.set(this,void 0),yl.set(this,new X),Go.set(this,void 0),Ho.set(this,void 0),qo.set(this,void 0),Jo.set(this,void 0),Xo.set(this,b.None),wl.set(this,b.None),Mc.set(this,null),cf.set(this,!1),ar(this,ki,e,"f"),ar(this,Mi,r,"f"),ar(this,qo,n,"f"),ar(this,Jo,i,"f"),ar(this,Iv,a,"f"),ar(this,Bv,o??0,"f"),ar(this,Tv,b.wrap(s),"f"),ye(this,yl,"f").own(ye(this,ki,"f").parameterFieldAdapters.register(this)),ar(this,Go,ye(this,yl,"f").own(new fe),"f"),ar(this,Ho,new Qt,"f"),ye(this,yl,"f").own(ye(this,Mi,"f").subscribe(()=>ye(this,Go,"f").notify(this))),ye(this,yl,"f").own(ye(this,Mi,"f").pointerHub.catchupAndSubscribe({onAdded:u=>{ye(this,Ho,"f").proxy.onControlSourceAdd(Gb(u.pointerType)),u.box.accept({visitTrackBox:d=>{te(ye(this,Xo,"f").isEmpty(),"Already assigned");let m=ye(this,ki,"f").boxAdapters.adapterFor(d,tr);ar(this,Xo,b.wrap(m),"f"),ye(this,ki,"f").isMainThread&&ar(this,wl,b.wrap(ye(this,ki,"f").liveStreamReceiver.subscribeFloat(ye(this,Mi,"f").address,x=>{ye(this,Mc,"f")!==x&&(ar(this,Mc,x,"f"),ye(this,Go,"f").notify(this))})),"f")}})},onRemoved:u=>{ye(this,Ho,"f").proxy.onControlSourceRemove(Gb(u.pointerType)),u.box.accept({visitTrackBox:d=>{te(ye(this,Xo,"f").unwrapOrNull()?.address?.equals(d.address)===!0,`Unknown ${d}`),ar(this,Xo,b.None,"f"),ye(this,ki,"f").isMainThread&&(ye(this,wl,"f").ifSome(m=>m.terminate()),ar(this,wl,b.None,"f"),ar(this,Mc,null,"f"),ye(this,Go,"f").notify(this))}})}},...hP)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return ye(this,Ho,"f").proxy.onControlSourceAdd("midi"),ar(this,cf,!0,"f"),{terminate:()=>{ar(this,cf,!1,"f"),ye(this,Ho,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ye(this,Mi,"f")}get valueMapping(){return ye(this,qo,"f")}get stringMapping(){return ye(this,Jo,"f")}get name(){return ye(this,Iv,"f")}get anchor(){return ye(this,Bv,"f")}get type(){return ye(this,Mi,"f").type}get address(){return ye(this,Mi,"f").address}get track(){return ye(this,Xo,"f")}registerTracks(e){return ye(this,ki,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){ye(this,ki,"f").parameterFieldAdapters.touchStart(this.address),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){ye(this,ki,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){ar(this,qo,e,"f"),ar(this,Jo,r,"f"),ye(this,Go,"f").notify(this)}valueAt(e){let r=ye(this,Xo,"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 ye(this,Go,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ye(this,cf,"f")&&e.onControlSourceAdd("midi"),ye(this,Mi,"f").pointerHub.filter(...hP).forEach(r=>e.onControlSourceAdd(Gb(r.pointerType))),ye(this,Ho,"f").subscribe(e)}getValue(){return ye(this,Mi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();ye(this,Mi,"f").setValue(e),ye(this,ki,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(ye(this,qo,"f").y(e))}getUnitValue(){return ye(this,qo,"f").x(this.getValue())}getControlledValue(){return ye(this,qo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ye(this,Mc,"f")??this.getUnitValue()}getControlledPrintValue(){return ye(this,Jo,"f").x(this.getControlledValue())}getPrintValue(){return ye(this,Jo,"f").x(this.getValue())}setPrintValue(e){let r=ye(this,Jo,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(ye(this,Tv,"f").unwrapOrElse(ye(this,Mi,"f").initValue))}terminate(){ye(this,wl,"f").ifSome(e=>e.terminate()),ar(this,wl,b.None,"f"),ye(this,yl,"f").terminate()}};ki=new WeakMap,Mi=new WeakMap,Iv=new WeakMap,Bv=new WeakMap,Tv=new WeakMap,yl=new WeakMap,Go=new WeakMap,Ho=new WeakMap,qo=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,wl=new WeakMap,Mc=new WeakMap,cf=new WeakMap;var Gb=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 V(`${t.toString()} is an unknown pointer type`)}};var Dv={min:400,max:480,default:440};var Hb=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)},uo,bl,Rv,Cv=class{constructor(e,r,n){uo.set(this,void 0),bl.set(this,void 0),Rv.set(this,void 0),Hb(this,uo,M.newSet(i=>i.uuid),"f"),Hb(this,bl,new Qt,"f"),Hb(this,Rv,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=On(this,uo,"f").add(a);te(o,`Could not add ${a}`),On(this,bl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;On(this,bl,"f").proxy.onRemove(On(this,uo,"f").removeByKey(a))}},n),"f")}subscribe(e){return On(this,bl,"f").subscribe(e)}catchupAndSubscribe(e){return On(this,uo,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return On(this,uo,"f").values()}size(){return On(this,uo,"f").size()}isEmpty(){return this.size()===0}terminate(){On(this,uo,"f").clear(),On(this,bl,"f").terminate(),On(this,Rv,"f").terminate()}};uo=new WeakMap,bl=new WeakMap,Rv=new WeakMap;var qb=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)},Jb,li,df,rn,Er,gP,Un=class{constructor(e,r){Jb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Delay,df.set(this,void 0),rn.set(this,void 0),Er.set(this,void 0),qb(this,df,e,"f"),qb(this,rn,r,"f"),qb(this,Er,new de(yt(this,df,"f")),"f"),this.namedParameter=yt(this,Jb,"m",gP).call(this,r)}get box(){return yt(this,rn,"f")}get uuid(){return yt(this,rn,"f").address.uuid}get address(){return yt(this,rn,"f").address}get indexField(){return yt(this,rn,"f").index}get labelField(){return yt(this,rn,"f").label}get enabledField(){return yt(this,rn,"f").enabled}get minimizedField(){return yt(this,rn,"f").minimized}get host(){return yt(this,rn,"f").host}deviceHost(){return yt(this,df,"f").boxAdapters.adapterFor(yt(this,rn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yt(this,Er,"f").terminate()}};li=Un,df=new WeakMap,rn=new WeakMap,Er=new WeakMap,Jb=new WeakSet,gP=function(e){return{preSyncTimeLeft:yt(this,Er,"f").createParameter(e.preSyncTimeLeft,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:yt(this,Er,"f").createParameter(e.preMillisTimeLeft,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:yt(this,Er,"f").createParameter(e.preSyncTimeRight,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"pre sync R"),preMillisTimeRight:yt(this,Er,"f").createParameter(e.preMillisTimeRight,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:yt(this,Er,"f").createParameter(e.delayMusical,E.linearInteger(0,li.Fractions.length-1),li.FractionsStringMapping,"delay"),millisTime:yt(this,Er,"f").createParameter(e.delayMillis,E.powerByCenter(100,0,li.MAX_MILLIS_TIME),$.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:yt(this,Er,"f").createParameter(e.feedback,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:yt(this,Er,"f").createParameter(e.cross,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:yt(this,Er,"f").createParameter(e.lfoSpeed,E.exponential(li.LFO_SPEED_MIN,li.LFO_SPEED_MAX),$.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:yt(this,Er,"f").createParameter(e.lfoDepth,E.power(4,0,li.LFO_DEPTH_MAX),$.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:yt(this,Er,"f").createParameter(e.filter,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:yt(this,Er,"f").createParameter(e.dry,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"dry"),wet:yt(this,Er,"f").createParameter(e.wet,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"wet")}};Un.Fractions=Ao.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();Un.FractionsStringMapping=$.indices("",li.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));Un.MAX_MILLIS_TIME=1e3;Un.LFO_SPEED_MIN=.1;Un.LFO_SPEED_MAX=5;Un.LFO_DEPTH_MAX=50;var Xb=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)},Yb,pf,nn,Ea,vP,zv=class{constructor(e,r){Yb.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Reverb,pf.set(this,void 0),nn.set(this,void 0),Ea.set(this,void 0),Xb(this,pf,e,"f"),Xb(this,nn,r,"f"),Xb(this,Ea,new de(pr(this,pf,"f")),"f"),this.namedParameter=pr(this,Yb,"m",vP).call(this,r)}get box(){return pr(this,nn,"f")}get uuid(){return pr(this,nn,"f").address.uuid}get address(){return pr(this,nn,"f").address}get indexField(){return pr(this,nn,"f").index}get labelField(){return pr(this,nn,"f").label}get enabledField(){return pr(this,nn,"f").enabled}get minimizedField(){return pr(this,nn,"f").minimized}get host(){return pr(this,nn,"f").host}deviceHost(){return pr(this,pf,"f").boxAdapters.adapterFor(pr(this,nn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pr(this,Ea,"f").terminate()}};pf=new WeakMap,nn=new WeakMap,Ea=new WeakMap,Yb=new WeakSet,vP=function(e){return{decay:pr(this,Ea,"f").createParameter(e.decay,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:pr(this,Ea,"f").createParameter(e.preDelay,E.exponential(.001,.5),$.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:pr(this,Ea,"f").createParameter(e.damp,E.unipolar(),$.numeric({unit:"%",fractionDigits:0}),"damping"),filter:pr(this,Ea,"f").createParameter(e.filter,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"filter"),dry:pr(this,Ea,"f").createParameter(e.dry,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"dry"),wet:pr(this,Ea,"f").createParameter(e.wet,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"wet")}};var Qb=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)},t_,ff,Ni,Vn,wP,Ov=class{constructor(e,r){t_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Revamp,ff.set(this,void 0),Ni.set(this,void 0),Vn.set(this,void 0),Qb(this,ff,e,"f"),Qb(this,Ni,r,"f"),Qb(this,Vn,new de(Zt(this,ff,"f")),"f"),this.namedParameter=Zt(this,t_,"m",wP).call(this,r)}get box(){return Zt(this,Ni,"f")}get uuid(){return Zt(this,Ni,"f").address.uuid}get address(){return Zt(this,Ni,"f").address}get indexField(){return Zt(this,Ni,"f").index}get labelField(){return Zt(this,Ni,"f").label}get enabledField(){return Zt(this,Ni,"f").enabled}get minimizedField(){return Zt(this,Ni,"f").minimized}get host(){return Zt(this,Ni,"f").host}get spectrum(){return Zt(this,Ni,"f").address.append(4095)}deviceHost(){return Zt(this,ff,"f").boxAdapters.adapterFor(Zt(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Zt(this,Vn,"f").terminate()}};ff=new WeakMap,Ni=new WeakMap,Vn=new WeakMap,t_=new WeakSet,wP=function(e){return{highPass:xP(Zt(this,Vn,"f"),e.highPass,"High-Pass"),lowShelf:yP(Zt(this,Vn,"f"),e.lowShelf,"Low-Shelf"),lowBell:e_(Zt(this,Vn,"f"),e.lowBell,"Low-Bell"),midBell:e_(Zt(this,Vn,"f"),e.midBell,"Mid-Bell"),highBell:e_(Zt(this,Vn,"f"),e.highBell,"High-Bell"),highShelf:yP(Zt(this,Vn,"f"),e.highShelf,"High-Shelf"),lowPass:xP(Zt(this,Vn,"f"),e.lowPass,"Low-Pass")}};var r_=E.exponential(20,2e4),bP=E.linear(-24,24),_P=E.exponential(.01,10),xP=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,E.linearInteger(0,3),$.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,_P,$.numeric({fractionDigits:3}),`${r} Q`)}),yP=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,bP,$.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),e_=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,$.bool,"enabled"),frequency:t.createParameter(e.frequency,r_,$.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,bP,$.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,_P,$.numeric({fractionDigits:3}),`${r} Q`)});var AP=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},ui=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)},Uv,Vv,ci,Yo=class{constructor(e,r){this.type="marker-event",Uv.set(this,new X),Vv.set(this,void 0),ci.set(this,void 0),AP(this,Vv,e,"f"),AP(this,ci,r,"f"),ui(this,Uv,"f").own(ui(this,ci,"f").subscribe(Te.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();ui(this,ci,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return ui(this,ci,"f")}get uuid(){return ui(this,ci,"f").address.uuid}get address(){return ui(this,ci,"f").address}get position(){return ui(this,ci,"f").position.getValue()}get plays(){return ui(this,ci,"f").plays.getValue()}get hue(){return ui(this,ci,"f").hue.getValue()}get label(){return ui(this,ci,"f").label.getValue()}get trackAdapter(){return ui(this,ci,"f").track.targetVertex.map(e=>ui(this,Vv,"f").boxAdapters.adapterFor(e.box,Pa).markerTrack)}terminate(){ui(this,Uv,"f").terminate()}toString(){return`{MarkerBoxAdapter ${M.toString(ui(this,ci,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Uv=new WeakMap,Vv=new WeakMap,ci=new WeakMap;Yo.Comparator=(t,e)=>t.position-e.position;var mf=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},an=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)},hf,Nc,gf,_l,jv,Kv=class{constructor(e,r){hf.set(this,void 0),Nc.set(this,void 0),gf.set(this,void 0),_l.set(this,void 0),jv.set(this,void 0),mf(this,hf,e,"f"),mf(this,Nc,r,"f"),this.changeNotifier=new fe,mf(this,gf,M.newSet(n=>n.uuid),"f"),mf(this,_l,Ir.create(Yo.Comparator),"f"),mf(this,jv,an(this,Nc,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof Fu){let i=an(this,hf,"f").boxAdapters.adapterFor(n,Yo),a=an(this,gf,"f").add(i);te(a,"Could not add adapter"),an(this,_l,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{an(this,_l,"f").remove(an(this,gf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return an(this,hf,"f")}get enabled(){return an(this,Nc,"f").enabled.getValue()}get events(){return an(this,_l,"f")}get object(){return an(this,Nc,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){an(this,_l,"f").onIndexingChanged(),this.dispatchChange()}terminate(){an(this,jv,"f").terminate()}};hf=new WeakMap,Nc=new WeakMap,gf=new WeakMap,_l=new WeakMap,jv=new WeakMap;var FP=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)},Wv,Lv,Bi,Al=class{constructor(e,r){this.type="signature-event",Wv.set(this,new X),Lv.set(this,void 0),Bi.set(this,void 0),FP(this,Lv,e,"f"),FP(this,Bi,r,"f"),Ii(this,Wv,"f").own(Ii(this,Bi,"f").subscribe(Te.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ii(this,Bi,"f")}get uuid(){return Ii(this,Bi,"f").address.uuid}get address(){return Ii(this,Bi,"f").address}get index(){return Ii(this,Bi,"f").index.getValue()}get indexField(){return Ii(this,Bi,"f").index}get relativePosition(){return Ii(this,Bi,"f").relativePosition.getValue()}get nominator(){return Ii(this,Bi,"f").nominator.getValue()}get denominator(){return Ii(this,Bi,"f").denominator.getValue()}get trackAdapter(){return Ii(this,Bi,"f").events.targetVertex.map(e=>Ii(this,Lv,"f").boxAdapters.adapterFor(e.box,Pa).signatureTrack)}terminate(){Ii(this,Wv,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Wv=new WeakMap,Lv=new WeakMap,Bi=new WeakMap;Al.Comparator=(t,e)=>t.index-e.index;var Zv=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)},Qo,vf,xf,Fl,co,es,SP,Ic,Gv=class{constructor(e,r,n){Qo.add(this),vf.set(this,new X),xf.set(this,void 0),Fl.set(this,void 0),co.set(this,void 0),es.set(this,void 0),Zv(this,xf,e,"f"),Zv(this,Fl,r,"f"),Zv(this,co,n,"f"),this.changeNotifier=new fe,Zv(this,es,wt(this,vf,"f").own(cr.create(wt(this,co,"f").events,i=>e.boxAdapters.adapterFor(i,Al),l.SignatureAutomation)),"f"),wt(this,vf,"f").ownAll(wt(this,Fl,"f").subscribe(()=>this.dispatchChange()),wt(this,co,"f").enabled.subscribe(()=>this.dispatchChange()),wt(this,es,"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 wt(this,xf,"f")}get enabled(){return wt(this,co,"f").enabled.getValue()}get object(){return wt(this,co,"f")}get size(){return wt(this,es,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=wt(this,Fl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return wt(this,es,"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},!!wt(this,co,"f").enabled.getValue())for(let a of wt(this,es,"f").adapters())e+=Me.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(u=>u.accumulatedPpqn);wt(this,Fl,"f").nominator.setValue(e),wt(this,Fl,"f").denominator.setValue(r);let a=0,o=0,s=Me.fromSignature(e,r);for(let u=0;u<n.length;u++){let d=n[u],m=this.adapterAt(d.index);if(m.isEmpty())continue;let g=(i[u]-a)/s,w=Math.floor(g),A=g-w;o+=A;let _=w;o>=1&&(_++,o--),_=Math.max(1,_),m.unwrap().box.relativePosition.setValue(_),a+=_*s,s=Me.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,[u,d]=s!==null?[s.nominator,s.denominator]:this.storageSignature,m=s!==null?s.accumulatedPpqn:0;e.box.delete();let x=m,g=Me.fromSignature(u,d);for(let w=0;w<a.length;w++){let A=a[w],_=this.adapterAt(A.index);if(_.isEmpty())continue;let W=(o[w]-x)/g,U=Math.max(1,Math.round(W));_.unwrap().box.relativePosition.setValue(U),x+=U*g,g=Me.fromSignature(A.nominator,A.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let _=1;_<i.length&&!(i[_].accumulatedPpqn>e);_++)a=i[_],o=_;let s=Me.fromSignature(a.nominator,a.denominator),u=(e-a.accumulatedPpqn)/s,d=Math.max(1,Math.round(u)),m=a.index+1,x=i.slice(o+1),g=a.accumulatedPpqn+d*s,w=Me.fromSignature(r,n),A=x.map(_=>({event:_,adapter:this.adapterAt(_.index)})).filter(({adapter:_})=>_.nonEmpty()).map(({event:_,adapter:C})=>({event:_,adapter:C.unwrap()}));for(let _=0;_<A.length;_++){let{event:C,adapter:W}=A[_];if(W.box.index.setValue(C.index+1),_===0){let U=(C.accumulatedPpqn-g)/w;W.box.relativePosition.setValue(Math.max(1,Math.round(U)))}}yu.create(wt(this,xf,"f").boxGraph,M.generate(),_=>{_.index.setValue(m),_.relativePosition.setValue(d),_.nominator.setValue(r),_.denominator.setValue(n),_.events.refer(wt(this,co,"f").events)})}adapterAt(e){return wt(this,es,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(g=>g.accumulatedBars),s=wt(this,Qo,"m",SP).call(this,r,a.index);if(s===a.accumulatedBars)return;let u=[...o];u[i]=s;let d=u.map((g,w)=>({bar:g,i:w})).sort((g,w)=>g.bar-w.bar).map(g=>g.i),m=n.map(g=>this.adapterAt(g.index).unwrap("adapterAt"));for(let g=0;g<d.length;g++)m[d[g]].box.index.setValue(g);let x=0;for(let g=0;g<d.length;g++){let w=d[g],A=m[w],_=u[w],C=Math.max(1,_-x);A.box.relativePosition.setValue(C),x=_}}floorToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=wt(this,Qo,"m",Ic).call(this,e),n=Me.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Me.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=wt(this,Qo,"m",Ic).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){wt(this,vf,"f").terminate()}};vf=new WeakMap,xf=new WeakMap,Fl=new WeakMap,co=new WeakMap,es=new WeakMap,Qo=new WeakSet,SP=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(ta(n)){let[o,s]=this.storageSignature,u=Me.fromSignature(o,s);return Math.max(1,Math.round(e/u))}let i=Me.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},Ic=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(ta(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Me.fromSignature(n,i)}}return{event:r,barPpqn:Me.fromSignature(r.nominator,r.denominator)}};var yf=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},Ut=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)},wf,$a,Hv,qv,po,bf,Jv,Pa=class{constructor(e,r){wf.set(this,new X),$a.set(this,void 0),Hv.set(this,void 0),qv.set(this,void 0),po.set(this,void 0),bf.set(this,void 0),Jv.set(this,()=>{let{tempoTrack:{enabled:s}}=Ut(this,$a,"f");return s.getValue()?Ut(this,po,"f").isEmpty()?b.None:Ut(this,po,"f").unwrap().events.isEmpty()?b.None:Ut(this,po,"f"):b.None}),yf(this,$a,r,"f"),yf(this,Hv,new Kv(e,r.markerTrack),"f"),yf(this,qv,new Gv(e,r.signature,r.signatureTrack),"f"),yf(this,po,new _r,"f"),yf(this,bf,new fe,"f");let n=Ut(this,wf,"f").own(new X),i=()=>Ut(this,bf,"f").notify(Ut(this,Jv,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Ut(this,wf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Ut(this,po,"f").clear(),some:({box:u})=>{let d=e.boxAdapters.adapterFor(u,Fr);Ut(this,po,"f").wrap(d),n.ownAll(d.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Ut(this,Jv,"f").call(this)),Ut(this,bf,"f").subscribe(e)}get box(){return Ut(this,$a,"f")}get uuid(){return Ut(this,$a,"f").address.uuid}get address(){return Ut(this,$a,"f").address}get markerTrack(){return Ut(this,Hv,"f")}get signatureTrack(){return Ut(this,qv,"f")}get tempoTrackEvents(){return Ut(this,po,"f")}get signature(){let{nominator:e,denominator:r}=Ut(this,$a,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Ut(this,$a,"f").signature;return Me.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Ut(this,$a,"f").signature.subscribe(()=>e(this.signature))}terminate(){Ut(this,wf,"f").terminate()}};wf=new WeakMap,$a=new WeakMap,Hv=new WeakMap,qv=new WeakMap,po=new WeakMap,bf=new WeakMap,Jv=new WeakMap;var EB=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},_f=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)},ts,rs=class{constructor(e,r){ts.set(this,void 0),EB(this,ts,r,"f")}get box(){return _f(this,ts,"f")}get uuid(){return _f(this,ts,"f").address.uuid}get address(){return _f(this,ts,"f").address}get source(){return _f(this,ts,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return _f(this,ts,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};ts=new WeakMap;var Sl=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)},Xv,El,Pl,Yv,Qv,Af,sn=class{constructor(e,r){Xv.set(this,void 0),El.set(this,void 0),Pl.set(this,void 0),Yv.set(this,void 0),Qv.set(this,void 0),Af.set(this,!1),Sl(this,Xv,e,"f"),Sl(this,El,r,"f"),Sl(this,Pl,new X,"f"),Sl(this,Yv,r.attributes,"f"),Sl(this,Qv,on(this,Pl,"f").own(new de(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return on(this,Pl,"f").own(e)}ownAll(...e){on(this,Pl,"f").ownAll(...e)}onSelected(){Sl(this,Af,!0,"f")}onDeselected(){Sl(this,Af,!1,"f")}isSelected(){return on(this,Af,"f")}get box(){return on(this,El,"f")}get attributes(){return on(this,Yv,"f")}get uuid(){return on(this,El,"f").address.uuid}get address(){return on(this,El,"f").address}get parameters(){return on(this,Qv,"f")}get modular(){return on(this,Xv,"f").boxAdapters.adapterFor(on(this,El,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,is)}terminate(){on(this,Pl,"f").terminate()}};Xv=new WeakMap,El=new WeakMap,Pl=new WeakMap,Yv=new WeakMap,Qv=new WeakMap,Af=new WeakMap;var ex=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},fo=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,ns,Ff,rx,Dr;(function(t){t.Input="input",t.Output="output"})(Dr||(Dr={}));var Rr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){tx.set(this,void 0),ns.set(this,void 0),Ff.set(this,void 0),rx.set(this,void 0),ex(this,tx,e,"f"),ex(this,ns,r,"f"),ex(this,Ff,n,"f"),ex(this,rx,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 fo(this,ns,"f").pointerHub.isEmpty()?ce.empty():fo(this,ns,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>fo(this,tx,"f").adapterFor(e,rs))}get field(){return fo(this,ns,"f")}get address(){return fo(this,ns,"f").address}get direction(){return fo(this,Ff,"f")}get name(){return fo(this,rx,"f")}toString(){return`{ModuleConnectorAdapter address: ${fo(this,ns,"f").address.toString()}, direction: ${fo(this,Ff,"f")}}`}};tx=new WeakMap,ns=new WeakMap,Ff=new WeakMap,rx=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},Sf=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)},ix,Ef,Pf,Bc=class extends sn{constructor(e,r){super(e,r),ix.set(this,void 0),Ef.set(this,void 0),Pf.set(this,void 0),i_(this,ix,this.parameters.createParameter(r.time,E.exponential(1,1e4),$.numeric({unit:"ms"}),"Time"),"f"),i_(this,Ef,Rr.create(e.boxAdapters,r.voltageInput,Dr.Input,"Input"),"f"),i_(this,Pf,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Output"),"f")}get parameterTime(){return Sf(this,ix,"f")}get voltageInput(){return Sf(this,Ef,"f")}get voltageOutput(){return Sf(this,Pf,"f")}get inputs(){return[Sf(this,Ef,"f")]}get outputs(){return[Sf(this,Pf,"f")]}};ix=new WeakMap,Ef=new WeakMap,Pf=new WeakMap;var PB=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},EP=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,Tc=class extends sn{constructor(e,r){super(e,r),$f.set(this,void 0),PB(this,$f,Rr.create(e.boxAdapters,r.input,Dr.Input,"Input"),"f")}get voltageInput(){return EP(this,$f,"f")}get inputs(){return[EP(this,$f,"f")]}get outputs(){return ce.empty()}};$f=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},kf=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)},nx,Mf,Nf,Dc=class extends sn{constructor(e,r){super(e,r),nx.set(this,void 0),Mf.set(this,void 0),Nf.set(this,void 0),n_(this,nx,this.parameters.createParameter(r.gain,E.DefaultDecibel,$.numeric({unit:"db"}),"Gain"),"f"),n_(this,Mf,Rr.create(e.boxAdapters,r.voltageInput,Dr.Input,"Input"),"f"),n_(this,Nf,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Output"),"f")}get parameterGain(){return kf(this,nx,"f")}get voltageInput(){return kf(this,Mf,"f")}get voltageOutput(){return kf(this,Nf,"f")}get inputs(){return[kf(this,Mf,"f")]}get outputs(){return[kf(this,Nf,"f")]}};nx=new WeakMap,Mf=new WeakMap,Nf=new WeakMap;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},o_=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,sx,Rc=class extends sn{constructor(e,r){super(e,r),ax.set(this,void 0),ox.set(this,void 0),sx.set(this,void 0),a_(this,ax,Rr.create(e.boxAdapters,r.voltageInputX,Dr.Input,"X"),"f"),a_(this,ox,Rr.create(e.boxAdapters,r.voltageInputY,Dr.Input,"Y"),"f"),a_(this,sx,Rr.create(e.boxAdapters,r.voltageOutput,Dr.Output,"Result"),"f")}get inputs(){return[o_(this,ax,"f"),o_(this,ox,"f")]}get outputs(){return[o_(this,sx,"f")]}};ax=new WeakMap,ox=new WeakMap,sx=new WeakMap;var $B=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},PP=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)},If,Cc=class extends sn{constructor(e,r){super(e,r),If.set(this,void 0),$B(this,If,Rr.create(e.boxAdapters,r.output,Dr.Output,"Output"),"f")}get voltageOutput(){return PP(this,If,"f")}get inputs(){return ce.empty()}get outputs(){return[PP(this,If,"f")]}};If=new WeakMap;var zc;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>ze(r.accept({visitModuleGainBox:n=>e.adapterFor(n,Dc),visitModuleDelayBox:n=>e.adapterFor(n,Bc),visitModuleMultiplierBox:n=>e.adapterFor(n,Rc),visitModularAudioInputBox:n=>e.adapterFor(n,Cc),visitModularAudioOutputBox:n=>e.adapterFor(n,Tc)}),`Could not find ModuleAdapter for ${r.name}`)})(zc||(zc={}));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},$l=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,ux,kl,s_,Oc=class{constructor(e,r){lx.add(this),ux.set(this,void 0),kl.set(this,void 0),$P(this,ux,e,"f"),$P(this,kl,r,"f")}get box(){return $l(this,kl,"f")}get uuid(){return $l(this,kl,"f").address.uuid}get address(){return $l(this,kl,"f").address}get moduleAdapter(){return zc.adapterFor($l(this,ux,"f").boxAdapters,$l(this,lx,"a",s_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt($l(this,lx,"a",s_).address)}terminate(){}};ux=new WeakMap,kl=new WeakMap,lx=new WeakSet,s_=function(){return $l(this,kl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};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},di=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)},Uc,pi,Vc=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Modular,Uc.set(this,void 0),pi.set(this,void 0),kP(this,Uc,e,"f"),kP(this,pi,r,"f")}get box(){return di(this,pi,"f")}get uuid(){return di(this,pi,"f").address.uuid}get address(){return di(this,pi,"f").address}get indexField(){return di(this,pi,"f").index}get labelField(){return di(this,pi,"f").label}get enabledField(){return di(this,pi,"f").enabled}get minimizedField(){return di(this,pi,"f").minimized}get host(){return di(this,pi,"f").host}parameterAt(e){return V("Not yet implemented")}deviceHost(){return di(this,Uc,"f").boxAdapters.adapterFor(di(this,pi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return di(this,Uc,"f").boxAdapters.adapterFor(di(this,pi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,is)}elements(){return di(this,pi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>di(this,Uc,"f").boxAdapters.adapterFor(e.box,Oc))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Uc=new WeakMap,pi=new WeakMap;var Bf=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)},jc,as,Kc,Ti,Ml,Nl,is=class{constructor(e,r){jc.set(this,new X),as.set(this,void 0),Kc.set(this,void 0),Ti.set(this,void 0),Ml.set(this,void 0),Nl.set(this,void 0),Bf(this,Kc,e,"f"),Bf(this,Ti,r,"f"),Bf(this,as,ot(this,jc,"f").own(new Qt),"f"),Bf(this,Ml,M.newSet(s=>s.uuid),"f"),Bf(this,Nl,M.newSet(s=>s.uuid),"f");let n=s=>{let u=zc.adapterFor(ot(this,Kc,"f").boxAdapters,s.box);ot(this,Ml,"f").add(u)&&ot(this,as,"f").proxy.onModuleAdded(u)},i=s=>ot(this,as,"f").proxy.onModuleRemoved(ot(this,Ml,"f").removeByKey(s.address.uuid)),a=s=>{let u=ot(this,Kc,"f").boxAdapters.adapterFor(s.box,rs);ot(this,Nl,"f").add(u)&&ot(this,as,"f").proxy.onConnectionAdded(u)},o=s=>ot(this,as,"f").proxy.onConnectionRemoved(ot(this,Nl,"f").removeByKey(s.address.uuid));ot(this,Ti,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,Ti,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,jc,"f").own(ot(this,Ti,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,jc,"f").own(ot(this,Ti,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return Pb(e.onModuleAdded,r=>ot(this,Ml,"f").forEach(n=>r(n))),Pb(e.onConnectionAdded,r=>ot(this,Nl,"f").forEach(n=>r(n))),ot(this,as,"f").subscribe(e)}get box(){return ot(this,Ti,"f")}get address(){return ot(this,Ti,"f").address}get uuid(){return ot(this,Ti,"f").address.uuid}get editingField(){return ot(this,Ti,"f").editing}get labelField(){return ot(this,Ti,"f").label}get modules(){return ot(this,Ml,"f").values()}get connections(){return ot(this,Nl,"f").values()}get device(){return ot(this,Kc,"f").boxAdapters.adapterFor(ze(ot(this,Ti,"f").device.pointerHub.incoming().at(0),"No device found").box,Vc)}terminate(){console.debug(`terminate ${this}`),ot(this,jc,"f").terminate()}};jc=new WeakMap,as=new WeakMap,Kc=new WeakMap,Ti=new WeakMap,Ml=new WeakMap,Nl=new WeakMap;var Tf=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)},l_,Lc,Df,cx,Wc,Cf,dx,Rf,px,MP,ka=class{constructor(e,r){l_.add(this),this.type="groove-adapter",Df.set(this,new X),cx.set(this,void 0),Wc.set(this,void 0),Cf.set(this,void 0),dx.set(this,new Nh({duration:()=>Jr(this,px,"f"),fx:n=>Nb(n,Jr(this,Rf,"f")),fy:n=>Nb(n,1-Jr(this,Rf,"f"))})),Rf.set(this,0),px.set(this,Me.SemiQuaver*2),Tf(this,cx,e,"f"),Tf(this,Wc,r,"f"),Tf(this,Cf,Jr(this,Df,"f").own(new de(Jr(this,cx,"f"))),"f"),this.namedParameter=Jr(this,l_,"m",MP).call(this,r),Jr(this,Df,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Tf(this,px,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Tf(this,Rf,UE(n.getValue(),.01),"f")))}unwarp(e){return Jr(this,dx,"f").unwarp(e)}warp(e){return Jr(this,dx,"f").warp(e)}get box(){return Jr(this,Wc,"f")}get uuid(){return Jr(this,Wc,"f").address.uuid}get address(){return Jr(this,Wc,"f").address}terminate(){Jr(this,Df,"f").terminate()}};Lc=ka,Df=new WeakMap,cx=new WeakMap,Wc=new WeakMap,Cf=new WeakMap,dx=new WeakMap,Rf=new WeakMap,px=new WeakMap,l_=new WeakSet,MP=function(e){return{duration:Jr(this,Cf,"f").createParameter(e.duration,E.values(Lc.DurationPPQNs),$.values("",Lc.DurationPPQNs,Lc.DurationStrings),"duration"),amount:Jr(this,Cf,"f").createParameter(e.amount,E.unipolar(),$.percent({fractionDigits:0}),"amount")}};ka.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];ka.DurationPPQNs=Lc.Durations.map(([t,e])=>Me.fromSignature(t,e));ka.DurationStrings=Lc.Durations.map(([t,e])=>`${t}/${e}`);var Zc=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},Rt=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)},Ma,os,Gc,fx,mx,zf,Of,u_,ss=class{constructor(e,r,n,i,a){Ma.set(this,void 0),os.set(this,void 0),Gc.set(this,void 0),fx.set(this,void 0),mx.set(this,void 0),zf.set(this,new X),Of.set(this,void 0),u_.set(this,b.None),Zc(this,Ma,e,"f"),Zc(this,os,r,"f"),Zc(this,Gc,n,"f"),Zc(this,fx,i,"f"),Zc(this,mx,a??0,"f"),Zc(this,Of,Rt(this,zf,"f").own(new fe),"f"),Rt(this,zf,"f").own(Rt(this,Ma,"f").subscribe(()=>Rt(this,Of,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Rt(this,Ma,"f")}get valueMapping(){return Rt(this,os,"f")}get stringMapping(){return Rt(this,Gc,"f")}get name(){return Rt(this,fx,"f")}get anchor(){return Rt(this,mx,"f")}get type(){return Rt(this,Ma,"f").type}get address(){return Rt(this,Ma,"f").address}get track(){return Rt(this,u_,"f")}subscribe(e){return Rt(this,Of,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Rt(this,Ma,"f").getValue()}setValue(e){Rt(this,Ma,"f").setValue(Rt(this,os,"f").clamp(e))}setUnitValue(e){this.setValue(Rt(this,os,"f").y(e))}getUnitValue(){return Rt(this,os,"f").x(this.getValue())}getPrintValue(){return Rt(this,Gc,"f").x(this.getValue())}setPrintValue(e){let r=Rt(this,Gc,"f").y(e);r.type==="unitValue"?this.setUnitValue(at(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Rt(this,os,"f").clamp(Rt(this,Ma,"f").initValue))}terminate(){Rt(this,zf,"f").terminate()}};Ma=new WeakMap,os=new WeakMap,Gc=new WeakMap,fx=new WeakMap,mx=new WeakMap,zf=new WeakMap,Of=new WeakMap,u_=new WeakMap;var Hc=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},ln=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)},Na,hx,gx,vx,xx,yx,wx=class{constructor(e){Na.set(this,void 0),hx.set(this,void 0),gx.set(this,void 0),vx.set(this,void 0),xx.set(this,void 0),yx.set(this,void 0),Hc(this,Na,e,"f"),Hc(this,hx,new ss(ln(this,Na,"f").keyboard,E.values([88,76,61,49]),$.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Hc(this,gx,new ss(ln(this,Na,"f").timeRangeInQuarters,E.exponential(1,64),$.numeric({fractionDigits:1}),"Time-Range"),"f"),Hc(this,vx,new ss(ln(this,Na,"f").noteScale,E.exponential(.5,2),$.numeric({fractionDigits:1}),"Note Scale"),"f"),Hc(this,xx,new ss(ln(this,Na,"f").noteLabels,E.bool,$.bool,"Note Labels"),"f"),Hc(this,yx,new ss(ln(this,Na,"f").transpose,E.linearInteger(-48,48),$.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return ln(this,Na,"f").box.subscribe(Te.Children,()=>e(this))}get object(){return ln(this,Na,"f")}get keyboard(){return ln(this,hx,"f")}get timeRangeInQuarters(){return ln(this,gx,"f")}get noteScale(){return ln(this,vx,"f")}get noteLabels(){return ln(this,xx,"f")}get transpose(){return ln(this,yx,"f")}};Na=new WeakMap,hx=new WeakMap,gx=new WeakMap,vx=new WeakMap,xx=new WeakMap,yx=new WeakMap;var Uf=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)},Il,Di,Bl,bx,_x,Ax=class{constructor(e,r){Il.set(this,void 0),Di.set(this,void 0),Bl.set(this,void 0),bx.set(this,void 0),_x.set(this,void 0),Uf(this,Il,e,"f"),Uf(this,Di,r,"f"),Uf(this,Bl,cr.create(or(this,Di,"f").audioUnits,n=>or(this,Il,"f").boxAdapters.adapterFor(n,tn),l.AudioUnits),"f"),Uf(this,bx,new Cv(or(this,Di,"f").audioBusses.pointerHub,n=>or(this,Il,"f").boxAdapters.adapterFor(n,Ei),l.AudioBusses),"f"),Uf(this,_x,new wx(or(this,Di,"f").pianoMode),"f")}get uuid(){return or(this,Di,"f").address.uuid}get address(){return or(this,Di,"f").address}get box(){return or(this,Di,"f")}get audioBusses(){return or(this,bx,"f")}get audioUnits(){return or(this,Bl,"f")}get clips(){return or(this,Bl,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return or(this,Il,"f").boxAdapters.adapterFor(or(this,Di,"f").groove.targetVertex.unwrap("no groove").box,ka)}get timeline(){return or(this,Il,"f").boxAdapters.adapterFor(or(this,Di,"f").timeline.targetVertex.unwrap("no timeline").box,Pa)}get pianoMode(){return or(this,_x,"f")}get created(){return new Date(or(this,Di,"f").created.getValue())}get midiOutputDevices(){return or(this,Di,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ie(e,Io))}*labeledAudioOutputs(){for(let e of or(this,Bl,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){or(this,Bl,"f").terminate()}};Il=new WeakMap,Di=new WeakMap,Bl=new WeakMap,bx=new WeakMap,_x=new WeakMap;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},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)},d_,Vf,jn,ls,NP,Fx=class{constructor(e,r){d_.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=oe.Tape,Vf.set(this,void 0),jn.set(this,void 0),ls.set(this,void 0),c_(this,Vf,e,"f"),c_(this,jn,r,"f"),c_(this,ls,new de(Cr(this,Vf,"f")),"f"),this.namedParameter=Cr(this,d_,"m",NP).call(this,r)}get box(){return Cr(this,jn,"f")}get uuid(){return Cr(this,jn,"f").address.uuid}get address(){return Cr(this,jn,"f").address}get labelField(){return Cr(this,jn,"f").label}get iconField(){return Cr(this,jn,"f").icon}get defaultTrackType(){return ve.Audio}get enabledField(){return Cr(this,jn,"f").enabled}get minimizedField(){return Cr(this,jn,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Cr(this,Vf,"f").boxAdapters.adapterFor(Cr(this,jn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Cr(this,ls,"f").terminate()}};Vf=new WeakMap,jn=new WeakMap,ls=new WeakMap,d_=new WeakSet,NP=function(e){return{flutter:Cr(this,ls,"f").createParameter(e.flutter,E.unipolar(),$.percent(),"flutter"),wow:Cr(this,ls,"f").createParameter(e.wow,E.unipolar(),$.percent(),"wow"),noise:Cr(this,ls,"f").createParameter(e.noise,E.unipolar(),$.percent(),"noise"),saturation:Cr(this,ls,"f").createParameter(e.saturation,E.unipolar(),$.percent(),"saturation")}};var Tl=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[aa.sine,aa.triangle,aa.saw,aa.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:$.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:E.values(r),FILTER_ORDER_STRING_MAPPING:$.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:E.values(i),LFO_WAVEFORM_STRING_MAPPING:$.values("",i,a)}})();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},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)},f_,jf,Kn,it,IP,Sx=class{constructor(e,r){f_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Vaporisateur,jf.set(this,void 0),Kn.set(this,void 0),it.set(this,void 0),p_(this,jf,e,"f"),p_(this,Kn,r,"f"),p_(this,it,new de(Ve(this,jf,"f")),"f"),this.namedParameter=Ve(this,f_,"m",IP).call(this,r)}get box(){return Ve(this,Kn,"f")}get uuid(){return Ve(this,Kn,"f").address.uuid}get address(){return Ve(this,Kn,"f").address}get labelField(){return Ve(this,Kn,"f").label}get iconField(){return Ve(this,Kn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Ve(this,Kn,"f").enabled}get minimizedField(){return Ve(this,Kn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ve(this,jf,"f").boxAdapters.adapterFor(Ve(this,Kn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ve(this,it,"f").terminate()}};jf=new WeakMap,Kn=new WeakMap,it=new WeakMap,f_=new WeakSet,IP=function(e){let r=[Cs.Monophonic,Cs.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ve(this,it,"f").createParameter(n.waveform,E.linearInteger(0,3),$.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ve(this,it,"f").createParameter(n.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ve(this,it,"f").createParameter(n.octave,E.linearInteger(-3,3),$.numeric({unit:"oct"}),"Octave",.5),tune:Ve(this,it,"f").createParameter(n.tune,E.linear(-1200,1200),$.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ve(this,it,"f").createParameter(e.noise.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ve(this,it,"f").createParameter(e.noise.attack,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ve(this,it,"f").createParameter(e.noise.hold,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ve(this,it,"f").createParameter(e.noise.release,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ve(this,it,"f").createParameter(e.filterOrder,Tl.FILTER_ORDER_VALUE_MAPPING,Tl.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ve(this,it,"f").createParameter(e.cutoff,Tl.CUTOFF_VALUE_MAPPING,Tl.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ve(this,it,"f").createParameter(e.resonance,E.exponential(.01,10),$.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ve(this,it,"f").createParameter(e.attack,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ve(this,it,"f").createParameter(e.decay,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ve(this,it,"f").createParameter(e.sustain,E.unipolar(),$.percent({fractionDigits:1}),"Sustain"),release:Ve(this,it,"f").createParameter(e.release,E.exponential(.001,5),$.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ve(this,it,"f").createParameter(e.filterEnvelope,E.bipolar(),$.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ve(this,it,"f").createParameter(e.filterKeyboard,E.bipolar(),$.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ve(this,it,"f").createParameter(e.voicingMode,E.values(r),$.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ve(this,it,"f").createParameter(e.glideTime,E.unipolar(),$.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ve(this,it,"f").createParameter(e.unisonCount,E.values([1,3,5]),$.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ve(this,it,"f").createParameter(e.unisonDetune,E.exponential(1,1200),$.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ve(this,it,"f").createParameter(e.unisonStereo,E.unipolar(),$.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ve(this,it,"f").createParameter(e.lfo.waveform,Tl.LFO_WAVEFORM_VALUE_MAPPING,Tl.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ve(this,it,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),$.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ve(this,it,"f").createParameter(e.lfo.targetTune,E.bipolar(),$.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ve(this,it,"f").createParameter(e.lfo.targetVolume,E.bipolar(),$.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ve(this,it,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),$.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};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},fr=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_,Ex,Kf,un,Ia,BP,Dl=class{constructor(e,r){h_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Arpeggio,Kf.set(this,void 0),un.set(this,void 0),Ia.set(this,void 0),m_(this,Kf,e,"f"),m_(this,un,r,"f"),m_(this,Ia,new de(fr(this,Kf,"f")),"f"),this.namedParameter=fr(this,h_,"m",BP).call(this,r)}get box(){return fr(this,un,"f")}get uuid(){return fr(this,un,"f").address.uuid}get address(){return fr(this,un,"f").address}get indexField(){return fr(this,un,"f").index}get labelField(){return fr(this,un,"f").label}get enabledField(){return fr(this,un,"f").enabled}get minimizedField(){return fr(this,un,"f").minimized}get host(){return fr(this,un,"f").host}deviceHost(){return fr(this,Kf,"f").boxAdapters.adapterFor(fr(this,un,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){fr(this,Ia,"f").terminate()}};Ex=Dl,Kf=new WeakMap,un=new WeakMap,Ia=new WeakMap,h_=new WeakSet,BP=function(e){return{modeIndex:fr(this,Ia,"f").createParameter(e.modeIndex,E.linearInteger(0,2),$.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:fr(this,Ia,"f").createParameter(e.numOctaves,E.linearInteger(1,5),$.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:fr(this,Ia,"f").createParameter(e.rateIndex,E.linearInteger(0,Ex.RateFractions.length-1),Ex.RateStringMapping,"Rate"),gate:fr(this,Ia,"f").createParameter(e.gate,E.linear(0,2),$.percent({fractionDigits:0}),"Gate"),repeat:fr(this,Ia,"f").createParameter(e.repeat,E.linearInteger(1,16),$.numeric({fractionDigits:0}),"Repeat"),velocity:fr(this,Ia,"f").createParameter(e.velocity,E.bipolar(),$.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Dl.RateFractions=Ao.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();Dl.RateStringMapping=$.indices("",Ex.RateFractions.map(([t,e])=>`${t}/${e}`));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},zr=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)},v_,Wf,cn,Rl,TP,Px=class{constructor(e,r){v_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Pitch,Wf.set(this,void 0),cn.set(this,void 0),Rl.set(this,void 0),g_(this,Wf,e,"f"),g_(this,cn,r,"f"),g_(this,Rl,new de(zr(this,Wf,"f")),"f"),this.namedParameter=zr(this,v_,"m",TP).call(this,r)}get box(){return zr(this,cn,"f")}get uuid(){return zr(this,cn,"f").address.uuid}get address(){return zr(this,cn,"f").address}get indexField(){return zr(this,cn,"f").index}get labelField(){return zr(this,cn,"f").label}get enabledField(){return zr(this,cn,"f").enabled}get minimizedField(){return zr(this,cn,"f").minimized}get host(){return zr(this,cn,"f").host}deviceHost(){return zr(this,Wf,"f").boxAdapters.adapterFor(zr(this,cn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){zr(this,Rl,"f").terminate()}};Wf=new WeakMap,cn=new WeakMap,Rl=new WeakMap,v_=new WeakSet,TP=function(e){return{octaves:zr(this,Rl,"f").createParameter(e.octaves,E.linearInteger(-7,7),$.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:zr(this,Rl,"f").createParameter(e.semiTones,E.linearInteger(-36,36),$.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:zr(this,Rl,"f").createParameter(e.cents,E.linear(-50,50),$.numeric({unit:"cents",fractionDigits:1}),"cents")}};var kB=/^\/\/ @label .+$/m,DP=/^\/\/ @param .+$/gm,RP=/^\/\/ @sample .+$/gm;var CP=/^\/\/ @(group|param|sample) .+$/gm,zP=/^\/\/ @(?:param|sample) \S+/gm,qc=1e-6,MB=["linear","exp","int","bool"],NB=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}}},OP=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]),m=parseFloat(e[3]);if(isNaN(d)||isNaN(m))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(m-d<qc)throw new Error(`Malformed @param: '${t}' \u2014 min (${d}) must be less than max (${m})`);if(i<d-qc||i>m+qc)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${d}, ${m}]`);return{label:r,defaultValue:i,min:d,max:m,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],u=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!MB.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<qc)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-qc||i>o+qc)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:u}},UP=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,IB=(t,e)=>UP(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,yr;(function(t){t.isEqual=IB,t.parseLabel=e=>{let r=kB.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(DP.lastIndex=0;(n=DP.exec(e))!==null;)r.push(OP(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(RP.lastIndex=0;(n=RP.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;zP.lastIndex=0;let i=0;for(;(n=zP.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=[];CP.lastIndex=0;let a;for(;(a=CP.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 u=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:u[0],color:u[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:OP(o)});else if(s==="sample"){let u=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(u.length===0||u[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:u[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(e.min,e.max);case"exp":return E.exponential(e.min,e.max);case"int":return E.linearInteger(e.min,e.max);case"bool":return E.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return $.percent();case"linear":return $.numeric({unit:e.unit,fractionDigits:2});case"exp":return $.numeric({unit:e.unit,fractionDigits:2});case"int":return $.numeric({unit:e.unit,fractionDigits:0});case"bool":return NB}},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 u=Ie(s,pa),d=u.label.getValue(),x=t.parseParams(r.getValue()).find(A=>A.label===d),{valueMapping:g,stringMapping:w}=K(x)?t.resolveParamMappings(x):{valueMapping:E.unipolar(),stringMapping:$.percent({fractionDigits:1})};e.createParameter(u.value,g,w,d,void 0,u.defaultValue.getValue()),K(x)&&i.set(d,x)}),onRemoved:(({box:s})=>{let u=Ie(s,pa);i.delete(u.label.getValue()),e.removeParameter(u.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let u of e.parameters()){let d=s.find(w=>w.label===u.name);if(!K(d))continue;let m=i.get(u.name);if(K(m)&&UP(m,d))continue;let{valueMapping:x,stringMapping:g}=t.resolveParamMappings(d);u.updateMappings(x,g),i.set(u.name,d)}a.notify()}),a),codeChanged:a}}})(yr||(yr={}));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},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)},Lf,Zf,dn,Gf,kx,Mx=class{constructor(e,r){Lf.set(this,new X),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Spielwerk,Zf.set(this,void 0),dn.set(this,void 0),Gf.set(this,void 0),kx.set(this,void 0),$x(this,Zf,e,"f"),$x(this,dn,r,"f"),$x(this,Gf,Pr(this,Lf,"f").own(new de(Pr(this,Zf,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Pr(this,Gf,"f"),r.code,r.parameters);Pr(this,Lf,"f").own(n),$x(this,kx,i,"f")}get box(){return Pr(this,dn,"f")}get uuid(){return Pr(this,dn,"f").address.uuid}get address(){return Pr(this,dn,"f").address}get indexField(){return Pr(this,dn,"f").index}get labelField(){return Pr(this,dn,"f").label}get enabledField(){return Pr(this,dn,"f").enabled}get minimizedField(){return Pr(this,dn,"f").minimized}get host(){return Pr(this,dn,"f").host}get parameters(){return Pr(this,Gf,"f")}get codeChanged(){return Pr(this,kx,"f")}deviceHost(){return Pr(this,Zf,"f").boxAdapters.adapterFor(Pr(this,dn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pr(this,Lf,"f").terminate()}};Lf=new WeakMap,Zf=new WeakMap,dn=new WeakMap,Gf=new WeakMap,kx=new WeakMap;var Nx=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)},Hf,qf,Wn,Jf,Ix,Bx=class{constructor(e,r){Hf.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Apparat,qf.set(this,void 0),Wn.set(this,void 0),Jf.set(this,void 0),Ix.set(this,void 0),Nx(this,qf,e,"f"),Nx(this,Wn,r,"f"),Nx(this,Jf,Or(this,Hf,"f").own(new de(Or(this,qf,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Or(this,Jf,"f"),r.code,r.parameters);Or(this,Hf,"f").own(n),Nx(this,Ix,i,"f")}get box(){return Or(this,Wn,"f")}get uuid(){return Or(this,Wn,"f").address.uuid}get address(){return Or(this,Wn,"f").address}get labelField(){return Or(this,Wn,"f").label}get iconField(){return Or(this,Wn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Or(this,Wn,"f").enabled}get minimizedField(){return Or(this,Wn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Or(this,Jf,"f")}get codeChanged(){return Or(this,Ix,"f")}deviceHost(){return Or(this,qf,"f").boxAdapters.adapterFor(Or(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Or(this,Hf,"f").terminate()}};Hf=new WeakMap,qf=new WeakMap,Wn=new WeakMap,Jf=new WeakMap,Ix=new WeakMap;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},fi=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_,Xf,Ln,Jc,VP,Tx=class{constructor(e,r){y_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Nano,Xf.set(this,void 0),Ln.set(this,void 0),Jc.set(this,void 0),x_(this,Xf,e,"f"),x_(this,Ln,r,"f"),x_(this,Jc,new de(fi(this,Xf,"f")),"f"),this.namedParameter=fi(this,y_,"m",VP).call(this,r)}get box(){return fi(this,Ln,"f")}get uuid(){return fi(this,Ln,"f").address.uuid}get address(){return fi(this,Ln,"f").address}get labelField(){return fi(this,Ln,"f").label}get iconField(){return fi(this,Ln,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return fi(this,Ln,"f").enabled}get minimizedField(){return fi(this,Ln,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return fi(this,Xf,"f").boxAdapters.adapterFor(fi(this,Ln,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){fi(this,Jc,"f").terminate()}};Xf=new WeakMap,Ln=new WeakMap,Jc=new WeakMap,y_=new WeakSet,VP=function(e){return{volume:fi(this,Jc,"f").createParameter(e.volume,E.DefaultDecibel,$.numeric({unit:"db",fractionDigits:1}),"volume"),release:fi(this,Jc,"f").createParameter(e.release,E.exponential(.001,8),$.numeric({unit:"s",fractionDigits:3}),"release")}};var Xc=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)},w_,Cl,us,Be,Dx,Yf,Ri,zl,jP,Yc=class{constructor(e,r){w_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",Cl.set(this,new X),us.set(this,void 0),Be.set(this,void 0),Dx.set(this,void 0),Yf.set(this,void 0),Ri.set(this,void 0),zl.set(this,b.None),Xc(this,us,e,"f"),Xc(this,Be,r,"f"),Xc(this,Dx,se(this,Cl,"f").own(cr.create(se(this,Be,"f").midiEffects,n=>se(this,us,"f").boxAdapters.adapterFor(n,ae.isMidiEffect),l.MIDIEffectHost)),"f"),Xc(this,Yf,se(this,Cl,"f").own(cr.create(se(this,Be,"f").audioEffects,n=>se(this,us,"f").boxAdapters.adapterFor(n,ae.isAudioEffect),l.AudioEffectHost)),"f"),Xc(this,Ri,se(this,Cl,"f").own(new de(se(this,us,"f"))),"f"),this.namedParameter=se(this,w_,"m",jP).call(this,r),se(this,Cl,"f").own(se(this,Be,"f").file.catchupAndSubscribe(n=>{Xc(this,zl,n.targetVertex.map(({box:i})=>se(this,us,"f").boxAdapters.adapterFor(i,In)),"f"),se(this,zl,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Be,"f")}get uuid(){return se(this,Be,"f").address.uuid}get address(){return se(this,Be,"f").address}get peakAddress(){return se(this,Be,"f").address.append(1001)}get indexField(){return se(this,Be,"f").index}get gate(){return se(this,Be,"f").gate.getValue()}get exclude(){return se(this,Be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,zl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,zl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Be,"f").icon}get defaultTrackType(){return ve.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return se(this,Be,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return se(this,Be,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return se(this,zl,"f")}fileUUID(){return se(this,Be,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,Be,"f").mute.reset(),se(this,Be,"f").solo.reset(),se(this,Be,"f").exclude.reset(),se(this,Be,"f").polyphone.reset(),se(this,Be,"f").pitch.reset(),se(this,Be,"f").attack.reset(),se(this,Be,"f").release.reset(),se(this,Be,"f").sampleStart.reset(),se(this,Be,"f").sampleEnd.reset(),se(this,Be,"f").gate.reset()}copyToIndex(e){Bo.create(se(this,Be,"f").graph,M.generate(),r=>{r.file.refer(se(this,Be,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,Be,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,Be,"f").mute.getValue()),r.solo.setValue(se(this,Be,"f").solo.getValue()),r.sampleStart.setValue(se(this,Be,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,Be,"f").sampleEnd.getValue()),r.attack.setValue(se(this,Be,"f").attack.getValue()),r.release.setValue(se(this,Be,"f").release.getValue()),r.pitch.setValue(se(this,Be,"f").pitch.getValue()),r.exclude.setValue(se(this,Be,"f").exclude.getValue()),r.gate.setValue(se(this,Be,"f").gate.getValue())})}get midiEffects(){return se(this,Dx,"f")}get inputAdapter(){return b.wrap(this)}get audioEffects(){return se(this,Yf,"f")}get labelField(){return Ie(se(this,Be,"f").file.targetVertex.unwrap("file.target").box,Li).fileName}get enabledField(){return se(this,Be,"f").enabled}get minimizedField(){return se(this,Be,"f").minimized}device(){return se(this,us,"f").boxAdapters.adapterFor(se(this,Be,"f").device.targetVertex.unwrap("device.target").box,Qc)}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,Yf,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,Cl,"f").terminate()}};Cl=new WeakMap,us=new WeakMap,Be=new WeakMap,Dx=new WeakMap,Yf=new WeakMap,Ri=new WeakMap,zl=new WeakMap,w_=new WeakSet,jP=function(e){return{gate:se(this,Ri,"f").createParameter(e.gate,E.linearInteger(0,2),$.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,Ri,"f").createParameter(e.mute,E.bool,$.bool,"Mute"),solo:se(this,Ri,"f").createParameter(e.solo,E.bool,$.bool,"Solo"),polyphone:se(this,Ri,"f").createParameter(e.polyphone,E.bool,$.bool,"Polyphone"),exclude:se(this,Ri,"f").createParameter(e.exclude,E.bool,$.bool,"Exclude"),pitch:se(this,Ri,"f").createParameter(e.pitch,E.linear(-1200,1200),$.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,Ri,"f").createParameter(e.sampleStart,E.unipolar(),$.percent(),"Start",0),sampleEnd:se(this,Ri,"f").createParameter(e.sampleEnd,E.unipolar(),$.percent(),"End",1),attack:se(this,Ri,"f").createParameter(e.attack,E.exponential(.001,5),$.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,Ri,"f").createParameter(e.release,E.exponential(.001,5),$.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Rx=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)},ed,Zn,td,Cx,Qc=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=oe.Playfield,ed.set(this,void 0),Zn.set(this,void 0),td.set(this,void 0),Cx.set(this,void 0),Rx(this,ed,e,"f"),Rx(this,Zn,r,"f"),Rx(this,td,cr.create(r.samples,n=>e.boxAdapters.adapterFor(n,Yc),l.Sample),"f"),Rx(this,Cx,new de(Xr(this,ed,"f")),"f")}reset(){Xr(this,td,"f").adapters().forEach(e=>e.box.delete())}get box(){return Xr(this,Zn,"f")}get uuid(){return Xr(this,Zn,"f").address.uuid}get address(){return Xr(this,Zn,"f").address}get labelField(){return Xr(this,Zn,"f").label}get iconField(){return Xr(this,Zn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return Xr(this,Zn,"f").enabled}get minimizedField(){return Xr(this,Zn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Xr(this,td,"f")}get context(){return Xr(this,ed,"f")}deviceHost(){return Xr(this,ed,"f").boxAdapters.adapterFor(Xr(this,Zn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of Xr(this,td,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){Xr(this,Cx,"f").terminate()}};ed=new WeakMap,Zn=new WeakMap,td=new WeakMap,Cx=new WeakMap;var b_=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)},__,Qf,pn,Ba,KP,zx=class{constructor(e,r){__.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.StereoTool,Qf.set(this,void 0),pn.set(this,void 0),Ba.set(this,void 0),b_(this,Qf,e,"f"),b_(this,pn,r,"f"),b_(this,Ba,new de(mr(this,Qf,"f")),"f"),this.namedParameter=mr(this,__,"m",KP).call(this,r)}get box(){return mr(this,pn,"f")}get uuid(){return mr(this,pn,"f").address.uuid}get address(){return mr(this,pn,"f").address}get indexField(){return mr(this,pn,"f").index}get labelField(){return mr(this,pn,"f").label}get enabledField(){return mr(this,pn,"f").enabled}get minimizedField(){return mr(this,pn,"f").minimized}get host(){return mr(this,pn,"f").host}deviceHost(){return mr(this,Qf,"f").boxAdapters.adapterFor(mr(this,pn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){mr(this,Ba,"f").terminate()}};Qf=new WeakMap,pn=new WeakMap,Ba=new WeakMap,__=new WeakSet,KP=function(e){return{volume:mr(this,Ba,"f").createParameter(e.volume,E.decibel(-72,0,12),$.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:mr(this,Ba,"f").createParameter(e.panning,E.bipolar(),$.panning,"Panning",.5),stereo:mr(this,Ba,"f").createParameter(e.stereo,E.bipolar(),$.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:mr(this,Ba,"f").createParameter(e.invertL,E.bool,$.bool,"Invert Left"),invertR:mr(this,Ba,"f").createParameter(e.invertR,E.bool,$.bool,"Invert Right"),swap:mr(this,Ba,"f").createParameter(e.swap,E.bool,$.bool,"Swap")}};var em;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(em||(em={}));var WP=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},mi=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)},rd,hi,Ox=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Zeitgeist,rd.set(this,void 0),hi.set(this,void 0),WP(this,rd,e,"f"),WP(this,hi,r,"f"),this.groove()}get box(){return mi(this,hi,"f")}get uuid(){return mi(this,hi,"f").address.uuid}get address(){return mi(this,hi,"f").address}get indexField(){return mi(this,hi,"f").index}get labelField(){return mi(this,hi,"f").label}get enabledField(){return mi(this,hi,"f").enabled}get minimizedField(){return mi(this,hi,"f").minimized}get host(){return mi(this,hi,"f").host}deviceHost(){return mi(this,rd,"f").boxAdapters.adapterFor(mi(this,hi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}groove(){return mi(this,rd,"f").boxAdapters.adapterFor(mi(this,hi,"f").groove.targetVertex.unwrap("no groove").box,em.checkType)}catchupAndSubscribeGroove(e){return mi(this,hi,"f").groove.catchupAndSubscribe(r=>e(mi(this,rd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,em.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};rd=new WeakMap,hi=new WeakMap;var LP=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)},Ux,Ci,Vx=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Ux.set(this,void 0),Ci.set(this,void 0),LP(this,Ux,e,"f"),LP(this,Ci,r,"f")}get box(){return Gn(this,Ci,"f")}get uuid(){return Gn(this,Ci,"f").address.uuid}get address(){return Gn(this,Ci,"f").address}get indexField(){return Gn(this,Ci,"f").index}get labelField(){return Gn(this,Ci,"f").label}get enabledField(){return Gn(this,Ci,"f").enabled}get minimizedField(){return Gn(this,Ci,"f").minimized}get host(){return Gn(this,Ci,"f").host}get commentField(){return Gn(this,Ci,"f").comment}deviceHost(){return Gn(this,Ux,"f").boxAdapters.adapterFor(Gn(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Ux=new WeakMap,Ci=new WeakMap;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},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)},jx,zi,Kx=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",jx.set(this,void 0),zi.set(this,void 0),ZP(this,jx,e,"f"),ZP(this,zi,r,"f")}get box(){return Hn(this,zi,"f")}get uuid(){return Hn(this,zi,"f").address.uuid}get address(){return Hn(this,zi,"f").address}get indexField(){return Hn(this,zi,"f").index}get labelField(){return Hn(this,zi,"f").label}get enabledField(){return Hn(this,zi,"f").enabled}get minimizedField(){return Hn(this,zi,"f").minimized}get host(){return Hn(this,zi,"f").host}get commentField(){return Hn(this,zi,"f").comment}deviceHost(){return Hn(this,jx,"f").boxAdapters.adapterFor(Hn(this,zi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};jx=new WeakMap,zi=new WeakMap;var cs=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},je=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_,F_,tm,gi,Wx,id,qn,fn,nd,GP,S_,Lx=class{constructor(e,r){A_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=oe.Soundfont,F_.set(this,new X),tm.set(this,void 0),gi.set(this,void 0),Wx.set(this,void 0),id.set(this,void 0),qn.set(this,void 0),fn.set(this,void 0),nd.set(this,pe.Empty),S_.set(this,n=>n.match({none:()=>{je(this,fn,"f").clear(),je(this,qn,"f").clear()},some:i=>i.soundfont.match({none:()=>{je(this,fn,"f").clear(),je(this,qn,"f").clear(),je(this,nd,"f").terminate(),cs(this,nd,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");je(this,fn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),je(this,qn,"f").wrap(o)}else a.type==="error"?(je(this,fn,"f").clear(),je(this,qn,"f").clear()):a.type==="idle"&&(je(this,fn,"f").clear(),je(this,qn,"f").clear())}),"f")},some:a=>{je(this,qn,"f").wrap(a),je(this,fn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),cs(this,tm,e,"f"),cs(this,gi,r,"f"),cs(this,Wx,new de(je(this,tm,"f")),"f"),this.namedParameter=je(this,A_,"m",GP).call(this,r),cs(this,id,new _r,"f"),cs(this,qn,new _r,"f"),cs(this,fn,new _r,"f"),je(this,F_,"f").ownAll(je(this,id,"f").subscribe(je(this,S_,"f")),je(this,gi,"f").file.catchupAndSubscribe(({targetVertex:n})=>je(this,id,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),je(this,gi,"f").presetIndex.catchupAndSubscribe(n=>je(this,qn,"f").match({none:()=>je(this,fn,"f").clear(),some:i=>je(this,fn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return je(this,id,"f")}get soundfont(){return je(this,qn,"f")}get preset(){return je(this,fn,"f")}get presetIndex(){return je(this,gi,"f").presetIndex.getValue()}get box(){return je(this,gi,"f")}get uuid(){return je(this,gi,"f").address.uuid}get address(){return je(this,gi,"f").address}get labelField(){return je(this,gi,"f").label}get iconField(){return je(this,gi,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return je(this,gi,"f").enabled}get minimizedField(){return je(this,gi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return je(this,tm,"f").boxAdapters.adapterFor(je(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){je(this,nd,"f").terminate(),cs(this,nd,pe.Empty,"f"),je(this,Wx,"f").terminate()}};F_=new WeakMap,tm=new WeakMap,gi=new WeakMap,Wx=new WeakMap,id=new WeakMap,qn=new WeakMap,fn=new WeakMap,nd=new WeakMap,S_=new WeakMap,A_=new WeakSet,GP=function(e){return{}};var HP=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},rm=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,Ol,Gx=class{constructor(e,r){Zx.set(this,void 0),Ol.set(this,void 0),HP(this,Zx,e,"f"),HP(this,Ol,r,"f")}get box(){return rm(this,Ol,"f")}get uuid(){return rm(this,Ol,"f").address.uuid}get address(){return rm(this,Ol,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return rm(this,Zx,"f").soundfontManager.getOrCreate(rm(this,Ol,"f").address.uuid)}terminate(){}};Zx=new WeakMap,Ol=new WeakMap;var E_=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)},P_,im,mn,nm,qP,Hx=class{constructor(e,r){P_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Maximizer,im.set(this,void 0),mn.set(this,void 0),nm.set(this,void 0),E_(this,im,e,"f"),E_(this,mn,r,"f"),E_(this,nm,new de(vi(this,im,"f")),"f"),this.namedParameter=vi(this,P_,"m",qP).call(this,r)}get box(){return vi(this,mn,"f")}get uuid(){return vi(this,mn,"f").address.uuid}get address(){return vi(this,mn,"f").address}get indexField(){return vi(this,mn,"f").index}get labelField(){return vi(this,mn,"f").label}get enabledField(){return vi(this,mn,"f").enabled}get minimizedField(){return vi(this,mn,"f").minimized}get host(){return vi(this,mn,"f").host}deviceHost(){return vi(this,im,"f").boxAdapters.adapterFor(vi(this,mn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){vi(this,nm,"f").terminate()}};im=new WeakMap,mn=new WeakMap,nm=new WeakMap,P_=new WeakSet,qP=function(e){return{threshold:vi(this,nm,"f").createParameter(e.threshold,E.linear(-24,0),$.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},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)},k_,am,Oi,Ur,JP,qx=class{constructor(e,r){k_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Compressor,am.set(this,void 0),Oi.set(this,void 0),Ur.set(this,void 0),$_(this,am,e,"f"),$_(this,Oi,r,"f"),$_(this,Ur,new de(bt(this,am,"f")),"f"),this.namedParameter=bt(this,k_,"m",JP).call(this,r)}get box(){return bt(this,Oi,"f")}get uuid(){return bt(this,Oi,"f").address.uuid}get address(){return bt(this,Oi,"f").address}get indexField(){return bt(this,Oi,"f").index}get labelField(){return bt(this,Oi,"f").label}get enabledField(){return bt(this,Oi,"f").enabled}get minimizedField(){return bt(this,Oi,"f").minimized}get host(){return bt(this,Oi,"f").host}get sideChain(){return bt(this,Oi,"f").sideChain}deviceHost(){return bt(this,am,"f").boxAdapters.adapterFor(bt(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bt(this,Ur,"f").terminate()}};am=new WeakMap,Oi=new WeakMap,Ur=new WeakMap,k_=new WeakSet,JP=function(e){return{lookahead:bt(this,Ur,"f").createParameter(e.lookahead,E.bool,$.bool,"Lookahead"),automakeup:bt(this,Ur,"f").createParameter(e.automakeup,E.bool,$.bool,"Auto Makeup"),autoattack:bt(this,Ur,"f").createParameter(e.autoattack,E.bool,$.bool,"Auto Attack"),autorelease:bt(this,Ur,"f").createParameter(e.autorelease,E.bool,$.bool,"Auto Release"),inputgain:bt(this,Ur,"f").createParameter(e.inputgain,E.linear(-30,30),$.decible,"Input Gain"),threshold:bt(this,Ur,"f").createParameter(e.threshold,E.linear(-60,0),$.decible,"Threshold"),ratio:bt(this,Ur,"f").createParameter(e.ratio,E.exponential(1,24),$.numeric({fractionDigits:1}),"Ratio"),knee:bt(this,Ur,"f").createParameter(e.knee,E.linear(0,24),$.decible,"Knee"),attack:bt(this,Ur,"f").createParameter(e.attack,E.linear(0,100),$.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:bt(this,Ur,"f").createParameter(e.release,E.linear(5,1500),$.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:bt(this,Ur,"f").createParameter(e.makeup,E.linear(-40,40),$.decible,"Makeup Gain"),mix:bt(this,Ur,"f").createParameter(e.mix,E.unipolar(),$.percent(),"Dry/Wet")}};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},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)},N_,om,Ui,Jn,XP,Jx=class{constructor(e,r){N_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Gate,om.set(this,void 0),Ui.set(this,void 0),Jn.set(this,void 0),M_(this,om,e,"f"),M_(this,Ui,r,"f"),M_(this,Jn,new de(Gt(this,om,"f")),"f"),this.namedParameter=Gt(this,N_,"m",XP).call(this,r)}get box(){return Gt(this,Ui,"f")}get uuid(){return Gt(this,Ui,"f").address.uuid}get address(){return Gt(this,Ui,"f").address}get indexField(){return Gt(this,Ui,"f").index}get labelField(){return Gt(this,Ui,"f").label}get enabledField(){return Gt(this,Ui,"f").enabled}get minimizedField(){return Gt(this,Ui,"f").minimized}get host(){return Gt(this,Ui,"f").host}get sideChain(){return Gt(this,Ui,"f").sideChain}deviceHost(){return Gt(this,om,"f").boxAdapters.adapterFor(Gt(this,Ui,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Gt(this,Jn,"f").terminate()}};om=new WeakMap,Ui=new WeakMap,Jn=new WeakMap,N_=new WeakSet,XP=function(e){return{inverse:Gt(this,Jn,"f").createParameter(e.inverse,E.bool,$.bool,"Inverse"),threshold:Gt(this,Jn,"f").createParameter(e.threshold,E.linear(-80,0),$.decible,"Threshold"),return:Gt(this,Jn,"f").createParameter(e.return,E.linear(0,24),$.decible,"Return"),attack:Gt(this,Jn,"f").createParameter(e.attack,E.linear(0,1e3),$.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Gt(this,Jn,"f").createParameter(e.hold,E.linear(0,500),$.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Gt(this,Jn,"f").createParameter(e.release,E.linear(1,2e3),$.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Gt(this,Jn,"f").createParameter(e.floor,E.decibel(-72,-12,0),$.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},$r=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_,sm,hn,ds,YP,Xx=class{constructor(e,r){B_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Crusher,sm.set(this,void 0),hn.set(this,void 0),ds.set(this,void 0),I_(this,sm,e,"f"),I_(this,hn,r,"f"),I_(this,ds,new de($r(this,sm,"f")),"f"),this.namedParameter=$r(this,B_,"m",YP).call(this,r)}get box(){return $r(this,hn,"f")}get uuid(){return $r(this,hn,"f").address.uuid}get address(){return $r(this,hn,"f").address}get indexField(){return $r(this,hn,"f").index}get labelField(){return $r(this,hn,"f").label}get enabledField(){return $r(this,hn,"f").enabled}get minimizedField(){return $r(this,hn,"f").minimized}get host(){return $r(this,hn,"f").host}deviceHost(){return $r(this,sm,"f").boxAdapters.adapterFor($r(this,hn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){$r(this,ds,"f").terminate()}};sm=new WeakMap,hn=new WeakMap,ds=new WeakMap,B_=new WeakSet,YP=function(e){return{crush:$r(this,ds,"f").createParameter(e.crush,E.unipolar(),$.percent(),"Crush"),bits:$r(this,ds,"f").createParameter(e.bits,E.linearInteger(1,16),$.numeric(),"Bits"),boost:$r(this,ds,"f").createParameter(e.boost,E.linear(0,24),$.decible,"Boost"),mix:$r(this,ds,"f").createParameter(e.mix,E.exponential(.001,1),$.percent(),"Mix")}};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},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)},D_,lm,gn,ad,QP,Yx=class{constructor(e,r){D_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Fold,lm.set(this,void 0),gn.set(this,void 0),ad.set(this,void 0),T_(this,lm,e,"f"),T_(this,gn,r,"f"),T_(this,ad,new de(Yr(this,lm,"f")),"f"),this.namedParameter=Yr(this,D_,"m",QP).call(this,r)}get box(){return Yr(this,gn,"f")}get uuid(){return Yr(this,gn,"f").address.uuid}get address(){return Yr(this,gn,"f").address}get indexField(){return Yr(this,gn,"f").index}get labelField(){return Yr(this,gn,"f").label}get enabledField(){return Yr(this,gn,"f").enabled}get minimizedField(){return Yr(this,gn,"f").minimized}get host(){return Yr(this,gn,"f").host}deviceHost(){return Yr(this,lm,"f").boxAdapters.adapterFor(Yr(this,gn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yr(this,ad,"f").terminate()}};lm=new WeakMap,gn=new WeakMap,ad=new WeakMap,D_=new WeakSet,QP=function(e){return{drive:Yr(this,ad,"f").createParameter(e.drive,E.linear(0,30),$.decible,"Drive"),volume:Yr(this,ad,"f").createParameter(e.volume,E.linear(-18,0),$.decible,"Volume")}};var Qx=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)},um,cm,vn,od,sd,ey=class{constructor(e,r){um.set(this,new X),this.type="instrument",this.accepts="midi",this.manualUrl=oe.MIDIOutput,cm.set(this,void 0),vn.set(this,void 0),od.set(this,void 0),sd.set(this,void 0),Qx(this,cm,e,"f"),Qx(this,vn,r,"f"),Qx(this,od,new _r,"f"),Qx(this,sd,sr(this,um,"f").own(new de(sr(this,cm,"f"))),"f"),sr(this,um,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>sr(this,sd,"f").createParameter(Ie(n,Vs).value,E.unipolar(),$.percent({fractionDigits:1}),"",0)),onRemoved:(({box:n})=>sr(this,sd,"f").removeParameter(Ie(n,Vs).value.address))}),sr(this,vn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>sr(this,od,"f").clear(),some:({box:i})=>sr(this,od,"f").wrap(Ie(i,Io))})))}get box(){return sr(this,vn,"f")}get uuid(){return sr(this,vn,"f").address.uuid}get address(){return sr(this,vn,"f").address}get labelField(){return sr(this,vn,"f").label}get iconField(){return sr(this,vn,"f").icon}get defaultTrackType(){return ve.Notes}get enabledField(){return sr(this,vn,"f").enabled}get minimizedField(){return sr(this,vn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return sr(this,sd,"f")}get midiDevice(){return sr(this,od,"f")}deviceHost(){return sr(this,cm,"f").boxAdapters.adapterFor(sr(this,vn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){sr(this,um,"f").terminate()}};um=new WeakMap,cm=new WeakMap,vn=new WeakMap,od=new WeakMap,sd=new WeakMap;var ty=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},Ht=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_,dm,xn,Ta,pm,e$,ry=class{constructor(e,r){R_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=oe.Velocity,dm.set(this,void 0),xn.set(this,void 0),Ta.set(this,void 0),pm.set(this,void 0),ty(this,dm,e,"f"),ty(this,xn,r,"f"),ty(this,Ta,new de(Ht(this,dm,"f")),"f"),ty(this,pm,Ah.create(),"f"),this.namedParameter=Ht(this,R_,"m",e$).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:u}=this.namedParameter;Ht(this,pm,"f").setSeed(a.valueAt(e)+e);let d=r+(n.valueAt(e)-r)*i.valueAt(e),m=(Ht(this,pm,"f").uniform()*2-1)*o.valueAt(e),x=s.valueAt(e),g=u.valueAt(e);return r*(1-g)+OE(d+m+x)*g}get box(){return Ht(this,xn,"f")}get uuid(){return Ht(this,xn,"f").address.uuid}get address(){return Ht(this,xn,"f").address}get indexField(){return Ht(this,xn,"f").index}get labelField(){return Ht(this,xn,"f").label}get enabledField(){return Ht(this,xn,"f").enabled}get minimizedField(){return Ht(this,xn,"f").minimized}get host(){return Ht(this,xn,"f").host}deviceHost(){return Ht(this,dm,"f").boxAdapters.adapterFor(Ht(this,xn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ht(this,Ta,"f").terminate()}};dm=new WeakMap,xn=new WeakMap,Ta=new WeakMap,pm=new WeakMap,R_=new WeakSet,e$=function(e){return{magnetPosition:Ht(this,Ta,"f").createParameter(e.magnetPosition,E.unipolar(),$.percent(),"Position"),magnetStrength:Ht(this,Ta,"f").createParameter(e.magnetStrength,E.unipolar(),$.percent(),"Strength"),randomSeed:Ht(this,Ta,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),$.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Ht(this,Ta,"f").createParameter(e.randomAmount,E.unipolar(),$.percent(),"Amount"),offset:Ht(this,Ta,"f").createParameter(e.offset,E.bipolar(),$.percent(),"Offset"),mix:Ht(this,Ta,"f").createParameter(e.mix,E.unipolar(),$.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},hr=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_,O_,fm,yn,Da,t$,Ul=class{constructor(e,r){z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Tidal,fm.set(this,void 0),yn.set(this,void 0),Da.set(this,void 0),C_(this,fm,e,"f"),C_(this,yn,r,"f"),C_(this,Da,new de(hr(this,fm,"f")),"f"),this.namedParameter=hr(this,z_,"m",t$).call(this,r)}get box(){return hr(this,yn,"f")}get uuid(){return hr(this,yn,"f").address.uuid}get address(){return hr(this,yn,"f").address}get indexField(){return hr(this,yn,"f").index}get labelField(){return hr(this,yn,"f").label}get enabledField(){return hr(this,yn,"f").enabled}get minimizedField(){return hr(this,yn,"f").minimized}get host(){return hr(this,yn,"f").host}deviceHost(){return hr(this,fm,"f").boxAdapters.adapterFor(hr(this,yn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){hr(this,Da,"f").terminate()}};O_=Ul,fm=new WeakMap,yn=new WeakMap,Da=new WeakMap,z_=new WeakSet,t$=function(e){let{RateFractions:r,RateStringMapping:n}=O_;return{slope:hr(this,Da,"f").createParameter(e.slope,E.bipolar(),$.percent({fractionDigits:1}),"Slope",.5),symmetry:hr(this,Da,"f").createParameter(e.symmetry,E.unipolar(),$.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:hr(this,Da,"f").createParameter(e.rate,E.values(r.map((i,a)=>a)),n,"Rate",0),depth:hr(this,Da,"f").createParameter(e.depth,E.unipolar(),$.percent({fractionDigits:1}),"Depth",0),offset:hr(this,Da,"f").createParameter(e.offset,E.linear(-180,180),$.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:hr(this,Da,"f").createParameter(e.channelOffset,E.linear(-180,180),$.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Ul.RateFractions=Ao.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();Ul.RateStringMapping=$.indices("",O_.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},_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)},V_,mm,Qr,xi,r$,iy=class{constructor(e,r){V_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Vocoder,mm.set(this,void 0),Qr.set(this,void 0),xi.set(this,void 0),U_(this,mm,e,"f"),U_(this,Qr,r,"f"),U_(this,xi,new de(_t(this,mm,"f")),"f"),this.namedParameter=_t(this,V_,"m",r$).call(this,r)}get box(){return _t(this,Qr,"f")}get uuid(){return _t(this,Qr,"f").address.uuid}get address(){return _t(this,Qr,"f").address}get indexField(){return _t(this,Qr,"f").index}get labelField(){return _t(this,Qr,"f").label}get enabledField(){return _t(this,Qr,"f").enabled}get minimizedField(){return _t(this,Qr,"f").minimized}get host(){return _t(this,Qr,"f").host}get sideChain(){return _t(this,Qr,"f").sideChain}get modulatorSpectrum(){return _t(this,Qr,"f").address.append(4094)}get carrierSpectrum(){return _t(this,Qr,"f").address.append(4095)}deviceHost(){return _t(this,mm,"f").boxAdapters.adapterFor(_t(this,Qr,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_t(this,xi,"f").terminate()}};mm=new WeakMap,Qr=new WeakMap,xi=new WeakMap,V_=new WeakSet,r$=function(e){let r=E.exponential(20,2e4),n=$.numeric({unit:"Hz",fractionDigits:0}),i=E.exponential(1,60),a=$.numeric({fractionDigits:1});return{carrierMinFreq:_t(this,xi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:_t(this,xi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:_t(this,xi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:_t(this,xi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:_t(this,xi,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:_t(this,xi,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:_t(this,xi,"f").createParameter(e.envAttack,E.exponential(.1,100),$.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:_t(this,xi,"f").createParameter(e.envRelease,E.exponential(1,1e3),$.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:_t(this,xi,"f").createParameter(e.gain,E.linear(-20,20),$.decible,"Gain"),mix:_t(this,xi,"f").createParameter(e.mix,E.unipolar(),$.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},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)},K_,hm,wn,Vr,i$,ny=class{constructor(e,r){K_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.DattorroReverb,hm.set(this,void 0),wn.set(this,void 0),Vr.set(this,void 0),j_(this,hm,e,"f"),j_(this,wn,r,"f"),j_(this,Vr,new de(Et(this,hm,"f")),"f"),this.namedParameter=Et(this,K_,"m",i$).call(this,r)}get box(){return Et(this,wn,"f")}get uuid(){return Et(this,wn,"f").address.uuid}get address(){return Et(this,wn,"f").address}get indexField(){return Et(this,wn,"f").index}get labelField(){return Et(this,wn,"f").label}get enabledField(){return Et(this,wn,"f").enabled}get minimizedField(){return Et(this,wn,"f").minimized}get host(){return Et(this,wn,"f").host}deviceHost(){return Et(this,hm,"f").boxAdapters.adapterFor(Et(this,wn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Et(this,Vr,"f").terminate()}};hm=new WeakMap,wn=new WeakMap,Vr=new WeakMap,K_=new WeakSet,i$=function(e){return{preDelay:Et(this,Vr,"f").createParameter(e.preDelay,E.linear(0,1e3),$.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Et(this,Vr,"f").createParameter(e.bandwidth,E.unipolar(),$.percent(),"Bandwidth"),inputDiffusion1:Et(this,Vr,"f").createParameter(e.inputDiffusion1,E.unipolar(),$.percent(),"Tank 1"),inputDiffusion2:Et(this,Vr,"f").createParameter(e.inputDiffusion2,E.unipolar(),$.percent(),"Tank 2"),decay:Et(this,Vr,"f").createParameter(e.decay,E.unipolar(),$.percent(),"Decay"),decayDiffusion1:Et(this,Vr,"f").createParameter(e.decayDiffusion1,E.unipolar(),$.percent(),"Tank 1"),decayDiffusion2:Et(this,Vr,"f").createParameter(e.decayDiffusion2,E.unipolar(),$.percent(),"Tank 2"),damping:Et(this,Vr,"f").createParameter(e.damping,E.unipolar(),$.percent(),"Damping"),excursionRate:Et(this,Vr,"f").createParameter(e.excursionRate,E.unipolar(),$.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Et(this,Vr,"f").createParameter(e.excursionDepth,E.unipolar(),$.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Et(this,Vr,"f").createParameter(e.wet,E.DefaultDecibel,$.decible,"Wet"),dry:Et(this,Vr,"f").createParameter(e.dry,E.DefaultDecibel,$.decible,"Dry")}};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},ld=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_,mo,ud=class{constructor(e,r){W_.set(this,void 0),mo.set(this,void 0),n$(this,W_,e,"f"),n$(this,mo,r,"f")}get box(){return ld(this,mo,"f")}get uuid(){return ld(this,mo,"f").address.uuid}get address(){return ld(this,mo,"f").address}get labelField(){return ld(this,mo,"f").label}get modelField(){return ld(this,mo,"f").model}getModelJson(){return ld(this,mo,"f").model.getValue()}terminate(){}};W_=new WeakMap,mo=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},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)},Z_,cd,kr,Vl,a$,ay=class{constructor(e,r){Z_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.NeuralAmp,cd.set(this,void 0),kr.set(this,void 0),Vl.set(this,void 0),L_(this,cd,e,"f"),L_(this,kr,r,"f"),L_(this,Vl,new de(Vt(this,cd,"f")),"f"),this.namedParameter=Vt(this,Z_,"m",a$).call(this,r)}get box(){return Vt(this,kr,"f")}get uuid(){return Vt(this,kr,"f").address.uuid}get address(){return Vt(this,kr,"f").address}get indexField(){return Vt(this,kr,"f").index}get labelField(){return Vt(this,kr,"f").label}get enabledField(){return Vt(this,kr,"f").enabled}get minimizedField(){return Vt(this,kr,"f").minimized}get host(){return Vt(this,kr,"f").host}get modelField(){return Vt(this,kr,"f").model}get monoField(){return Vt(this,kr,"f").mono}get spectrum(){return Vt(this,kr,"f").address.append(4095)}getModelAdapter(){let e=Vt(this,kr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Vt(this,cd,"f").boxAdapters.adapterFor(e.unwrap().box,ud))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Vt(this,kr,"f").modelJson.getValue()}deviceHost(){return Vt(this,cd,"f").boxAdapters.adapterFor(Vt(this,kr,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Vt(this,Vl,"f").terminate()}};cd=new WeakMap,kr=new WeakMap,Vl=new WeakMap,Z_=new WeakSet,a$=function(e){return{inputGain:Vt(this,Vl,"f").createParameter(e.inputGain,E.decibel(-72,0,12),$.numeric({unit:"dB",fractionDigits:1}),"input"),outputGain:Vt(this,Vl,"f").createParameter(e.outputGain,E.decibel(-72,0,12),$.numeric({unit:"dB",fractionDigits:1}),"output"),mix:Vt(this,Vl,"f").createParameter(e.mix,E.linear(0,1),$.percent(),"Mix")}};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},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)},H_,gm,bn,jl,o$,oy=class{constructor(e,r){H_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Waveshaper,gm.set(this,void 0),bn.set(this,void 0),jl.set(this,void 0),G_(this,gm,e,"f"),G_(this,bn,r,"f"),G_(this,jl,new de(jr(this,gm,"f")),"f"),this.namedParameter=jr(this,H_,"m",o$).call(this,r)}get box(){return jr(this,bn,"f")}get uuid(){return jr(this,bn,"f").address.uuid}get address(){return jr(this,bn,"f").address}get indexField(){return jr(this,bn,"f").index}get labelField(){return jr(this,bn,"f").label}get enabledField(){return jr(this,bn,"f").enabled}get minimizedField(){return jr(this,bn,"f").minimized}get host(){return jr(this,bn,"f").host}deviceHost(){return jr(this,gm,"f").boxAdapters.adapterFor(jr(this,bn,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){jr(this,jl,"f").terminate()}};gm=new WeakMap,bn=new WeakMap,jl=new WeakMap,H_=new WeakSet,o$=function(e){return{inputGain:jr(this,jl,"f").createParameter(e.inputGain,E.linear(0,40),$.decible,"Input"),outputGain:jr(this,jl,"f").createParameter(e.outputGain,E.linear(-24,24),$.decible,"Output"),mix:jr(this,jl,"f").createParameter(e.mix,E.unipolar(),$.percent(),"Mix")}};var sy=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)},vm,xm,_n,ym,ly,uy=class{constructor(e,r){vm.set(this,new X),this.type="audio-effect",this.accepts="audio",this.manualUrl=oe.Werkstatt,xm.set(this,void 0),_n.set(this,void 0),ym.set(this,void 0),ly.set(this,void 0),sy(this,xm,e,"f"),sy(this,_n,r,"f"),sy(this,ym,Mr(this,vm,"f").own(new de(Mr(this,xm,"f"))),"f");let{terminable:n,codeChanged:i}=yr.subscribeScriptParams(Mr(this,ym,"f"),r.code,r.parameters);Mr(this,vm,"f").own(n),sy(this,ly,i,"f")}get box(){return Mr(this,_n,"f")}get uuid(){return Mr(this,_n,"f").address.uuid}get address(){return Mr(this,_n,"f").address}get indexField(){return Mr(this,_n,"f").index}get labelField(){return Mr(this,_n,"f").label}get enabledField(){return Mr(this,_n,"f").enabled}get minimizedField(){return Mr(this,_n,"f").minimized}get host(){return Mr(this,_n,"f").host}get parameters(){return Mr(this,ym,"f")}get codeChanged(){return Mr(this,ly,"f")}deviceHost(){return Mr(this,xm,"f").boxAdapters.adapterFor(Mr(this,_n,"f").host.targetVertex.unwrap("no device-host").box,ae.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Mr(this,vm,"f").terminate()}};vm=new WeakMap,xm=new WeakMap,_n=new WeakMap,ym=new WeakMap,ly=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)},BB,le,TB,DB,RB,CB;le=new WeakMap,TB=new WeakMap,DB=new WeakMap,RB=new WeakMap,BB=new WeakSet,CB=function(e){return ze(e.accept({visitArpeggioDeviceBox:r=>new Dl(ue(this,le,"f"),r),visitAudioBusBox:r=>new Ei(ue(this,le,"f"),r),visitAudioClipBox:r=>new Ju(ue(this,le,"f"),r),visitAudioFileBox:r=>new In(ue(this,le,"f"),r),visitAudioTimeStretchBox:r=>new va(ue(this,le,"f"),r),visitAudioPitchStretchBox:r=>new ga(ue(this,le,"f"),r),visitAudioSignalsmithBox:r=>new xa(ue(this,le,"f"),r),visitTransientMarkerBox:r=>new Uu(r),visitWarpMarkerBox:r=>new ma(ue(this,le,"f"),r),visitApparatDeviceBox:r=>new Bx(ue(this,le,"f"),r),visitAudioRegionBox:r=>new pc(ue(this,le,"f"),r),visitAudioUnitBox:r=>new tn(ue(this,le,"f"),r),visitAuxSendBox:r=>new Sc(ue(this,le,"f"),r),visitMaximizerDeviceBox:r=>new Hx(ue(this,le,"f"),r),visitCompressorDeviceBox:r=>new qx(ue(this,le,"f"),r),visitGateDeviceBox:r=>new Jx(ue(this,le,"f"),r),visitCrusherDeviceBox:r=>new Xx(ue(this,le,"f"),r),visitDattorroReverbDeviceBox:r=>new ny(ue(this,le,"f"),r),visitDelayDeviceBox:r=>new Un(ue(this,le,"f"),r),visitDeviceInterfaceKnobBox:r=>new Oc(ue(this,le,"f"),r),visitTidalDeviceBox:r=>new Ul(ue(this,le,"f"),r),visitFoldDeviceBox:r=>new Yx(ue(this,le,"f"),r),visitGrooveShuffleBox:r=>new ka(ue(this,le,"f"),r),visitMarkerBox:r=>new Yo(ue(this,le,"f"),r),visitSignatureEventBox:r=>new Al(ue(this,le,"f"),r),visitMIDIOutputDeviceBox:r=>new ey(ue(this,le,"f"),r),visitModularAudioInputBox:r=>new Cc(ue(this,le,"f"),r),visitModularAudioOutputBox:r=>new Tc(ue(this,le,"f"),r),visitModularBox:r=>new is(ue(this,le,"f"),r),visitModularDeviceBox:r=>new Vc(ue(this,le,"f"),r),visitModuleConnectionBox:r=>new rs(ue(this,le,"f"),r),visitModuleDelayBox:r=>new Bc(ue(this,le,"f"),r),visitModuleGainBox:r=>new Dc(ue(this,le,"f"),r),visitModuleMultiplierBox:r=>new Rc(ue(this,le,"f"),r),visitNanoDeviceBox:r=>new Tx(ue(this,le,"f"),r),visitNeuralAmpDeviceBox:r=>new ay(ue(this,le,"f"),r),visitNeuralAmpModelBox:r=>new ud(ue(this,le,"f"),r),visitNoteClipBox:r=>new ec(ue(this,le,"f"),r),visitNoteEventBox:r=>new il(ue(this,le,"f"),r),visitNoteEventCollectionBox:r=>new Ji(ue(this,le,"f"),r),visitNoteRegionBox:r=>new mc(ue(this,le,"f"),r),visitPitchDeviceBox:r=>new Px(ue(this,le,"f"),r),visitPlayfieldDeviceBox:r=>new Qc(ue(this,le,"f"),r),visitPlayfieldSampleBox:r=>new Yc(ue(this,le,"f"),r),visitRevampDeviceBox:r=>new Ov(ue(this,le,"f"),r),visitReverbDeviceBox:r=>new zv(ue(this,le,"f"),r),visitRootBox:r=>new Ax(ue(this,le,"f"),r),visitSoundfontDeviceBox:r=>new Lx(ue(this,le,"f"),r),visitSoundfontFileBox:r=>new Gx(ue(this,le,"f"),r),visitSpielwerkDeviceBox:r=>new Mx(ue(this,le,"f"),r),visitStereoToolDeviceBox:r=>new zx(ue(this,le,"f"),r),visitTapeDeviceBox:r=>new Fx(ue(this,le,"f"),r),visitTimelineBox:r=>new Pa(ue(this,le,"f"),r),visitTrackBox:r=>new tr(ue(this,le,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Vx(ue(this,le,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Kx(ue(this,le,"f"),r),visitValueClipBox:r=>new Oo(ue(this,le,"f"),r),visitValueEventBox:r=>new Ya(ue(this,le,"f"),r),visitValueEventCollectionBox:r=>new Fr(ue(this,le,"f"),r),visitValueRegionBox:r=>new ao(ue(this,le,"f"),r),visitVaporisateurDeviceBox:r=>new Sx(ue(this,le,"f"),r),visitVocoderDeviceBox:r=>new iy(ue(this,le,"f"),r),visitWaveshaperDeviceBox:r=>new oy(ue(this,le,"f"),r),visitWerkstattDeviceBox:r=>new uy(ue(this,le,"f"),r),visitVelocityDeviceBox:r=>new ry(ue(this,le,"f"),r),visitZeitgeistDeviceBox:r=>new Ox(ue(this,le,"f"),r)}),`Could not find factory for ${e}`)};var dd;(function(t){t.PEAKS=Oe.compose(M.Lowest).append(0),t.SPECTRUM=Oe.compose(M.Lowest).append(1),t.WAVEFORM=Oe.compose(M.Lowest).append(2)})(dd||(dd={}));var s$;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>K(r.stems)?Object.keys(r.stems).length+(K(r.metronome?.stem)?1:0):1}),t.isMetronomeAudible=e=>e.match({none:()=>!1,some:r=>K(r.stems)?K(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 K(n)&&r.push(n.fileName),r},t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{let r=e.metronome?.stem;if(!K(e.stems)&&!K(r))return;let n=e.stems??{},i=new Map,a=o=>{let s=i.get(o)??0,u=o;for(;i.has(u);)s++,u=`${o} ${s}`;return i.set(o,s),i.set(u,1),u};Object.keys(n).forEach(o=>{let s=n[o];s.fileName=a(t.sanitizeFileName(s.fileName))}),K(r)&&(r.fileName=a(t.sanitizeFileName(r.fileName)))}})(s$||(s$={}));var cy=512,l$=_i.createBuilder({position:_i.float,bpm:_i.float,playbackTimestamp:_i.float,countInBeatsRemaining:_i.float,isPlaying:_i.bool,isCountingIn:_i.bool,isRecording:_i.bool,perfIndex:_i.int32,perfBuffer:_i.floats(cy)});var u$;(function(t){t.store=(e,r,n)=>{if(n==="")return V("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof $n&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};Sb(i)?a(i):$n.create(e.graph,M.generate(),a)},t.read=(e,r)=>{if(r==="")return V("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof $n&&i.origin.getValue()===r);if(Sb(n)){let{status:i,value:a,error:o}=Ct(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return V("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof $n&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return V("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=M.newSet(s=>s.uuid),a=s=>{let{status:u,value:d,error:m}=Ct(()=>JSON.parse(s.value.getValue()));u==="success"?n(b.wrap(d)):(console.warn(m),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof $n)||s.origin.getValue()!==r)return;let u=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:u})},onRemoved:({box:s})=>{if(!(s instanceof $n)||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()}}}})(u$||(u$={}));var zB,OB,UB,VB;zB=new WeakMap,OB=new WeakMap,UB=new WeakMap,VB=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)=>{ta(r)||(t.isNoteOn(r)?P(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?P(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?P(n.pitchBend,t.asPitchBend(r)):t.isController(r)?P(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?P(n.clock):t.isStart(r)?P(n.start):t.isContinue(r)?P(n.continue):t.isStop(r)?P(n.stop):t.isPosition(r)&&P(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 ho;(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 V("Unknown MIDI event")}})(ho||(ho={}));var c$;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(ho.on(r,n,i)),{terminate:()=>{a&&(e(ho.off(r,n)),a=!1)}}}})(c$||(c$={}));var d$=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)},jB,KB,p$,f$,WB,LB;KB=new WeakMap,p$=new WeakMap,f$=new WeakMap,WB=new WeakMap,jB=new WeakSet,LB=function(e,r){return e.subscribeIntegers(r,n=>{d$(this,p$,"f").replace(n.buffer)&&d$(this,f$,"f").notify(this)})};var ZB,GB,HB,qB,JB,XB;ZB=new WeakMap,GB=new WeakMap,HB=new WeakMap,qB=new WeakMap,JB=new WeakMap,XB=new WeakMap;var Xn={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})??V("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var dy={min:30,max:1e3,default:120};var py;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?wr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?wr.err("Denominator must be a power of two between 1 and 32"):wr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?at(e,dy.min,dy.max):dy.default,t.clampBaseFrequency=e=>Number.isFinite(e)?at(e,Dv.min,Dv.max):Dv.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of ce.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>Xn.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof No&&i.timeBase.getValue()===Lr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(py||(py={}));var m$;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return py.isTimeSignatureValid(i,a)}})(m$||(m$={}));var h$;(function(t){t.reader=(e,r)=>{let n=`
4
4
  onmessage = (event) => {
5
5
  const {sab, numChunks, numberOfChannels, bufferSize} = event.data
6
6
  const pointers = new Int32Array(sab, 0, 2)
@@ -32,7 +32,7 @@ var vB=Object.defineProperty;var Va=(t,e)=>{for(var r in e)vB(t,r,{get:e[r],enum
32
32
  }
33
33
  }
34
34
  `,i=URL.createObjectURL(new Blob([n],{type:"application/javascript"})),a=new Worker(i);return a.onmessage=o=>{let s=o.data;for(let u of s)r(u)},a.postMessage(e),{stop:()=>{a.terminate(),URL.revokeObjectURL(i)}}},t.writer=({sab:e,numChunks:r,numberOfChannels:n,bufferSize:i})=>{let a=new Int32Array(e,0,2),o=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==n)return;for(let m of s)if(m.length!==i)return V("Each channel buffer must contain 'bufferSize' samples");let u=Atomics.load(a,0),d=u*n*i;s.forEach((m,x)=>o.set(m,d+x*i)),Atomics.store(a,0,(u+1)%r),Atomics.notify(a,0)}})}})(h$||(h$={}));var YB=1,QB=t=>new RegExp(`^// @${t} (\\w+) (\\d+) (\\d+)
35
- `),fy=(t,e)=>{let r=t.match(e);return r!==null?{userCode:t.slice(r[0].length),update:parseInt(r[3])}:{userCode:t,update:0}},J_=new WeakMap,eT=(t,e,r)=>{let n=t.graph,i=J_.get(t)??new Map,a=t.parameters.pointerHub.filter(),o=new Map;for(let d of a){let m=Ie(d.box,pa);o.set(m.label.getValue(),m)}let s=new Set;for(let{label:d}of e)s.add(d);for(let[d,m]of o)s.has(d)||m.delete();s.clear();let u=new Map;for(let d of e){if(s.has(d.label))continue;s.add(d.label);let m=r.get(d.label)??0,x=o.get(d.label),g=i.get(d.label),w=!W(g)||!yr.isEqual(g,d);W(x)&&w&&(x.delete(),o.delete(d.label));let A=o.get(d.label);W(A)?A.index.getValue()!==m&&A.index.setValue(m):pa.create(n,M.generate(),_=>{_.owner.refer(t.parameters),_.label.setValue(d.label),_.index.setValue(m),_.value.setValue(d.defaultValue),_.defaultValue.setValue(d.defaultValue)}),u.set(d.label,d)}J_.set(t,u)},tT=(t,e,r)=>{let n=t.graph,i=t.samples.pointerHub.filter(),a=new Map;for(let s of i){let u=Ie(s.box,js);a.set(u.label.getValue(),u)}let o=new Set;for(let{label:s}of e)o.add(s);for(let[s,u]of a)o.has(s)||(u.file.targetVertex.ifSome(({box:d})=>{let m=d.pointerHub.size()===1;u.file.defer(),m&&d.delete()}),u.delete());o.clear();for(let s of e){if(o.has(s.label))continue;o.add(s.label);let u=r.get(s.label)??0,d=a.get(s.label);W(d)?d.index.getValue()!==u&&d.index.setValue(u):js.create(n,M.generate(),m=>{m.owner.refer(t.samples),m.label.setValue(s.label),m.index.setValue(u)})}},q_=(t,e,r,n)=>{let i=yr.parseDeclarationOrder(n),a=yr.parseParams(n).map(s=>({label:s.label,index:i.get(s.label)??0,mapping:s.mapping,min:s.min,max:s.max,unit:s.unit})),o=yr.parseSamples(n).map(s=>({label:s.label,index:i.get(s.label)??0}));return`
35
+ `),fy=(t,e)=>{let r=t.match(e);return r!==null?{userCode:t.slice(r[0].length),update:parseInt(r[3])}:{userCode:t,update:0}},J_=new WeakMap,eT=(t,e,r)=>{let n=t.graph,i=J_.get(t)??new Map,a=t.parameters.pointerHub.filter(),o=new Map;for(let d of a){let m=Ie(d.box,pa);o.set(m.label.getValue(),m)}let s=new Set;for(let{label:d}of e)s.add(d);for(let[d,m]of o)s.has(d)||m.delete();s.clear();let u=new Map;for(let d of e){if(s.has(d.label))continue;s.add(d.label);let m=r.get(d.label)??0,x=o.get(d.label),g=i.get(d.label),w=!K(g)||!yr.isEqual(g,d);K(x)&&w&&(x.delete(),o.delete(d.label));let A=o.get(d.label);K(A)?A.index.getValue()!==m&&A.index.setValue(m):pa.create(n,M.generate(),_=>{_.owner.refer(t.parameters),_.label.setValue(d.label),_.index.setValue(m),_.value.setValue(d.defaultValue),_.defaultValue.setValue(d.defaultValue)}),u.set(d.label,d)}J_.set(t,u)},tT=(t,e,r)=>{let n=t.graph,i=t.samples.pointerHub.filter(),a=new Map;for(let s of i){let u=Ie(s.box,js);a.set(u.label.getValue(),u)}let o=new Set;for(let{label:s}of e)o.add(s);for(let[s,u]of a)o.has(s)||(u.file.targetVertex.ifSome(({box:d})=>{let m=d.pointerHub.size()===1;u.file.defer(),m&&d.delete()}),u.delete());o.clear();for(let s of e){if(o.has(s.label))continue;o.add(s.label);let u=r.get(s.label)??0,d=a.get(s.label);K(d)?d.index.getValue()!==u&&d.index.setValue(u):js.create(n,M.generate(),m=>{m.owner.refer(t.samples),m.label.setValue(s.label),m.index.setValue(u)})}},q_=(t,e,r,n)=>{let i=yr.parseDeclarationOrder(n),a=yr.parseParams(n).map(s=>({label:s.label,index:i.get(s.label)??0,mapping:s.mapping,min:s.min,max:s.max,unit:s.unit})),o=yr.parseSamples(n).map(s=>({label:s.label,index:i.get(s.label)??0}));return`
36
36
  if (typeof globalThis.openDAW === "undefined") { globalThis.openDAW = {} }
37
37
  if (typeof globalThis.openDAW.${t.registryName} === "undefined") { globalThis.openDAW.${t.registryName} = {} }
38
38
  globalThis.openDAW.${t.registryName}["${e}"] = {
@@ -45,10 +45,10 @@ var vB=Object.defineProperty;var Va=(t,e)=>{for(var r in e)vB(t,r,{get:e[r],enum
45
45
  samples: ${JSON.stringify(o)}
46
46
  }
47
47
  `},g$=t=>{new Function(t)},v$=async(t,e)=>{let r=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(r);try{await t.audioWorklet.addModule(n)}finally{URL.revokeObjectURL(n)}},x$;(function(t){t.wrap=q_,t.create=e=>{let r=QB(e.headerTag),n=a=>`// @${e.headerTag} js ${YB} ${a}
48
- `,i=0;return{stripHeader:a=>fy(a,r).userCode,load:async(a,o)=>{let{userCode:s,update:u}=fy(o.code.getValue(),r);if(u===0)return;let d=yr.parseParams(s),m=new Map;for(let w of d)m.set(w.label,w);J_.set(o,m);let x=M.toString(o.address.uuid),g=q_(e,x,u,s);return g$(g),v$(a,g)},compile:async(a,o,s,u,d=!1)=>{let m=fy(u,r).userCode,x=fy(s.code.getValue(),r).update;i=Math.max(i,x);let g=i+1;i=g;let w=M.toString(s.address.uuid),A=yr.parseParams(m),_=yr.parseSamples(m),C=yr.parseDeclarationOrder(m),K=q_(e,w,g,m);g$(K);let U=yr.parseLabel(m),ee=()=>{s.code.setValue(n(g)+m),U.ifSome(re=>s.label.setValue(re)),eT(s,A,C),tT(s,_,C)};return d?o.append(ee):o.modify(ee),v$(a,K)}}}})(x$||(x$={}));var X_={isRegion:t=>Xn.isRegionBox(t.box),isLoopableRegion:t=>Xn.isLoopableRegionBox(t.box)};var 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)},Mt=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},y$,my,Y_,hy,wm,fs,Kl,Wl,rT,iT,w$,nT,aT,Ll,Zl,Gl,gy,b$,oT,sT,lT,uT,cT;my=new WeakMap,Y_=new WeakMap,hy=new WeakMap,wm=new WeakMap,fs=new WeakMap,Kl=new WeakMap,Wl=new WeakMap,y$=new WeakSet,rT=function(e,r){Mt(this,my,e,"f"),Mt(this,Y_,r,"f"),Mt(this,hy,-2,"f"),Mt(this,wm,Number.NEGATIVE_INFINITY,"f"),Mt(this,fs,0,"f"),Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f")},iT=function(e){let r=st(this,my,"f");if(r.length===0)return st(this,Y_,"f");let n=st(this,y$,"m",w$).call(this,e);if(n===st(this,hy,"f")&&e===st(this,wm,"f")+$h)return Mt(this,wm,e,"f"),Mt(this,fs,st(this,Kl,"f")*st(this,fs,"f")+st(this,Wl,"f"),"f");if(Mt(this,hy,n,"f"),Mt(this,wm,e,"f"),n<0)return Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f"),Mt(this,fs,n===-1?r[0].value:r[r.length-1].value,"f");let i=r[n],a=r[n+1],o=i.interpolation;if(o.type==="none")return Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f"),Mt(this,fs,i.value,"f");if(o.type==="linear")return Mt(this,Kl,1,"f"),Mt(this,Wl,(a.value-i.value)*$h/(a.position-i.position),"f"),Mt(this,fs,i.value+(e-i.position)/(a.position-i.position)*(a.value-i.value),"f");{let{m:s,q:u}=Jt.coefficients({slope:o.slope,steps:(a.position-i.position)/$h,y0:i.value,y1:a.value});return Mt(this,Kl,s,"f"),Mt(this,Wl,u,"f"),Mt(this,fs,Jt.valueAt({slope:o.slope,steps:a.position-i.position,y0:i.value,y1:a.value},e-i.position),"f")}},w$=function(e){let r=st(this,my,"f");if(e<r[0].position)return-1;let n=r.length-1;if(e>=r[n].position)return-3;let i=0,a=n;for(;i<a;){let o=i+a+1>>1;r[o].position<=e?i=o:a=o-1}return i};aT=new WeakMap,Ll=new WeakMap,Zl=new WeakMap,Gl=new WeakMap,gy=new WeakMap,b$=new WeakMap,oT=new WeakMap,sT=new WeakMap,nT=new WeakSet,lT=function(){st(this,Zl,"f").length=0,st(this,Gl,"f").length=0,Mt(this,b$,Number.NaN,"f");let e=st(this,Ll,"f").tempoTrackEvents;if(e.isEmpty())return;let r=e.unwrap();if(r.events.isEmpty())return;let n=r.events.asArray(),i=st(this,Ll,"f").box.bpm.getValue(),a=[{ppqn:0,seconds:0,bpm:r.valueAt(0,i)}],o=0,s=0;for(let d of n){let m=d.position;m<=s||(o+=st(this,gy,"f").integrate(n,s,m,i),s=m,a.push({ppqn:m,seconds:o,bpm:r.valueAt(m,i)}))}st(this,Zl,"f").push(...a);let u=a.slice().sort((d,m)=>d.seconds-m.seconds);st(this,Gl,"f").push(...u)},uT=function(e){if(e<=0)return 0;let r=st(this,Ll,"f").box.bpm.getValue(),n=st(this,Ll,"f").tempoTrackEvents;if(n.isEmpty())return Me.pulsesToSeconds(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.pulsesToSeconds(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Zl,"f").length>0){let u=ht.rightMostMapped(st(this,Zl,"f"),e,bo,d=>d.ppqn);if(u>=0){let d=st(this,Zl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Zl,"f").length-1)return s+Me.pulsesToSeconds(e-o,d.bpm)}}return s+st(this,gy,"f").integrate(a,o,e,r)},cT=function(e){if(e<=0)return 0;let r=st(this,Ll,"f").box.bpm.getValue(),n=st(this,Ll,"f").tempoTrackEvents;if(n.isEmpty())return Me.secondsToPulses(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.secondsToPulses(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Gl,"f").length>0){let u=ht.rightMostMapped(st(this,Gl,"f"),e,bo,d=>d.seconds);if(u>=0){let d=st(this,Gl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Gl,"f").length-1)return o+Me.secondsToPulses(e-s,d.bpm)}}return st(this,gy,"f").advance(a,o,s,e,r)};var _$;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Loop=2]="Loop"})(_$||(_$={}));var dT,pT,fT,mT;dT=new WeakMap,pT=new WeakMap,fT=new WeakMap,mT=new WeakMap;var hT,gT,vT,xT;hT=new WeakMap,gT=new WeakMap,vT=new WeakMap,xT=new WeakMap;var ke={};Va(ke,{$brand:()=>e0,$input:()=>b1,$output:()=>w1,NEVER:()=>Q_,TimePrecision:()=>S1,ZodAny:()=>mS,ZodArray:()=>xS,ZodBase64:()=>Kw,ZodBase64URL:()=>Ww,ZodBigInt:()=>jd,ZodBigIntFormat:()=>Gw,ZodBoolean:()=>Vd,ZodCIDRv4:()=>Vw,ZodCIDRv6:()=>jw,ZodCUID:()=>Tw,ZodCUID2:()=>Dw,ZodCatch:()=>US,ZodCodec:()=>Ym,ZodCustom:()=>Qm,ZodCustomStringFormat:()=>Od,ZodDate:()=>Gm,ZodDefault:()=>TS,ZodDiscriminatedUnion:()=>wS,ZodE164:()=>Lw,ZodEmail:()=>Nw,ZodEmoji:()=>Iw,ZodEnum:()=>Cd,ZodError:()=>qR,ZodExactOptional:()=>NS,ZodFile:()=>kS,ZodFirstPartyTypeKind:()=>QS,ZodFunction:()=>JS,ZodGUID:()=>jm,ZodIPv4:()=>Ow,ZodIPv6:()=>Uw,ZodISODate:()=>Sw,ZodISODateTime:()=>Fw,ZodISODuration:()=>Pw,ZodISOTime:()=>Ew,ZodIntersection:()=>bS,ZodIssueCode:()=>XR,ZodJWT:()=>Zw,ZodKSUID:()=>zw,ZodLazy:()=>GS,ZodLiteral:()=>$S,ZodMAC:()=>sS,ZodMap:()=>ES,ZodNaN:()=>jS,ZodNanoID:()=>Bw,ZodNever:()=>gS,ZodNonOptional:()=>Qw,ZodNull:()=>pS,ZodNullable:()=>BS,ZodNumber:()=>Ud,ZodNumberFormat:()=>ru,ZodObject:()=>qm,ZodOptional:()=>Yw,ZodPipe:()=>Xm,ZodPrefault:()=>RS,ZodPreprocess:()=>KS,ZodPromise:()=>qS,ZodReadonly:()=>WS,ZodRealError:()=>bi,ZodRecord:()=>Rd,ZodSet:()=>PS,ZodString:()=>zd,ZodStringFormat:()=>dt,ZodSuccess:()=>OS,ZodSymbol:()=>cS,ZodTemplateLiteral:()=>ZS,ZodTransform:()=>MS,ZodTuple:()=>AS,ZodType:()=>De,ZodULID:()=>Rw,ZodURL:()=>Zm,ZodUUID:()=>Oa,ZodUndefined:()=>dS,ZodUnion:()=>Jm,ZodUnknown:()=>hS,ZodVoid:()=>vS,ZodXID:()=>Cw,ZodXor:()=>yS,_ZodString:()=>Mw,_default:()=>DS,_function:()=>cN,any:()=>VM,array:()=>Hm,base64:()=>FM,base64url:()=>SM,bigint:()=>RM,boolean:()=>uS,catch:()=>VS,check:()=>dN,cidrv4:()=>_M,cidrv6:()=>AM,clone:()=>ei,codec:()=>oN,coerce:()=>eE,config:()=>jt,core:()=>xo,cuid:()=>mM,cuid2:()=>hM,custom:()=>pN,date:()=>KM,decode:()=>eS,decodeAsync:()=>rS,describe:()=>fN,discriminatedUnion:()=>qM,e164:()=>EM,email:()=>nM,emoji:()=>pM,encode:()=>QF,encodeAsync:()=>tS,endsWith:()=>Ed,enum:()=>Jw,exactOptional:()=>IS,file:()=>rN,flattenError:()=>$m,float32:()=>IM,float64:()=>BM,formatError:()=>km,fromJSONSchema:()=>wN,function:()=>cN,getErrorMap:()=>QR,globalRegistry:()=>Nr,gt:()=>Ca,gte:()=>ri,guid:()=>aM,hash:()=>NM,hex:()=>MM,hostname:()=>kM,httpUrl:()=>dM,includes:()=>Fd,instanceof:()=>hN,int:()=>$w,int32:()=>TM,int64:()=>CM,intersection:()=>_S,invertCodec:()=>sN,ipv4:()=>yM,ipv6:()=>bM,iso:()=>Dd,json:()=>vN,jwt:()=>PM,keyof:()=>WM,ksuid:()=>xM,lazy:()=>HS,length:()=>eu,literal:()=>tN,locales:()=>Cm,looseObject:()=>GM,looseRecord:()=>XM,lowercase:()=>_d,lt:()=>Ra,lte:()=>ji,mac:()=>wM,map:()=>YM,maxLength:()=>Ql,maxSize:()=>ws,meta:()=>mN,mime:()=>Pd,minLength:()=>vo,minSize:()=>za,multipleOf:()=>ys,nan:()=>aN,nanoid:()=>fM,nativeEnum:()=>eN,negative:()=>mw,never:()=>Hw,nonnegative:()=>gw,nonoptional:()=>zS,nonpositive:()=>hw,normalize:()=>$d,null:()=>fS,nullable:()=>Wm,nullish:()=>iN,number:()=>lS,object:()=>LM,optional:()=>Km,overwrite:()=>Qn,parse:()=>qF,parseAsync:()=>JF,partialRecord:()=>JM,pipe:()=>kw,positive:()=>fw,prefault:()=>CS,preprocess:()=>xN,prettifyError:()=>f0,promise:()=>uN,property:()=>vw,readonly:()=>LS,record:()=>SS,refine:()=>XS,regex:()=>bd,regexes:()=>Vi,registry:()=>Zy,safeDecode:()=>nS,safeDecodeAsync:()=>oS,safeEncode:()=>iS,safeEncodeAsync:()=>aS,safeParse:()=>XF,safeParseAsync:()=>YF,set:()=>QM,setErrorMap:()=>YR,size:()=>Yl,slugify:()=>Id,startsWith:()=>Sd,strictObject:()=>ZM,string:()=>Vm,stringFormat:()=>$M,stringbool:()=>gN,success:()=>nN,superRefine:()=>YS,symbol:()=>OM,templateLiteral:()=>lN,toJSONSchema:()=>bw,toLowerCase:()=>Md,toUpperCase:()=>Nd,transform:()=>Xw,treeifyError:()=>p0,trim:()=>kd,tuple:()=>FS,uint32:()=>DM,uint64:()=>zM,ulid:()=>gM,undefined:()=>UM,union:()=>qw,unknown:()=>tu,uppercase:()=>Ad,url:()=>cM,util:()=>H,uuid:()=>oM,uuidv4:()=>sM,uuidv6:()=>lM,uuidv7:()=>uM,void:()=>jM,xid:()=>vM,xor:()=>HM});var xo={};Va(xo,{$ZodAny:()=>jA,$ZodArray:()=>GA,$ZodAsyncError:()=>Yn,$ZodBase64:()=>IA,$ZodBase64URL:()=>BA,$ZodBigInt:()=>zy,$ZodBigIntFormat:()=>zA,$ZodBoolean:()=>Bm,$ZodCIDRv4:()=>kA,$ZodCIDRv6:()=>MA,$ZodCUID:()=>vA,$ZodCUID2:()=>xA,$ZodCatch:()=>d1,$ZodCheck:()=>ft,$ZodCheckBigIntFormat:()=>G0,$ZodCheckEndsWith:()=>aA,$ZodCheckGreaterThan:()=>Iy,$ZodCheckIncludes:()=>iA,$ZodCheckLengthEquals:()=>Q0,$ZodCheckLessThan:()=>Ny,$ZodCheckLowerCase:()=>tA,$ZodCheckMaxLength:()=>X0,$ZodCheckMaxSize:()=>H0,$ZodCheckMimeType:()=>sA,$ZodCheckMinLength:()=>Y0,$ZodCheckMinSize:()=>q0,$ZodCheckMultipleOf:()=>L0,$ZodCheckNumberFormat:()=>Z0,$ZodCheckOverwrite:()=>lA,$ZodCheckProperty:()=>oA,$ZodCheckRegex:()=>eA,$ZodCheckSizeEquals:()=>J0,$ZodCheckStartsWith:()=>nA,$ZodCheckStringFormat:()=>yd,$ZodCheckUpperCase:()=>rA,$ZodCodec:()=>Dm,$ZodCustom:()=>y1,$ZodCustomStringFormat:()=>RA,$ZodDate:()=>ZA,$ZodDefault:()=>s1,$ZodDiscriminatedUnion:()=>JA,$ZodE164:()=>TA,$ZodEmail:()=>fA,$ZodEmoji:()=>hA,$ZodEncodeError:()=>ms,$ZodEnum:()=>t1,$ZodError:()=>Pm,$ZodExactOptional:()=>a1,$ZodFile:()=>i1,$ZodFunction:()=>g1,$ZodGUID:()=>dA,$ZodIPv4:()=>EA,$ZodIPv6:()=>PA,$ZodISODate:()=>AA,$ZodISODateTime:()=>_A,$ZodISODuration:()=>SA,$ZodISOTime:()=>FA,$ZodIntersection:()=>XA,$ZodJWT:()=>DA,$ZodKSUID:()=>bA,$ZodLazy:()=>x1,$ZodLiteral:()=>r1,$ZodMAC:()=>$A,$ZodMap:()=>QA,$ZodNaN:()=>p1,$ZodNanoID:()=>gA,$ZodNever:()=>WA,$ZodNonOptional:()=>u1,$ZodNull:()=>VA,$ZodNullable:()=>o1,$ZodNumber:()=>Cy,$ZodNumberFormat:()=>CA,$ZodObject:()=>Q$,$ZodObjectJIT:()=>HA,$ZodOptional:()=>Uy,$ZodPipe:()=>Vy,$ZodPrefault:()=>l1,$ZodPreprocess:()=>f1,$ZodPromise:()=>v1,$ZodReadonly:()=>m1,$ZodRealError:()=>wi,$ZodRecord:()=>YA,$ZodRegistry:()=>Ly,$ZodSet:()=>e1,$ZodString:()=>Xl,$ZodStringFormat:()=>ct,$ZodSuccess:()=>c1,$ZodSymbol:()=>OA,$ZodTemplateLiteral:()=>h1,$ZodTransform:()=>n1,$ZodTuple:()=>Oy,$ZodType:()=>Pe,$ZodULID:()=>yA,$ZodURL:()=>mA,$ZodUUID:()=>pA,$ZodUndefined:()=>UA,$ZodUnion:()=>Tm,$ZodUnknown:()=>KA,$ZodVoid:()=>LA,$ZodXID:()=>wA,$ZodXor:()=>qA,$brand:()=>e0,$constructor:()=>I,$input:()=>b1,$output:()=>w1,Doc:()=>Im,JSONSchema:()=>tM,JSONSchemaGenerator:()=>_w,NEVER:()=>Q_,TimePrecision:()=>S1,_any:()=>Z1,_array:()=>Q1,_base64:()=>uw,_base64url:()=>cw,_bigint:()=>O1,_boolean:()=>C1,_catch:()=>VR,_check:()=>eM,_cidrv4:()=>sw,_cidrv6:()=>lw,_coercedBigint:()=>U1,_coercedBoolean:()=>z1,_coercedDate:()=>X1,_coercedNumber:()=>N1,_coercedString:()=>A1,_cuid:()=>ew,_cuid2:()=>tw,_custom:()=>tF,_date:()=>J1,_decode:()=>_y,_decodeAsync:()=>Fy,_default:()=>zR,_discriminatedUnion:()=>ER,_e164:()=>dw,_email:()=>Gy,_emoji:()=>Yy,_encode:()=>by,_encodeAsync:()=>Ay,_endsWith:()=>Ed,_enum:()=>IR,_file:()=>eF,_float32:()=>B1,_float64:()=>T1,_gt:()=>Ca,_gte:()=>ri,_guid:()=>zm,_includes:()=>Fd,_int:()=>I1,_int32:()=>D1,_int64:()=>V1,_intersection:()=>PR,_ipv4:()=>aw,_ipv6:()=>ow,_isoDate:()=>P1,_isoDateTime:()=>E1,_isoDuration:()=>k1,_isoTime:()=>$1,_jwt:()=>pw,_ksuid:()=>nw,_lazy:()=>LR,_length:()=>eu,_literal:()=>TR,_lowercase:()=>_d,_lt:()=>Ra,_lte:()=>ji,_mac:()=>F1,_map:()=>MR,_max:()=>ji,_maxLength:()=>Ql,_maxSize:()=>ws,_mime:()=>Pd,_min:()=>ri,_minLength:()=>vo,_minSize:()=>za,_multipleOf:()=>ys,_nan:()=>Y1,_nanoid:()=>Qy,_nativeEnum:()=>BR,_negative:()=>mw,_never:()=>H1,_nonnegative:()=>gw,_nonoptional:()=>OR,_nonpositive:()=>hw,_normalize:()=>$d,_null:()=>L1,_nullable:()=>CR,_number:()=>M1,_optional:()=>RR,_overwrite:()=>Qn,_parse:()=>hd,_parseAsync:()=>gd,_pipe:()=>jR,_positive:()=>fw,_promise:()=>ZR,_property:()=>vw,_readonly:()=>KR,_record:()=>kR,_refine:()=>rF,_regex:()=>bd,_safeDecode:()=>Ey,_safeDecodeAsync:()=>$y,_safeEncode:()=>Sy,_safeEncodeAsync:()=>Py,_safeParse:()=>vd,_safeParseAsync:()=>xd,_set:()=>NR,_size:()=>Yl,_slugify:()=>Id,_startsWith:()=>Sd,_string:()=>_1,_stringFormat:()=>Bd,_stringbool:()=>oF,_success:()=>UR,_superRefine:()=>iF,_symbol:()=>K1,_templateLiteral:()=>WR,_toLowerCase:()=>Md,_toUpperCase:()=>Nd,_transform:()=>DR,_trim:()=>kd,_tuple:()=>$R,_uint32:()=>R1,_uint64:()=>j1,_ulid:()=>rw,_undefined:()=>W1,_union:()=>FR,_unknown:()=>G1,_uppercase:()=>Ad,_url:()=>Om,_uuid:()=>Hy,_uuidv4:()=>qy,_uuidv6:()=>Jy,_uuidv7:()=>Xy,_void:()=>q1,_xid:()=>iw,_xor:()=>SR,clone:()=>ei,config:()=>jt,createStandardJSONSchemaMethod:()=>Td,createToJSONSchemaMethod:()=>sF,decode:()=>ZT,decodeAsync:()=>HT,describe:()=>nF,encode:()=>LT,encodeAsync:()=>GT,extractDefs:()=>_s,finalize:()=>As,flattenError:()=>$m,formatError:()=>km,globalConfig:()=>Hl,globalRegistry:()=>Nr,initializeContext:()=>bs,isValidBase64:()=>NA,isValidBase64URL:()=>q$,isValidJWT:()=>J$,locales:()=>Cm,meta:()=>aF,parse:()=>yy,parseAsync:()=>wy,prettifyError:()=>f0,process:()=>lt,regexes:()=>Vi,registry:()=>Zy,safeDecode:()=>JT,safeDecodeAsync:()=>YT,safeEncode:()=>qT,safeEncodeAsync:()=>XT,safeParse:()=>m0,safeParseAsync:()=>h0,toDotPath:()=>$$,toJSONSchema:()=>bw,treeifyError:()=>p0,util:()=>H,version:()=>uA});var A$,Q_=Object.freeze({status:"aborted"});function I(t,e,r){function n(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),s._zod.traits.has(t))return;s._zod.traits.add(t),e(s,u);let d=o.prototype,m=Object.keys(d);for(let x=0;x<m.length;x++){let g=m[x];g in s||(s[g]=d[g].bind(s))}}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:t});function o(s){var u;let d=r?.Parent?new a:this;n(d,s),(u=d._zod).deferred??(u.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var e0=Symbol("zod_brand"),Yn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ms=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(A$=globalThis).__zod_globalConfig??(A$.__zod_globalConfig={});var Hl=globalThis.__zod_globalConfig;function jt(t){return t&&Object.assign(Hl,t),Hl}var H={};Va(H,{BIGINT_FORMAT_RANGES:()=>c0,Class:()=>r0,NUMBER_FORMAT_RANGES:()=>u0,aborted:()=>xs,allowsEval:()=>a0,assert:()=>AT,assertEqual:()=>yT,assertIs:()=>bT,assertNever:()=>_T,assertNotEqual:()=>wT,assignProp:()=>gs,base64ToUint8Array:()=>S$,base64urlToUint8Array:()=>UT,cached:()=>fd,captureStackTrace:()=>xy,cleanEnum:()=>OT,cleanRegex:()=>Am,clone:()=>ei,cloneDef:()=>ST,createTransparentProxy:()=>NT,defineLazy:()=>Ke,esc:()=>vy,escapeRegex:()=>An,explicitlyAborted:()=>d0,extend:()=>TT,finalizeIssue:()=>ti,floatSafeRemainder:()=>i0,getElementAtPath:()=>ET,getEnumValues:()=>_m,getLengthableOrigin:()=>Em,getParsedType:()=>MT,getSizableOrigin:()=>Sm,hexToUint8Array:()=>jT,isObject:()=>ql,isPlainObject:()=>vs,issue:()=>md,joinValues:()=>O,jsonStringifyReplacer:()=>pd,merge:()=>RT,mergeDefs:()=>go,normalizeParams:()=>J,nullish:()=>hs,numKeys:()=>kT,objectClone:()=>FT,omit:()=>BT,optionalKeys:()=>l0,parsedType:()=>G,partial:()=>CT,pick:()=>IT,prefixIssues:()=>yi,primitiveTypes:()=>s0,promiseAllObject:()=>PT,propertyKeyTypes:()=>Fm,randomString:()=>$T,required:()=>zT,safeExtend:()=>DT,shallowClone:()=>o0,slugify:()=>n0,stringifyPrimitive:()=>L,uint8ArrayToBase64:()=>E$,uint8ArrayToBase64url:()=>VT,uint8ArrayToHex:()=>KT,unwrapMessage:()=>bm});function yT(t){return t}function wT(t){return t}function bT(t){}function _T(t){throw new Error("Unexpected value in exhaustive check")}function AT(t){}function _m(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function O(t,e="|"){return t.map(r=>L(r)).join(e)}function pd(t,e){return typeof e=="bigint"?e.toString():e}function fd(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function hs(t){return t==null}function Am(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function i0(t,e){let r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}var F$=Symbol("evaluating");function Ke(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==F$)return n===void 0&&(n=F$,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function FT(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function gs(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function go(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function ST(t){return go(t._zod.def)}function ET(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function PT(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<e.length;a++)i[e[a]]=n[a];return i})}function $T(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function vy(t){return JSON.stringify(t)}function n0(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xy="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ql(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var a0=fd(()=>{if(Hl.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vs(t){if(ql(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ql(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function o0(t){return vs(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function kT(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var MT=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Fm=new Set(["string","number","symbol"]),s0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function An(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function J(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function NT(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,a){return e??(e=t()),Reflect.set(e,n,i,a)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function L(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function l0(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var u0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},c0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function IT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=go(t._zod.def,{get shape(){let o={};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(o[s]=r.shape[s])}return gs(this,"shape",o),o},checks:[]});return ei(t,a)}function BT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=go(t._zod.def,{get shape(){let o={...t._zod.def.shape};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete o[s]}return gs(this,"shape",o),o},checks:[]});return ei(t,a)}function TT(t,e){if(!vs(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let a=t._zod.def.shape;for(let o in e)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=go(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return gs(this,"shape",a),a}});return ei(t,i)}function DT(t,e){if(!vs(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=go(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return gs(this,"shape",n),n}});return ei(t,r)}function RT(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=go(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return gs(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ei(t,r)}function CT(t,e,r){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=go(e._zod.def,{get shape(){let s=e._zod.def.shape,u={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=t?new t({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)u[d]=t?new t({type:"optional",innerType:s[d]}):s[d];return gs(this,"shape",u),u},checks:[]});return ei(e,o)}function zT(t,e,r){let n=go(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)a[o]=new t({type:"nonoptional",innerType:i[o]});return gs(this,"shape",a),a}});return ei(e,n)}function xs(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function d0(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function yi(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function bm(t){return typeof t=="string"?t:t?.message}function ti(t,e,r){let n=t.message?t.message:bm(t.inst?._zod.def?.error?.(t))??bm(e?.error?.(t))??bm(r.customError?.(t))??bm(r.localeError?.(t))??"Invalid input",{inst:i,continue:a,input:o,...s}=t;return s.path??(s.path=[]),s.message=n,e?.reportInput&&(s.input=o),s}function Sm(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Em(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function G(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function md(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function OT(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function S$(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function E$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function UT(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return S$(e+r)}function VT(t){return E$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jT(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function KT(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var r0=class{constructor(...e){}};var P$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,pd,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Pm=I("$ZodError",P$),wi=I("$ZodError",P$,{Parent:Error});function $m(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function km(t,e=r=>r.message){let r={_errors:[]},n=(i,a=[])=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s},[...a,...o.path]));else if(o.code==="invalid_key")n({issues:o.issues},[...a,...o.path]);else if(o.code==="invalid_element")n({issues:o.issues},[...a,...o.path]);else{let s=[...a,...o.path];if(s.length===0)r._errors.push(e(o));else{let u=r,d=0;for(;d<s.length;){let m=s[d];d===s.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(e(o))):u[m]=u[m]||{_errors:[]},u=u[m],d++}}}};return n(t),r}function p0(t,e=r=>r.message){let r={errors:[]},n=(i,a=[])=>{var o,s;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...a,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...a,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...a,...u.path]);else{let d=[...a,...u.path];if(d.length===0){r.errors.push(e(u));continue}let m=r,x=0;for(;x<d.length;){let g=d[x],w=x===d.length-1;typeof g=="string"?(m.properties??(m.properties={}),(o=m.properties)[g]??(o[g]={errors:[]}),m=m.properties[g]):(m.items??(m.items=[]),(s=m.items)[g]??(s[g]={errors:[]}),m=m.items[g]),w&&m.errors.push(e(u)),x++}}};return n(t),r}function $$(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function f0(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${$$(n.path)}`);return e.join(`
48
+ `,i=0;return{stripHeader:a=>fy(a,r).userCode,load:async(a,o)=>{let{userCode:s,update:u}=fy(o.code.getValue(),r);if(u===0)return;let d=yr.parseParams(s),m=new Map;for(let w of d)m.set(w.label,w);J_.set(o,m);let x=M.toString(o.address.uuid),g=q_(e,x,u,s);return g$(g),v$(a,g)},compile:async(a,o,s,u,d=!1)=>{let m=fy(u,r).userCode,x=fy(s.code.getValue(),r).update;i=Math.max(i,x);let g=i+1;i=g;let w=M.toString(s.address.uuid),A=yr.parseParams(m),_=yr.parseSamples(m),C=yr.parseDeclarationOrder(m),W=q_(e,w,g,m);g$(W);let U=yr.parseLabel(m),ee=()=>{s.code.setValue(n(g)+m),U.ifSome(re=>s.label.setValue(re)),eT(s,A,C),tT(s,_,C)};return d?o.append(ee):o.modify(ee),v$(a,W)}}}})(x$||(x$={}));var X_={isRegion:t=>Xn.isRegionBox(t.box),isLoopableRegion:t=>Xn.isLoopableRegionBox(t.box)};var 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)},Mt=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},y$,my,Y_,hy,wm,fs,Kl,Wl,rT,iT,w$,nT,aT,Ll,Zl,Gl,gy,b$,oT,sT,lT,uT,cT;my=new WeakMap,Y_=new WeakMap,hy=new WeakMap,wm=new WeakMap,fs=new WeakMap,Kl=new WeakMap,Wl=new WeakMap,y$=new WeakSet,rT=function(e,r){Mt(this,my,e,"f"),Mt(this,Y_,r,"f"),Mt(this,hy,-2,"f"),Mt(this,wm,Number.NEGATIVE_INFINITY,"f"),Mt(this,fs,0,"f"),Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f")},iT=function(e){let r=st(this,my,"f");if(r.length===0)return st(this,Y_,"f");let n=st(this,y$,"m",w$).call(this,e);if(n===st(this,hy,"f")&&e===st(this,wm,"f")+$h)return Mt(this,wm,e,"f"),Mt(this,fs,st(this,Kl,"f")*st(this,fs,"f")+st(this,Wl,"f"),"f");if(Mt(this,hy,n,"f"),Mt(this,wm,e,"f"),n<0)return Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f"),Mt(this,fs,n===-1?r[0].value:r[r.length-1].value,"f");let i=r[n],a=r[n+1],o=i.interpolation;if(o.type==="none")return Mt(this,Kl,1,"f"),Mt(this,Wl,0,"f"),Mt(this,fs,i.value,"f");if(o.type==="linear")return Mt(this,Kl,1,"f"),Mt(this,Wl,(a.value-i.value)*$h/(a.position-i.position),"f"),Mt(this,fs,i.value+(e-i.position)/(a.position-i.position)*(a.value-i.value),"f");{let{m:s,q:u}=Jt.coefficients({slope:o.slope,steps:(a.position-i.position)/$h,y0:i.value,y1:a.value});return Mt(this,Kl,s,"f"),Mt(this,Wl,u,"f"),Mt(this,fs,Jt.valueAt({slope:o.slope,steps:a.position-i.position,y0:i.value,y1:a.value},e-i.position),"f")}},w$=function(e){let r=st(this,my,"f");if(e<r[0].position)return-1;let n=r.length-1;if(e>=r[n].position)return-3;let i=0,a=n;for(;i<a;){let o=i+a+1>>1;r[o].position<=e?i=o:a=o-1}return i};aT=new WeakMap,Ll=new WeakMap,Zl=new WeakMap,Gl=new WeakMap,gy=new WeakMap,b$=new WeakMap,oT=new WeakMap,sT=new WeakMap,nT=new WeakSet,lT=function(){st(this,Zl,"f").length=0,st(this,Gl,"f").length=0,Mt(this,b$,Number.NaN,"f");let e=st(this,Ll,"f").tempoTrackEvents;if(e.isEmpty())return;let r=e.unwrap();if(r.events.isEmpty())return;let n=r.events.asArray(),i=st(this,Ll,"f").box.bpm.getValue(),a=[{ppqn:0,seconds:0,bpm:r.valueAt(0,i)}],o=0,s=0;for(let d of n){let m=d.position;m<=s||(o+=st(this,gy,"f").integrate(n,s,m,i),s=m,a.push({ppqn:m,seconds:o,bpm:r.valueAt(m,i)}))}st(this,Zl,"f").push(...a);let u=a.slice().sort((d,m)=>d.seconds-m.seconds);st(this,Gl,"f").push(...u)},uT=function(e){if(e<=0)return 0;let r=st(this,Ll,"f").box.bpm.getValue(),n=st(this,Ll,"f").tempoTrackEvents;if(n.isEmpty())return Me.pulsesToSeconds(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.pulsesToSeconds(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Zl,"f").length>0){let u=ht.rightMostMapped(st(this,Zl,"f"),e,bo,d=>d.ppqn);if(u>=0){let d=st(this,Zl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Zl,"f").length-1)return s+Me.pulsesToSeconds(e-o,d.bpm)}}return s+st(this,gy,"f").integrate(a,o,e,r)},cT=function(e){if(e<=0)return 0;let r=st(this,Ll,"f").box.bpm.getValue(),n=st(this,Ll,"f").tempoTrackEvents;if(n.isEmpty())return Me.secondsToPulses(e,r);let i=n.unwrap();if(i.events.isEmpty())return Me.secondsToPulses(e,r);let a=i.events.asArray(),o=0,s=0;if(st(this,Gl,"f").length>0){let u=ht.rightMostMapped(st(this,Gl,"f"),e,bo,d=>d.seconds);if(u>=0){let d=st(this,Gl,"f")[u];if(o=d.ppqn,s=d.seconds,u===st(this,Gl,"f").length-1)return o+Me.secondsToPulses(e-s,d.bpm)}}return st(this,gy,"f").advance(a,o,s,e,r)};var _$;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Loop=2]="Loop"})(_$||(_$={}));var dT,pT,fT,mT;dT=new WeakMap,pT=new WeakMap,fT=new WeakMap,mT=new WeakMap;var hT,gT,vT,xT;hT=new WeakMap,gT=new WeakMap,vT=new WeakMap,xT=new WeakMap;var ke={};Va(ke,{$brand:()=>e0,$input:()=>b1,$output:()=>w1,NEVER:()=>Q_,TimePrecision:()=>S1,ZodAny:()=>mS,ZodArray:()=>xS,ZodBase64:()=>Kw,ZodBase64URL:()=>Ww,ZodBigInt:()=>jd,ZodBigIntFormat:()=>Gw,ZodBoolean:()=>Vd,ZodCIDRv4:()=>Vw,ZodCIDRv6:()=>jw,ZodCUID:()=>Tw,ZodCUID2:()=>Dw,ZodCatch:()=>US,ZodCodec:()=>Ym,ZodCustom:()=>Qm,ZodCustomStringFormat:()=>Od,ZodDate:()=>Gm,ZodDefault:()=>TS,ZodDiscriminatedUnion:()=>wS,ZodE164:()=>Lw,ZodEmail:()=>Nw,ZodEmoji:()=>Iw,ZodEnum:()=>Cd,ZodError:()=>qR,ZodExactOptional:()=>NS,ZodFile:()=>kS,ZodFirstPartyTypeKind:()=>QS,ZodFunction:()=>JS,ZodGUID:()=>jm,ZodIPv4:()=>Ow,ZodIPv6:()=>Uw,ZodISODate:()=>Sw,ZodISODateTime:()=>Fw,ZodISODuration:()=>Pw,ZodISOTime:()=>Ew,ZodIntersection:()=>bS,ZodIssueCode:()=>XR,ZodJWT:()=>Zw,ZodKSUID:()=>zw,ZodLazy:()=>GS,ZodLiteral:()=>$S,ZodMAC:()=>sS,ZodMap:()=>ES,ZodNaN:()=>jS,ZodNanoID:()=>Bw,ZodNever:()=>gS,ZodNonOptional:()=>Qw,ZodNull:()=>pS,ZodNullable:()=>BS,ZodNumber:()=>Ud,ZodNumberFormat:()=>ru,ZodObject:()=>qm,ZodOptional:()=>Yw,ZodPipe:()=>Xm,ZodPrefault:()=>RS,ZodPreprocess:()=>KS,ZodPromise:()=>qS,ZodReadonly:()=>WS,ZodRealError:()=>bi,ZodRecord:()=>Rd,ZodSet:()=>PS,ZodString:()=>zd,ZodStringFormat:()=>dt,ZodSuccess:()=>OS,ZodSymbol:()=>cS,ZodTemplateLiteral:()=>ZS,ZodTransform:()=>MS,ZodTuple:()=>AS,ZodType:()=>De,ZodULID:()=>Rw,ZodURL:()=>Zm,ZodUUID:()=>Oa,ZodUndefined:()=>dS,ZodUnion:()=>Jm,ZodUnknown:()=>hS,ZodVoid:()=>vS,ZodXID:()=>Cw,ZodXor:()=>yS,_ZodString:()=>Mw,_default:()=>DS,_function:()=>cN,any:()=>VM,array:()=>Hm,base64:()=>FM,base64url:()=>SM,bigint:()=>RM,boolean:()=>uS,catch:()=>VS,check:()=>dN,cidrv4:()=>_M,cidrv6:()=>AM,clone:()=>ei,codec:()=>oN,coerce:()=>eE,config:()=>jt,core:()=>xo,cuid:()=>mM,cuid2:()=>hM,custom:()=>pN,date:()=>KM,decode:()=>eS,decodeAsync:()=>rS,describe:()=>fN,discriminatedUnion:()=>qM,e164:()=>EM,email:()=>nM,emoji:()=>pM,encode:()=>QF,encodeAsync:()=>tS,endsWith:()=>Ed,enum:()=>Jw,exactOptional:()=>IS,file:()=>rN,flattenError:()=>$m,float32:()=>IM,float64:()=>BM,formatError:()=>km,fromJSONSchema:()=>wN,function:()=>cN,getErrorMap:()=>QR,globalRegistry:()=>Nr,gt:()=>Ca,gte:()=>ri,guid:()=>aM,hash:()=>NM,hex:()=>MM,hostname:()=>kM,httpUrl:()=>dM,includes:()=>Fd,instanceof:()=>hN,int:()=>$w,int32:()=>TM,int64:()=>CM,intersection:()=>_S,invertCodec:()=>sN,ipv4:()=>yM,ipv6:()=>bM,iso:()=>Dd,json:()=>vN,jwt:()=>PM,keyof:()=>WM,ksuid:()=>xM,lazy:()=>HS,length:()=>eu,literal:()=>tN,locales:()=>Cm,looseObject:()=>GM,looseRecord:()=>XM,lowercase:()=>_d,lt:()=>Ra,lte:()=>ji,mac:()=>wM,map:()=>YM,maxLength:()=>Ql,maxSize:()=>ws,meta:()=>mN,mime:()=>Pd,minLength:()=>vo,minSize:()=>za,multipleOf:()=>ys,nan:()=>aN,nanoid:()=>fM,nativeEnum:()=>eN,negative:()=>mw,never:()=>Hw,nonnegative:()=>gw,nonoptional:()=>zS,nonpositive:()=>hw,normalize:()=>$d,null:()=>fS,nullable:()=>Wm,nullish:()=>iN,number:()=>lS,object:()=>LM,optional:()=>Km,overwrite:()=>Qn,parse:()=>qF,parseAsync:()=>JF,partialRecord:()=>JM,pipe:()=>kw,positive:()=>fw,prefault:()=>CS,preprocess:()=>xN,prettifyError:()=>f0,promise:()=>uN,property:()=>vw,readonly:()=>LS,record:()=>SS,refine:()=>XS,regex:()=>bd,regexes:()=>Vi,registry:()=>Zy,safeDecode:()=>nS,safeDecodeAsync:()=>oS,safeEncode:()=>iS,safeEncodeAsync:()=>aS,safeParse:()=>XF,safeParseAsync:()=>YF,set:()=>QM,setErrorMap:()=>YR,size:()=>Yl,slugify:()=>Id,startsWith:()=>Sd,strictObject:()=>ZM,string:()=>Vm,stringFormat:()=>$M,stringbool:()=>gN,success:()=>nN,superRefine:()=>YS,symbol:()=>OM,templateLiteral:()=>lN,toJSONSchema:()=>bw,toLowerCase:()=>Md,toUpperCase:()=>Nd,transform:()=>Xw,treeifyError:()=>p0,trim:()=>kd,tuple:()=>FS,uint32:()=>DM,uint64:()=>zM,ulid:()=>gM,undefined:()=>UM,union:()=>qw,unknown:()=>tu,uppercase:()=>Ad,url:()=>cM,util:()=>H,uuid:()=>oM,uuidv4:()=>sM,uuidv6:()=>lM,uuidv7:()=>uM,void:()=>jM,xid:()=>vM,xor:()=>HM});var xo={};Va(xo,{$ZodAny:()=>jA,$ZodArray:()=>GA,$ZodAsyncError:()=>Yn,$ZodBase64:()=>IA,$ZodBase64URL:()=>BA,$ZodBigInt:()=>zy,$ZodBigIntFormat:()=>zA,$ZodBoolean:()=>Bm,$ZodCIDRv4:()=>kA,$ZodCIDRv6:()=>MA,$ZodCUID:()=>vA,$ZodCUID2:()=>xA,$ZodCatch:()=>d1,$ZodCheck:()=>ft,$ZodCheckBigIntFormat:()=>G0,$ZodCheckEndsWith:()=>aA,$ZodCheckGreaterThan:()=>Iy,$ZodCheckIncludes:()=>iA,$ZodCheckLengthEquals:()=>Q0,$ZodCheckLessThan:()=>Ny,$ZodCheckLowerCase:()=>tA,$ZodCheckMaxLength:()=>X0,$ZodCheckMaxSize:()=>H0,$ZodCheckMimeType:()=>sA,$ZodCheckMinLength:()=>Y0,$ZodCheckMinSize:()=>q0,$ZodCheckMultipleOf:()=>L0,$ZodCheckNumberFormat:()=>Z0,$ZodCheckOverwrite:()=>lA,$ZodCheckProperty:()=>oA,$ZodCheckRegex:()=>eA,$ZodCheckSizeEquals:()=>J0,$ZodCheckStartsWith:()=>nA,$ZodCheckStringFormat:()=>yd,$ZodCheckUpperCase:()=>rA,$ZodCodec:()=>Dm,$ZodCustom:()=>y1,$ZodCustomStringFormat:()=>RA,$ZodDate:()=>ZA,$ZodDefault:()=>s1,$ZodDiscriminatedUnion:()=>JA,$ZodE164:()=>TA,$ZodEmail:()=>fA,$ZodEmoji:()=>hA,$ZodEncodeError:()=>ms,$ZodEnum:()=>t1,$ZodError:()=>Pm,$ZodExactOptional:()=>a1,$ZodFile:()=>i1,$ZodFunction:()=>g1,$ZodGUID:()=>dA,$ZodIPv4:()=>EA,$ZodIPv6:()=>PA,$ZodISODate:()=>AA,$ZodISODateTime:()=>_A,$ZodISODuration:()=>SA,$ZodISOTime:()=>FA,$ZodIntersection:()=>XA,$ZodJWT:()=>DA,$ZodKSUID:()=>bA,$ZodLazy:()=>x1,$ZodLiteral:()=>r1,$ZodMAC:()=>$A,$ZodMap:()=>QA,$ZodNaN:()=>p1,$ZodNanoID:()=>gA,$ZodNever:()=>WA,$ZodNonOptional:()=>u1,$ZodNull:()=>VA,$ZodNullable:()=>o1,$ZodNumber:()=>Cy,$ZodNumberFormat:()=>CA,$ZodObject:()=>Q$,$ZodObjectJIT:()=>HA,$ZodOptional:()=>Uy,$ZodPipe:()=>Vy,$ZodPrefault:()=>l1,$ZodPreprocess:()=>f1,$ZodPromise:()=>v1,$ZodReadonly:()=>m1,$ZodRealError:()=>wi,$ZodRecord:()=>YA,$ZodRegistry:()=>Ly,$ZodSet:()=>e1,$ZodString:()=>Xl,$ZodStringFormat:()=>ct,$ZodSuccess:()=>c1,$ZodSymbol:()=>OA,$ZodTemplateLiteral:()=>h1,$ZodTransform:()=>n1,$ZodTuple:()=>Oy,$ZodType:()=>Pe,$ZodULID:()=>yA,$ZodURL:()=>mA,$ZodUUID:()=>pA,$ZodUndefined:()=>UA,$ZodUnion:()=>Tm,$ZodUnknown:()=>KA,$ZodVoid:()=>LA,$ZodXID:()=>wA,$ZodXor:()=>qA,$brand:()=>e0,$constructor:()=>I,$input:()=>b1,$output:()=>w1,Doc:()=>Im,JSONSchema:()=>tM,JSONSchemaGenerator:()=>_w,NEVER:()=>Q_,TimePrecision:()=>S1,_any:()=>Z1,_array:()=>Q1,_base64:()=>uw,_base64url:()=>cw,_bigint:()=>O1,_boolean:()=>C1,_catch:()=>VR,_check:()=>eM,_cidrv4:()=>sw,_cidrv6:()=>lw,_coercedBigint:()=>U1,_coercedBoolean:()=>z1,_coercedDate:()=>X1,_coercedNumber:()=>N1,_coercedString:()=>A1,_cuid:()=>ew,_cuid2:()=>tw,_custom:()=>tF,_date:()=>J1,_decode:()=>_y,_decodeAsync:()=>Fy,_default:()=>zR,_discriminatedUnion:()=>ER,_e164:()=>dw,_email:()=>Gy,_emoji:()=>Yy,_encode:()=>by,_encodeAsync:()=>Ay,_endsWith:()=>Ed,_enum:()=>IR,_file:()=>eF,_float32:()=>B1,_float64:()=>T1,_gt:()=>Ca,_gte:()=>ri,_guid:()=>zm,_includes:()=>Fd,_int:()=>I1,_int32:()=>D1,_int64:()=>V1,_intersection:()=>PR,_ipv4:()=>aw,_ipv6:()=>ow,_isoDate:()=>P1,_isoDateTime:()=>E1,_isoDuration:()=>k1,_isoTime:()=>$1,_jwt:()=>pw,_ksuid:()=>nw,_lazy:()=>LR,_length:()=>eu,_literal:()=>TR,_lowercase:()=>_d,_lt:()=>Ra,_lte:()=>ji,_mac:()=>F1,_map:()=>MR,_max:()=>ji,_maxLength:()=>Ql,_maxSize:()=>ws,_mime:()=>Pd,_min:()=>ri,_minLength:()=>vo,_minSize:()=>za,_multipleOf:()=>ys,_nan:()=>Y1,_nanoid:()=>Qy,_nativeEnum:()=>BR,_negative:()=>mw,_never:()=>H1,_nonnegative:()=>gw,_nonoptional:()=>OR,_nonpositive:()=>hw,_normalize:()=>$d,_null:()=>L1,_nullable:()=>CR,_number:()=>M1,_optional:()=>RR,_overwrite:()=>Qn,_parse:()=>hd,_parseAsync:()=>gd,_pipe:()=>jR,_positive:()=>fw,_promise:()=>ZR,_property:()=>vw,_readonly:()=>KR,_record:()=>kR,_refine:()=>rF,_regex:()=>bd,_safeDecode:()=>Ey,_safeDecodeAsync:()=>$y,_safeEncode:()=>Sy,_safeEncodeAsync:()=>Py,_safeParse:()=>vd,_safeParseAsync:()=>xd,_set:()=>NR,_size:()=>Yl,_slugify:()=>Id,_startsWith:()=>Sd,_string:()=>_1,_stringFormat:()=>Bd,_stringbool:()=>oF,_success:()=>UR,_superRefine:()=>iF,_symbol:()=>K1,_templateLiteral:()=>WR,_toLowerCase:()=>Md,_toUpperCase:()=>Nd,_transform:()=>DR,_trim:()=>kd,_tuple:()=>$R,_uint32:()=>R1,_uint64:()=>j1,_ulid:()=>rw,_undefined:()=>W1,_union:()=>FR,_unknown:()=>G1,_uppercase:()=>Ad,_url:()=>Om,_uuid:()=>Hy,_uuidv4:()=>qy,_uuidv6:()=>Jy,_uuidv7:()=>Xy,_void:()=>q1,_xid:()=>iw,_xor:()=>SR,clone:()=>ei,config:()=>jt,createStandardJSONSchemaMethod:()=>Td,createToJSONSchemaMethod:()=>sF,decode:()=>ZT,decodeAsync:()=>HT,describe:()=>nF,encode:()=>LT,encodeAsync:()=>GT,extractDefs:()=>_s,finalize:()=>As,flattenError:()=>$m,formatError:()=>km,globalConfig:()=>Hl,globalRegistry:()=>Nr,initializeContext:()=>bs,isValidBase64:()=>NA,isValidBase64URL:()=>q$,isValidJWT:()=>J$,locales:()=>Cm,meta:()=>aF,parse:()=>yy,parseAsync:()=>wy,prettifyError:()=>f0,process:()=>lt,regexes:()=>Vi,registry:()=>Zy,safeDecode:()=>JT,safeDecodeAsync:()=>YT,safeEncode:()=>qT,safeEncodeAsync:()=>XT,safeParse:()=>m0,safeParseAsync:()=>h0,toDotPath:()=>$$,toJSONSchema:()=>bw,treeifyError:()=>p0,util:()=>H,version:()=>uA});var A$,Q_=Object.freeze({status:"aborted"});function I(t,e,r){function n(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),s._zod.traits.has(t))return;s._zod.traits.add(t),e(s,u);let d=o.prototype,m=Object.keys(d);for(let x=0;x<m.length;x++){let g=m[x];g in s||(s[g]=d[g].bind(s))}}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:t});function o(s){var u;let d=r?.Parent?new a:this;n(d,s),(u=d._zod).deferred??(u.deferred=[]);for(let m of d._zod.deferred)m();return d}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var e0=Symbol("zod_brand"),Yn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ms=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(A$=globalThis).__zod_globalConfig??(A$.__zod_globalConfig={});var Hl=globalThis.__zod_globalConfig;function jt(t){return t&&Object.assign(Hl,t),Hl}var H={};Va(H,{BIGINT_FORMAT_RANGES:()=>c0,Class:()=>r0,NUMBER_FORMAT_RANGES:()=>u0,aborted:()=>xs,allowsEval:()=>a0,assert:()=>AT,assertEqual:()=>yT,assertIs:()=>bT,assertNever:()=>_T,assertNotEqual:()=>wT,assignProp:()=>gs,base64ToUint8Array:()=>S$,base64urlToUint8Array:()=>UT,cached:()=>fd,captureStackTrace:()=>xy,cleanEnum:()=>OT,cleanRegex:()=>Am,clone:()=>ei,cloneDef:()=>ST,createTransparentProxy:()=>NT,defineLazy:()=>Ke,esc:()=>vy,escapeRegex:()=>An,explicitlyAborted:()=>d0,extend:()=>TT,finalizeIssue:()=>ti,floatSafeRemainder:()=>i0,getElementAtPath:()=>ET,getEnumValues:()=>_m,getLengthableOrigin:()=>Em,getParsedType:()=>MT,getSizableOrigin:()=>Sm,hexToUint8Array:()=>jT,isObject:()=>ql,isPlainObject:()=>vs,issue:()=>md,joinValues:()=>O,jsonStringifyReplacer:()=>pd,merge:()=>RT,mergeDefs:()=>go,normalizeParams:()=>J,nullish:()=>hs,numKeys:()=>kT,objectClone:()=>FT,omit:()=>BT,optionalKeys:()=>l0,parsedType:()=>G,partial:()=>CT,pick:()=>IT,prefixIssues:()=>yi,primitiveTypes:()=>s0,promiseAllObject:()=>PT,propertyKeyTypes:()=>Fm,randomString:()=>$T,required:()=>zT,safeExtend:()=>DT,shallowClone:()=>o0,slugify:()=>n0,stringifyPrimitive:()=>L,uint8ArrayToBase64:()=>E$,uint8ArrayToBase64url:()=>VT,uint8ArrayToHex:()=>KT,unwrapMessage:()=>bm});function yT(t){return t}function wT(t){return t}function bT(t){}function _T(t){throw new Error("Unexpected value in exhaustive check")}function AT(t){}function _m(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function O(t,e="|"){return t.map(r=>L(r)).join(e)}function pd(t,e){return typeof e=="bigint"?e.toString():e}function fd(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function hs(t){return t==null}function Am(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function i0(t,e){let r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}var F$=Symbol("evaluating");function Ke(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==F$)return n===void 0&&(n=F$,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function FT(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function gs(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function go(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function ST(t){return go(t._zod.def)}function ET(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function PT(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<e.length;a++)i[e[a]]=n[a];return i})}function $T(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function vy(t){return JSON.stringify(t)}function n0(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xy="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ql(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var a0=fd(()=>{if(Hl.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function vs(t){if(ql(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ql(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function o0(t){return vs(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function kT(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var MT=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Fm=new Set(["string","number","symbol"]),s0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function An(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ei(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function J(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function NT(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,a){return e??(e=t()),Reflect.set(e,n,i,a)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function L(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function l0(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var u0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},c0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function IT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=go(t._zod.def,{get shape(){let o={};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(o[s]=r.shape[s])}return gs(this,"shape",o),o},checks:[]});return ei(t,a)}function BT(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=go(t._zod.def,{get shape(){let o={...t._zod.def.shape};for(let s in e){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete o[s]}return gs(this,"shape",o),o},checks:[]});return ei(t,a)}function TT(t,e){if(!vs(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let a=t._zod.def.shape;for(let o in e)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=go(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return gs(this,"shape",a),a}});return ei(t,i)}function DT(t,e){if(!vs(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=go(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return gs(this,"shape",n),n}});return ei(t,r)}function RT(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=go(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return gs(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ei(t,r)}function CT(t,e,r){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=go(e._zod.def,{get shape(){let s=e._zod.def.shape,u={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=t?new t({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)u[d]=t?new t({type:"optional",innerType:s[d]}):s[d];return gs(this,"shape",u),u},checks:[]});return ei(e,o)}function zT(t,e,r){let n=go(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)a[o]=new t({type:"nonoptional",innerType:i[o]});return gs(this,"shape",a),a}});return ei(e,n)}function xs(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function d0(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function yi(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function bm(t){return typeof t=="string"?t:t?.message}function ti(t,e,r){let n=t.message?t.message:bm(t.inst?._zod.def?.error?.(t))??bm(e?.error?.(t))??bm(r.customError?.(t))??bm(r.localeError?.(t))??"Invalid input",{inst:i,continue:a,input:o,...s}=t;return s.path??(s.path=[]),s.message=n,e?.reportInput&&(s.input=o),s}function Sm(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Em(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function G(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function md(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function OT(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function S$(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function E$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function UT(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return S$(e+r)}function VT(t){return E$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jT(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function KT(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var r0=class{constructor(...e){}};var P$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,pd,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Pm=I("$ZodError",P$),wi=I("$ZodError",P$,{Parent:Error});function $m(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function km(t,e=r=>r.message){let r={_errors:[]},n=(i,a=[])=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>n({issues:s},[...a,...o.path]));else if(o.code==="invalid_key")n({issues:o.issues},[...a,...o.path]);else if(o.code==="invalid_element")n({issues:o.issues},[...a,...o.path]);else{let s=[...a,...o.path];if(s.length===0)r._errors.push(e(o));else{let u=r,d=0;for(;d<s.length;){let m=s[d];d===s.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(e(o))):u[m]=u[m]||{_errors:[]},u=u[m],d++}}}};return n(t),r}function p0(t,e=r=>r.message){let r={errors:[]},n=(i,a=[])=>{var o,s;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>n({issues:d},[...a,...u.path]));else if(u.code==="invalid_key")n({issues:u.issues},[...a,...u.path]);else if(u.code==="invalid_element")n({issues:u.issues},[...a,...u.path]);else{let d=[...a,...u.path];if(d.length===0){r.errors.push(e(u));continue}let m=r,x=0;for(;x<d.length;){let g=d[x],w=x===d.length-1;typeof g=="string"?(m.properties??(m.properties={}),(o=m.properties)[g]??(o[g]={errors:[]}),m=m.properties[g]):(m.items??(m.items=[]),(s=m.items)[g]??(s[g]={errors:[]}),m=m.items[g]),w&&m.errors.push(e(u)),x++}}};return n(t),r}function $$(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function f0(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${$$(n.path)}`);return e.join(`
49
49
  `)}var hd=t=>(e,r,n,i)=>{let a=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Yn;if(o.issues.length){let s=new(i?.Err??t)(o.issues.map(u=>ti(u,a,jt())));throw xy(s,i?.callee),s}return o.value},yy=hd(wi),gd=t=>async(e,r,n,i)=>{let a=n?{...n,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??t)(o.issues.map(u=>ti(u,a,jt())));throw xy(s,i?.callee),s}return o.value},wy=gd(wi),vd=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Yn;return a.issues.length?{success:!1,error:new(t??Pm)(a.issues.map(o=>ti(o,i,jt())))}:{success:!0,data:a.value}},m0=vd(wi),xd=t=>async(e,r,n)=>{let i=n?{...n,async:!0}:{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(o=>ti(o,i,jt())))}:{success:!0,data:a.value}},h0=xd(wi),by=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return hd(t)(e,r,i)},LT=by(wi),_y=t=>(e,r,n)=>hd(t)(e,r,n),ZT=_y(wi),Ay=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return gd(t)(e,r,i)},GT=Ay(wi),Fy=t=>async(e,r,n)=>gd(t)(e,r,n),HT=Fy(wi),Sy=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return vd(t)(e,r,i)},qT=Sy(wi),Ey=t=>(e,r,n)=>vd(t)(e,r,n),JT=Ey(wi),Py=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return xd(t)(e,r,i)},XT=Py(wi),$y=t=>async(e,r,n)=>xd(t)(e,r,n),YT=$y(wi);var Vi={};Va(Vi,{base64:()=>N0,base64url:()=>ky,bigint:()=>z0,boolean:()=>U0,browserEmail:()=>oD,cidrv4:()=>k0,cidrv6:()=>M0,cuid:()=>g0,cuid2:()=>v0,date:()=>T0,datetime:()=>R0,domain:()=>uD,duration:()=>_0,e164:()=>B0,email:()=>F0,emoji:()=>S0,extendedDuration:()=>QT,guid:()=>A0,hex:()=>cD,hostname:()=>lD,html5Email:()=>iD,httpProtocol:()=>I0,idnEmail:()=>aD,integer:()=>O0,ipv4:()=>E0,ipv6:()=>P0,ksuid:()=>w0,lowercase:()=>K0,mac:()=>$0,md5_base64:()=>pD,md5_base64url:()=>fD,md5_hex:()=>dD,nanoid:()=>b0,null:()=>V0,number:()=>My,rfc5322Email:()=>nD,sha1_base64:()=>hD,sha1_base64url:()=>gD,sha1_hex:()=>mD,sha256_base64:()=>xD,sha256_base64url:()=>yD,sha256_hex:()=>vD,sha384_base64:()=>bD,sha384_base64url:()=>_D,sha384_hex:()=>wD,sha512_base64:()=>FD,sha512_base64url:()=>SD,sha512_hex:()=>AD,string:()=>C0,time:()=>D0,ulid:()=>x0,undefined:()=>j0,unicodeEmail:()=>k$,uppercase:()=>W0,uuid:()=>Jl,uuid4:()=>eD,uuid6:()=>tD,uuid7:()=>rD,xid:()=>y0});var g0=/^[cC][0-9a-z]{6,}$/,v0=/^[0-9a-z]+$/,x0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,y0=/^[0-9a-vA-V]{20}$/,w0=/^[A-Za-z0-9]{27}$/,b0=/^[a-zA-Z0-9_-]{21}$/,_0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,QT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,A0=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jl=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,eD=Jl(4),tD=Jl(6),rD=Jl(7),F0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iD=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nD=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,k$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,aD=k$,oD=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function S0(){return new RegExp(sD,"u")}var E0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,P0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,$0=t=>{let e=An(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},k0=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,M0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ky=/^[A-Za-z0-9_-]*$/,lD=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,uD=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,I0=/^https?$/,B0=/^\+[1-9]\d{6,14}$/,M$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",T0=new RegExp(`^${M$}$`);function N$(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function D0(t){return new RegExp(`^${N$(t)}$`)}function R0(t){let e=N$({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${M$}T(?:${n})$`)}var C0=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},z0=/^-?\d+n?$/,O0=/^-?\d+$/,My=/^-?\d+(?:\.\d+)?$/,U0=/^(?:true|false)$/i,V0=/^null$/i;var j0=/^undefined$/i;var K0=/^[^A-Z]*$/,W0=/^[^a-z]*$/,cD=/^[0-9a-fA-F]*$/;function Mm(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Nm(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var dD=/^[0-9a-fA-F]{32}$/,pD=Mm(22,"=="),fD=Nm(22),mD=/^[0-9a-fA-F]{40}$/,hD=Mm(27,"="),gD=Nm(27),vD=/^[0-9a-fA-F]{64}$/,xD=Mm(43,"="),yD=Nm(43),wD=/^[0-9a-fA-F]{96}$/,bD=Mm(64,""),_D=Nm(64),AD=/^[0-9a-fA-F]{128}$/,FD=Mm(86,"=="),SD=Nm(86);var ft=I("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),B$={number:"number",bigint:"bigint",object:"date"},Ny=I("$ZodCheckLessThan",(t,e)=>{ft.init(t,e);let r=B$[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Iy=I("$ZodCheckGreaterThan",(t,e)=>{ft.init(t,e);let r=B$[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),L0=I("$ZodCheckMultipleOf",(t,e)=>{ft.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):i0(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Z0=I("$ZodCheckNumberFormat",(t,e)=>{ft.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,a]=u0[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=i,s.maximum=a,r&&(s.pattern=O0)}),t._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:t,continue:!e.abort})}}),G0=I("$ZodCheckBigIntFormat",(t,e)=>{ft.init(t,e);let[r,n]=c0[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=r,a.maximum=n}),t._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}}),H0=I("$ZodCheckMaxSize",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:Sm(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),q0=I("$ZodCheckMinSize",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:Sm(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),J0=I("$ZodCheckSizeEquals",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=n=>{let i=n.value,a=i.size;if(a===e.size)return;let o=a>e.size;n.issues.push({origin:Sm(i),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),X0=I("$ZodCheckMaxLength",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let o=Em(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Y0=I("$ZodCheckMinLength",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let o=Em(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Q0=I("$ZodCheckLengthEquals",(t,e)=>{var r;ft.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hs(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,a=i.length;if(a===e.length)return;let o=Em(i),s=a>e.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),yd=I("$ZodCheckStringFormat",(t,e)=>{var r,n;ft.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),eA=I("$ZodCheckRegex",(t,e)=>{yd.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),tA=I("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=K0),yd.init(t,e)}),rA=I("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=W0),yd.init(t,e)}),iA=I("$ZodCheckIncludes",(t,e)=>{ft.init(t,e);let r=An(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),nA=I("$ZodCheckStartsWith",(t,e)=>{ft.init(t,e);let r=new RegExp(`^${An(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),aA=I("$ZodCheckEndsWith",(t,e)=>{ft.init(t,e);let r=new RegExp(`.*${An(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function I$(t,e,r){t.issues.length&&e.issues.push(...yi(r,t.issues))}var oA=I("$ZodCheckProperty",(t,e)=>{ft.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>I$(i,r,e.property));I$(n,r,e.property)}}),sA=I("$ZodCheckMimeType",(t,e)=>{ft.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),lA=I("$ZodCheckOverwrite",(t,e)=>{ft.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Im=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
50
50
  `).filter(o=>o),i=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let e=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new e(...r,i.join(`
51
- `))}};var uA={major:4,minor:4,patch:3};var Pe=I("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uA;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=(o,s,u)=>{let d=xs(o),m;for(let x of s){if(x._zod.def.when){if(d0(o)||!x._zod.def.when(o))continue}else if(d)continue;let g=o.issues.length,w=x._zod.check(o);if(w instanceof Promise&&u?.async===!1)throw new Yn;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await w,o.issues.length!==g&&(d||(d=xs(o,g)))});else{if(o.issues.length===g)continue;d||(d=xs(o,g))}}return m?m.then(()=>o):o},a=(o,s,u)=>{if(xs(o))return o.aborted=!0,o;let d=i(s,n,u);if(d instanceof Promise){if(u.async===!1)throw new Yn;return d.then(m=>t._zod.parse(m,u))}return t._zod.parse(d,u)};t._zod.run=(o,s)=>{if(s.skipChecks)return t._zod.parse(o,s);if(s.direction==="backward"){let d=t._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(m=>a(m,o,s)):a(d,o,s)}let u=t._zod.parse(o,s);if(u instanceof Promise){if(s.async===!1)throw new Yn;return u.then(d=>i(d,n,s))}return i(u,n,s)}}Ke(t,"~standard",()=>({validate:i=>{try{let a=m0(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return h0(t,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Xl=I("$ZodString",(t,e)=>{Pe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??C0(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ct=I("$ZodStringFormat",(t,e)=>{yd.init(t,e),Xl.init(t,e)}),dA=I("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=A0),ct.init(t,e)}),pA=I("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Jl(n))}else e.pattern??(e.pattern=Jl());ct.init(t,e)}),fA=I("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=F0),ct.init(t,e)}),mA=I("$ZodURL",(t,e)=>{ct.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===I0.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),hA=I("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=S0()),ct.init(t,e)}),gA=I("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=b0),ct.init(t,e)}),vA=I("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=g0),ct.init(t,e)}),xA=I("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=v0),ct.init(t,e)}),yA=I("$ZodULID",(t,e)=>{e.pattern??(e.pattern=x0),ct.init(t,e)}),wA=I("$ZodXID",(t,e)=>{e.pattern??(e.pattern=y0),ct.init(t,e)}),bA=I("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=w0),ct.init(t,e)}),_A=I("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=R0(e)),ct.init(t,e)}),AA=I("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=T0),ct.init(t,e)}),FA=I("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=D0(e)),ct.init(t,e)}),SA=I("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=_0),ct.init(t,e)}),EA=I("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=E0),ct.init(t,e),t._zod.bag.format="ipv4"}),PA=I("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=P0),ct.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),$A=I("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=$0(e.delimiter)),ct.init(t,e),t._zod.bag.format="mac"}),kA=I("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=k0),ct.init(t,e)}),MA=I("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=M0),ct.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,a]=n;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function NA(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var IA=I("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=N0),ct.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{NA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function q$(t){if(!ky.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return NA(r)}var BA=I("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ky),ct.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{q$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),TA=I("$ZodE164",(t,e)=>{e.pattern??(e.pattern=B0),ct.init(t,e)});function J$(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var DA=I("$ZodJWT",(t,e)=>{ct.init(t,e),t._zod.check=r=>{J$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),RA=I("$ZodCustomStringFormat",(t,e)=>{ct.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Cy=I("$ZodNumber",(t,e)=>{Pe.init(t,e),t._zod.pattern=t._zod.bag.pattern??My,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),CA=I("$ZodNumberFormat",(t,e)=>{Z0.init(t,e),Cy.init(t,e)}),Bm=I("$ZodBoolean",(t,e)=>{Pe.init(t,e),t._zod.pattern=U0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),zy=I("$ZodBigInt",(t,e)=>{Pe.init(t,e),t._zod.pattern=z0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),zA=I("$ZodBigIntFormat",(t,e)=>{G0.init(t,e),zy.init(t,e)}),OA=I("$ZodSymbol",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),UA=I("$ZodUndefined",(t,e)=>{Pe.init(t,e),t._zod.pattern=j0,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),VA=I("$ZodNull",(t,e)=>{Pe.init(t,e),t._zod.pattern=V0,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),jA=I("$ZodAny",(t,e)=>{Pe.init(t,e),t._zod.parse=r=>r}),KA=I("$ZodUnknown",(t,e)=>{Pe.init(t,e),t._zod.parse=r=>r}),WA=I("$ZodNever",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),LA=I("$ZodVoid",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),ZA=I("$ZodDate",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function D$(t,e,r){t.issues.length&&e.issues.push(...yi(r,t.issues)),e.value[r]=t.value}var GA=I("$ZodArray",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let a=[];for(let o=0;o<i.length;o++){let s=i[o],u=e.element._zod.run({value:s,issues:[]},n);u instanceof Promise?a.push(u.then(d=>D$(d,r,o))):D$(u,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function Ry(t,e,r,n,i,a){let o=r in n;if(t.issues.length){if(i&&a&&!o)return;e.issues.push(...yi(r,t.issues))}if(!o&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?o&&(e.value[r]=void 0):e.value[r]=t.value}function X$(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=l0(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Y$(t,e,r,n,i,a){let o=[],s=i.keySet,u=i.catchall._zod,d=u.def.type,m=u.optin==="optional",x=u.optout==="optional";for(let g in e){if(g==="__proto__"||s.has(g))continue;if(d==="never"){o.push(g);continue}let w=u.run({value:e[g],issues:[]},n);w instanceof Promise?t.push(w.then(A=>Ry(A,r,g,e,m,x))):Ry(w,r,g,e,m,x)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}var Q$=I("$ZodObject",(t,e)=>{if(Pe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...s};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=fd(()=>X$(e));Ke(t._zod,"propValues",()=>{let s=e.shape,u={};for(let d in s){let m=s[d]._zod;if(m.values){u[d]??(u[d]=new Set);for(let x of m.values)u[d].add(x)}}return u});let i=ql,a=e.catchall,o;t._zod.parse=(s,u)=>{o??(o=n.value);let d=s.value;if(!i(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),s;s.value={};let m=[],x=o.shape;for(let g of o.keys){let w=x[g],A=w._zod.optin==="optional",_=w._zod.optout==="optional",C=w._zod.run({value:d[g],issues:[]},u);C instanceof Promise?m.push(C.then(K=>Ry(K,s,g,d,A,_))):Ry(C,s,g,d,A,_)}return a?Y$(m,d,s,u,n.value,t):m.length?Promise.all(m).then(()=>s):s}}),HA=I("$ZodObjectJIT",(t,e)=>{Q$.init(t,e);let r=t._zod.parse,n=fd(()=>X$(e)),i=g=>{let w=new Im(["shape","payload","ctx"]),A=n.value,_=ee=>{let re=vy(ee);return`shape[${re}]._zod.run({ value: input[${re}], issues: [] }, ctx)`};w.write("const input = payload.value;");let C=Object.create(null),K=0;for(let ee of A.keys)C[ee]=`key_${K++}`;w.write("const newResult = {};");for(let ee of A.keys){let re=C[ee],me=vy(ee),$e=g[ee],Q=$e?._zod?.optin==="optional",we=$e?._zod?.optout==="optional";w.write(`const ${re} = ${_(ee)};`),Q&&we?w.write(`
51
+ `))}};var uA={major:4,minor:4,patch:3};var Pe=I("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=uA;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=(o,s,u)=>{let d=xs(o),m;for(let x of s){if(x._zod.def.when){if(d0(o)||!x._zod.def.when(o))continue}else if(d)continue;let g=o.issues.length,w=x._zod.check(o);if(w instanceof Promise&&u?.async===!1)throw new Yn;if(m||w instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await w,o.issues.length!==g&&(d||(d=xs(o,g)))});else{if(o.issues.length===g)continue;d||(d=xs(o,g))}}return m?m.then(()=>o):o},a=(o,s,u)=>{if(xs(o))return o.aborted=!0,o;let d=i(s,n,u);if(d instanceof Promise){if(u.async===!1)throw new Yn;return d.then(m=>t._zod.parse(m,u))}return t._zod.parse(d,u)};t._zod.run=(o,s)=>{if(s.skipChecks)return t._zod.parse(o,s);if(s.direction==="backward"){let d=t._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(m=>a(m,o,s)):a(d,o,s)}let u=t._zod.parse(o,s);if(u instanceof Promise){if(s.async===!1)throw new Yn;return u.then(d=>i(d,n,s))}return i(u,n,s)}}Ke(t,"~standard",()=>({validate:i=>{try{let a=m0(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return h0(t,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Xl=I("$ZodString",(t,e)=>{Pe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??C0(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ct=I("$ZodStringFormat",(t,e)=>{yd.init(t,e),Xl.init(t,e)}),dA=I("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=A0),ct.init(t,e)}),pA=I("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Jl(n))}else e.pattern??(e.pattern=Jl());ct.init(t,e)}),fA=I("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=F0),ct.init(t,e)}),mA=I("$ZodURL",(t,e)=>{ct.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===I0.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),hA=I("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=S0()),ct.init(t,e)}),gA=I("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=b0),ct.init(t,e)}),vA=I("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=g0),ct.init(t,e)}),xA=I("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=v0),ct.init(t,e)}),yA=I("$ZodULID",(t,e)=>{e.pattern??(e.pattern=x0),ct.init(t,e)}),wA=I("$ZodXID",(t,e)=>{e.pattern??(e.pattern=y0),ct.init(t,e)}),bA=I("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=w0),ct.init(t,e)}),_A=I("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=R0(e)),ct.init(t,e)}),AA=I("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=T0),ct.init(t,e)}),FA=I("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=D0(e)),ct.init(t,e)}),SA=I("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=_0),ct.init(t,e)}),EA=I("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=E0),ct.init(t,e),t._zod.bag.format="ipv4"}),PA=I("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=P0),ct.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),$A=I("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=$0(e.delimiter)),ct.init(t,e),t._zod.bag.format="mac"}),kA=I("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=k0),ct.init(t,e)}),MA=I("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=M0),ct.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[i,a]=n;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function NA(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var IA=I("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=N0),ct.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{NA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function q$(t){if(!ky.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return NA(r)}var BA=I("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ky),ct.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{q$(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),TA=I("$ZodE164",(t,e)=>{e.pattern??(e.pattern=B0),ct.init(t,e)});function J$(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var DA=I("$ZodJWT",(t,e)=>{ct.init(t,e),t._zod.check=r=>{J$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),RA=I("$ZodCustomStringFormat",(t,e)=>{ct.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Cy=I("$ZodNumber",(t,e)=>{Pe.init(t,e),t._zod.pattern=t._zod.bag.pattern??My,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),CA=I("$ZodNumberFormat",(t,e)=>{Z0.init(t,e),Cy.init(t,e)}),Bm=I("$ZodBoolean",(t,e)=>{Pe.init(t,e),t._zod.pattern=U0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),zy=I("$ZodBigInt",(t,e)=>{Pe.init(t,e),t._zod.pattern=z0,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),zA=I("$ZodBigIntFormat",(t,e)=>{G0.init(t,e),zy.init(t,e)}),OA=I("$ZodSymbol",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),UA=I("$ZodUndefined",(t,e)=>{Pe.init(t,e),t._zod.pattern=j0,t._zod.values=new Set([void 0]),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),VA=I("$ZodNull",(t,e)=>{Pe.init(t,e),t._zod.pattern=V0,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),jA=I("$ZodAny",(t,e)=>{Pe.init(t,e),t._zod.parse=r=>r}),KA=I("$ZodUnknown",(t,e)=>{Pe.init(t,e),t._zod.parse=r=>r}),WA=I("$ZodNever",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),LA=I("$ZodVoid",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),ZA=I("$ZodDate",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function D$(t,e,r){t.issues.length&&e.issues.push(...yi(r,t.issues)),e.value[r]=t.value}var GA=I("$ZodArray",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let a=[];for(let o=0;o<i.length;o++){let s=i[o],u=e.element._zod.run({value:s,issues:[]},n);u instanceof Promise?a.push(u.then(d=>D$(d,r,o))):D$(u,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function Ry(t,e,r,n,i,a){let o=r in n;if(t.issues.length){if(i&&a&&!o)return;e.issues.push(...yi(r,t.issues))}if(!o&&!i){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?o&&(e.value[r]=void 0):e.value[r]=t.value}function X$(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=l0(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Y$(t,e,r,n,i,a){let o=[],s=i.keySet,u=i.catchall._zod,d=u.def.type,m=u.optin==="optional",x=u.optout==="optional";for(let g in e){if(g==="__proto__"||s.has(g))continue;if(d==="never"){o.push(g);continue}let w=u.run({value:e[g],issues:[]},n);w instanceof Promise?t.push(w.then(A=>Ry(A,r,g,e,m,x))):Ry(w,r,g,e,m,x)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}var Q$=I("$ZodObject",(t,e)=>{if(Pe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...s};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=fd(()=>X$(e));Ke(t._zod,"propValues",()=>{let s=e.shape,u={};for(let d in s){let m=s[d]._zod;if(m.values){u[d]??(u[d]=new Set);for(let x of m.values)u[d].add(x)}}return u});let i=ql,a=e.catchall,o;t._zod.parse=(s,u)=>{o??(o=n.value);let d=s.value;if(!i(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),s;s.value={};let m=[],x=o.shape;for(let g of o.keys){let w=x[g],A=w._zod.optin==="optional",_=w._zod.optout==="optional",C=w._zod.run({value:d[g],issues:[]},u);C instanceof Promise?m.push(C.then(W=>Ry(W,s,g,d,A,_))):Ry(C,s,g,d,A,_)}return a?Y$(m,d,s,u,n.value,t):m.length?Promise.all(m).then(()=>s):s}}),HA=I("$ZodObjectJIT",(t,e)=>{Q$.init(t,e);let r=t._zod.parse,n=fd(()=>X$(e)),i=g=>{let w=new Im(["shape","payload","ctx"]),A=n.value,_=ee=>{let re=vy(ee);return`shape[${re}]._zod.run({ value: input[${re}], issues: [] }, ctx)`};w.write("const input = payload.value;");let C=Object.create(null),W=0;for(let ee of A.keys)C[ee]=`key_${W++}`;w.write("const newResult = {};");for(let ee of A.keys){let re=C[ee],me=vy(ee),$e=g[ee],Q=$e?._zod?.optin==="optional",we=$e?._zod?.optout==="optional";w.write(`const ${re} = ${_(ee)};`),Q&&we?w.write(`
52
52
  if (${re}.issues.length) {
53
53
  if (${me} in input) {
54
54
  payload.issues = payload.issues.concat(${re}.issues.map(iss => ({
@@ -109,10 +109,10 @@ var vB=Object.defineProperty;var Va=(t,e)=>{for(var r in e)vB(t,r,{get:e[r],enum
109
109
 
110
110
  `)}w.write("payload.value = newResult;"),w.write("return payload;");let U=w.compile();return(ee,re)=>U(g,ee,re)},a,o=ql,s=!Hl.jitless,d=s&&a0.value,m=e.catchall,x;t._zod.parse=(g,w)=>{x??(x=n.value);let A=g.value;return o(A)?s&&d&&w?.async===!1&&w.jitless!==!0?(a||(a=i(e.shape)),g=a(g,w),m?Y$([],A,g,w,x,t):g):r(g,w):(g.issues.push({expected:"object",code:"invalid_type",input:A,inst:t}),g)}});function R$(t,e,r,n){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;let i=t.filter(a=>!xs(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>ti(o,n,jt())))}),e)}var Tm=I("$ZodUnion",(t,e)=>{Pe.init(t,e),Ke(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ke(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ke(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ke(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Am(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let u=s._zod.run({value:n.value,issues:[]},i);if(u instanceof Promise)o.push(u),a=!0;else{if(u.issues.length===0)return u;o.push(u)}}return a?Promise.all(o).then(s=>R$(s,n,t,i)):R$(o,n,t,i)}});function C$(t,e,r,n){let i=t.filter(a=>a.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>ti(o,n,jt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var qA=I("$ZodXor",(t,e)=>{Tm.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let u=s._zod.run({value:n.value,issues:[]},i);u instanceof Promise?(o.push(u),a=!0):o.push(u)}return a?Promise.all(o).then(s=>C$(s,n,t,i)):C$(o,n,t,i)}}),JA=I("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Tm.init(t,e);let r=t._zod.parse;Ke(t._zod,"propValues",()=>{let i={};for(let a of e.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let[s,u]of Object.entries(o)){i[s]||(i[s]=new Set);for(let d of u)i[s].add(d)}}return i});let n=fd(()=>{let i=e.options,a=new Map;for(let o of i){let s=o._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let u of s){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,o)}}return a});t._zod.parse=(i,a)=>{let o=i.value;if(!ql(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),i;let s=n.value.get(o?.[e.discriminator]);return s?s._zod.run(i,a):e.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:o,path:[e.discriminator],inst:t}),i)}}),XA=I("$ZodIntersection",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,a=e.left._zod.run({value:i,issues:[]},n),o=e.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([u,d])=>z$(r,u,d)):z$(r,a,o)}});function cA(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(vs(t)&&vs(e)){let r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};for(let a of n){let o=cA(t[a],e[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=e[n],o=cA(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function z$(t,e,r){let n=new Map,i;for(let s of e.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let u of s.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else t.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else t.issues.push(s);let a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&i&&t.issues.push({...i,keys:a}),xs(t))return t;let o=cA(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var Oy=I("$ZodTuple",(t,e)=>{Pe.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],s=O$(r,"optin"),u=O$(r,"optout");if(!e.rest){if(a.length<s)return n.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:t,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:t,origin:"array"})}let d=new Array(r.length);for(let m=0;m<r.length;m++){let x=r[m]._zod.run({value:a[m],issues:[]},i);x instanceof Promise?o.push(x.then(g=>{d[m]=g})):d[m]=x}if(e.rest){let m=r.length-1,x=a.slice(r.length);for(let g of x){m++;let w=e.rest._zod.run({value:g,issues:[]},i);w instanceof Promise?o.push(w.then(A=>U$(A,n,m))):U$(w,n,m)}}return o.length?Promise.all(o).then(()=>V$(d,n,r,a,u)):V$(d,n,r,a,u)}});function O$(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function U$(t,e,r){t.issues.length&&e.issues.push(...yi(r,t.issues)),e.value[r]=t.value}function V$(t,e,r,n,i){for(let a=0;a<r.length;a++){let o=t[a],s=a<n.length;if(o.issues.length){if(!s&&a>=i){e.value.length=a;break}e.issues.push(...yi(a,o.issues))}e.value[a]=o.value}for(let a=e.value.length-1;a>=n.length&&(r[a]._zod.optout==="optional"&&e.value[a]===void 0);a--)e.value.length=a;return e}var YA=I("$ZodRecord",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!vs(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let a=[],o=e.keyType._zod.values;if(o){r.value={};let s=new Set;for(let d of o)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){s.add(typeof d=="number"?d.toString():d);let m=e.keyType._zod.run({value:d,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(m.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(w=>ti(w,n,jt())),input:d,path:[d],inst:t});continue}let x=m.value,g=e.valueType._zod.run({value:i[d],issues:[]},n);g instanceof Promise?a.push(g.then(w=>{w.issues.length&&r.issues.push(...yi(d,w.issues)),r.value[x]=w.value})):(g.issues.length&&r.issues.push(...yi(d,g.issues)),r.value[x]=g.value)}let u;for(let d in i)s.has(d)||(u=u??[],u.push(d));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:u})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let u=e.keyType._zod.run({value:s,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&My.test(s)&&u.issues.length){let x=e.keyType._zod.run({value:Number(s),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(u=x)}if(u.issues.length){e.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(x=>ti(x,n,jt())),input:s,path:[s],inst:t});continue}let m=e.valueType._zod.run({value:i[s],issues:[]},n);m instanceof Promise?a.push(m.then(x=>{x.issues.length&&r.issues.push(...yi(s,x.issues)),r.value[u.value]=x.value})):(m.issues.length&&r.issues.push(...yi(s,m.issues)),r.value[u.value]=m.value)}}return a.length?Promise.all(a).then(()=>r):r}}),QA=I("$ZodMap",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let a=[];r.value=new Map;for(let[o,s]of i){let u=e.keyType._zod.run({value:o,issues:[]},n),d=e.valueType._zod.run({value:s,issues:[]},n);u instanceof Promise||d instanceof Promise?a.push(Promise.all([u,d]).then(([m,x])=>{j$(m,x,r,o,i,t,n)})):j$(u,d,r,o,i,t,n)}return a.length?Promise.all(a).then(()=>r):r}});function j$(t,e,r,n,i,a,o){t.issues.length&&(Fm.has(typeof n)?r.issues.push(...yi(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:t.issues.map(s=>ti(s,o,jt()))})),e.issues.length&&(Fm.has(typeof n)?r.issues.push(...yi(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:e.issues.map(s=>ti(s,o,jt()))})),r.value.set(t.value,e.value)}var e1=I("$ZodSet",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let o of i){let s=e.valueType._zod.run({value:o,issues:[]},n);s instanceof Promise?a.push(s.then(u=>K$(u,r))):K$(s,r)}return a.length?Promise.all(a).then(()=>r):r}});function K$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var t1=I("$ZodEnum",(t,e)=>{Pe.init(t,e);let r=_m(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Fm.has(typeof i)).map(i=>typeof i=="string"?An(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:t}),i}}),r1=I("$ZodLiteral",(t,e)=>{if(Pe.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?An(n):n?An(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}}),i1=I("$ZodFile",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),n1=I("$ZodTransform",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ms(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(r.value=o,r.fallback=!0,r));if(i instanceof Promise)throw new Yn;return r.value=i,r.fallback=!0,r}});function W$(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Uy=I("$ZodOptional",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ke(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ke(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Am(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,a=e.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>W$(o,i)):W$(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),a1=I("$ZodExactOptional",(t,e)=>{Uy.init(t,e),Ke(t._zod,"values",()=>e.innerType._zod.values),Ke(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),o1=I("$ZodNullable",(t,e)=>{Pe.init(t,e),Ke(t._zod,"optin",()=>e.innerType._zod.optin),Ke(t._zod,"optout",()=>e.innerType._zod.optout),Ke(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Am(r.source)}|null)$`):void 0}),Ke(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),s1=I("$ZodDefault",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",Ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>L$(a,e)):L$(i,e)}});function L$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var l1=I("$ZodPrefault",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",Ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),u1=I("$ZodNonOptional",(t,e)=>{Pe.init(t,e),Ke(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>Z$(a,t)):Z$(i,t)}});function Z$(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var c1=I("$ZodSuccess",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ms("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),d1=I("$ZodCatch",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",Ke(t._zod,"optout",()=>e.innerType._zod.optout),Ke(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=e.catchValue({...r,error:{issues:a.issues.map(o=>ti(o,n,jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>ti(a,n,jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),p1=I("$ZodNaN",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Vy=I("$ZodPipe",(t,e)=>{Pe.init(t,e),Ke(t._zod,"values",()=>e.in._zod.values),Ke(t._zod,"optin",()=>e.in._zod.optin),Ke(t._zod,"optout",()=>e.out._zod.optout),Ke(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>By(o,e.in,n)):By(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>By(a,e.out,n)):By(i,e.out,n)}});function By(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Dm=I("$ZodCodec",(t,e)=>{Pe.init(t,e),Ke(t._zod,"values",()=>e.in._zod.values),Ke(t._zod,"optin",()=>e.in._zod.optin),Ke(t._zod,"optout",()=>e.out._zod.optout),Ke(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=e.in._zod.run(r,n);return a instanceof Promise?a.then(o=>Ty(o,e,n)):Ty(a,e,n)}else{let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>Ty(o,e,n)):Ty(a,e,n)}}});function Ty(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let i=e.transform(t.value,t);return i instanceof Promise?i.then(a=>Dy(t,a,e.out,r)):Dy(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(a=>Dy(t,a,e.in,r)):Dy(t,i,e.in,r)}}function Dy(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var f1=I("$ZodPreprocess",(t,e)=>{Vy.init(t,e)}),m1=I("$ZodReadonly",(t,e)=>{Pe.init(t,e),Ke(t._zod,"propValues",()=>e.innerType._zod.propValues),Ke(t._zod,"values",()=>e.innerType._zod.values),Ke(t._zod,"optin",()=>e.innerType?._zod?.optin),Ke(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(G$):G$(i)}});function G$(t){return t.value=Object.freeze(t.value),t}var h1=I("$ZodTemplateLiteral",(t,e)=>{Pe.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=i.startsWith("^")?1:0,o=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,o))}else if(n===null||s0.has(typeof n))r.push(An(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),g1=I("$ZodFunction",(t,e)=>(Pe.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?yy(t._def.input,n):n,a=Reflect.apply(r,this,i);return t._def.output?yy(t._def.output,a):a}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await wy(t._def.input,n):n,a=await Reflect.apply(r,this,i);return t._def.output?await wy(t._def.output,a):a}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new Oy({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),v1=I("$ZodPromise",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),x1=I("$ZodLazy",(t,e)=>{Pe.init(t,e),Ke(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Ke(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Ke(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Ke(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Ke(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),y1=I("$ZodCustom",(t,e)=>{ft.init(t,e),Pe.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>H$(a,r,n,t));H$(i,r,n,t)}});function H$(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(md(i))}}var Cm={};Va(Cm,{ar:()=>ek,az:()=>tk,be:()=>ik,bg:()=>nk,ca:()=>ak,cs:()=>ok,da:()=>sk,de:()=>lk,el:()=>uk,en:()=>jy,eo:()=>ck,es:()=>dk,fa:()=>pk,fi:()=>fk,fr:()=>mk,frCA:()=>hk,he:()=>gk,hr:()=>vk,hu:()=>xk,hy:()=>wk,id:()=>bk,is:()=>_k,it:()=>Ak,ja:()=>Fk,ka:()=>Sk,kh:()=>Ek,km:()=>Ky,ko:()=>Pk,lt:()=>kk,mk:()=>Mk,ms:()=>Nk,nl:()=>Ik,no:()=>Bk,ota:()=>Tk,pl:()=>Rk,ps:()=>Dk,pt:()=>Ck,ro:()=>zk,ru:()=>Uk,sl:()=>Vk,sv:()=>jk,ta:()=>Kk,th:()=>Wk,tr:()=>Lk,ua:()=>Zk,uk:()=>Wy,ur:()=>Gk,uz:()=>Hk,vi:()=>qk,yo:()=>Yk,zhCN:()=>Jk,zhTW:()=>Xk});var PD=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${L(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${r[a.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${O(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ek(){return{localeError:PD()}}var $D=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${s}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${L(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[a.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function tk(){return{localeError:$D()}}function rk(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var kD=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${L(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=rk(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=rk(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${O(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function ik(){return{localeError:kD()}}var MD=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${L(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;if(a.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;if(a.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;if(a.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;if(a.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${O(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function nk(){return{localeError:MD()}}var ND=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${s}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${L(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${O(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a m\xE0xim":"menys de",o=e(i.origin);return o?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${a} ${i.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(i.origin);return o?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${a} ${i.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function ak(){return{localeError:ND()}}var ID=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${s}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${L(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${r[a.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${O(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function ok(){return{localeError:ID()}}var BD=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${s}`:`Ugyldigt input: forventede ${a}, fik ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${L(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For stor: forventede ${s??"value"} ${o.verb} ${a} ${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For lille: forventede ${s} ${o.verb} ${a} ${i.minimum.toString()} ${o.unit}`:`For lille: forventede ${s} havde ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${O(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function sk(){return{localeError:BD()}}var TD=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${s}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${L(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${O(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function lk(){return{localeError:TD()}}var DD=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${a}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${L(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${a.prefix}"`:a.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${a.suffix}"`:a.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${a.includes}"`:a.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${a.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${O(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function uk(){return{localeError:DD()}}var RD=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return`Invalid input: expected ${a}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${L(i.values[0])}`:`Invalid option: expected one of ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function jy(){return{localeError:RD()}}var CD=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${s}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${L(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${a}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${r[a.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function ck(){return{localeError:CD()}}var zD=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${L(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${a}${i.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function dk(){return{localeError:zD()}}var OD=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${L(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${O(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[a.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${O(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function pk(){return{localeError:OD()}}var UD=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${s}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${L(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${a}${i.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${a}${i.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${r[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${O(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function fk(){return{localeError:UD()}}var VD=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${s} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${L(i.values[0])} attendu`:`Option invalide : une valeur parmi ${O(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Trop grand : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Trop petit : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${O(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function mk(){return{localeError:VD()}}var jD=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${s}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${L(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u2264":"<",o=e(i.origin);return o?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u2265":">",o=e(i.origin);return o?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${O(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function hk(){return{localeError:jD()}}var KD=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=d=>d?t[d]:void 0,n=d=>{let m=r(d);return m?m.label:d??t.unknown.label},i=d=>`\u05D4${n(d)}`,a=d=>(r(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=d=>d?e[d]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let m=d.expected,x=u[m??""]??n(m),g=G(d.input),w=u[g]??t[g]?.label??g;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${x}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${L(d.values[0])}`;let m=d.values.map(w=>L(w));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${m[0]} \u05D0\u05D5 ${m[1]}`;let x=m[m.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${m.slice(0,-1).join(", ")} \u05D0\u05D5 ${x}`}case"too_big":{let m=o(d.origin),x=i(d.origin??"value");if(d.origin==="string")return`${m?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${m?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",_=d.inclusive?`${d.maximum} ${m?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${m?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${x} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let g=d.inclusive?"<=":"<",w=a(d.origin??"value");return m?.unit?`${m.longLabel} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.maximum.toString()} ${m.unit}`:`${m?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.maximum.toString()}`}case"too_small":{let m=o(d.origin),x=i(d.origin??"value");if(d.origin==="string")return`${m?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${m?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let A=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${A}`}if(d.origin==="array"||d.origin==="set"){let A=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let C=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${C}`}let _=d.inclusive?`${d.minimum} ${m?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${m?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${x} ${A} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let g=d.inclusive?">=":">",w=a(d.origin??"value");return m?.unit?`${m.shortLabel} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.minimum.toString()} ${m.unit}`:`${m?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${x} ${w} ${g}${d.minimum.toString()}`}case"invalid_format":{let m=d;if(m.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${m.prefix}"`;if(m.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${m.suffix}"`;if(m.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${m.includes}"`;if(m.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${m.pattern}`;let x=s[m.format],g=x?.label??m.format,A=(x?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${g} \u05DC\u05D0 ${A}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${O(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function gk(){return{localeError:KD()}}var WD=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${a}, a primljeno je ${s}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${L(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${a}${i.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Premalo: o\u010Dekivano da ${s} ima ${a}${i.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${a.prefix}"`:a.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${a.suffix}"`:a.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${a.includes}"`:a.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${a.pattern}`:`Neispravna ${r[a.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${O(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function vk(){return{localeError:WD()}}var LD=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${L(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${i.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${a}${i.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[a.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function xk(){return{localeError:LD()}}function yk(t,e,r){return Math.abs(t)===1?e:r}function wd(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var ZD=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${L(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=yk(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=yk(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wd(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${wd(i.origin)} \u056C\u056B\u0576\u056B ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[a.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${O(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${wd(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${wd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function wk(){return{localeError:ZD()}}var GD=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${L(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${r[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function bk(){return{localeError:GD()}}var HD=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${L(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${a}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${a}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${r[a.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${O(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function _k(){return{localeError:HD()}}var qD=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${s}`:`Input non valido: atteso ${a}, ricevuto ${s}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${L(i.values[0])}`:`Opzione non valida: atteso uno tra ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Input non valido: ${r[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${O(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function Ak(){return{localeError:qD()}}var JD=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${L(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${O(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(i.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(i.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${O(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Fk(){return{localeError:JD()}}var XD=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${L(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${O(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`:a.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`:a.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`:a.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${O(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Sk(){return{localeError:XD()}}var YD=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${L(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${O(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Ky(){return{localeError:YD()}}function Ek(){return Ky()}var QD=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${L(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${O(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),u=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${u} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${a}${o}`}case"too_small":{let a=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),u=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${u} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${a}${o}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[a.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${O(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Pk(){return{localeError:QD()}}var Rm=t=>t.charAt(0).toUpperCase()+t.slice(1);function $k(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}var eR=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,a,o,s){let u=t[i]??null;return u===null?u:{unit:u.unit[a],verb:u.verb[s][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${a}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${L(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${O(i.values,"|")} pasirinkim\u0173`;case"too_big":{let a=n[i.origin]??i.origin,o=e(i.origin,$k(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Rm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Rm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let a=n[i.origin]??i.origin,o=e(i.origin,$k(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Rm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Rm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${r[a.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${O(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=n[i.origin]??i.origin;return`${Rm(a??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function kk(){return{localeError:eR()}}var tR=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${L(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${O(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Mk(){return{localeError:tR()}}var rR=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${s}`:`Input tidak sah: dijangka ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${L(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: dijangka ${i.origin??"nilai"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: dijangka ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${r[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${O(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function Nk(){return{localeError:rR()}}var iR=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${a}, ontving ${s}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${L(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return o?`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return o?`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function Ik(){return{localeError:iR()}}var nR=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${s}`:`Ugyldig input: forventet ${a}, fikk ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${L(i.values[0])}`:`Ugyldig valg: forventet en av ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${O(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function Bk(){return{localeError:nR()}}var aR=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${L(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[a.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Tk(){return{localeError:aR()}}var oR=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${L(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${O(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[a.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${O(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Dk(){return{localeError:oR()}}var sR=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${s}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${L(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[a.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Rk(){return{localeError:sR()}}var lR=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${L(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${r[a.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${O(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function Ck(){return{localeError:lR()}}var uR=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return`Intrare invalid\u0103: a\u0219teptat ${a}, primit ${s}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${L(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Prea mic: a\u0219teptat ca ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${a.prefix}"`:a.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${a.suffix}"`:a.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${a.includes}"`:a.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${a.pattern}`:`Format invalid: ${r[a.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${O(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}};function zk(){return{localeError:uR()}}function Ok(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var cR=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${L(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),u=Ok(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),u=Ok(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${O(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Uk(){return{localeError:cR()}}var dR=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${s}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${L(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${r[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${O(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function Vk(){return{localeError:dR()}}var pR=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${s}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${L(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${r[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${O(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function jk(){return{localeError:pR()}}var fR=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${L(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${O(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Kk(){return{localeError:fR()}}var mR=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${L(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${O(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Wk(){return{localeError:mR()}}var hR=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${L(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[a.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Lk(){return{localeError:hR()}}var gR=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${L(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${O(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Wy(){return{localeError:gR()}}function Zk(){return Wy()}var vR=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${L(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${O(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${a}${i.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${a}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${O(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Gk(){return{localeError:vR()}}var xR=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${s}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${L(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[a.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Hk(){return{localeError:xR()}}var yR=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${L(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${r[a.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${O(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function qk(){return{localeError:yR()}}var wR=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${L(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${r[a.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${O(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Jk(){return{localeError:wR()}}var bR=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${L(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${O(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Xk(){return{localeError:bR()}}var _R=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=G(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${L(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${O(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${o.verb} ${a}${i.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.maximum}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${o.verb} ${a}${i.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.minimum}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${r[a.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${O(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Yk(){return{localeError:_R()}}var Qk,w1=Symbol("ZodOutput"),b1=Symbol("ZodInput"),Ly=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Zy(){return new Ly}(Qk=globalThis).__zod_globalRegistry??(Qk.__zod_globalRegistry=Zy());var Nr=globalThis.__zod_globalRegistry;function _1(t,e){return new t({type:"string",...J(e)})}function A1(t,e){return new t({type:"string",coerce:!0,...J(e)})}function Gy(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...J(e)})}function zm(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...J(e)})}function Hy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...J(e)})}function qy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(e)})}function Jy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(e)})}function Xy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(e)})}function Om(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...J(e)})}function Yy(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...J(e)})}function Qy(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(e)})}function ew(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...J(e)})}function tw(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(e)})}function rw(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...J(e)})}function iw(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...J(e)})}function nw(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(e)})}function aw(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(e)})}function ow(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(e)})}function F1(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...J(e)})}function sw(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(e)})}function lw(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(e)})}function uw(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...J(e)})}function cw(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...J(e)})}function dw(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...J(e)})}function pw(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...J(e)})}var S1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function E1(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(e)})}function P1(t,e){return new t({type:"string",format:"date",check:"string_format",...J(e)})}function $1(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...J(e)})}function k1(t,e){return new t({type:"string",format:"duration",check:"string_format",...J(e)})}function M1(t,e){return new t({type:"number",checks:[],...J(e)})}function N1(t,e){return new t({type:"number",coerce:!0,checks:[],...J(e)})}function I1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...J(e)})}function B1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...J(e)})}function T1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...J(e)})}function D1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...J(e)})}function R1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...J(e)})}function C1(t,e){return new t({type:"boolean",...J(e)})}function z1(t,e){return new t({type:"boolean",coerce:!0,...J(e)})}function O1(t,e){return new t({type:"bigint",...J(e)})}function U1(t,e){return new t({type:"bigint",coerce:!0,...J(e)})}function V1(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...J(e)})}function j1(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...J(e)})}function K1(t,e){return new t({type:"symbol",...J(e)})}function W1(t,e){return new t({type:"undefined",...J(e)})}function L1(t,e){return new t({type:"null",...J(e)})}function Z1(t){return new t({type:"any"})}function G1(t){return new t({type:"unknown"})}function H1(t,e){return new t({type:"never",...J(e)})}function q1(t,e){return new t({type:"void",...J(e)})}function J1(t,e){return new t({type:"date",...J(e)})}function X1(t,e){return new t({type:"date",coerce:!0,...J(e)})}function Y1(t,e){return new t({type:"nan",...J(e)})}function Ra(t,e){return new Ny({check:"less_than",...J(e),value:t,inclusive:!1})}function ji(t,e){return new Ny({check:"less_than",...J(e),value:t,inclusive:!0})}function Ca(t,e){return new Iy({check:"greater_than",...J(e),value:t,inclusive:!1})}function ri(t,e){return new Iy({check:"greater_than",...J(e),value:t,inclusive:!0})}function fw(t){return Ca(0,t)}function mw(t){return Ra(0,t)}function hw(t){return ji(0,t)}function gw(t){return ri(0,t)}function ys(t,e){return new L0({check:"multiple_of",...J(e),value:t})}function ws(t,e){return new H0({check:"max_size",...J(e),maximum:t})}function za(t,e){return new q0({check:"min_size",...J(e),minimum:t})}function Yl(t,e){return new J0({check:"size_equals",...J(e),size:t})}function Ql(t,e){return new X0({check:"max_length",...J(e),maximum:t})}function vo(t,e){return new Y0({check:"min_length",...J(e),minimum:t})}function eu(t,e){return new Q0({check:"length_equals",...J(e),length:t})}function bd(t,e){return new eA({check:"string_format",format:"regex",...J(e),pattern:t})}function _d(t){return new tA({check:"string_format",format:"lowercase",...J(t)})}function Ad(t){return new rA({check:"string_format",format:"uppercase",...J(t)})}function Fd(t,e){return new iA({check:"string_format",format:"includes",...J(e),includes:t})}function Sd(t,e){return new nA({check:"string_format",format:"starts_with",...J(e),prefix:t})}function Ed(t,e){return new aA({check:"string_format",format:"ends_with",...J(e),suffix:t})}function vw(t,e,r){return new oA({check:"property",property:t,schema:e,...J(r)})}function Pd(t,e){return new sA({check:"mime_type",mime:t,...J(e)})}function Qn(t){return new lA({check:"overwrite",tx:t})}function $d(t){return Qn(e=>e.normalize(t))}function kd(){return Qn(t=>t.trim())}function Md(){return Qn(t=>t.toLowerCase())}function Nd(){return Qn(t=>t.toUpperCase())}function Id(){return Qn(t=>n0(t))}function Q1(t,e,r){return new t({type:"array",element:e,...J(r)})}function FR(t,e,r){return new t({type:"union",options:e,...J(r)})}function SR(t,e,r){return new t({type:"union",options:e,inclusive:!1,...J(r)})}function ER(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...J(n)})}function PR(t,e,r){return new t({type:"intersection",left:e,right:r})}function $R(t,e,r,n){let i=r instanceof Pe,a=i?n:r,o=i?r:null;return new t({type:"tuple",items:e,rest:o,...J(a)})}function kR(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...J(n)})}function MR(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...J(n)})}function NR(t,e,r){return new t({type:"set",valueType:e,...J(r)})}function IR(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...J(r)})}function BR(t,e,r){return new t({type:"enum",entries:e,...J(r)})}function TR(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...J(r)})}function eF(t,e){return new t({type:"file",...J(e)})}function DR(t,e){return new t({type:"transform",transform:e})}function RR(t,e){return new t({type:"optional",innerType:e})}function CR(t,e){return new t({type:"nullable",innerType:e})}function zR(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():o0(r)}})}function OR(t,e,r){return new t({type:"nonoptional",innerType:e,...J(r)})}function UR(t,e){return new t({type:"success",innerType:e})}function VR(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function jR(t,e,r){return new t({type:"pipe",in:e,out:r})}function KR(t,e){return new t({type:"readonly",innerType:e})}function WR(t,e,r){return new t({type:"template_literal",parts:e,...J(r)})}function LR(t,e){return new t({type:"lazy",getter:e})}function ZR(t,e){return new t({type:"promise",innerType:e})}function tF(t,e,r){let n=J(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function rF(t,e,r){return new t({type:"custom",check:"custom",fn:e,...J(r)})}function iF(t,e){let r=eM(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(md(i,n.value,r._zod.def));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(md(a))}},t(n.value,n)),e);return r}function eM(t,e){let r=new ft({check:"custom",...J(e)});return r._zod.check=t,r}function nF(t){let e=new ft({check:"describe"});return e._zod.onattach=[r=>{let n=Nr.get(r)??{};Nr.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function aF(t){let e=new ft({check:"meta"});return e._zod.onattach=[r=>{let n=Nr.get(r)??{};Nr.add(r,{...n,...t})}],e._zod.check=()=>{},e}function oF(t,e){let r=J(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(w=>typeof w=="string"?w.toLowerCase():w),i=i.map(w=>typeof w=="string"?w.toLowerCase():w));let a=new Set(n),o=new Set(i),s=t.Codec??Dm,u=t.Boolean??Bm,d=t.String??Xl,m=new d({type:"string",error:r.error}),x=new u({type:"boolean",error:r.error}),g=new s({type:"pipe",in:m,out:x,transform:((w,A)=>{let _=w;return r.case!=="sensitive"&&(_=_.toLowerCase()),a.has(_)?!0:o.has(_)?!1:(A.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:A.value,inst:g,continue:!1}),{})}),reverseTransform:((w,A)=>w===!0?n[0]||"true":i[0]||"false"),error:r.error});return g}function Bd(t,e,r,n={}){let i=J(n),a={...J(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(a.pattern=r),new t(a)}function bs(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Nr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function lt(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let s=t._zod.toJSONSchema?.();if(s)o.schema=s;else{let m={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,m);else{let g=o.schema,w=e.processors[i.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);w(t,e,g,m)}let x=t._zod.parent;x&&(o.ref||(o.ref=x),lt(x,e,m),e.seen.get(x).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(o.schema,u),e.io==="input"&&ii(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function _s(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of t.seen.entries()){let s=t.metadataRegistry.get(o[0])?.id;if(s){let u=n.get(s);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,o[0])}}let i=o=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let x=t.external.registry.get(o[0])?.id,g=t.external.uri??(A=>A);if(x)return{ref:g(x)};let w=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=w,{defId:w,ref:`${g("__shared")}#/${s}/${w}`}}if(o[1]===r)return{ref:"#"};let d=`#/${s}/`,m=o[1].schema.id??`__schema${t.counter++}`;return{defId:m,ref:d+m}},a=o=>{if(o[1].schema.$ref)return;let s=o[1],{ref:u,defId:d}=i(o);s.def={...s.schema},d&&(s.defId=d);let m=s.schema;for(let x in m)delete m[x];m.$ref=u};if(t.cycles==="throw")for(let o of t.seen.entries()){let s=o[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
111
111
 
112
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let d=t.external.registry.get(o[0])?.id;if(e!==o[0]&&d){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function As(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let u=t.seen.get(s);if(u.ref===null)return;let d=u.def??u.schema,m={...d},x=u.ref;if(u.ref=null,x){n(x);let w=t.seen.get(x),A=w.schema;if(A.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(A)):Object.assign(d,A),Object.assign(d,m),s._zod.parent===x)for(let C in d)C==="$ref"||C==="allOf"||C in m||delete d[C];if(A.$ref&&w.def)for(let C in d)C==="$ref"||C==="allOf"||C in w.def&&JSON.stringify(d[C])===JSON.stringify(w.def[C])&&delete d[C]}let g=s._zod.parent;if(g&&g!==x){n(g);let w=t.seen.get(g);if(w?.schema.$ref&&(d.$ref=w.schema.$ref,w.def))for(let A in d)A==="$ref"||A==="allOf"||A in w.def&&JSON.stringify(d[A])===JSON.stringify(w.def[A])&&delete d[A]}t.override({zodSchema:s,jsonSchema:d,path:u.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let a=t.metadataRegistry.get(e)?.id;a!==void 0&&i.id===a&&delete i.id;let o=t.external?.defs??{};for(let s of t.seen.entries()){let u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Td(e,"input",t.processors),output:Td(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ii(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ii(n.element,r);if(n.type==="set")return ii(n.valueType,r);if(n.type==="lazy")return ii(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ii(n.innerType,r);if(n.type==="intersection")return ii(n.left,r)||ii(n.right,r);if(n.type==="record"||n.type==="map")return ii(n.keyType,r)||ii(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ii(n.in,r)||ii(n.out,r);if(n.type==="object"){for(let i in n.shape)if(ii(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(ii(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(ii(i,r))return!0;return!!(n.rest&&ii(n.rest,r))}return!1}var sF=(t,e={})=>r=>{let n=bs({...r,processors:e});return lt(t,n),_s(n,t),As(n,t)},Td=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=bs({...i??{},target:a,io:e,processors:r});return lt(t,o),_s(o,t),As(o,t)};var GR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=GR[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),d&&(i.contentEncoding=d),u&&u.size>0){let m=[...u];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(x=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},uF=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:m}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number";let x=typeof m=="number"&&m>=(a??Number.NEGATIVE_INFINITY),g=typeof d=="number"&&d<=(o??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";x?w?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m:typeof a=="number"&&(i.minimum=a),g?w?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d:typeof o=="number"&&(i.maximum=o),typeof u=="number"&&(i.multipleOf=u)},cF=(t,e,r,n)=>{r.type="boolean"},dF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},pF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},fF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},mF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},gF=(t,e,r,n)=>{r.not={}},vF=(t,e,r,n)=>{},xF=(t,e,r,n)=>{},yF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wF=(t,e,r,n)=>{let i=t._zod.def,a=_m(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},bF=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},_F=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},AF=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},FF=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:u}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),u?u.length===1?(a.contentMediaType=u[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(i,a)},SF=(t,e,r,n)=>{r.type="boolean"},EF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$F=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},MF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},NF=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=lt(a.element,e,{...n,path:[...n.path,"items"]})},IF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let d in o)i.properties[d]=lt(o[d],e,{...n,path:[...n.path,"properties",d]});let s=new Set(Object.keys(o)),u=new Set([...s].filter(d=>{let m=a.shape[d]._zod;return e.io==="input"?m.optin===void 0:m.optout===void 0}));u.size>0&&(i.required=Array.from(u)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=lt(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},yw=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,u)=>lt(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?r.oneOf=o:r.anyOf=o},BF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=lt(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,u=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=u},TF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((g,w)=>lt(g,e,{...n,path:[...n.path,o,w]})),d=a.rest?lt(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=u,d&&(i.items=d)):e.target==="openapi-3.0"?(i.items={anyOf:u},d&&i.items.anyOf.push(d),i.minItems=u.length,d||(i.maxItems=u.length)):(i.items=u,d&&(i.additionalItems=d));let{minimum:m,maximum:x}=t._zod.bag;typeof m=="number"&&(i.minItems=m),typeof x=="number"&&(i.maxItems=x)},DF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,u=o._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){let m=lt(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let x of u)i.patternProperties[x.source]=m}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=lt(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=lt(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let d=o._zod.values;if(d){let m=[...d].filter(x=>typeof x=="string"||typeof x=="number");m.length>0&&(i.required=m)}},RF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},CF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},zF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},OF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},UF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},VF=(t,e,r,n)=>{let i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?a?i.out:i.in:i.out;lt(o,e,n);let s=e.seen.get(t);s.ref=o},jF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},KF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},ww=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},WF=(t,e,r,n)=>{let i=t._zod.innerType;lt(i,e,n);let a=e.seen.get(t);a.ref=i},xw={string:lF,number:uF,boolean:cF,bigint:dF,symbol:pF,null:fF,undefined:mF,void:hF,never:gF,any:vF,unknown:xF,date:yF,enum:wF,literal:bF,nan:_F,template_literal:AF,file:FF,success:SF,custom:EF,function:PF,transform:$F,map:kF,set:MF,array:NF,object:IF,union:yw,intersection:BF,tuple:TF,record:DF,nullable:RF,nonoptional:CF,default:zF,prefault:OF,catch:UF,pipe:VF,readonly:jF,promise:KF,optional:ww,lazy:WF};function bw(t,e){if("_idmap"in t){let n=t,i=bs({...e,processors:xw}),a={};for(let u of n._idmap.entries()){let[d,m]=u;lt(m,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let u of n._idmap.entries()){let[d,m]=u;_s(i,m),o[d]=As(i,m)}if(Object.keys(a).length>0){let u=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[u]:a}}return{schemas:o}}let r=bs({...e,processors:xw});return lt(t,r),_s(r,t),As(r,t)}var _w=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=bs({processors:xw,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return lt(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),_s(this.ctx,e);let n=As(this.ctx,e),{"~standard":i,...a}=n;return a}};var tM={};var Um={};Va(Um,{ZodAny:()=>mS,ZodArray:()=>xS,ZodBase64:()=>Kw,ZodBase64URL:()=>Ww,ZodBigInt:()=>jd,ZodBigIntFormat:()=>Gw,ZodBoolean:()=>Vd,ZodCIDRv4:()=>Vw,ZodCIDRv6:()=>jw,ZodCUID:()=>Tw,ZodCUID2:()=>Dw,ZodCatch:()=>US,ZodCodec:()=>Ym,ZodCustom:()=>Qm,ZodCustomStringFormat:()=>Od,ZodDate:()=>Gm,ZodDefault:()=>TS,ZodDiscriminatedUnion:()=>wS,ZodE164:()=>Lw,ZodEmail:()=>Nw,ZodEmoji:()=>Iw,ZodEnum:()=>Cd,ZodExactOptional:()=>NS,ZodFile:()=>kS,ZodFunction:()=>JS,ZodGUID:()=>jm,ZodIPv4:()=>Ow,ZodIPv6:()=>Uw,ZodIntersection:()=>bS,ZodJWT:()=>Zw,ZodKSUID:()=>zw,ZodLazy:()=>GS,ZodLiteral:()=>$S,ZodMAC:()=>sS,ZodMap:()=>ES,ZodNaN:()=>jS,ZodNanoID:()=>Bw,ZodNever:()=>gS,ZodNonOptional:()=>Qw,ZodNull:()=>pS,ZodNullable:()=>BS,ZodNumber:()=>Ud,ZodNumberFormat:()=>ru,ZodObject:()=>qm,ZodOptional:()=>Yw,ZodPipe:()=>Xm,ZodPrefault:()=>RS,ZodPreprocess:()=>KS,ZodPromise:()=>qS,ZodReadonly:()=>WS,ZodRecord:()=>Rd,ZodSet:()=>PS,ZodString:()=>zd,ZodStringFormat:()=>dt,ZodSuccess:()=>OS,ZodSymbol:()=>cS,ZodTemplateLiteral:()=>ZS,ZodTransform:()=>MS,ZodTuple:()=>AS,ZodType:()=>De,ZodULID:()=>Rw,ZodURL:()=>Zm,ZodUUID:()=>Oa,ZodUndefined:()=>dS,ZodUnion:()=>Jm,ZodUnknown:()=>hS,ZodVoid:()=>vS,ZodXID:()=>Cw,ZodXor:()=>yS,_ZodString:()=>Mw,_default:()=>DS,_function:()=>cN,any:()=>VM,array:()=>Hm,base64:()=>FM,base64url:()=>SM,bigint:()=>RM,boolean:()=>uS,catch:()=>VS,check:()=>dN,cidrv4:()=>_M,cidrv6:()=>AM,codec:()=>oN,cuid:()=>mM,cuid2:()=>hM,custom:()=>pN,date:()=>KM,describe:()=>fN,discriminatedUnion:()=>qM,e164:()=>EM,email:()=>nM,emoji:()=>pM,enum:()=>Jw,exactOptional:()=>IS,file:()=>rN,float32:()=>IM,float64:()=>BM,function:()=>cN,guid:()=>aM,hash:()=>NM,hex:()=>MM,hostname:()=>kM,httpUrl:()=>dM,instanceof:()=>hN,int:()=>$w,int32:()=>TM,int64:()=>CM,intersection:()=>_S,invertCodec:()=>sN,ipv4:()=>yM,ipv6:()=>bM,json:()=>vN,jwt:()=>PM,keyof:()=>WM,ksuid:()=>xM,lazy:()=>HS,literal:()=>tN,looseObject:()=>GM,looseRecord:()=>XM,mac:()=>wM,map:()=>YM,meta:()=>mN,nan:()=>aN,nanoid:()=>fM,nativeEnum:()=>eN,never:()=>Hw,nonoptional:()=>zS,null:()=>fS,nullable:()=>Wm,nullish:()=>iN,number:()=>lS,object:()=>LM,optional:()=>Km,partialRecord:()=>JM,pipe:()=>kw,prefault:()=>CS,preprocess:()=>xN,promise:()=>uN,readonly:()=>LS,record:()=>SS,refine:()=>XS,set:()=>QM,strictObject:()=>ZM,string:()=>Vm,stringFormat:()=>$M,stringbool:()=>gN,success:()=>nN,superRefine:()=>YS,symbol:()=>OM,templateLiteral:()=>lN,transform:()=>Xw,tuple:()=>FS,uint32:()=>DM,uint64:()=>zM,ulid:()=>gM,undefined:()=>UM,union:()=>qw,unknown:()=>tu,url:()=>cM,uuid:()=>oM,uuidv4:()=>sM,uuidv6:()=>lM,uuidv7:()=>uM,void:()=>jM,xid:()=>vM,xor:()=>HM});var Aw={};Va(Aw,{endsWith:()=>Ed,gt:()=>Ca,gte:()=>ri,includes:()=>Fd,length:()=>eu,lowercase:()=>_d,lt:()=>Ra,lte:()=>ji,maxLength:()=>Ql,maxSize:()=>ws,mime:()=>Pd,minLength:()=>vo,minSize:()=>za,multipleOf:()=>ys,negative:()=>mw,nonnegative:()=>gw,nonpositive:()=>hw,normalize:()=>$d,overwrite:()=>Qn,positive:()=>fw,property:()=>vw,regex:()=>bd,size:()=>Yl,slugify:()=>Id,startsWith:()=>Sd,toLowerCase:()=>Md,toUpperCase:()=>Nd,trim:()=>kd,uppercase:()=>Ad});var Dd={};Va(Dd,{ZodISODate:()=>Sw,ZodISODateTime:()=>Fw,ZodISODuration:()=>Pw,ZodISOTime:()=>Ew,date:()=>ZF,datetime:()=>LF,duration:()=>HF,time:()=>GF});var Fw=I("ZodISODateTime",(t,e)=>{_A.init(t,e),dt.init(t,e)});function LF(t){return E1(Fw,t)}var Sw=I("ZodISODate",(t,e)=>{AA.init(t,e),dt.init(t,e)});function ZF(t){return P1(Sw,t)}var Ew=I("ZodISOTime",(t,e)=>{FA.init(t,e),dt.init(t,e)});function GF(t){return $1(Ew,t)}var Pw=I("ZodISODuration",(t,e)=>{SA.init(t,e),dt.init(t,e)});function HF(t){return k1(Pw,t)}var rM=(t,e)=>{Pm.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>km(t,r)},flatten:{value:r=>$m(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,pd,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,pd,2)}},isEmpty:{get(){return t.issues.length===0}}})},qR=I("ZodError",rM),bi=I("ZodError",rM,{Parent:Error});var qF=hd(bi),JF=gd(bi),XF=vd(bi),YF=xd(bi),QF=by(bi),eS=_y(bi),tS=Ay(bi),rS=Fy(bi),iS=Sy(bi),nS=Ey(bi),aS=Py(bi),oS=$y(bi);var iM=new WeakMap;function Lm(t,e,r){let n=Object.getPrototypeOf(t),i=iM.get(n);if(i||(i=new Set,iM.set(n,i)),!i.has(e)){i.add(e);for(let a in r){let o=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){let s=o.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var De=I("ZodType",(t,e)=>(Pe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Td(t,"input"),output:Td(t,"output")}}),t.toJSONSchema=sF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>qF(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>XF(t,r,n),t.parseAsync=async(r,n)=>JF(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>YF(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>QF(t,r,n),t.decode=(r,n)=>eS(t,r,n),t.encodeAsync=async(r,n)=>tS(t,r,n),t.decodeAsync=async(r,n)=>rS(t,r,n),t.safeEncode=(r,n)=>iS(t,r,n),t.safeDecode=(r,n)=>nS(t,r,n),t.safeEncodeAsync=async(r,n)=>aS(t,r,n),t.safeDecodeAsync=async(r,n)=>oS(t,r,n),Lm(t,"ZodType",{check(...r){let n=this.def;return this.clone(H.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return ei(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(XS(r,n))},superRefine(r,n){return this.check(YS(r,n))},overwrite(r){return this.check(Qn(r))},optional(){return Km(this)},exactOptional(){return IS(this)},nullable(){return Wm(this)},nullish(){return Km(Wm(this))},nonoptional(r){return zS(this,r)},array(){return Hm(this)},or(r){return qw([this,r])},and(r){return _S(this,r)},transform(r){return kw(this,Xw(r))},default(r){return DS(this,r)},prefault(r){return CS(this,r)},catch(r){return VS(this,r)},pipe(r){return kw(this,r)},readonly(){return LS(this)},describe(r){let n=this.clone();return Nr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Nr.get(this);let n=this.clone();return Nr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Nr.get(t)?.description},configurable:!0}),t)),Mw=I("_ZodString",(t,e)=>{Xl.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>lF(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Lm(t,"_ZodString",{regex(...n){return this.check(bd(...n))},includes(...n){return this.check(Fd(...n))},startsWith(...n){return this.check(Sd(...n))},endsWith(...n){return this.check(Ed(...n))},min(...n){return this.check(vo(...n))},max(...n){return this.check(Ql(...n))},length(...n){return this.check(eu(...n))},nonempty(...n){return this.check(vo(1,...n))},lowercase(n){return this.check(_d(n))},uppercase(n){return this.check(Ad(n))},trim(){return this.check(kd())},normalize(...n){return this.check($d(...n))},toLowerCase(){return this.check(Md())},toUpperCase(){return this.check(Nd())},slugify(){return this.check(Id())}})}),zd=I("ZodString",(t,e)=>{Xl.init(t,e),Mw.init(t,e),t.email=r=>t.check(Gy(Nw,r)),t.url=r=>t.check(Om(Zm,r)),t.jwt=r=>t.check(pw(Zw,r)),t.emoji=r=>t.check(Yy(Iw,r)),t.guid=r=>t.check(zm(jm,r)),t.uuid=r=>t.check(Hy(Oa,r)),t.uuidv4=r=>t.check(qy(Oa,r)),t.uuidv6=r=>t.check(Jy(Oa,r)),t.uuidv7=r=>t.check(Xy(Oa,r)),t.nanoid=r=>t.check(Qy(Bw,r)),t.guid=r=>t.check(zm(jm,r)),t.cuid=r=>t.check(ew(Tw,r)),t.cuid2=r=>t.check(tw(Dw,r)),t.ulid=r=>t.check(rw(Rw,r)),t.base64=r=>t.check(uw(Kw,r)),t.base64url=r=>t.check(cw(Ww,r)),t.xid=r=>t.check(iw(Cw,r)),t.ksuid=r=>t.check(nw(zw,r)),t.ipv4=r=>t.check(aw(Ow,r)),t.ipv6=r=>t.check(ow(Uw,r)),t.cidrv4=r=>t.check(sw(Vw,r)),t.cidrv6=r=>t.check(lw(jw,r)),t.e164=r=>t.check(dw(Lw,r)),t.datetime=r=>t.check(LF(r)),t.date=r=>t.check(ZF(r)),t.time=r=>t.check(GF(r)),t.duration=r=>t.check(HF(r))});function Vm(t){return _1(zd,t)}var dt=I("ZodStringFormat",(t,e)=>{ct.init(t,e),Mw.init(t,e)}),Nw=I("ZodEmail",(t,e)=>{fA.init(t,e),dt.init(t,e)});function nM(t){return Gy(Nw,t)}var jm=I("ZodGUID",(t,e)=>{dA.init(t,e),dt.init(t,e)});function aM(t){return zm(jm,t)}var Oa=I("ZodUUID",(t,e)=>{pA.init(t,e),dt.init(t,e)});function oM(t){return Hy(Oa,t)}function sM(t){return qy(Oa,t)}function lM(t){return Jy(Oa,t)}function uM(t){return Xy(Oa,t)}var Zm=I("ZodURL",(t,e)=>{mA.init(t,e),dt.init(t,e)});function cM(t){return Om(Zm,t)}function dM(t){return Om(Zm,{protocol:Vi.httpProtocol,hostname:Vi.domain,...H.normalizeParams(t)})}var Iw=I("ZodEmoji",(t,e)=>{hA.init(t,e),dt.init(t,e)});function pM(t){return Yy(Iw,t)}var Bw=I("ZodNanoID",(t,e)=>{gA.init(t,e),dt.init(t,e)});function fM(t){return Qy(Bw,t)}var Tw=I("ZodCUID",(t,e)=>{vA.init(t,e),dt.init(t,e)});function mM(t){return ew(Tw,t)}var Dw=I("ZodCUID2",(t,e)=>{xA.init(t,e),dt.init(t,e)});function hM(t){return tw(Dw,t)}var Rw=I("ZodULID",(t,e)=>{yA.init(t,e),dt.init(t,e)});function gM(t){return rw(Rw,t)}var Cw=I("ZodXID",(t,e)=>{wA.init(t,e),dt.init(t,e)});function vM(t){return iw(Cw,t)}var zw=I("ZodKSUID",(t,e)=>{bA.init(t,e),dt.init(t,e)});function xM(t){return nw(zw,t)}var Ow=I("ZodIPv4",(t,e)=>{EA.init(t,e),dt.init(t,e)});function yM(t){return aw(Ow,t)}var sS=I("ZodMAC",(t,e)=>{$A.init(t,e),dt.init(t,e)});function wM(t){return F1(sS,t)}var Uw=I("ZodIPv6",(t,e)=>{PA.init(t,e),dt.init(t,e)});function bM(t){return ow(Uw,t)}var Vw=I("ZodCIDRv4",(t,e)=>{kA.init(t,e),dt.init(t,e)});function _M(t){return sw(Vw,t)}var jw=I("ZodCIDRv6",(t,e)=>{MA.init(t,e),dt.init(t,e)});function AM(t){return lw(jw,t)}var Kw=I("ZodBase64",(t,e)=>{IA.init(t,e),dt.init(t,e)});function FM(t){return uw(Kw,t)}var Ww=I("ZodBase64URL",(t,e)=>{BA.init(t,e),dt.init(t,e)});function SM(t){return cw(Ww,t)}var Lw=I("ZodE164",(t,e)=>{TA.init(t,e),dt.init(t,e)});function EM(t){return dw(Lw,t)}var Zw=I("ZodJWT",(t,e)=>{DA.init(t,e),dt.init(t,e)});function PM(t){return pw(Zw,t)}var Od=I("ZodCustomStringFormat",(t,e)=>{RA.init(t,e),dt.init(t,e)});function $M(t,e,r={}){return Bd(Od,t,e,r)}function kM(t){return Bd(Od,"hostname",Vi.hostname,t)}function MM(t){return Bd(Od,"hex",Vi.hex,t)}function NM(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Vi[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Bd(Od,n,i,e)}var Ud=I("ZodNumber",(t,e)=>{Cy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>uF(t,n,i,a),Lm(t,"ZodNumber",{gt(n,i){return this.check(Ca(n,i))},gte(n,i){return this.check(ri(n,i))},min(n,i){return this.check(ri(n,i))},lt(n,i){return this.check(Ra(n,i))},lte(n,i){return this.check(ji(n,i))},max(n,i){return this.check(ji(n,i))},int(n){return this.check($w(n))},safe(n){return this.check($w(n))},positive(n){return this.check(Ca(0,n))},nonnegative(n){return this.check(ri(0,n))},negative(n){return this.check(Ra(0,n))},nonpositive(n){return this.check(ji(0,n))},multipleOf(n,i){return this.check(ys(n,i))},step(n,i){return this.check(ys(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function lS(t){return M1(Ud,t)}var ru=I("ZodNumberFormat",(t,e)=>{CA.init(t,e),Ud.init(t,e)});function $w(t){return I1(ru,t)}function IM(t){return B1(ru,t)}function BM(t){return T1(ru,t)}function TM(t){return D1(ru,t)}function DM(t){return R1(ru,t)}var Vd=I("ZodBoolean",(t,e)=>{Bm.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cF(t,r,n,i)});function uS(t){return C1(Vd,t)}var jd=I("ZodBigInt",(t,e)=>{zy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>dF(t,n,i,a),t.gte=(n,i)=>t.check(ri(n,i)),t.min=(n,i)=>t.check(ri(n,i)),t.gt=(n,i)=>t.check(Ca(n,i)),t.gte=(n,i)=>t.check(ri(n,i)),t.min=(n,i)=>t.check(ri(n,i)),t.lt=(n,i)=>t.check(Ra(n,i)),t.lte=(n,i)=>t.check(ji(n,i)),t.max=(n,i)=>t.check(ji(n,i)),t.positive=n=>t.check(Ca(BigInt(0),n)),t.negative=n=>t.check(Ra(BigInt(0),n)),t.nonpositive=n=>t.check(ji(BigInt(0),n)),t.nonnegative=n=>t.check(ri(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(ys(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function RM(t){return O1(jd,t)}var Gw=I("ZodBigIntFormat",(t,e)=>{zA.init(t,e),jd.init(t,e)});function CM(t){return V1(Gw,t)}function zM(t){return j1(Gw,t)}var cS=I("ZodSymbol",(t,e)=>{OA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pF(t,r,n,i)});function OM(t){return K1(cS,t)}var dS=I("ZodUndefined",(t,e)=>{UA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mF(t,r,n,i)});function UM(t){return W1(dS,t)}var pS=I("ZodNull",(t,e)=>{VA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fF(t,r,n,i)});function fS(t){return L1(pS,t)}var mS=I("ZodAny",(t,e)=>{jA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vF(t,r,n,i)});function VM(){return Z1(mS)}var hS=I("ZodUnknown",(t,e)=>{KA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xF(t,r,n,i)});function tu(){return G1(hS)}var gS=I("ZodNever",(t,e)=>{WA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gF(t,r,n,i)});function Hw(t){return H1(gS,t)}var vS=I("ZodVoid",(t,e)=>{LA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hF(t,r,n,i)});function jM(t){return q1(vS,t)}var Gm=I("ZodDate",(t,e)=>{ZA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>yF(t,n,i,a),t.min=(n,i)=>t.check(ri(n,i)),t.max=(n,i)=>t.check(ji(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function KM(t){return J1(Gm,t)}var xS=I("ZodArray",(t,e)=>{GA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NF(t,r,n,i),t.element=e.element,Lm(t,"ZodArray",{min(r,n){return this.check(vo(r,n))},nonempty(r){return this.check(vo(1,r))},max(r,n){return this.check(Ql(r,n))},length(r,n){return this.check(eu(r,n))},unwrap(){return this.element}})});function Hm(t,e){return Q1(xS,t,e)}function WM(t){let e=t._zod.def.shape;return Jw(Object.keys(e))}var qm=I("ZodObject",(t,e)=>{HA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IF(t,r,n,i),H.defineLazy(t,"shape",()=>e.shape),Lm(t,"ZodObject",{keyof(){return Jw(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tu()})},loose(){return this.clone({...this._zod.def,catchall:tu()})},strict(){return this.clone({...this._zod.def,catchall:Hw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return H.extend(this,r)},safeExtend(r){return H.safeExtend(this,r)},merge(r){return H.merge(this,r)},pick(r){return H.pick(this,r)},omit(r){return H.omit(this,r)},partial(...r){return H.partial(Yw,this,r[0])},required(...r){return H.required(Qw,this,r[0])}})});function LM(t,e){let r={type:"object",shape:t??{},...H.normalizeParams(e)};return new qm(r)}function ZM(t,e){return new qm({type:"object",shape:t,catchall:Hw(),...H.normalizeParams(e)})}function GM(t,e){return new qm({type:"object",shape:t,catchall:tu(),...H.normalizeParams(e)})}var Jm=I("ZodUnion",(t,e)=>{Tm.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yw(t,r,n,i),t.options=e.options});function qw(t,e){return new Jm({type:"union",options:t,...H.normalizeParams(e)})}var yS=I("ZodXor",(t,e)=>{Jm.init(t,e),qA.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yw(t,r,n,i),t.options=e.options});function HM(t,e){return new yS({type:"union",options:t,inclusive:!1,...H.normalizeParams(e)})}var wS=I("ZodDiscriminatedUnion",(t,e)=>{Jm.init(t,e),JA.init(t,e)});function qM(t,e,r){return new wS({type:"union",options:e,discriminator:t,...H.normalizeParams(r)})}var bS=I("ZodIntersection",(t,e)=>{XA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BF(t,r,n,i)});function _S(t,e){return new bS({type:"intersection",left:t,right:e})}var AS=I("ZodTuple",(t,e)=>{Oy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TF(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function FS(t,e,r){let n=e instanceof Pe,i=n?r:e,a=n?e:null;return new AS({type:"tuple",items:t,rest:a,...H.normalizeParams(i)})}var Rd=I("ZodRecord",(t,e)=>{YA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function SS(t,e,r){return!e||!e._zod?new Rd({type:"record",keyType:Vm(),valueType:t,...H.normalizeParams(e)}):new Rd({type:"record",keyType:t,valueType:e,...H.normalizeParams(r)})}function JM(t,e,r){let n=ei(t);return n._zod.values=void 0,new Rd({type:"record",keyType:n,valueType:e,...H.normalizeParams(r)})}function XM(t,e,r){return new Rd({type:"record",keyType:t,valueType:e,mode:"loose",...H.normalizeParams(r)})}var ES=I("ZodMap",(t,e)=>{QA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(za(...r)),t.nonempty=r=>t.check(za(1,r)),t.max=(...r)=>t.check(ws(...r)),t.size=(...r)=>t.check(Yl(...r))});function YM(t,e,r){return new ES({type:"map",keyType:t,valueType:e,...H.normalizeParams(r)})}var PS=I("ZodSet",(t,e)=>{e1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MF(t,r,n,i),t.min=(...r)=>t.check(za(...r)),t.nonempty=r=>t.check(za(1,r)),t.max=(...r)=>t.check(ws(...r)),t.size=(...r)=>t.check(Yl(...r))});function QM(t,e){return new PS({type:"set",valueType:t,...H.normalizeParams(e)})}var Cd=I("ZodEnum",(t,e)=>{t1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>wF(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Cd({...e,checks:[],...H.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Cd({...e,checks:[],...H.normalizeParams(i),entries:a})}});function Jw(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Cd({type:"enum",entries:r,...H.normalizeParams(e)})}function eN(t,e){return new Cd({type:"enum",entries:t,...H.normalizeParams(e)})}var $S=I("ZodLiteral",(t,e)=>{r1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bF(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function tN(t,e){return new $S({type:"literal",values:Array.isArray(t)?t:[t],...H.normalizeParams(e)})}var kS=I("ZodFile",(t,e)=>{i1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FF(t,r,n,i),t.min=(r,n)=>t.check(za(r,n)),t.max=(r,n)=>t.check(ws(r,n)),t.mime=(r,n)=>t.check(Pd(Array.isArray(r)?r:[r],n))});function rN(t){return eF(kS,t)}var MS=I("ZodTransform",(t,e)=>{n1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$F(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ms(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(H.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(H.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Xw(t){return new MS({type:"transform",transform:t})}var Yw=I("ZodOptional",(t,e)=>{Uy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ww(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Km(t){return new Yw({type:"optional",innerType:t})}var NS=I("ZodExactOptional",(t,e)=>{a1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ww(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function IS(t){return new NS({type:"optional",innerType:t})}var BS=I("ZodNullable",(t,e)=>{o1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Wm(t){return new BS({type:"nullable",innerType:t})}function iN(t){return Km(Wm(t))}var TS=I("ZodDefault",(t,e)=>{s1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function DS(t,e){return new TS({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var RS=I("ZodPrefault",(t,e)=>{l1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function CS(t,e){return new RS({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var Qw=I("ZodNonOptional",(t,e)=>{u1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function zS(t,e){return new Qw({type:"nonoptional",innerType:t,...H.normalizeParams(e)})}var OS=I("ZodSuccess",(t,e)=>{c1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nN(t){return new OS({type:"success",innerType:t})}var US=I("ZodCatch",(t,e)=>{d1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function VS(t,e){return new US({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var jS=I("ZodNaN",(t,e)=>{p1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_F(t,r,n,i)});function aN(t){return Y1(jS,t)}var Xm=I("ZodPipe",(t,e)=>{Vy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VF(t,r,n,i),t.in=e.in,t.out=e.out});function kw(t,e){return new Xm({type:"pipe",in:t,out:e})}var Ym=I("ZodCodec",(t,e)=>{Xm.init(t,e),Dm.init(t,e)});function oN(t,e,r){return new Ym({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function sN(t){let e=t._zod.def;return new Ym({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var KS=I("ZodPreprocess",(t,e)=>{Xm.init(t,e),f1.init(t,e)}),WS=I("ZodReadonly",(t,e)=>{m1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function LS(t){return new WS({type:"readonly",innerType:t})}var ZS=I("ZodTemplateLiteral",(t,e)=>{h1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AF(t,r,n,i)});function lN(t,e){return new ZS({type:"template_literal",parts:t,...H.normalizeParams(e)})}var GS=I("ZodLazy",(t,e)=>{x1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WF(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function HS(t){return new GS({type:"lazy",getter:t})}var qS=I("ZodPromise",(t,e)=>{v1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function uN(t){return new qS({type:"promise",innerType:t})}var JS=I("ZodFunction",(t,e)=>{g1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PF(t,r,n,i)});function cN(t){return new JS({type:"function",input:Array.isArray(t?.input)?FS(t?.input):t?.input??Hm(tu()),output:t?.output??tu()})}var Qm=I("ZodCustom",(t,e)=>{y1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EF(t,r,n,i)});function dN(t){let e=new ft({check:"custom"});return e._zod.check=t,e}function pN(t,e){return tF(Qm,t??(()=>!0),e)}function XS(t,e={}){return rF(Qm,t,e)}function YS(t,e){return iF(t,e)}var fN=nF,mN=aF;function hN(t,e={}){let r=new Qm({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...H.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var gN=(...t)=>oF({Codec:Ym,Boolean:Vd,String:zd},...t);function vN(t){let e=HS(()=>qw([Vm(t),lS(),uS(),fS(),Hm(e),SS(Vm(),e)]));return e}function xN(t,e){return new KS({type:"pipe",in:Xw(t),out:e})}var XR={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function YR(t){jt({customError:t})}function QR(){return jt().customError}var QS;QS||(QS={});var ie={...Um,...Aw,iso:Dd},e2=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function t2(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function r2(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function yN(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return ie.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return ie.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=r2(i,e),o=Kr(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return ie.null();if(i.length===0)return ie.never();if(i.length===1)return ie.literal(i[0]);if(i.every(o=>typeof o=="string"))return ie.enum(i);let a=i.map(o=>ie.literal(o));return a.length<2?a[0]:ie.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return ie.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return yN(o,e)});return i.length===0?ie.never():i.length===1?i[0]:ie.union(i)}if(!r)return ie.any();let n;switch(r){case"string":{let i=ie.string();if(t.format){let a=t.format;a==="email"?i=i.check(ie.email()):a==="uri"||a==="uri-reference"?i=i.check(ie.url()):a==="uuid"||a==="guid"?i=i.check(ie.uuid()):a==="date-time"?i=i.check(ie.iso.datetime()):a==="date"?i=i.check(ie.iso.date()):a==="time"?i=i.check(ie.iso.time()):a==="duration"?i=i.check(ie.iso.duration()):a==="ipv4"?i=i.check(ie.ipv4()):a==="ipv6"?i=i.check(ie.ipv6()):a==="mac"?i=i.check(ie.mac()):a==="cidr"?i=i.check(ie.cidrv4()):a==="cidr-v6"?i=i.check(ie.cidrv6()):a==="base64"?i=i.check(ie.base64()):a==="base64url"?i=i.check(ie.base64url()):a==="e164"?i=i.check(ie.e164()):a==="jwt"?i=i.check(ie.jwt()):a==="emoji"?i=i.check(ie.emoji()):a==="nanoid"?i=i.check(ie.nanoid()):a==="cuid"?i=i.check(ie.cuid()):a==="cuid2"?i=i.check(ie.cuid2()):a==="ulid"?i=i.check(ie.ulid()):a==="xid"?i=i.check(ie.xid()):a==="ksuid"&&(i=i.check(ie.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?ie.number().int():ie.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=ie.boolean();break}case"null":{n=ie.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[u,d]of Object.entries(a)){let m=Kr(d,e);i[u]=o.has(u)?m:m.optional()}if(t.propertyNames){let u=Kr(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Kr(t.additionalProperties,e):ie.any();if(Object.keys(i).length===0){n=ie.record(u,d);break}let m=ie.object(i).passthrough(),x=ie.looseRecord(u,d);n=ie.intersection(m,x);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),m=[];for(let g of d){let w=Kr(u[g],e),A=ie.string().regex(new RegExp(g));m.push(ie.looseRecord(A,w))}let x=[];if(Object.keys(i).length>0&&x.push(ie.object(i).passthrough()),x.push(...m),x.length===0)n=ie.object({}).passthrough();else if(x.length===1)n=x[0];else{let g=ie.intersection(x[0],x[1]);for(let w=2;w<x.length;w++)g=ie.intersection(g,x[w]);n=g}break}let s=ie.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Kr(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(u=>Kr(u,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Kr(a,e):void 0;s?n=ie.tuple(o).rest(s):n=ie.tuple(o),typeof t.minItems=="number"&&(n=n.check(ie.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ie.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(u=>Kr(u,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Kr(t.additionalItems,e):void 0;s?n=ie.tuple(o).rest(s):n=ie.tuple(o),typeof t.minItems=="number"&&(n=n.check(ie.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ie.maxLength(t.maxItems)))}else if(a!==void 0){let o=Kr(a,e),s=ie.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=ie.array(ie.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Kr(t,e){if(typeof t=="boolean")return t?ie.any():ie.never();let r=yN(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(d=>Kr(d,e)),u=ie.union(s);r=n?ie.intersection(r,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(d=>Kr(d,e)),u=ie.xor(s);r=n?ie.intersection(r,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:ie.any();else{let s=n?r:Kr(t.allOf[0],e),u=n?0:1;for(let d=u;d<t.allOf.length;d++)s=ie.intersection(s,Kr(t.allOf[d],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=ie.nullable(r)),t.readOnly===!0&&(r=ie.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))e2.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function wN(t,e){if(typeof t=="boolean")return t?ie.any():ie.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=t2(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Nr};return Kr(r,a)}var eE={};Va(eE,{bigint:()=>o2,boolean:()=>a2,date:()=>s2,number:()=>n2,string:()=>i2});function i2(t){return A1(zd,t)}function n2(t){return N1(Ud,t)}function a2(t){return z1(Vd,t)}function o2(t){return U1(jd,t)}function s2(t){return X1(Gm,t)}jt(jy());var _N=[1,2,4,8],AN=[1,2,3,4,5,6,7,8],FN=["disable-track","mute-region"],SN=["none","all","previous-only"],EN=ke.object({metronome:ke.object({enabled:ke.boolean(),beatSubDivision:ke.union(_N.map(t=>ke.literal(t))),gain:ke.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:ke.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:ke.object({timestampEnabled:ke.boolean(),pauseOnLoopDisabled:ke.boolean(),truncateNotesAtRegionEnd:ke.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:ke.object({dspLoadMeasurement:ke.boolean()}).default({dspLoadMeasurement:!1}),recording:ke.object({countInBars:ke.union(AN.map(t=>ke.literal(t))),allowTakes:ke.boolean(),automationEnabled:ke.boolean(),olderTakeAction:ke.union(FN.map(t=>ke.literal(t))),olderTakeScope:ke.union(SN.map(t=>ke.literal(t))),inputLatency:ke.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),bN;(function(t){t.BeatSubDivisionOptions=_N,t.RecordingCountInBars=AN,t.OlderTakeActionOptions=FN,t.OlderTakeScopeOptions=SN})(bN||(bN={}));var Fs={[Ft.Instrument]:0,[Ft.Aux]:1,[Ft.Bus]:2,[Ft.Output]:3};var eb;(function(t){t.create=({boxGraph:e,mandatoryBoxes:{rootBox:r,primaryAudioBusBox:n}},i,a,o)=>{let s=o??t.orderAndGetIndex(r,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),Xe.create(e,M.generate(),u=>{u.collection.refer(r.audioUnits),u.output.refer(n.input),u.index.setValue(s),u.type.setValue(i),a.ifSome(d=>u.capture.refer(d))})},t.orderAndGetIndex=(e,r)=>{let n=ai.collectIndexedBoxes(e.audioUnits,Xe),i=Fs[r],a=0;for(;a<n.length&&!(Fs[n[a].type.getValue()]>i);a++);let o=a;for(;a<n.length;)n[a].index.setValue(++a);return o},t.trackTypeToCapture=(e,r)=>{switch(r){case ve.Audio:return b.wrap(ca.create(e,M.generate()));case ve.Notes:return b.wrap(da.create(e,M.generate()));default:return b.None}}})(eb||(eb={}));var PN;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;te(s.isAttached(),"rootBox not attached");let u=M.generate(),d=Nn.create(o,u,x=>{x.collection.refer(s.audioBusses),x.label.setValue(r),x.icon.setValue(Le.toName(n)),x.color.setValue(a.toString())}),m=eb.create(e,i,b.None);return Br.create(o,M.generate(),x=>{x.tracks.refer(m.tracks),x.target.refer(m),x.index.setValue(0),x.type.setValue(ve.Undefined)}),d.output.refer(m.input),d}})(PN||(PN={}));var $N;(function(t){t.forAudioType=e=>{switch(e){case Ft.Output:return Eo.blue;case Ft.Aux:return Eo.purple;case Ft.Bus:return Eo.orange;case Ft.Instrument:return Eo.green;default:return Eo.dark}},t.forTrackType=e=>{switch(e){case ve.Audio:return 200;case ve.Notes:return 45;case ve.Value:return 156;default:return 0}}})($N||($N={}));var kN;(function(t){t.Tape={defaultName:"Tape",defaultIcon:Le.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:oe.Tape,trackType:ve.Audio,create:(n,i,a,o,s)=>Bu.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.flutter.setValue(.2),u.wow.setValue(.05),u.noise.setValue(.02),u.saturation.setValue(.5),u.host.refer(i)})},t.Nano={defaultName:"Nano",defaultIcon:Le.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:oe.Nano,trackType:ve.Notes,create:(n,i,a,o,s)=>Nu.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),W(s)&&u.file.refer(s),u.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:Le.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:oe.Playfield,trackType:ve.Notes,create:(n,i,a,o,s)=>{let u=Iu.create(n,M.generate(),d=>{d.label.setValue(a),d.icon.setValue(Le.toName(o)),d.host.refer(i)});return W(s)&&s.filter(({note:d,uuid:m,name:x,durationInSeconds:g,exclude:w})=>{let A=e(n,m,x,g);Bo.create(n,M.generate(),_=>{_.device.refer(u.samples),_.file.refer(A),_.index.setValue(d),_.exclude.setValue(w)})}),u}},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Le.Piano,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:oe.Vaporisateur,trackType:ve.Notes,create:(n,i,a,o,s)=>$u.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.cutoff.setInitValue(8e3),u.resonance.setInitValue(.1),u.attack.setInitValue(.005),u.decay.setInitValue(.1),u.sustain.setInitValue(.5),u.release.setInitValue(.5),u.voicingMode.setInitValue(Cs.Polyphonic),u.lfo.rate.setInitValue(1),u.oscillators.fields()[0].waveform.setInitValue(aa.saw),u.oscillators.fields()[0].volume.setInitValue(-6),u.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),u.oscillators.fields()[1].waveform.setInitValue(aa.square),u.host.refer(i),u.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Le.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:oe.MIDIOutput,trackType:ve.Notes,create:(n,i,a,o,s)=>ku.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:Le.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:oe.Soundfont,trackType:ve.Notes,create:(n,i,a,o)=>Mu.create(n,M.generate(),s=>{s.label.setValue(a),s.icon.setValue(Le.toName(o)),s.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:Le.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:oe.Apparat,trackType:ve.Notes,create:(n,i,a,o)=>Tu.create(n,M.generate(),s=>{s.label.setValue(a),s.icon.setValue(Le.toName(o)),s.host.refer(i)})},t.Named={Apparat:t.Apparat,MIDIOutput:t.MIDIOutput,Nano:t.Nano,Playfield:t.Playfield,Soundfont:t.Soundfont,Tape:t.Tape,Vaporisateur:t.Vaporisateur};let e=(n,i,a,o)=>n.findBox(i).unwrapOrElse(()=>Li.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>ua.create(n,i,o=>o.fileName.setValue(a)))})(kN||(kN={}));var iu;(function(t){t.empty=n=>{let i=new Za(b.wrap(qa.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=Eu.create(i,M.generate(),g=>{g.label.setValue("Groove Shuffle")}),s=$o.create(i,M.generate(),g=>{g.groove.refer(o),g.created.setValue(a)}),u=Nn.create(i,M.generate(),g=>{g.collection.refer(s.audioBusses),g.label.setValue("Output"),g.icon.setValue(Le.toName(Le.SpeakerHeadphone)),g.color.setValue(Eo.blue.toString())}),d=Xe.create(i,M.generate(),g=>{g.type.setValue(Ft.Output),g.collection.refer(s.audioUnits),g.output.refer(s.outputDevice),g.index.setValue(0)});n.createOutputMaximizer&&Pu.create(i,M.generate(),g=>{g.label.setValue("Master Maximizer"),g.index.setValue(0),g.host.refer(d.audioEffects),g.lookahead.setValue(!1)});let m=zs.create(i,M.generate());Mn.create(i,M.generate(),g=>m.tempoTrack.events.refer(g.owners)),s.timeline.refer(m.root),u.output.refer(d.input);let x=[];if(n.createDefaultUser){let g=Ja.create(i,M.generate());g.root.refer(s.users),x.push(g)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:u,primaryAudioUnitBox:d,timelineBox:m,userInterfaceBoxes:x}}},t.encode=n=>{let i=Yt.create();i.writeInt(1330660686),i.writeInt(2);let a=n.toArrayBuffer();return i.writeInt(a.byteLength),i.writeBytes(new Int8Array(a)),i.toArrayBuffer()},t.decode=n=>{let i=new rt(n);te(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),te(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new Za(b.wrap(qa.create));return s.fromArrayBuffer(o.buffer,!1),{boxGraph:s,mandatoryBoxes:t.findMandatoryBoxes(s)}},t.findMandatoryBoxes=n=>{let i=n.boxes().find(a=>a.accept({visitRootBox:()=>!0}));if(W(i)){let a=Ie(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),o=Ie(a.input.pointerHub.incoming().at(0)?.box,Nn),s=Ie(i.timeline.targetVertex.unwrap("TimelineBox not found").box,zs),u=i.users.pointerHub.incoming().map(({box:d})=>Ie(d,Ja));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:u}}return V("Could not find mandatory boxes")}})(iu||(iu={}));var Nt;(function(t){let e=({graph:n},{graph:i})=>n===i,r=(n,i)=>n.index.getValue()-i.index.getValue();t.excludeTimelinePredicate=n=>n.accept({visitTrackBox:()=>!0})===!0,t.shouldExclude=n=>n.ephemeral||n.name===Su.ClassName,t.generateMap=(n,i,a,o)=>{let s=M.newSet(({source:u})=>u);return s.addMany([...n.filter(({output:{targetAddress:u}})=>u.nonEmpty()).map(u=>({source:u.output.targetAddress.unwrap().uuid,target:o})),...n.map(u=>({source:u.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:a})),...n.map(u=>({source:u.address.uuid,target:M.generate()})),...i.map(u=>({source:u.address.uuid,target:u.resource==="preserved"?u.address.uuid:M.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=M.newSet(d=>d);o.forEach(d=>{d.resource==="preserved"&&i.findBox(d.address.uuid).nonEmpty()&&s.add(d.address.uuid)});let u=d=>{for(let[m,x]of d.outgoingEdges())if(m.mandatory&&!x.isBox()&&s.hasKey(x.uuid))return!0;return!1};N.decodeWith({map:(d,m)=>m.flatMap(x=>n.opt(x.uuid).match({some:({target:g})=>b.wrap(x.moveTo(g)),none:()=>i.findBox(x.uuid).nonEmpty()?b.wrap(x):b.None}))},()=>{a.forEach(d=>{let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))}),o.forEach(d=>{if(s.hasKey(d.address.uuid)||u(d))return;let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(g=>Ie(a.graph.findBox(n.get(g.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)),u=new Set(s),m=ai.collectIndexedBoxes(a.audioUnits,Xe).filter(g=>!u.has(g)),x;if(W(o)){let g=at(o,0,m.length);x=[...m.slice(0,g),...s,...m.slice(g)]}else{let g=m.toSorted((_,C)=>(Fs[_.type.getValue()]??0)-(Fs[C.type.getValue()]??0)),w=s.reduce((_,C)=>Math.max(_,Fs[C.type.getValue()]??0),0),A=g.findIndex(_=>(Fs[_.type.getValue()]??0)>w);A===-1&&(A=g.length),x=[...g.slice(0,A),...s,...g.slice(A)]}x.forEach((g,w)=>g.index.setValue(w))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{te(ce.satisfy(n,e),"Region smust be from the same BoxGraph");let u=new Set(n),d=new Set,m=new wh;n.forEach(K=>{let U=Ie(K.regions.targetVertex.unwrap("regions.target").box,Br);d.add(U);let ee=Ie(U.tracks.targetVertex.unwrap("tracks.target").box,Xe);m.add(ee,U)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${d.size} tracks`);let x=[...m.keys()],g=K=>t.shouldExclude(K)||mt(K,Br)&&!d.has(K)||Xn.isRegionBox(K)&&!u.has(K),w=Array.from(x[0].graph.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:g}).boxes),A=t.generateMap(x,w,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(A,i,x,w),t.reorderAudioUnits(A,x,o),m.forEach((K,U)=>[...U].sort(r).forEach((ee,re)=>{let me=i.findBox(A.get(ee.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");Ie(me,Br).index.setValue(re)}));let _=n.reduce((K,U)=>Math.min(K,U.position.getValue()),Number.MAX_VALUE),C=s-_;n.forEach(K=>{let U=i.findBox(A.get(K.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:ee}=Xn.asRegionBox(U);ee.setValue(ee.getValue()+C)})}})(Nt||(Nt={}));var MN;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(x=>x.type.getValue()!==Ft.Output);if(o.length===0)return[];let s=x=>Nt.shouldExclude(x)||a?.excludeTimeline===!0&&Nt.excludeTimelinePredicate(x),u=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),d=Nt.generateMap(o,u,i.audioUnits.address.uuid,n.address.uuid);Nt.copyBoxes(d,r,o,u),Nt.reorderAudioUnits(d,o,i,a.insertIndex);let m=o.map(x=>Ie(i.graph.findBox(d.get(x.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe));if(a.deleteSource===!0){let x=Ie(o[0].collection.targetVertex.unwrap("collection.target").box,$o);o.forEach(g=>g.delete()),ai.collectIndexedBoxes(x.audioUnits,Xe).forEach((g,w)=>g.index.setValue(w))}return m}})(MN||(MN={}));var NN;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=M.newSet(g=>g.address.uuid);o.add(e);for(let g of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:w=>w.ephemeral}).boxes)o.add(g);let s=M.newSet(g=>g);o.forEach(g=>{g.resource==="preserved"&&a.findBox(g.address.uuid).nonEmpty()&&s.add(g.address.uuid)});let u=g=>{if(g.resource==="preserved"&&s.hasKey(g.address.uuid))return!0;for(let[,w]of g.outgoingEdges())if(s.hasKey(w.uuid)&&!w.isBox())return!0;return!1},d=o.values().filter(g=>!u(g)),m=M.newSet(g=>g.source);d.forEach(g=>{m.add({source:g.address.uuid,target:g.resource==="preserved"?g.address.uuid:M.generate()})}),s.forEach(g=>m.add({source:g,target:g}));let x=null;return N.decodeWith({map:(g,w)=>{let A=w.flatMap(_=>m.opt(_.uuid).map(C=>_.moveTo(C.target)));return A.nonEmpty()?A:g.pointerType===l.RegionCollection?b.wrap(r.regions.address):g.pointerType===l.ClipCollection?b.wrap(r.clips.address):b.None}},()=>d.forEach(g=>{let w=new rt(g.toArrayBuffer()),A=m.get(g.address.uuid,"uuid mapping").target;a.createBox(g.name,A,_=>{if(_.read(w),Xn.isRegionBox(_)){let C=Xn.asRegionBox(_);C.position.setValue(n),x=C}})})),i&&e.delete(),ze(x,"Failed to create region copy")}})(NN||(NN={}));var Kt;(function(t){t.MAGIC_HEADER_OPEN=1330664005,t.FORMAT_VERSION=1;let e;(function(r){r[r.Midi=0]="Midi",r[r.Audio=1]="Audio"})(e=t.ChainKind||(t.ChainKind={}))})(Kt||(Kt={}));var IN;(function(t){t.decode=(e,r)=>{let n=new rt(e.slice(0,8));if(n.readInt()!==Kt.MAGIC_HEADER_OPEN)return fu.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==Kt.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${Kt.FORMAT_VERSION})`),fu.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new Za(b.wrap(qa.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(A){return console.warn(A),fu.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let A of a.boxes())o[A.name]=(o[A.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(A=>mt(A,Xe)).filter(A=>A.type.getValue()!==Ft.Output),u=A=>Nt.shouldExclude(A),d=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:u}).boxes),{mandatoryBoxes:{rootBox:m,primaryAudioBusBox:x}}=r,g=Nt.generateMap(s,d,m.audioUnits.address.uuid,x.address.uuid);Nt.copyBoxes(g,r.boxGraph,s,d),Nt.reorderAudioUnits(g,s,m);let w=s.map(A=>Ie(m.graph.findBox(g.get(A.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)).filter(A=>A.type.getValue()!==Ft.Output);return w.forEach(A=>{let _=A.input.pointerHub.incoming().at(0)?.box;if(!W(_))return;let C=A.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${M.toString(A.address.uuid)} has ${C} pre-copied track(s)`),!(C>0)&&A.capture.targetVertex.ifSome(({box:K})=>{K instanceof da?Br.create(r.boxGraph,M.generate(),U=>{U.index.setValue(0),U.type.setValue(ve.Notes),U.target.refer(A),U.tracks.refer(A.tracks)}):K instanceof ca&&Br.create(r.boxGraph,M.generate(),U=>{U.index.setValue(0),U.type.setValue(ve.Audio),U.target.refer(A),U.tracks.refer(A.tracks)})})}),w},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new rt(e.slice(0,8));if(r.readInt()!==Kt.MAGIC_HEADER_OPEN||r.readInt()!==Kt.FORMAT_VERSION)return!1;let n=new Za(b.wrap(qa.create));if(Ct(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(mt(a,Br))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=iu.empty({createDefaultUser:!1,createOutputMaximizer:!1}),a=i.boxGraph,o=r.graph;a.beginTransaction(),t.decode(e,i),a.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:U})=>Ie(U,Xe)).find(U=>U.type.getValue()!==Ft.Output);if(Eb(s))return wr.err("Preset contains no valid audio unit. Please send the file to the developers.");let u=s.capture.targetVertex.mapOr(({box:U})=>U.name,""),d=r.capture.targetVertex.mapOr(({box:U})=>U.name,"");if(u!==d)return wr.err("Cannot replace incompatible instruments");let m=n?.keepMIDIEffects!==!0,x=n?.keepAudioEffects!==!0,g=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",m),console.debug("replaceAudioEffects",x),console.debug("replaceTimeline",g),ze(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),m?r.midiEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()),a.endTransaction()),x?r.audioEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&g&&r.tracks.pointerHub.incoming().forEach(({box:U})=>U.delete());let A=U=>!!(U.accept({visitCaptureMidiBox:ee=>!0,visitCaptureAudioBox:ee=>!0})===!0||!g&&Nt.excludeTimelinePredicate(U)),_=M.newSet(({source:U})=>U),C=Array.from(a.dependenciesOf(s,{excludeBox:A,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);_.addMany([{source:s.address.uuid,target:r.address.uuid},...C.map(({address:{uuid:U},name:ee})=>({source:U,target:ee===Li.ClassName||ee===ua.ClassName?U:M.generate()}))]);let K=M.newSet(U=>U);return C.forEach(U=>{(U instanceof Li||U instanceof ua)&&o.findBox(U.address.uuid).nonEmpty()&&K.add(U.address.uuid)}),N.decodeWith({map:(U,ee)=>ee.flatMap(re=>_.opt(re.uuid).match({some:({target:me})=>b.wrap(re.moveTo(me)),none:()=>o.findBox(re.uuid).nonEmpty()?b.wrap(re):b.None}))},()=>{C.forEach(U=>{if((U instanceof Li||U instanceof ua)&&K.opt(U.address.uuid).nonEmpty())return;let ee=new rt(U.toArrayBuffer()),re=U.name,me=_.get(U.address.uuid,"uuid mapping").target;o.createBox(re,me,$e=>$e.read(ee))})}),wr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return wr.err("Invalid preset header");let a=new rt(e.slice(0,8));if(a.readInt()!==Kt.MAGIC_HEADER_OPEN)return wr.err("Invalid preset header");let o=a.readInt();if(o!==Kt.FORMAT_VERSION)return wr.err(`Unsupported preset version ${o} (this build supports ${Kt.FORMAT_VERSION}).`);let s=new Za(b.wrap(qa.create)),u=Ct(()=>s.fromArrayBuffer(e.slice(8),!1));if(u.status==="failure")return wr.err(`Failed to decode preset: ${String(u.error)}`);let d=s.boxes().filter(Q=>mt(Q,Xe)).map(Q=>Ie(Q,Xe)).find(Q=>Q.type.getValue()!==Ft.Output);if(Eb(d))return wr.err("Preset contains no audio unit");let m=i===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,x=ai.collectIndexedBoxes(m);if(x.length===0)return wr.err("Preset contains no effects of the requested kind");let g=i===Kt.ChainKind.Audio?r.audioEffects:r.midiEffects,w=g.address,A=i===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,_=r.graph,C=x.length,K=ai.collectIndexedBoxes(g);for(let Q=K.length-1;Q>=0;Q--){let we=K[Q],Ge=we.index.getValue();Ge>=n&&we.index.setValue(Ge+C)}let U=Q=>Nt.shouldExclude(Q)||Nt.excludeTimelinePredicate(Q)||Q instanceof Xe,ee=new Set(x),re=Array.from(s.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:U}).boxes).filter(Q=>!ee.has(Q)),me=M.newSet(Q=>Q);re.forEach(Q=>{Q.resource==="preserved"&&_.findBox(Q.address.uuid).nonEmpty()&&me.add(Q.address.uuid)});let $e=M.newSet(({source:Q})=>Q);return $e.addMany([...x.map(Q=>({source:Q.address.uuid,target:M.generate()})),...re.map(Q=>({source:Q.address.uuid,target:Q.resource==="preserved"?Q.address.uuid:M.generate()}))]),N.decodeWith({map:(Q,we)=>Q.pointerType===A?b.wrap(w):we.flatMap(Ge=>$e.opt(Ge.uuid).match({some:({target:It})=>b.wrap(Ge.moveTo(It)),none:()=>_.findBox(Ge.uuid).nonEmpty()?b.wrap(Ge):b.None}))},()=>{x.forEach((Q,we)=>{let Ge=new rt(Q.toArrayBuffer()),It=$e.get(Q.address.uuid,"uuid mapping").target;_.createBox(Q.name,It,ea=>{ea.read(Ge),ai.isIndexedBox(ea)&&ea.index.setValue(n+we)})}),re.forEach(Q=>{if(me.hasKey(Q.address.uuid))return;let we=new rt(Q.toArrayBuffer()),Ge=$e.get(Q.address.uuid,"uuid mapping").target;_.createBox(Q.name,Ge,It=>It.read(we))})}),wr.Ok}})(IN||(IN={}));var BN;(function(t){t.encode=(e,r={})=>{let n=Yt.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=iu.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,u=[e],d=r.excludeEffect??(()=>!1),m=r.includeTimeline===!0,x=_=>Nt.shouldExclude(_)||!m&&Nt.excludeTimelinePredicate(_)||d(_);a.beginTransaction();let g=Array.from(e.graph.dependenciesOf(u,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes),w={};for(let _ of g)w[_.name]=(w[_.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${m}, deps=${g.length}`,w);let A=Nt.generateMap(u,g,o.audioUnits.address.uuid,s.address.uuid);return Nt.copyBoxes(A,a,u,g),Nt.reorderAudioUnits(A,u,o),a.endTransaction(),ce.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=Yt.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=iu.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let u=r===Kt.ChainKind.Audio?ca.create(a,M.generate()):da.create(a,M.generate()),d=Xe.create(a,M.generate(),m=>{m.collection.refer(o.audioUnits),m.output.refer(s.input),m.index.setValue(0),m.type.setValue(Ft.Instrument),m.capture.refer(u)});if(Du.create(a,M.generate(),m=>{m.host.refer(d.input)}),e.length>0){let m=e[0].graph,x=K=>Nt.shouldExclude(K)||Nt.excludeTimelinePredicate(K)||K instanceof Xe,g=new Set(e),w=Array.from(m.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes).filter(K=>!g.has(K)),A=M.newSet(({source:K})=>K);A.addMany([...e.map(K=>({source:K.address.uuid,target:M.generate()})),...w.map(K=>({source:K.address.uuid,target:K.resource==="preserved"?K.address.uuid:M.generate()}))]);let _=r===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,C=r===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;N.decodeWith({map:(K,U)=>K.pointerType===C?b.wrap(_.address):U.flatMap(ee=>A.opt(ee.uuid).match({some:({target:re})=>b.wrap(ee.moveTo(re)),none:()=>a.findBox(ee.uuid).nonEmpty()?b.wrap(ee):b.None}))},()=>{e.forEach((K,U)=>{let ee=new rt(K.toArrayBuffer()),re=A.get(K.address.uuid,"uuid mapping").target;a.createBox(K.name,re,me=>{me.read(ee),ai.isIndexedBox(me)&&me.index.setValue(U)})}),w.forEach(K=>{let U=new rt(K.toArrayBuffer()),ee=A.get(K.address.uuid,"uuid mapping").target;a.createBox(K.name,ee,re=>re.read(U))})})}return a.endTransaction(),ce.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(BN||(BN={}));var TN;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=Ie(r,Xe).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof B?i.label.getValue():"N/A"})})(TN||(TN={}));var DN=ke.object({name:ke.string(),bpm:ke.number(),duration:ke.number(),sample_rate:ke.number(),origin:ke.enum(["openDAW","recording","import"]),custom:ke.string().optional()});var Joe=DN.extend({uuid:M.zType(ke)});var l2,u2,c2,d2,p2,f2;l2=new WeakMap,u2=new WeakMap,c2=new WeakMap,d2=new WeakMap,p2=new WeakMap,f2=new WeakMap;var m2,h2,g2,v2,x2,y2;m2=new WeakMap,h2=new WeakMap,g2=new WeakMap,v2=new WeakMap,x2=new WeakMap,y2=new WeakMap;var w2=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},lr=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)},Ss,b2,_2,eh,RN,tb,tE,th,A2,rE,CN,zN,iE,ON;b2=new WeakMap,_2=new WeakMap,eh=new WeakMap,RN=new WeakMap,tb=new WeakMap,tE=new WeakMap,th=new WeakMap,Ss=new WeakSet,A2=function(e){let r=lr(this,th,"f");w2(this,th,e.isEmpty()?b.None:b.wrap(e.unwrap()),"f"),r.ifSome(n=>lr(this,Ss,"m",rE).call(this,n)),lr(this,th,"f").ifSome(n=>{r.contains(n)||lr(this,Ss,"m",rE).call(this,n)})},rE=function(e){let r=lr(this,RN,"f").hasKey(e.address.uuid)&&!lr(this,th,"f").contains(e),n=lr(this,tb,"f").hasKey(e.address.uuid);r!==n&&(r?lr(this,tb,"f").add({user:e,terminable:lr(this,Ss,"m",CN).call(this,e)}):lr(this,tb,"f").removeByKey(e.address.uuid).terminable.terminate())},CN=function(e){let r=M.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=Ie(i.box,sa);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&lr(this,Ss,"m",zN).call(this,s,e)})},onRemoved:i=>{let a=Ie(i.box,sa),o=r.removeByKeyIfExist(a.address.uuid);W(o)&&lr(this,Ss,"m",iE).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>lr(this,Ss,"m",iE).call(this,i.selectable,e)),r.clear()}}},zN=function(e,r){(lr(this,eh,"f").getOrNull(e.address)??lr(this,Ss,"m",ON).call(this,e)).owners.add(r),lr(this,tE,"f").proxy.onSelected(e,r)},iE=function(e,r){let n=lr(this,eh,"f").getOrNull(e.address);W(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&lr(this,eh,"f").removeByKey(e.address),lr(this,tE,"f").proxy.onDeselected(e,r))},ON=function(e){let r={selectable:e,owners:M.newSet(n=>n.address.uuid)};return lr(this,eh,"f").add(r),r};var 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)},F2,S2,nE,aE,oE,E2,P2,$2;S2=new WeakMap,nE=new WeakMap,aE=new WeakMap,oE=new WeakMap,E2=new WeakMap,P2=new WeakMap,F2=new WeakSet,$2=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=Ie(r.box,sa);te(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),a={box:n,selectable:i};Kd(this,oE,"f").proxy.onSelected(i),te(Kd(this,nE,"f").add(a),"Could not add to entityMap"),te(Kd(this,aE,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=Ie(r.box,sa),i=Kd(this,nE,"f").removeByKey(n.address.uuid);te(i.box===n,"Broken selection");let a=i.selectable;Kd(this,oE,"f").proxy.onDeselected(a),Kd(this,aE,"f").removeByKey(a.address)}},l.Selection)};var UN=ke.object({name:ke.string(),size:ke.number().int(),url:ke.string(),license:ke.string(),origin:ke.enum(["openDAW","import"])});var xse=UN.extend({uuid:M.zType(ke)});var VN;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return b.None;if(X_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,b.wrap(e.copyTo({position:r,duration:a-r,loopOffset:$s(o+(r-i),s),consolidate:n}))}else return V("Not yet implemented")},t.clip=(e,r,n)=>{if(X_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?V(`first part duration will be zero or negative(${r-i})`):a-n<=0?V(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:$s(o+(n-i),s)}))}else return V("Not yet implemented")}})(VN||(VN={}));var rb=class{#e;#t;#r=0;#i=0;#n=0;#a=0;constructor(e){this.#e=new Int32Array(e),this.#t=new Float64Array(e)}start(){let e=Atomics.load(this.#e,1),r=Atomics.load(this.#e,2),n=this.#t[2],i=this.#t[3];this.#o();let a=0;return this.#r>0&&this.#i===this.#r+1&&(a=this.#a-this.#n),this.#r=e,this.#i=r,this.#n=n,this.#a=i,a}end(){this.#o()}#o(){Atomics.add(this.#e,0,1),Atomics.notify(this.#e,0)}};var ib=class t{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#a=0;#o=0;#s=0;#c=0;constructor(e,r){this.#e=e,this.#t=r,this.#r=new Float32Array(4),this.#i=ce.create(()=>new Ih(t.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#a,this.#r[1]=this.#o,this.#r[2]=this.#s,this.#r[3]=this.#c})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#a=0,this.#o=0}process(e,r,n=0,i=na){let a=i-n,o=t.PEAK_DECAY**a,s=0,u=0;for(let d=n;d<i;d++){let m=Math.abs(e[d]),x=Math.abs(r[d]);m>s&&(s=m),x>u&&(u=x)}this.#a=Math.max(s,this.#a*o),this.#o=Math.max(u,this.#o*o),this.#s=this.#i[0].processBlock(e,n,i),this.#c=this.#i[1].processBlock(r,n,i)}processStereo([e,r],n=0,i=na){this.process(e,r,n,i)}terminate(){this.#n.terminate()}};var nb=class{#e;#t;#r;#i;#n=new Map;#a=[];constructor(e,r){this.#e=e,this.#t=new Uint32Array(r,0,2),this.#r=new Uint32Array(r,8),this.#i=(this.#r.length>>1)-1}send(e,r,n){let i=this.#n.get(e);if(fh(i)){if(i=this.#a.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#a.push(e),this.#e.postMessage({registerDevice:e,id:i})}let a=Atomics.load(this.#t,0),o=a+1&this.#i;if(o===Atomics.load(this.#t,1))return!1;let s=r.length,u=r[0]??0,d=r[1]??0,m=r[2]??0,x=s<<30|i<<24|u<<16|d<<8|m,g=n|0,w=a<<1;return this.#r[w]=x,this.#r[w+1]=g,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var ab=t=>{let e="",r=0,n=()=>(t[r++]??0)&63;for(;r<t.length;){let i=t[r++]??0,a=i<128?i:(i&224)===192?(i&31)<<6|n():(i&240)===224?(i&15)<<12|n()<<6|n():(i&248)===240?(i&7)<<18|n()<<12|n()<<6|n():65533;e+=a<=1114111?String.fromCodePoint(a):"\uFFFD"}return e};var sE=16,ob=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new nb(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*sE),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*sE).slice(),u=new DataView(s.buffer);for(let d=0;d<a;d++){let m=d*sE,x=u.getUint32(m,!0),g=Math.min(Math.max(u.getUint8(m+7),1),3),w=u.getFloat64(m+8,!0),A=this.#t[g-1];A[0]=u.getUint8(m+4),g>1&&(A[1]=u.getUint8(m+5)),g>2&&(A[2]=u.getUint8(m+6)),o.send(this.#i(e,r,x),A,w)}}#i(e,r,n){let i=this.#e.get(n);if(W(i))return i;let a=e.input_reserve(256),o=e.midi_out_device_id(n,a,256),s=o===0?"":ab(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};var jN=(t,e)=>{let r=t.panic_message_len();return r===0?"":ab(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var k2=["host_pull_events","host_pulse_to_offset","host_bind_parameter","host_bind_broadcast","host_broadcast_ptr","host_broadcast_active","host_update_parameters","host_first_update_position","host_next_update_position","host_resolve_sample","host_observe_sample","host_resolve_soundfont","host_observe_soundfont","host_observe_field","host_observe_target_string","host_bind_sidechain","host_resolve_input","host_self_uuid","host_panic","host_base_frequency"],sb=(t,e)=>{let r=0,n=0,i=e;for(;;){let a=t[i++];if(r|=(a&127)<<n,(a&128)===0)break;n+=7}return[r>>>0,i]},M2=t=>{let e=WebAssembly.Module.customSections(t,"dylink.0");if(e.length===0)return{memorySize:0,tableSize:0};let r=new Uint8Array(e[0]),n=0;for(;n<r.length;){let i=r[n++],[a,o]=sb(r,n);if(i===1){let[s,u]=sb(r,o),[,d]=sb(r,u),[m]=sb(r,d);return{memorySize:s,tableSize:m}}n=o+a}return{memorySize:0,tableSize:0}},KN=(t,e,r)=>{let n=r.length,i=t.input_reserve(n),a=new Uint8Array(e.buffer,i,n);for(let o=0;o<n;o++)a[o]=r.charCodeAt(o)&255;return n},WN=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:u}=M2(n),d=t.device_alloc(s),m=u>0?r.grow(u):r.length,x=t.device_alloc(262144),g={memory:e,__indirect_function_table:r,__memory_base:new WebAssembly.Global({value:"i32",mutable:!1},d),__table_base:new WebAssembly.Global({value:"i32",mutable:!1},m),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:!0},x+262144)};for(let K of k2){let U=t[K];if(typeof U!="function")throw new Error(`engine is missing the device host export '${K}'`);g[K]=U}Object.assign(g,o);let w=new WebAssembly.Instance(n,{env:g}).exports;w.__wasm_apply_data_relocs?.(),w.__wasm_call_ctors?.();let A=K=>{if(K===void 0)return 0;let U=r.grow(1);return r.set(U,K),U},_=r.grow(1);r.set(_,w.process_events??w.process);let C=t.device_register(_,w.state_size(a),w.kind(),A(w.init),A(w.parameter_changed),A(w.field_changed),A(w.sample_changed),A(w.soundfont_changed),A(w.reset),A(w.terminate),w.midi_effects_field?.()??0,w.audio_effects_field?.()??0,w.observe_param_collection_field?.()??0,w.observe_sample_collection_field?.()??0);t.device_set_box_type(C,KN(t,e,i))},LN=(t,e,r)=>{t.composite_register(KN(t,e,r.boxType),r.childrenField,r.indexKey,r.excludeKey,r.cellInstrumentField,r.cellMidiField,r.cellAudioField,r.childEnabledKey,r.childMuteKey,r.childSoloKey)};var N2=1,lb=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},I2=(t,e,r,n,i,a,o,s,u)=>{let d=e*40;t.setFloat64(d+0,n,!0),t.setUint32(d+8,0,!0),t.setUint32(d+12,r,!0),t.setUint32(d+16,i,!0),t.setUint32(d+20,a,!0),t.setFloat32(d+24,o,!0),t.setFloat32(d+28,s,!0),t.setFloat64(d+32,u,!0)},B2=(t,e)=>t==null?"process yielded undefined":typeof t.pitch!="number"||t.pitch!==t.pitch?`Invalid pitch: ${t.pitch}`:t.pitch<0||t.pitch>127?`Pitch out of range: ${t.pitch} (must be 0-127)`:typeof t.velocity!="number"||t.velocity!==t.velocity?`Invalid velocity: ${t.velocity}`:t.velocity<0||t.velocity>1?`Velocity out of range: ${t.velocity} (must be 0-1)`:typeof t.duration!="number"||t.duration!==t.duration?`Invalid duration: ${t.duration}`:t.duration<=0?`Duration must be positive: ${t.duration}`:typeof t.position!="number"||t.position!==t.position?`Invalid position: ${t.position}`:t.position<e?`Position ${t.position} is in the past (block starts at ${e})`:null,GN=(t,e,r,n,i,a,o,s,u,d,m,x,g)=>{let w=new DataView(r,n,i*40),A=new DataView(r,a,o*40),_=0,C=($e,Q,we,Ge,It,ea,He)=>{if(_>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);I2(A,_++,$e,Q,we,Ge,It,ea,He)};for(let $e=t.retained.length-1;$e>=0;$e--){let Q=t.retained[$e],we=Q.position+Q.duration;we<u&&(t.retained.splice($e,1),C(1,we,Q.id,Q.pitch,0,0,0))}let K=[];for(let $e=0;$e<i;$e++){let Q=$e*40,we=w.getUint32(Q+12,!0),Ge=w.getUint32(Q+16,!0),It=w.getFloat64(Q+0,!0),ea=w.getUint32(Q+20,!0);if(we===0)K.push({gate:!0,id:Ge,position:It,duration:w.getFloat64(Q+32,!0),pitch:ea,velocity:w.getFloat32(Q+24,!0),cent:w.getFloat32(Q+28,!0)});else if(we===1){let He=t.sourceToOutput.get(Ge);if(He!==void 0){for(let $t of He){let nh=t.retained.findIndex(ou=>ou.id===$t);if(nh>=0){let ou=t.retained.splice(nh,1)[0];C(1,It,ou.id,ou.pitch,0,0,0)}}t.sourceToOutput.delete(Ge)}K.push({gate:!1,id:Ge,position:It,pitch:ea})}}for(let $e=t.scheduled.length-1;$e>=0;$e--){let Q=t.scheduled[$e];Q.position>=s&&Q.position<u&&(t.scheduled.splice($e,1),C(0,Q.position,ZN(t,Q),Q.pitch,Q.velocity,Q.cent,Q.duration))}let U=-1,ee={[Symbol.iterator](){let $e=0;return{next(){if($e>=K.length)return U=-1,{done:!0,value:void 0};let Q=K[$e++];return Q.gate&&(U=Q.id),{done:!1,value:Q}}}}},re={from:s,to:u,bpm:d,s0:x,s1:g,flags:m},me=0;for(let $e of e.process(re,ee)){if(++me>128)throw new Error("Note flood: exceeded 128 notes per block");let Q=B2($e,s);if(Q!==null)throw new Error(Q);let we={position:$e.position,duration:$e.duration,pitch:$e.pitch,velocity:$e.velocity,cent:$e.cent??0};if(we.position>=u){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(we)}else{let Ge=ZN(t,we);if(U>=0){let It=t.sourceToOutput.get(U);It===void 0&&(It=new Set,t.sourceToOutput.set(U,It)),It.add(Ge)}C(0,we.position,Ge,we.pitch,we.velocity,we.cent,we.duration)}}return _},ZN=(t,e)=>{let r=N2++;return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var ub=128,T2=375,lE=0,qN=1,JN=2,D2={[lE]:"apparatProcessors",[qN]:"werkstattProcessors",[JN]:"spielwerkProcessors"},R2=0,HN=1e3,uE=class{constructor(e,r,n){this.uuid=e;this.kind=r;this.registryName=n}proc=null;currentUpdate=-1;silenced=!1;paramMappings=new Map;rawParams=new Map;sampleLabels=new Map;sampleHandles=new Map;limiter=null;spielwerk=null;missingCalls=0;warnedMissing=!1},C2=t=>{switch(t.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(t.min,t.max);case"exp":return E.exponential(t.min,t.max);case"int":return E.linearInteger(t.min,t.max);case"bool":return E.linearInteger(0,1);default:return E.unipolar()}},z2=(t,e,r)=>{for(let n=0;n<t.length;n++){let i=t[n];for(let a=e;a<r;a++){let o=i[a];if(o!==o)return`NaN detected in output channel ${n} at sample ${a}`;if(o>HN||o<-HN)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},cb=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#o=1;constructor(e,r,n,i=()=>{}){this.#e=e,this.#t=r,this.#r=n,this.#i=i}imports(){return{host_script_create:(e,r,n)=>this.#s(e,r,n),host_script_audio:(e,r,n,i,a,o,s,u,d,m,x,g)=>this.#l(e,r,n,i,a,o,s,u,d,m,x,g),host_script_note_on:(e,r,n,i,a)=>this.#u(e,r,n,i,a),host_script_note_off:(e,r)=>this.#p(e,r),host_script_reset:e=>this.#d(e),host_script_param:(e,r,n,i)=>this.#v(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#m(e,r,n,i),host_script_notes:(e,r,n,i,a,o,s,u,d,m,x)=>this.#w(e,r,n,i,a,o,s,u,d,m,x),host_script_release:e=>this.#g(e)}}#s(e,r,n){let i=M.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);W(a)&&this.#g(a);let o=this.#o++;return this.#n.set(o,new uE(i,r,D2[r]??"werkstattProcessors")),this.#a.set(i,o),o}#c(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>T2&&(e.warnedMissing=!0,this.#i(e.uuid,`No Processor registered at globalThis.openDAW.${e.registryName}[${e.uuid}] \u2014 device is rendering silence`)),null;if(r!==void 0&&r.update!==e.currentUpdate)try{let n=new r.create;if(e.paramMappings=new Map(r.params.map(i=>[i.index,{label:i.label,mapping:C2(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===lE){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Bh(this.#r)}e.kind===JN&&(e.spielwerk=new lb),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#f(e,i,a.kind,a.value);for(let[i,a]of e.sampleHandles)this.#h(e,i,a)}catch(n){this.#x(e,`Failed to instantiate Processor: ${n}`)}return e.silenced?null:e.proc}#l(e,r,n,i,a,o,s,u,d,m,x,g){let w=this.#n.get(e);if(w===void 0)return 1;let A=this.#c(w);if(A===null)return 1;let _=this.#e.buffer,C=new Float32Array(_,i,ub),K=new Float32Array(_,a,ub),U={index:u,p0:d,p1:m,s0:o,s1:s,bpm:x,flags:g};try{if(w.kind===qN){let re={src:[new Float32Array(_,r,ub),new Float32Array(_,n,ub)],out:[C,K]};A.process(re,U)}else{for(let[re,me]of w.sampleHandles)this.#h(w,re,me);C.fill(0,o,s),K.fill(0,o,s),A.process([C,K],U)}}catch(re){return this.#x(w,`Runtime error: ${re}`),1}let ee=z2([C,K],o,s);return ee!==null?(C.fill(0,o,s),K.fill(0,o,s),this.#x(w,ee),1):(w.kind===lE&&w.limiter!==null&&w.limiter.replace({channels:()=>[C,K]},o,s),0)}#u(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#c(o)?.noteOn?.(r,n,i,a)}#p(e,r){let n=this.#n.get(e);n!==void 0&&this.#c(n)?.noteOff?.(r)}#d(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#v(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#f(a,r,n,i))}#f(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===R2?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#m(e,r,n,i){let a=this.#n.get(e);if(a===void 0)return;let o=i!==0?n:-1;a.sampleHandles.set(r,o),this.#h(a,r,o)}#w(e,r,n,i,a,o,s,u,d,m,x){let g=this.#n.get(e);if(g===void 0)return 0;let w=this.#c(g);if(w===null||g.spielwerk===null)return 0;try{return GN(g.spielwerk,w,this.#e.buffer,r,n,i,a,o,s,u,d,m,x)}catch(A){return this.#x(g,`Runtime error: ${A}`),0}}#h(e,r,n){if(e.proc===null)return;let i=e.sampleLabels.get(r);if(i===void 0)return;if(n<0){e.proc.samples[i]=null;return}let a=this.#t.input_reserve(16);if(this.#t.host_resolve_sample(n,a)===0){e.proc.samples[i]=null;return}let o=new DataView(this.#e.buffer,a,16),s=o.getUint32(0,!0),u=o.getUint32(4,!0),d=o.getUint32(8,!0),m=o.getFloat32(12,!0),x=[];for(let g=0;g<d;g++)x.push(new Float32Array(this.#e.buffer,s+g*u*4,u));e.proc.samples[i]={sampleRate:m,numberOfFrames:u,numberOfChannels:d,frames:x}}#x(e,r){e.silenced=!0,this.#i(e.uuid,r)}#g(e){let r=this.#n.get(e);W(r)&&(this.#n.delete(e),this.#a.get(r.uuid)===e&&this.#a.delete(r.uuid))}liveBridgeCount(){return this.#n.size}};var db=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},tt=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)},Pt,nu,au,rh,ih=class t{constructor(e,r=128){if(Pt.set(this,void 0),nu.set(this,void 0),au.set(this,void 0),rh.set(this,void 0),db(this,Pt,e,"f"),db(this,rh,r,"f"),db(this,nu,e._malloc(r*4),"f"),db(this,au,e._malloc(r*4),"f"),tt(this,nu,"f")===0||tt(this,au,"f")===0)throw new Error("Failed to allocate audio buffers")}static async create(e,r=128){let n=await e();return new t(n,r)}static fromModule(e,r=128){return new t(e,r)}dispose(){tt(this,Pt,"f")._free(tt(this,nu,"f")),tt(this,Pt,"f")._free(tt(this,au,"f"))}createInstance(){return tt(this,Pt,"f")._nam_createInstance()}destroyInstance(e){tt(this,Pt,"f")._nam_destroyInstance(e)}getInstanceCount(){return tt(this,Pt,"f")._nam_getInstanceCount()}loadModel(e,r){let n=tt(this,Pt,"f").lengthBytesUTF8(r)+1,i=tt(this,Pt,"f")._malloc(n);if(i===0)return!1;try{return tt(this,Pt,"f").stringToUTF8(r,i,n),tt(this,Pt,"f")._nam_loadModel(e,i)}finally{tt(this,Pt,"f")._free(i)}}unloadModel(e){tt(this,Pt,"f")._nam_unloadModel(e)}hasModel(e){return tt(this,Pt,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,tt(this,rh,"f")),a=tt(this,nu,"f")>>2,o=tt(this,au,"f")>>2;tt(this,Pt,"f").HEAPF32.set(r.subarray(0,i),a),tt(this,Pt,"f")._nam_process(e,tt(this,nu,"f"),tt(this,au,"f"),i),n.set(tt(this,Pt,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){tt(this,Pt,"f")._nam_setSampleRate(e)}getSampleRate(){return tt(this,Pt,"f")._nam_getSampleRate()}setMaxBufferSize(e){tt(this,Pt,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return tt(this,Pt,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return tt(this,Pt,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return tt(this,Pt,"f")._nam_hasModelLoudness(e)}reset(e){tt(this,Pt,"f")._nam_reset(e)}get bufferSize(){return tt(this,rh,"f")}};Pt=new WeakMap,nu=new WeakMap,au=new WeakMap,rh=new WeakMap;var cE;(function(t){t.parse=e=>JSON.parse(e),t.isArchitecture2=e=>e.architecture==="WaveNet"&&e.config.layers!==void 0&&e.config.layers.some(r=>r.gating_mode!==void 0||r.bottleneck!==void 0)})(cE||(cE={}));var O2=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((c,f)=>{n=c,i=f});var a=Object.assign({},r),o=[],s="./this.program",u=(c,f)=>{throw f},d=typeof window=="object",m=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g="";function w(c){return r.locateFile?r.locateFile(c,g):g+c}var A,_,C;(d||m)&&(m?g=self.location.href:typeof document<"u"&&document.currentScript&&(g=document.currentScript.src),t&&(g=t),g.indexOf("blob:")!==0?g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):g="",A=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.send(null),f.responseText},m&&(C=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.responseType="arraybuffer",f.send(null),new Uint8Array(f.response)}),_=(c,f,h)=>{var y=new XMLHttpRequest;y.open("GET",c,!0),y.responseType="arraybuffer",y.onload=()=>{if(y.status==200||y.status==0&&y.response){f(y.response);return}h()},y.onerror=h,y.send(null)});var K=r.print||console.log.bind(console),U=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.arguments&&(o=r.arguments),r.thisProgram&&(s=r.thisProgram),r.quit&&(u=r.quit);var ee;r.wasmBinary&&(ee=r.wasmBinary),typeof WebAssembly!="object"&&su("no native wasm support detected");var re,me=!1,$e;function Q(c,f){c||su(f)}var we,Ge,It,ea,He,$t,nh,ou;function hE(){var c=re.buffer;r.HEAP8=we=new Int8Array(c),r.HEAP16=It=new Int16Array(c),r.HEAPU8=Ge=new Uint8Array(c),r.HEAPU16=ea=new Uint16Array(c),r.HEAP32=He=new Int32Array(c),r.HEAPU32=$t=new Uint32Array(c),r.HEAPF32=nh=new Float32Array(c),r.HEAPF64=ou=new Float64Array(c)}var gE=[],vE=[],xE=[],sI=!1;function lI(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)dI(r.preRun.shift());vb(gE)}function uI(){sI=!0,!r.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,yo.init(),vb(vE)}function cI(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)fI(r.postRun.shift());vb(xE)}function dI(c){gE.unshift(c)}function pI(c){vE.unshift(c)}function fI(c){xE.unshift(c)}var Es=0,hb=null,Ld=null;function L2(c){return c}function gb(c){Es++,r.monitorRunDependencies?.(Es)}function ah(c){if(Es--,r.monitorRunDependencies?.(Es),Es==0&&(hb!==null&&(clearInterval(hb),hb=null),Ld)){var f=Ld;Ld=null,f()}}function su(c){r.onAbort?.(c),c="Aborted("+c+")",U(c),me=!0,$e=1,c+=". Build with -sASSERTIONS for more info.";var f=new WebAssembly.RuntimeError(c);throw i(f),f}var mI="data:application/octet-stream;base64,",yE=c=>c.startsWith(mI),Ps;r.locateFile?(Ps="nam.wasm",yE(Ps)||(Ps=w(Ps))):Ps=new URL("nam.wasm",import.meta.url).href;function wE(c){if(c==Ps&&ee)return new Uint8Array(ee);if(C)return C(c);throw"both async and sync fetching of the wasm failed"}function hI(c){return!ee&&(d||m)&&typeof fetch=="function"?fetch(c,{credentials:"same-origin"}).then(f=>{if(!f.ok)throw"failed to load wasm binary file at '"+c+"'";return f.arrayBuffer()}).catch(()=>wE(c)):Promise.resolve().then(()=>wE(c))}function bE(c,f,h){return hI(c).then(y=>WebAssembly.instantiate(y,f)).then(y=>y).then(h,y=>{U(`failed to asynchronously prepare wasm: ${y}`),su(y)})}function gI(c,f,h,y){return!c&&typeof WebAssembly.instantiateStreaming=="function"&&!yE(f)&&typeof fetch=="function"?fetch(f,{credentials:"same-origin"}).then(F=>{var T=WebAssembly.instantiateStreaming(F,h);return T.then(y,function(z){return U(`wasm streaming compile failed: ${z}`),U("falling back to ArrayBuffer instantiation"),bE(f,h,y)})}):bE(f,h,y)}function vI(){var c={a:XI};function f(y,F){return pt=y.exports,re=pt.l,hE(),pI(pt.m),ah("wasm-instantiate"),pt}gb("wasm-instantiate");function h(y){f(y.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(c,f)}catch(y){U(`Module.instantiateWasm callback failed with error: ${y}`),i(y)}return gI(ee,Ps,c,h).catch(i),{}}var qe,gr,vb=c=>{for(;c.length>0;)c.shift()(r)},Z2=r.noExitRuntime||!0;function xI(c){this.excPtr=c,this.ptr=c-24,this.set_type=function(f){$t[this.ptr+4>>2]=f},this.get_type=function(){return $t[this.ptr+4>>2]},this.set_destructor=function(f){$t[this.ptr+8>>2]=f},this.get_destructor=function(){return $t[this.ptr+8>>2]},this.set_caught=function(f){f=f?1:0,we[this.ptr+12>>0]=f},this.get_caught=function(){return we[this.ptr+12>>0]!=0},this.set_rethrown=function(f){f=f?1:0,we[this.ptr+13>>0]=f},this.get_rethrown=function(){return we[this.ptr+13>>0]!=0},this.init=function(f,h){this.set_adjusted_ptr(0),this.set_type(f),this.set_destructor(h)},this.set_adjusted_ptr=function(f){$t[this.ptr+16>>2]=f},this.get_adjusted_ptr=function(){return $t[this.ptr+16>>2]},this.get_exception_ptr=function(){var f=DE(this.get_type());if(f)return $t[this.excPtr>>2];var h=this.get_adjusted_ptr();return h!==0?h:this.excPtr}}var _E=0,yI=0,wI=(c,f,h)=>{var y=new xI(c);throw y.init(f,h),_E=c,yI++,_E},bI=()=>{su("")},_I=(c,f,h)=>Ge.copyWithin(c,f,f+h),AI=()=>536870912,FI=c=>{var f=re.buffer,h=(c-f.byteLength+65535)/65536;try{return re.grow(h),hE(),1}catch{}},SI=c=>{var f=Ge.length;c>>>=0;var h=AI();if(c>h)return!1;for(var y=(ne,Ne)=>ne+(Ne-ne%Ne)%Ne,F=1;F<=4;F*=2){var T=f*(1+.2/F);T=Math.min(T,c+100663296);var z=Math.min(h,y(Math.max(c,T),65536)),j=FI(z);if(j)return!0}return!1},xb={},EI=()=>s||"./this.program",Zd=()=>{if(!Zd.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",f={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:EI()};for(var h in xb)xb[h]===void 0?delete f[h]:f[h]=xb[h];var y=[];for(var h in f)y.push(`${h}=${f[h]}`);Zd.strings=y}return Zd.strings},PI=(c,f)=>{for(var h=0;h<c.length;++h)we[f++>>0]=c.charCodeAt(h);we[f>>0]=0},ut={isAbs:c=>c.charAt(0)==="/",splitPath:c=>{var f=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return f.exec(c).slice(1)},normalizeArray:(c,f)=>{for(var h=0,y=c.length-1;y>=0;y--){var F=c[y];F==="."?c.splice(y,1):F===".."?(c.splice(y,1),h++):h&&(c.splice(y,1),h--)}if(f)for(;h;h--)c.unshift("..");return c},normalize:c=>{var f=ut.isAbs(c),h=c.substr(-1)==="/";return c=ut.normalizeArray(c.split("/").filter(y=>!!y),!f).join("/"),!c&&!f&&(c="."),c&&h&&(c+="/"),(f?"/":"")+c},dirname:c=>{var f=ut.splitPath(c),h=f[0],y=f[1];return!h&&!y?".":(y&&(y=y.substr(0,y.length-1)),h+y)},basename:c=>{if(c==="/")return"/";c=ut.normalize(c),c=c.replace(/\/$/,"");var f=c.lastIndexOf("/");return f===-1?c:c.substr(f+1)},join:function(){var c=Array.prototype.slice.call(arguments);return ut.normalize(c.join("/"))},join2:(c,f)=>ut.normalize(c+"/"+f)},$I=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return c=>crypto.getRandomValues(c);su("initRandomDevice")},AE=c=>(AE=$I())(c),Ua={resolve:function(){for(var c="",f=!1,h=arguments.length-1;h>=-1&&!f;h--){var y=h>=0?arguments[h]:v.cwd();if(typeof y!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!y)return"";c=y+"/"+c,f=ut.isAbs(y)}return c=ut.normalizeArray(c.split("/").filter(F=>!!F),!f).join("/"),(f?"/":"")+c||"."},relative:(c,f)=>{c=Ua.resolve(c).substr(1),f=Ua.resolve(f).substr(1);function h(Ne){for(var We=0;We<Ne.length&&Ne[We]==="";We++);for(var nt=Ne.length-1;nt>=0&&Ne[nt]==="";nt--);return We>nt?[]:Ne.slice(We,nt-We+1)}for(var y=h(c.split("/")),F=h(f.split("/")),T=Math.min(y.length,F.length),z=T,j=0;j<T;j++)if(y[j]!==F[j]){z=j;break}for(var ne=[],j=z;j<y.length;j++)ne.push("..");return ne=ne.concat(F.slice(z)),ne.join("/")}},FE=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,lu=(c,f,h)=>{for(var y=f+h,F=f;c[F]&&!(F>=y);)++F;if(F-f>16&&c.buffer&&FE)return FE.decode(c.subarray(f,F));for(var T="";f<F;){var z=c[f++];if(!(z&128)){T+=String.fromCharCode(z);continue}var j=c[f++]&63;if((z&224)==192){T+=String.fromCharCode((z&31)<<6|j);continue}var ne=c[f++]&63;if((z&240)==224?z=(z&15)<<12|j<<6|ne:z=(z&7)<<18|j<<12|ne<<6|c[f++]&63,z<65536)T+=String.fromCharCode(z);else{var Ne=z-65536;T+=String.fromCharCode(55296|Ne>>10,56320|Ne&1023)}}return T},yb=[],oh=c=>{for(var f=0,h=0;h<c.length;++h){var y=c.charCodeAt(h);y<=127?f++:y<=2047?f+=2:y>=55296&&y<=57343?(f+=4,++h):f+=3}return f},wb=(c,f,h,y)=>{if(!(y>0))return 0;for(var F=h,T=h+y-1,z=0;z<c.length;++z){var j=c.charCodeAt(z);if(j>=55296&&j<=57343){var ne=c.charCodeAt(++z);j=65536+((j&1023)<<10)|ne&1023}if(j<=127){if(h>=T)break;f[h++]=j}else if(j<=2047){if(h+1>=T)break;f[h++]=192|j>>6,f[h++]=128|j&63}else if(j<=65535){if(h+2>=T)break;f[h++]=224|j>>12,f[h++]=128|j>>6&63,f[h++]=128|j&63}else{if(h+3>=T)break;f[h++]=240|j>>18,f[h++]=128|j>>12&63,f[h++]=128|j>>6&63,f[h++]=128|j&63}}return f[h]=0,h-F};function sh(c,f,h){var y=h>0?h:oh(c)+1,F=new Array(y),T=wb(c,F,0,F.length);return f&&(F.length=T),F}var kI=()=>{if(!yb.length){var c=null;if(typeof window<"u"&&typeof window.prompt=="function"?(c=window.prompt("Input: "),c!==null&&(c+=`
112
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let d=t.external.registry.get(o[0])?.id;if(e!==o[0]&&d){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function As(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let u=t.seen.get(s);if(u.ref===null)return;let d=u.def??u.schema,m={...d},x=u.ref;if(u.ref=null,x){n(x);let w=t.seen.get(x),A=w.schema;if(A.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(A)):Object.assign(d,A),Object.assign(d,m),s._zod.parent===x)for(let C in d)C==="$ref"||C==="allOf"||C in m||delete d[C];if(A.$ref&&w.def)for(let C in d)C==="$ref"||C==="allOf"||C in w.def&&JSON.stringify(d[C])===JSON.stringify(w.def[C])&&delete d[C]}let g=s._zod.parent;if(g&&g!==x){n(g);let w=t.seen.get(g);if(w?.schema.$ref&&(d.$ref=w.schema.$ref,w.def))for(let A in d)A==="$ref"||A==="allOf"||A in w.def&&JSON.stringify(d[A])===JSON.stringify(w.def[A])&&delete d[A]}t.override({zodSchema:s,jsonSchema:d,path:u.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let a=t.metadataRegistry.get(e)?.id;a!==void 0&&i.id===a&&delete i.id;let o=t.external?.defs??{};for(let s of t.seen.entries()){let u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Td(e,"input",t.processors),output:Td(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function ii(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ii(n.element,r);if(n.type==="set")return ii(n.valueType,r);if(n.type==="lazy")return ii(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ii(n.innerType,r);if(n.type==="intersection")return ii(n.left,r)||ii(n.right,r);if(n.type==="record"||n.type==="map")return ii(n.keyType,r)||ii(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:ii(n.in,r)||ii(n.out,r);if(n.type==="object"){for(let i in n.shape)if(ii(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(ii(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(ii(i,r))return!0;return!!(n.rest&&ii(n.rest,r))}return!1}var sF=(t,e={})=>r=>{let n=bs({...r,processors:e});return lt(t,n),_s(n,t),As(n,t)},Td=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=bs({...i??{},target:a,io:e,processors:r});return lt(t,o),_s(o,t),As(o,t)};var GR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lF=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=GR[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),d&&(i.contentEncoding=d),u&&u.size>0){let m=[...u];m.length===1?i.pattern=m[0].source:m.length>1&&(i.allOf=[...m.map(x=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},uF=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:m}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number";let x=typeof m=="number"&&m>=(a??Number.NEGATIVE_INFINITY),g=typeof d=="number"&&d<=(o??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";x?w?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m:typeof a=="number"&&(i.minimum=a),g?w?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d:typeof o=="number"&&(i.maximum=o),typeof u=="number"&&(i.multipleOf=u)},cF=(t,e,r,n)=>{r.type="boolean"},dF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},pF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},fF=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},mF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},gF=(t,e,r,n)=>{r.not={}},vF=(t,e,r,n)=>{},xF=(t,e,r,n)=>{},yF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},wF=(t,e,r,n)=>{let i=t._zod.def,a=_m(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},bF=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},_F=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},AF=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},FF=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:u}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),u?u.length===1?(a.contentMediaType=u[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(i,a)},SF=(t,e,r,n)=>{r.type="boolean"},EF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},$F=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},MF=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},NF=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=lt(a.element,e,{...n,path:[...n.path,"items"]})},IF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let d in o)i.properties[d]=lt(o[d],e,{...n,path:[...n.path,"properties",d]});let s=new Set(Object.keys(o)),u=new Set([...s].filter(d=>{let m=a.shape[d]._zod;return e.io==="input"?m.optin===void 0:m.optout===void 0}));u.size>0&&(i.required=Array.from(u)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=lt(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},yw=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,u)=>lt(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?r.oneOf=o:r.anyOf=o},BF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=lt(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,u=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=u},TF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((g,w)=>lt(g,e,{...n,path:[...n.path,o,w]})),d=a.rest?lt(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=u,d&&(i.items=d)):e.target==="openapi-3.0"?(i.items={anyOf:u},d&&i.items.anyOf.push(d),i.minItems=u.length,d||(i.maxItems=u.length)):(i.items=u,d&&(i.additionalItems=d));let{minimum:m,maximum:x}=t._zod.bag;typeof m=="number"&&(i.minItems=m),typeof x=="number"&&(i.maxItems=x)},DF=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,u=o._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){let m=lt(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let x of u)i.patternProperties[x.source]=m}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=lt(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=lt(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let d=o._zod.values;if(d){let m=[...d].filter(x=>typeof x=="string"||typeof x=="number");m.length>0&&(i.required=m)}},RF=(t,e,r,n)=>{let i=t._zod.def,a=lt(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},CF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},zF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},OF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},UF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},VF=(t,e,r,n)=>{let i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?a?i.out:i.in:i.out;lt(o,e,n);let s=e.seen.get(t);s.ref=o},jF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},KF=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},ww=(t,e,r,n)=>{let i=t._zod.def;lt(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},WF=(t,e,r,n)=>{let i=t._zod.innerType;lt(i,e,n);let a=e.seen.get(t);a.ref=i},xw={string:lF,number:uF,boolean:cF,bigint:dF,symbol:pF,null:fF,undefined:mF,void:hF,never:gF,any:vF,unknown:xF,date:yF,enum:wF,literal:bF,nan:_F,template_literal:AF,file:FF,success:SF,custom:EF,function:PF,transform:$F,map:kF,set:MF,array:NF,object:IF,union:yw,intersection:BF,tuple:TF,record:DF,nullable:RF,nonoptional:CF,default:zF,prefault:OF,catch:UF,pipe:VF,readonly:jF,promise:KF,optional:ww,lazy:WF};function bw(t,e){if("_idmap"in t){let n=t,i=bs({...e,processors:xw}),a={};for(let u of n._idmap.entries()){let[d,m]=u;lt(m,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let u of n._idmap.entries()){let[d,m]=u;_s(i,m),o[d]=As(i,m)}if(Object.keys(a).length>0){let u=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[u]:a}}return{schemas:o}}let r=bs({...e,processors:xw});return lt(t,r),_s(r,t),As(r,t)}var _w=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=bs({processors:xw,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return lt(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),_s(this.ctx,e);let n=As(this.ctx,e),{"~standard":i,...a}=n;return a}};var tM={};var Um={};Va(Um,{ZodAny:()=>mS,ZodArray:()=>xS,ZodBase64:()=>Kw,ZodBase64URL:()=>Ww,ZodBigInt:()=>jd,ZodBigIntFormat:()=>Gw,ZodBoolean:()=>Vd,ZodCIDRv4:()=>Vw,ZodCIDRv6:()=>jw,ZodCUID:()=>Tw,ZodCUID2:()=>Dw,ZodCatch:()=>US,ZodCodec:()=>Ym,ZodCustom:()=>Qm,ZodCustomStringFormat:()=>Od,ZodDate:()=>Gm,ZodDefault:()=>TS,ZodDiscriminatedUnion:()=>wS,ZodE164:()=>Lw,ZodEmail:()=>Nw,ZodEmoji:()=>Iw,ZodEnum:()=>Cd,ZodExactOptional:()=>NS,ZodFile:()=>kS,ZodFunction:()=>JS,ZodGUID:()=>jm,ZodIPv4:()=>Ow,ZodIPv6:()=>Uw,ZodIntersection:()=>bS,ZodJWT:()=>Zw,ZodKSUID:()=>zw,ZodLazy:()=>GS,ZodLiteral:()=>$S,ZodMAC:()=>sS,ZodMap:()=>ES,ZodNaN:()=>jS,ZodNanoID:()=>Bw,ZodNever:()=>gS,ZodNonOptional:()=>Qw,ZodNull:()=>pS,ZodNullable:()=>BS,ZodNumber:()=>Ud,ZodNumberFormat:()=>ru,ZodObject:()=>qm,ZodOptional:()=>Yw,ZodPipe:()=>Xm,ZodPrefault:()=>RS,ZodPreprocess:()=>KS,ZodPromise:()=>qS,ZodReadonly:()=>WS,ZodRecord:()=>Rd,ZodSet:()=>PS,ZodString:()=>zd,ZodStringFormat:()=>dt,ZodSuccess:()=>OS,ZodSymbol:()=>cS,ZodTemplateLiteral:()=>ZS,ZodTransform:()=>MS,ZodTuple:()=>AS,ZodType:()=>De,ZodULID:()=>Rw,ZodURL:()=>Zm,ZodUUID:()=>Oa,ZodUndefined:()=>dS,ZodUnion:()=>Jm,ZodUnknown:()=>hS,ZodVoid:()=>vS,ZodXID:()=>Cw,ZodXor:()=>yS,_ZodString:()=>Mw,_default:()=>DS,_function:()=>cN,any:()=>VM,array:()=>Hm,base64:()=>FM,base64url:()=>SM,bigint:()=>RM,boolean:()=>uS,catch:()=>VS,check:()=>dN,cidrv4:()=>_M,cidrv6:()=>AM,codec:()=>oN,cuid:()=>mM,cuid2:()=>hM,custom:()=>pN,date:()=>KM,describe:()=>fN,discriminatedUnion:()=>qM,e164:()=>EM,email:()=>nM,emoji:()=>pM,enum:()=>Jw,exactOptional:()=>IS,file:()=>rN,float32:()=>IM,float64:()=>BM,function:()=>cN,guid:()=>aM,hash:()=>NM,hex:()=>MM,hostname:()=>kM,httpUrl:()=>dM,instanceof:()=>hN,int:()=>$w,int32:()=>TM,int64:()=>CM,intersection:()=>_S,invertCodec:()=>sN,ipv4:()=>yM,ipv6:()=>bM,json:()=>vN,jwt:()=>PM,keyof:()=>WM,ksuid:()=>xM,lazy:()=>HS,literal:()=>tN,looseObject:()=>GM,looseRecord:()=>XM,mac:()=>wM,map:()=>YM,meta:()=>mN,nan:()=>aN,nanoid:()=>fM,nativeEnum:()=>eN,never:()=>Hw,nonoptional:()=>zS,null:()=>fS,nullable:()=>Wm,nullish:()=>iN,number:()=>lS,object:()=>LM,optional:()=>Km,partialRecord:()=>JM,pipe:()=>kw,prefault:()=>CS,preprocess:()=>xN,promise:()=>uN,readonly:()=>LS,record:()=>SS,refine:()=>XS,set:()=>QM,strictObject:()=>ZM,string:()=>Vm,stringFormat:()=>$M,stringbool:()=>gN,success:()=>nN,superRefine:()=>YS,symbol:()=>OM,templateLiteral:()=>lN,transform:()=>Xw,tuple:()=>FS,uint32:()=>DM,uint64:()=>zM,ulid:()=>gM,undefined:()=>UM,union:()=>qw,unknown:()=>tu,url:()=>cM,uuid:()=>oM,uuidv4:()=>sM,uuidv6:()=>lM,uuidv7:()=>uM,void:()=>jM,xid:()=>vM,xor:()=>HM});var Aw={};Va(Aw,{endsWith:()=>Ed,gt:()=>Ca,gte:()=>ri,includes:()=>Fd,length:()=>eu,lowercase:()=>_d,lt:()=>Ra,lte:()=>ji,maxLength:()=>Ql,maxSize:()=>ws,mime:()=>Pd,minLength:()=>vo,minSize:()=>za,multipleOf:()=>ys,negative:()=>mw,nonnegative:()=>gw,nonpositive:()=>hw,normalize:()=>$d,overwrite:()=>Qn,positive:()=>fw,property:()=>vw,regex:()=>bd,size:()=>Yl,slugify:()=>Id,startsWith:()=>Sd,toLowerCase:()=>Md,toUpperCase:()=>Nd,trim:()=>kd,uppercase:()=>Ad});var Dd={};Va(Dd,{ZodISODate:()=>Sw,ZodISODateTime:()=>Fw,ZodISODuration:()=>Pw,ZodISOTime:()=>Ew,date:()=>ZF,datetime:()=>LF,duration:()=>HF,time:()=>GF});var Fw=I("ZodISODateTime",(t,e)=>{_A.init(t,e),dt.init(t,e)});function LF(t){return E1(Fw,t)}var Sw=I("ZodISODate",(t,e)=>{AA.init(t,e),dt.init(t,e)});function ZF(t){return P1(Sw,t)}var Ew=I("ZodISOTime",(t,e)=>{FA.init(t,e),dt.init(t,e)});function GF(t){return $1(Ew,t)}var Pw=I("ZodISODuration",(t,e)=>{SA.init(t,e),dt.init(t,e)});function HF(t){return k1(Pw,t)}var rM=(t,e)=>{Pm.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>km(t,r)},flatten:{value:r=>$m(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,pd,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,pd,2)}},isEmpty:{get(){return t.issues.length===0}}})},qR=I("ZodError",rM),bi=I("ZodError",rM,{Parent:Error});var qF=hd(bi),JF=gd(bi),XF=vd(bi),YF=xd(bi),QF=by(bi),eS=_y(bi),tS=Ay(bi),rS=Fy(bi),iS=Sy(bi),nS=Ey(bi),aS=Py(bi),oS=$y(bi);var iM=new WeakMap;function Lm(t,e,r){let n=Object.getPrototypeOf(t),i=iM.get(n);if(i||(i=new Set,iM.set(n,i)),!i.has(e)){i.add(e);for(let a in r){let o=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){let s=o.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var De=I("ZodType",(t,e)=>(Pe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Td(t,"input"),output:Td(t,"output")}}),t.toJSONSchema=sF(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>qF(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>XF(t,r,n),t.parseAsync=async(r,n)=>JF(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>YF(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>QF(t,r,n),t.decode=(r,n)=>eS(t,r,n),t.encodeAsync=async(r,n)=>tS(t,r,n),t.decodeAsync=async(r,n)=>rS(t,r,n),t.safeEncode=(r,n)=>iS(t,r,n),t.safeDecode=(r,n)=>nS(t,r,n),t.safeEncodeAsync=async(r,n)=>aS(t,r,n),t.safeDecodeAsync=async(r,n)=>oS(t,r,n),Lm(t,"ZodType",{check(...r){let n=this.def;return this.clone(H.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return ei(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(XS(r,n))},superRefine(r,n){return this.check(YS(r,n))},overwrite(r){return this.check(Qn(r))},optional(){return Km(this)},exactOptional(){return IS(this)},nullable(){return Wm(this)},nullish(){return Km(Wm(this))},nonoptional(r){return zS(this,r)},array(){return Hm(this)},or(r){return qw([this,r])},and(r){return _S(this,r)},transform(r){return kw(this,Xw(r))},default(r){return DS(this,r)},prefault(r){return CS(this,r)},catch(r){return VS(this,r)},pipe(r){return kw(this,r)},readonly(){return LS(this)},describe(r){let n=this.clone();return Nr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Nr.get(this);let n=this.clone();return Nr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Nr.get(t)?.description},configurable:!0}),t)),Mw=I("_ZodString",(t,e)=>{Xl.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>lF(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Lm(t,"_ZodString",{regex(...n){return this.check(bd(...n))},includes(...n){return this.check(Fd(...n))},startsWith(...n){return this.check(Sd(...n))},endsWith(...n){return this.check(Ed(...n))},min(...n){return this.check(vo(...n))},max(...n){return this.check(Ql(...n))},length(...n){return this.check(eu(...n))},nonempty(...n){return this.check(vo(1,...n))},lowercase(n){return this.check(_d(n))},uppercase(n){return this.check(Ad(n))},trim(){return this.check(kd())},normalize(...n){return this.check($d(...n))},toLowerCase(){return this.check(Md())},toUpperCase(){return this.check(Nd())},slugify(){return this.check(Id())}})}),zd=I("ZodString",(t,e)=>{Xl.init(t,e),Mw.init(t,e),t.email=r=>t.check(Gy(Nw,r)),t.url=r=>t.check(Om(Zm,r)),t.jwt=r=>t.check(pw(Zw,r)),t.emoji=r=>t.check(Yy(Iw,r)),t.guid=r=>t.check(zm(jm,r)),t.uuid=r=>t.check(Hy(Oa,r)),t.uuidv4=r=>t.check(qy(Oa,r)),t.uuidv6=r=>t.check(Jy(Oa,r)),t.uuidv7=r=>t.check(Xy(Oa,r)),t.nanoid=r=>t.check(Qy(Bw,r)),t.guid=r=>t.check(zm(jm,r)),t.cuid=r=>t.check(ew(Tw,r)),t.cuid2=r=>t.check(tw(Dw,r)),t.ulid=r=>t.check(rw(Rw,r)),t.base64=r=>t.check(uw(Kw,r)),t.base64url=r=>t.check(cw(Ww,r)),t.xid=r=>t.check(iw(Cw,r)),t.ksuid=r=>t.check(nw(zw,r)),t.ipv4=r=>t.check(aw(Ow,r)),t.ipv6=r=>t.check(ow(Uw,r)),t.cidrv4=r=>t.check(sw(Vw,r)),t.cidrv6=r=>t.check(lw(jw,r)),t.e164=r=>t.check(dw(Lw,r)),t.datetime=r=>t.check(LF(r)),t.date=r=>t.check(ZF(r)),t.time=r=>t.check(GF(r)),t.duration=r=>t.check(HF(r))});function Vm(t){return _1(zd,t)}var dt=I("ZodStringFormat",(t,e)=>{ct.init(t,e),Mw.init(t,e)}),Nw=I("ZodEmail",(t,e)=>{fA.init(t,e),dt.init(t,e)});function nM(t){return Gy(Nw,t)}var jm=I("ZodGUID",(t,e)=>{dA.init(t,e),dt.init(t,e)});function aM(t){return zm(jm,t)}var Oa=I("ZodUUID",(t,e)=>{pA.init(t,e),dt.init(t,e)});function oM(t){return Hy(Oa,t)}function sM(t){return qy(Oa,t)}function lM(t){return Jy(Oa,t)}function uM(t){return Xy(Oa,t)}var Zm=I("ZodURL",(t,e)=>{mA.init(t,e),dt.init(t,e)});function cM(t){return Om(Zm,t)}function dM(t){return Om(Zm,{protocol:Vi.httpProtocol,hostname:Vi.domain,...H.normalizeParams(t)})}var Iw=I("ZodEmoji",(t,e)=>{hA.init(t,e),dt.init(t,e)});function pM(t){return Yy(Iw,t)}var Bw=I("ZodNanoID",(t,e)=>{gA.init(t,e),dt.init(t,e)});function fM(t){return Qy(Bw,t)}var Tw=I("ZodCUID",(t,e)=>{vA.init(t,e),dt.init(t,e)});function mM(t){return ew(Tw,t)}var Dw=I("ZodCUID2",(t,e)=>{xA.init(t,e),dt.init(t,e)});function hM(t){return tw(Dw,t)}var Rw=I("ZodULID",(t,e)=>{yA.init(t,e),dt.init(t,e)});function gM(t){return rw(Rw,t)}var Cw=I("ZodXID",(t,e)=>{wA.init(t,e),dt.init(t,e)});function vM(t){return iw(Cw,t)}var zw=I("ZodKSUID",(t,e)=>{bA.init(t,e),dt.init(t,e)});function xM(t){return nw(zw,t)}var Ow=I("ZodIPv4",(t,e)=>{EA.init(t,e),dt.init(t,e)});function yM(t){return aw(Ow,t)}var sS=I("ZodMAC",(t,e)=>{$A.init(t,e),dt.init(t,e)});function wM(t){return F1(sS,t)}var Uw=I("ZodIPv6",(t,e)=>{PA.init(t,e),dt.init(t,e)});function bM(t){return ow(Uw,t)}var Vw=I("ZodCIDRv4",(t,e)=>{kA.init(t,e),dt.init(t,e)});function _M(t){return sw(Vw,t)}var jw=I("ZodCIDRv6",(t,e)=>{MA.init(t,e),dt.init(t,e)});function AM(t){return lw(jw,t)}var Kw=I("ZodBase64",(t,e)=>{IA.init(t,e),dt.init(t,e)});function FM(t){return uw(Kw,t)}var Ww=I("ZodBase64URL",(t,e)=>{BA.init(t,e),dt.init(t,e)});function SM(t){return cw(Ww,t)}var Lw=I("ZodE164",(t,e)=>{TA.init(t,e),dt.init(t,e)});function EM(t){return dw(Lw,t)}var Zw=I("ZodJWT",(t,e)=>{DA.init(t,e),dt.init(t,e)});function PM(t){return pw(Zw,t)}var Od=I("ZodCustomStringFormat",(t,e)=>{RA.init(t,e),dt.init(t,e)});function $M(t,e,r={}){return Bd(Od,t,e,r)}function kM(t){return Bd(Od,"hostname",Vi.hostname,t)}function MM(t){return Bd(Od,"hex",Vi.hex,t)}function NM(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Vi[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Bd(Od,n,i,e)}var Ud=I("ZodNumber",(t,e)=>{Cy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>uF(t,n,i,a),Lm(t,"ZodNumber",{gt(n,i){return this.check(Ca(n,i))},gte(n,i){return this.check(ri(n,i))},min(n,i){return this.check(ri(n,i))},lt(n,i){return this.check(Ra(n,i))},lte(n,i){return this.check(ji(n,i))},max(n,i){return this.check(ji(n,i))},int(n){return this.check($w(n))},safe(n){return this.check($w(n))},positive(n){return this.check(Ca(0,n))},nonnegative(n){return this.check(ri(0,n))},negative(n){return this.check(Ra(0,n))},nonpositive(n){return this.check(ji(0,n))},multipleOf(n,i){return this.check(ys(n,i))},step(n,i){return this.check(ys(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function lS(t){return M1(Ud,t)}var ru=I("ZodNumberFormat",(t,e)=>{CA.init(t,e),Ud.init(t,e)});function $w(t){return I1(ru,t)}function IM(t){return B1(ru,t)}function BM(t){return T1(ru,t)}function TM(t){return D1(ru,t)}function DM(t){return R1(ru,t)}var Vd=I("ZodBoolean",(t,e)=>{Bm.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cF(t,r,n,i)});function uS(t){return C1(Vd,t)}var jd=I("ZodBigInt",(t,e)=>{zy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>dF(t,n,i,a),t.gte=(n,i)=>t.check(ri(n,i)),t.min=(n,i)=>t.check(ri(n,i)),t.gt=(n,i)=>t.check(Ca(n,i)),t.gte=(n,i)=>t.check(ri(n,i)),t.min=(n,i)=>t.check(ri(n,i)),t.lt=(n,i)=>t.check(Ra(n,i)),t.lte=(n,i)=>t.check(ji(n,i)),t.max=(n,i)=>t.check(ji(n,i)),t.positive=n=>t.check(Ca(BigInt(0),n)),t.negative=n=>t.check(Ra(BigInt(0),n)),t.nonpositive=n=>t.check(ji(BigInt(0),n)),t.nonnegative=n=>t.check(ri(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(ys(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function RM(t){return O1(jd,t)}var Gw=I("ZodBigIntFormat",(t,e)=>{zA.init(t,e),jd.init(t,e)});function CM(t){return V1(Gw,t)}function zM(t){return j1(Gw,t)}var cS=I("ZodSymbol",(t,e)=>{OA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pF(t,r,n,i)});function OM(t){return K1(cS,t)}var dS=I("ZodUndefined",(t,e)=>{UA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mF(t,r,n,i)});function UM(t){return W1(dS,t)}var pS=I("ZodNull",(t,e)=>{VA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fF(t,r,n,i)});function fS(t){return L1(pS,t)}var mS=I("ZodAny",(t,e)=>{jA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vF(t,r,n,i)});function VM(){return Z1(mS)}var hS=I("ZodUnknown",(t,e)=>{KA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xF(t,r,n,i)});function tu(){return G1(hS)}var gS=I("ZodNever",(t,e)=>{WA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gF(t,r,n,i)});function Hw(t){return H1(gS,t)}var vS=I("ZodVoid",(t,e)=>{LA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hF(t,r,n,i)});function jM(t){return q1(vS,t)}var Gm=I("ZodDate",(t,e)=>{ZA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>yF(t,n,i,a),t.min=(n,i)=>t.check(ri(n,i)),t.max=(n,i)=>t.check(ji(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function KM(t){return J1(Gm,t)}var xS=I("ZodArray",(t,e)=>{GA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NF(t,r,n,i),t.element=e.element,Lm(t,"ZodArray",{min(r,n){return this.check(vo(r,n))},nonempty(r){return this.check(vo(1,r))},max(r,n){return this.check(Ql(r,n))},length(r,n){return this.check(eu(r,n))},unwrap(){return this.element}})});function Hm(t,e){return Q1(xS,t,e)}function WM(t){let e=t._zod.def.shape;return Jw(Object.keys(e))}var qm=I("ZodObject",(t,e)=>{HA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IF(t,r,n,i),H.defineLazy(t,"shape",()=>e.shape),Lm(t,"ZodObject",{keyof(){return Jw(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:tu()})},loose(){return this.clone({...this._zod.def,catchall:tu()})},strict(){return this.clone({...this._zod.def,catchall:Hw()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return H.extend(this,r)},safeExtend(r){return H.safeExtend(this,r)},merge(r){return H.merge(this,r)},pick(r){return H.pick(this,r)},omit(r){return H.omit(this,r)},partial(...r){return H.partial(Yw,this,r[0])},required(...r){return H.required(Qw,this,r[0])}})});function LM(t,e){let r={type:"object",shape:t??{},...H.normalizeParams(e)};return new qm(r)}function ZM(t,e){return new qm({type:"object",shape:t,catchall:Hw(),...H.normalizeParams(e)})}function GM(t,e){return new qm({type:"object",shape:t,catchall:tu(),...H.normalizeParams(e)})}var Jm=I("ZodUnion",(t,e)=>{Tm.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yw(t,r,n,i),t.options=e.options});function qw(t,e){return new Jm({type:"union",options:t,...H.normalizeParams(e)})}var yS=I("ZodXor",(t,e)=>{Jm.init(t,e),qA.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yw(t,r,n,i),t.options=e.options});function HM(t,e){return new yS({type:"union",options:t,inclusive:!1,...H.normalizeParams(e)})}var wS=I("ZodDiscriminatedUnion",(t,e)=>{Jm.init(t,e),JA.init(t,e)});function qM(t,e,r){return new wS({type:"union",options:e,discriminator:t,...H.normalizeParams(r)})}var bS=I("ZodIntersection",(t,e)=>{XA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BF(t,r,n,i)});function _S(t,e){return new bS({type:"intersection",left:t,right:e})}var AS=I("ZodTuple",(t,e)=>{Oy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TF(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function FS(t,e,r){let n=e instanceof Pe,i=n?r:e,a=n?e:null;return new AS({type:"tuple",items:t,rest:a,...H.normalizeParams(i)})}var Rd=I("ZodRecord",(t,e)=>{YA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function SS(t,e,r){return!e||!e._zod?new Rd({type:"record",keyType:Vm(),valueType:t,...H.normalizeParams(e)}):new Rd({type:"record",keyType:t,valueType:e,...H.normalizeParams(r)})}function JM(t,e,r){let n=ei(t);return n._zod.values=void 0,new Rd({type:"record",keyType:n,valueType:e,...H.normalizeParams(r)})}function XM(t,e,r){return new Rd({type:"record",keyType:t,valueType:e,mode:"loose",...H.normalizeParams(r)})}var ES=I("ZodMap",(t,e)=>{QA.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kF(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(za(...r)),t.nonempty=r=>t.check(za(1,r)),t.max=(...r)=>t.check(ws(...r)),t.size=(...r)=>t.check(Yl(...r))});function YM(t,e,r){return new ES({type:"map",keyType:t,valueType:e,...H.normalizeParams(r)})}var PS=I("ZodSet",(t,e)=>{e1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MF(t,r,n,i),t.min=(...r)=>t.check(za(...r)),t.nonempty=r=>t.check(za(1,r)),t.max=(...r)=>t.check(ws(...r)),t.size=(...r)=>t.check(Yl(...r))});function QM(t,e){return new PS({type:"set",valueType:t,...H.normalizeParams(e)})}var Cd=I("ZodEnum",(t,e)=>{t1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(n,i,a)=>wF(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Cd({...e,checks:[],...H.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Cd({...e,checks:[],...H.normalizeParams(i),entries:a})}});function Jw(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Cd({type:"enum",entries:r,...H.normalizeParams(e)})}function eN(t,e){return new Cd({type:"enum",entries:t,...H.normalizeParams(e)})}var $S=I("ZodLiteral",(t,e)=>{r1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bF(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function tN(t,e){return new $S({type:"literal",values:Array.isArray(t)?t:[t],...H.normalizeParams(e)})}var kS=I("ZodFile",(t,e)=>{i1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FF(t,r,n,i),t.min=(r,n)=>t.check(za(r,n)),t.max=(r,n)=>t.check(ws(r,n)),t.mime=(r,n)=>t.check(Pd(Array.isArray(r)?r:[r],n))});function rN(t){return eF(kS,t)}var MS=I("ZodTransform",(t,e)=>{n1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$F(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ms(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(H.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(H.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Xw(t){return new MS({type:"transform",transform:t})}var Yw=I("ZodOptional",(t,e)=>{Uy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ww(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Km(t){return new Yw({type:"optional",innerType:t})}var NS=I("ZodExactOptional",(t,e)=>{a1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ww(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function IS(t){return new NS({type:"optional",innerType:t})}var BS=I("ZodNullable",(t,e)=>{o1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Wm(t){return new BS({type:"nullable",innerType:t})}function iN(t){return Km(Wm(t))}var TS=I("ZodDefault",(t,e)=>{s1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function DS(t,e){return new TS({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var RS=I("ZodPrefault",(t,e)=>{l1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function CS(t,e){return new RS({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var Qw=I("ZodNonOptional",(t,e)=>{u1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function zS(t,e){return new Qw({type:"nonoptional",innerType:t,...H.normalizeParams(e)})}var OS=I("ZodSuccess",(t,e)=>{c1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>SF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nN(t){return new OS({type:"success",innerType:t})}var US=I("ZodCatch",(t,e)=>{d1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function VS(t,e){return new US({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var jS=I("ZodNaN",(t,e)=>{p1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_F(t,r,n,i)});function aN(t){return Y1(jS,t)}var Xm=I("ZodPipe",(t,e)=>{Vy.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VF(t,r,n,i),t.in=e.in,t.out=e.out});function kw(t,e){return new Xm({type:"pipe",in:t,out:e})}var Ym=I("ZodCodec",(t,e)=>{Xm.init(t,e),Dm.init(t,e)});function oN(t,e,r){return new Ym({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function sN(t){let e=t._zod.def;return new Ym({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var KS=I("ZodPreprocess",(t,e)=>{Xm.init(t,e),f1.init(t,e)}),WS=I("ZodReadonly",(t,e)=>{m1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function LS(t){return new WS({type:"readonly",innerType:t})}var ZS=I("ZodTemplateLiteral",(t,e)=>{h1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AF(t,r,n,i)});function lN(t,e){return new ZS({type:"template_literal",parts:t,...H.normalizeParams(e)})}var GS=I("ZodLazy",(t,e)=>{x1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WF(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function HS(t){return new GS({type:"lazy",getter:t})}var qS=I("ZodPromise",(t,e)=>{v1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KF(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function uN(t){return new qS({type:"promise",innerType:t})}var JS=I("ZodFunction",(t,e)=>{g1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PF(t,r,n,i)});function cN(t){return new JS({type:"function",input:Array.isArray(t?.input)?FS(t?.input):t?.input??Hm(tu()),output:t?.output??tu()})}var Qm=I("ZodCustom",(t,e)=>{y1.init(t,e),De.init(t,e),t._zod.processJSONSchema=(r,n,i)=>EF(t,r,n,i)});function dN(t){let e=new ft({check:"custom"});return e._zod.check=t,e}function pN(t,e){return tF(Qm,t??(()=>!0),e)}function XS(t,e={}){return rF(Qm,t,e)}function YS(t,e){return iF(t,e)}var fN=nF,mN=aF;function hN(t,e={}){let r=new Qm({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...H.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var gN=(...t)=>oF({Codec:Ym,Boolean:Vd,String:zd},...t);function vN(t){let e=HS(()=>qw([Vm(t),lS(),uS(),fS(),Hm(e),SS(Vm(),e)]));return e}function xN(t,e){return new KS({type:"pipe",in:Xw(t),out:e})}var XR={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function YR(t){jt({customError:t})}function QR(){return jt().customError}var QS;QS||(QS={});var ie={...Um,...Aw,iso:Dd},e2=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function t2(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function r2(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function yN(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return ie.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return ie.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=r2(i,e),o=Kr(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return ie.null();if(i.length===0)return ie.never();if(i.length===1)return ie.literal(i[0]);if(i.every(o=>typeof o=="string"))return ie.enum(i);let a=i.map(o=>ie.literal(o));return a.length<2?a[0]:ie.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return ie.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return yN(o,e)});return i.length===0?ie.never():i.length===1?i[0]:ie.union(i)}if(!r)return ie.any();let n;switch(r){case"string":{let i=ie.string();if(t.format){let a=t.format;a==="email"?i=i.check(ie.email()):a==="uri"||a==="uri-reference"?i=i.check(ie.url()):a==="uuid"||a==="guid"?i=i.check(ie.uuid()):a==="date-time"?i=i.check(ie.iso.datetime()):a==="date"?i=i.check(ie.iso.date()):a==="time"?i=i.check(ie.iso.time()):a==="duration"?i=i.check(ie.iso.duration()):a==="ipv4"?i=i.check(ie.ipv4()):a==="ipv6"?i=i.check(ie.ipv6()):a==="mac"?i=i.check(ie.mac()):a==="cidr"?i=i.check(ie.cidrv4()):a==="cidr-v6"?i=i.check(ie.cidrv6()):a==="base64"?i=i.check(ie.base64()):a==="base64url"?i=i.check(ie.base64url()):a==="e164"?i=i.check(ie.e164()):a==="jwt"?i=i.check(ie.jwt()):a==="emoji"?i=i.check(ie.emoji()):a==="nanoid"?i=i.check(ie.nanoid()):a==="cuid"?i=i.check(ie.cuid()):a==="cuid2"?i=i.check(ie.cuid2()):a==="ulid"?i=i.check(ie.ulid()):a==="xid"?i=i.check(ie.xid()):a==="ksuid"&&(i=i.check(ie.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?ie.number().int():ie.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=ie.boolean();break}case"null":{n=ie.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[u,d]of Object.entries(a)){let m=Kr(d,e);i[u]=o.has(u)?m:m.optional()}if(t.propertyNames){let u=Kr(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Kr(t.additionalProperties,e):ie.any();if(Object.keys(i).length===0){n=ie.record(u,d);break}let m=ie.object(i).passthrough(),x=ie.looseRecord(u,d);n=ie.intersection(m,x);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),m=[];for(let g of d){let w=Kr(u[g],e),A=ie.string().regex(new RegExp(g));m.push(ie.looseRecord(A,w))}let x=[];if(Object.keys(i).length>0&&x.push(ie.object(i).passthrough()),x.push(...m),x.length===0)n=ie.object({}).passthrough();else if(x.length===1)n=x[0];else{let g=ie.intersection(x[0],x[1]);for(let w=2;w<x.length;w++)g=ie.intersection(g,x[w]);n=g}break}let s=ie.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Kr(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(u=>Kr(u,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Kr(a,e):void 0;s?n=ie.tuple(o).rest(s):n=ie.tuple(o),typeof t.minItems=="number"&&(n=n.check(ie.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ie.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(u=>Kr(u,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Kr(t.additionalItems,e):void 0;s?n=ie.tuple(o).rest(s):n=ie.tuple(o),typeof t.minItems=="number"&&(n=n.check(ie.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ie.maxLength(t.maxItems)))}else if(a!==void 0){let o=Kr(a,e),s=ie.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=ie.array(ie.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Kr(t,e){if(typeof t=="boolean")return t?ie.any():ie.never();let r=yN(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(d=>Kr(d,e)),u=ie.union(s);r=n?ie.intersection(r,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(d=>Kr(d,e)),u=ie.xor(s);r=n?ie.intersection(r,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:ie.any();else{let s=n?r:Kr(t.allOf[0],e),u=n?0:1;for(let d=u;d<t.allOf.length;d++)s=ie.intersection(s,Kr(t.allOf[d],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=ie.nullable(r)),t.readOnly===!0&&(r=ie.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))e2.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function wN(t,e){if(typeof t=="boolean")return t?ie.any():ie.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=t2(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Nr};return Kr(r,a)}var eE={};Va(eE,{bigint:()=>o2,boolean:()=>a2,date:()=>s2,number:()=>n2,string:()=>i2});function i2(t){return A1(zd,t)}function n2(t){return N1(Ud,t)}function a2(t){return z1(Vd,t)}function o2(t){return U1(jd,t)}function s2(t){return X1(Gm,t)}jt(jy());var _N=[1,2,4,8],AN=[1,2,3,4,5,6,7,8],FN=["disable-track","mute-region"],SN=["none","all","previous-only"],EN=ke.object({metronome:ke.object({enabled:ke.boolean(),beatSubDivision:ke.union(_N.map(t=>ke.literal(t))),gain:ke.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:ke.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:ke.object({timestampEnabled:ke.boolean(),pauseOnLoopDisabled:ke.boolean(),truncateNotesAtRegionEnd:ke.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:ke.object({dspLoadMeasurement:ke.boolean()}).default({dspLoadMeasurement:!1}),recording:ke.object({countInBars:ke.union(AN.map(t=>ke.literal(t))),allowTakes:ke.boolean(),automationEnabled:ke.boolean(),olderTakeAction:ke.union(FN.map(t=>ke.literal(t))),olderTakeScope:ke.union(SN.map(t=>ke.literal(t))),inputLatency:ke.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),bN;(function(t){t.BeatSubDivisionOptions=_N,t.RecordingCountInBars=AN,t.OlderTakeActionOptions=FN,t.OlderTakeScopeOptions=SN})(bN||(bN={}));var Fs={[Ft.Instrument]:0,[Ft.Aux]:1,[Ft.Bus]:2,[Ft.Output]:3};var eb;(function(t){t.create=({boxGraph:e,mandatoryBoxes:{rootBox:r,primaryAudioBusBox:n}},i,a,o)=>{let s=o??t.orderAndGetIndex(r,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),Xe.create(e,M.generate(),u=>{u.collection.refer(r.audioUnits),u.output.refer(n.input),u.index.setValue(s),u.type.setValue(i),a.ifSome(d=>u.capture.refer(d))})},t.orderAndGetIndex=(e,r)=>{let n=ai.collectIndexedBoxes(e.audioUnits,Xe),i=Fs[r],a=0;for(;a<n.length&&!(Fs[n[a].type.getValue()]>i);a++);let o=a;for(;a<n.length;)n[a].index.setValue(++a);return o},t.trackTypeToCapture=(e,r)=>{switch(r){case ve.Audio:return b.wrap(ca.create(e,M.generate()));case ve.Notes:return b.wrap(da.create(e,M.generate()));default:return b.None}}})(eb||(eb={}));var PN;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;te(s.isAttached(),"rootBox not attached");let u=M.generate(),d=Nn.create(o,u,x=>{x.collection.refer(s.audioBusses),x.label.setValue(r),x.icon.setValue(Le.toName(n)),x.color.setValue(a.toString())}),m=eb.create(e,i,b.None);return Br.create(o,M.generate(),x=>{x.tracks.refer(m.tracks),x.target.refer(m),x.index.setValue(0),x.type.setValue(ve.Undefined)}),d.output.refer(m.input),d}})(PN||(PN={}));var $N;(function(t){t.forAudioType=e=>{switch(e){case Ft.Output:return Eo.blue;case Ft.Aux:return Eo.purple;case Ft.Bus:return Eo.orange;case Ft.Instrument:return Eo.green;default:return Eo.dark}},t.forTrackType=e=>{switch(e){case ve.Audio:return 200;case ve.Notes:return 45;case ve.Value:return 156;default:return 0}}})($N||($N={}));var kN;(function(t){t.Tape={defaultName:"Tape",defaultIcon:Le.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:oe.Tape,trackType:ve.Audio,create:(n,i,a,o,s)=>Bu.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.flutter.setValue(.2),u.wow.setValue(.05),u.noise.setValue(.02),u.saturation.setValue(.5),u.host.refer(i)})},t.Nano={defaultName:"Nano",defaultIcon:Le.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:oe.Nano,trackType:ve.Notes,create:(n,i,a,o,s)=>Nu.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),K(s)&&u.file.refer(s),u.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:Le.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:oe.Playfield,trackType:ve.Notes,create:(n,i,a,o,s)=>{let u=Iu.create(n,M.generate(),d=>{d.label.setValue(a),d.icon.setValue(Le.toName(o)),d.host.refer(i)});return K(s)&&s.filter(({note:d,uuid:m,name:x,durationInSeconds:g,exclude:w})=>{let A=e(n,m,x,g);Bo.create(n,M.generate(),_=>{_.device.refer(u.samples),_.file.refer(A),_.index.setValue(d),_.exclude.setValue(w)})}),u}},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Le.Piano,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:oe.Vaporisateur,trackType:ve.Notes,create:(n,i,a,o,s)=>$u.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.cutoff.setInitValue(8e3),u.resonance.setInitValue(.1),u.attack.setInitValue(.005),u.decay.setInitValue(.1),u.sustain.setInitValue(.5),u.release.setInitValue(.5),u.voicingMode.setInitValue(Cs.Polyphonic),u.lfo.rate.setInitValue(1),u.oscillators.fields()[0].waveform.setInitValue(aa.saw),u.oscillators.fields()[0].volume.setInitValue(-6),u.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),u.oscillators.fields()[1].waveform.setInitValue(aa.square),u.host.refer(i),u.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Le.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:oe.MIDIOutput,trackType:ve.Notes,create:(n,i,a,o,s)=>ku.create(n,M.generate(),u=>{u.label.setValue(a),u.icon.setValue(Le.toName(o)),u.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:Le.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:oe.Soundfont,trackType:ve.Notes,create:(n,i,a,o)=>Mu.create(n,M.generate(),s=>{s.label.setValue(a),s.icon.setValue(Le.toName(o)),s.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:Le.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:oe.Apparat,trackType:ve.Notes,create:(n,i,a,o)=>Tu.create(n,M.generate(),s=>{s.label.setValue(a),s.icon.setValue(Le.toName(o)),s.host.refer(i)})},t.Named={Apparat:t.Apparat,MIDIOutput:t.MIDIOutput,Nano:t.Nano,Playfield:t.Playfield,Soundfont:t.Soundfont,Tape:t.Tape,Vaporisateur:t.Vaporisateur};let e=(n,i,a,o)=>n.findBox(i).unwrapOrElse(()=>Li.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>ua.create(n,i,o=>o.fileName.setValue(a)))})(kN||(kN={}));var iu;(function(t){t.empty=n=>{let i=new Za(b.wrap(qa.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=Eu.create(i,M.generate(),g=>{g.label.setValue("Groove Shuffle")}),s=$o.create(i,M.generate(),g=>{g.groove.refer(o),g.created.setValue(a)}),u=Nn.create(i,M.generate(),g=>{g.collection.refer(s.audioBusses),g.label.setValue("Output"),g.icon.setValue(Le.toName(Le.SpeakerHeadphone)),g.color.setValue(Eo.blue.toString())}),d=Xe.create(i,M.generate(),g=>{g.type.setValue(Ft.Output),g.collection.refer(s.audioUnits),g.output.refer(s.outputDevice),g.index.setValue(0)});n.createOutputMaximizer&&Pu.create(i,M.generate(),g=>{g.label.setValue("Master Maximizer"),g.index.setValue(0),g.host.refer(d.audioEffects),g.lookahead.setValue(!1)});let m=zs.create(i,M.generate());Mn.create(i,M.generate(),g=>m.tempoTrack.events.refer(g.owners)),s.timeline.refer(m.root),u.output.refer(d.input);let x=[];if(n.createDefaultUser){let g=Ja.create(i,M.generate());g.root.refer(s.users),x.push(g)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:u,primaryAudioUnitBox:d,timelineBox:m,userInterfaceBoxes:x}}},t.encode=n=>{let i=Yt.create();i.writeInt(1330660686),i.writeInt(2);let a=n.toArrayBuffer();return i.writeInt(a.byteLength),i.writeBytes(new Int8Array(a)),i.toArrayBuffer()},t.decode=n=>{let i=new rt(n);te(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),te(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new Za(b.wrap(qa.create));return s.fromArrayBuffer(o.buffer,!1),{boxGraph:s,mandatoryBoxes:t.findMandatoryBoxes(s)}},t.findMandatoryBoxes=n=>{let i=n.boxes().find(a=>a.accept({visitRootBox:()=>!0}));if(K(i)){let a=Ie(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),o=Ie(a.input.pointerHub.incoming().at(0)?.box,Nn),s=Ie(i.timeline.targetVertex.unwrap("TimelineBox not found").box,zs),u=i.users.pointerHub.incoming().map(({box:d})=>Ie(d,Ja));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:u}}return V("Could not find mandatory boxes")}})(iu||(iu={}));var Nt;(function(t){let e=({graph:n},{graph:i})=>n===i,r=(n,i)=>n.index.getValue()-i.index.getValue();t.excludeTimelinePredicate=n=>n.accept({visitTrackBox:()=>!0})===!0,t.shouldExclude=n=>n.ephemeral||n.name===Su.ClassName,t.generateMap=(n,i,a,o)=>{let s=M.newSet(({source:u})=>u);return s.addMany([...n.filter(({output:{targetAddress:u}})=>u.nonEmpty()).map(u=>({source:u.output.targetAddress.unwrap().uuid,target:o})),...n.map(u=>({source:u.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:a})),...n.map(u=>({source:u.address.uuid,target:M.generate()})),...i.map(u=>({source:u.address.uuid,target:u.resource==="preserved"?u.address.uuid:M.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=M.newSet(d=>d);o.forEach(d=>{d.resource==="preserved"&&i.findBox(d.address.uuid).nonEmpty()&&s.add(d.address.uuid)});let u=d=>{for(let[m,x]of d.outgoingEdges())if(m.mandatory&&!x.isBox()&&s.hasKey(x.uuid))return!0;return!1};N.decodeWith({map:(d,m)=>m.flatMap(x=>n.opt(x.uuid).match({some:({target:g})=>b.wrap(x.moveTo(g)),none:()=>i.findBox(x.uuid).nonEmpty()?b.wrap(x):b.None}))},()=>{a.forEach(d=>{let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))}),o.forEach(d=>{if(s.hasKey(d.address.uuid)||u(d))return;let m=new rt(d.toArrayBuffer()),x=n.get(d.address.uuid,"uuid mapping").target;i.createBox(d.name,x,g=>g.read(m))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(g=>Ie(a.graph.findBox(n.get(g.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)),u=new Set(s),m=ai.collectIndexedBoxes(a.audioUnits,Xe).filter(g=>!u.has(g)),x;if(K(o)){let g=at(o,0,m.length);x=[...m.slice(0,g),...s,...m.slice(g)]}else{let g=m.toSorted((_,C)=>(Fs[_.type.getValue()]??0)-(Fs[C.type.getValue()]??0)),w=s.reduce((_,C)=>Math.max(_,Fs[C.type.getValue()]??0),0),A=g.findIndex(_=>(Fs[_.type.getValue()]??0)>w);A===-1&&(A=g.length),x=[...g.slice(0,A),...s,...g.slice(A)]}x.forEach((g,w)=>g.index.setValue(w))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{te(ce.satisfy(n,e),"Region smust be from the same BoxGraph");let u=new Set(n),d=new Set,m=new wh;n.forEach(W=>{let U=Ie(W.regions.targetVertex.unwrap("regions.target").box,Br);d.add(U);let ee=Ie(U.tracks.targetVertex.unwrap("tracks.target").box,Xe);m.add(ee,U)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${d.size} tracks`);let x=[...m.keys()],g=W=>t.shouldExclude(W)||mt(W,Br)&&!d.has(W)||Xn.isRegionBox(W)&&!u.has(W),w=Array.from(x[0].graph.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:g}).boxes),A=t.generateMap(x,w,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(A,i,x,w),t.reorderAudioUnits(A,x,o),m.forEach((W,U)=>[...U].sort(r).forEach((ee,re)=>{let me=i.findBox(A.get(ee.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");Ie(me,Br).index.setValue(re)}));let _=n.reduce((W,U)=>Math.min(W,U.position.getValue()),Number.MAX_VALUE),C=s-_;n.forEach(W=>{let U=i.findBox(A.get(W.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:ee}=Xn.asRegionBox(U);ee.setValue(ee.getValue()+C)})}})(Nt||(Nt={}));var MN;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(x=>x.type.getValue()!==Ft.Output);if(o.length===0)return[];let s=x=>Nt.shouldExclude(x)||a?.excludeTimeline===!0&&Nt.excludeTimelinePredicate(x),u=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),d=Nt.generateMap(o,u,i.audioUnits.address.uuid,n.address.uuid);Nt.copyBoxes(d,r,o,u),Nt.reorderAudioUnits(d,o,i,a.insertIndex);let m=o.map(x=>Ie(i.graph.findBox(d.get(x.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe));if(a.deleteSource===!0){let x=Ie(o[0].collection.targetVertex.unwrap("collection.target").box,$o);o.forEach(g=>g.delete()),ai.collectIndexedBoxes(x.audioUnits,Xe).forEach((g,w)=>g.index.setValue(w))}return m}})(MN||(MN={}));var NN;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=M.newSet(g=>g.address.uuid);o.add(e);for(let g of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:w=>w.ephemeral}).boxes)o.add(g);let s=M.newSet(g=>g);o.forEach(g=>{g.resource==="preserved"&&a.findBox(g.address.uuid).nonEmpty()&&s.add(g.address.uuid)});let u=g=>{if(g.resource==="preserved"&&s.hasKey(g.address.uuid))return!0;for(let[,w]of g.outgoingEdges())if(s.hasKey(w.uuid)&&!w.isBox())return!0;return!1},d=o.values().filter(g=>!u(g)),m=M.newSet(g=>g.source);d.forEach(g=>{m.add({source:g.address.uuid,target:g.resource==="preserved"?g.address.uuid:M.generate()})}),s.forEach(g=>m.add({source:g,target:g}));let x=null;return N.decodeWith({map:(g,w)=>{let A=w.flatMap(_=>m.opt(_.uuid).map(C=>_.moveTo(C.target)));return A.nonEmpty()?A:g.pointerType===l.RegionCollection?b.wrap(r.regions.address):g.pointerType===l.ClipCollection?b.wrap(r.clips.address):b.None}},()=>d.forEach(g=>{let w=new rt(g.toArrayBuffer()),A=m.get(g.address.uuid,"uuid mapping").target;a.createBox(g.name,A,_=>{if(_.read(w),Xn.isRegionBox(_)){let C=Xn.asRegionBox(_);C.position.setValue(n),x=C}})})),i&&e.delete(),ze(x,"Failed to create region copy")}})(NN||(NN={}));var Kt;(function(t){t.MAGIC_HEADER_OPEN=1330664005,t.FORMAT_VERSION=1;let e;(function(r){r[r.Midi=0]="Midi",r[r.Audio=1]="Audio"})(e=t.ChainKind||(t.ChainKind={}))})(Kt||(Kt={}));var IN;(function(t){t.decode=(e,r)=>{let n=new rt(e.slice(0,8));if(n.readInt()!==Kt.MAGIC_HEADER_OPEN)return fu.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==Kt.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${Kt.FORMAT_VERSION})`),fu.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new Za(b.wrap(qa.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(A){return console.warn(A),fu.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let A of a.boxes())o[A.name]=(o[A.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(A=>mt(A,Xe)).filter(A=>A.type.getValue()!==Ft.Output),u=A=>Nt.shouldExclude(A),d=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:u}).boxes),{mandatoryBoxes:{rootBox:m,primaryAudioBusBox:x}}=r,g=Nt.generateMap(s,d,m.audioUnits.address.uuid,x.address.uuid);Nt.copyBoxes(g,r.boxGraph,s,d),Nt.reorderAudioUnits(g,s,m);let w=s.map(A=>Ie(m.graph.findBox(g.get(A.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)).filter(A=>A.type.getValue()!==Ft.Output);return w.forEach(A=>{let _=A.input.pointerHub.incoming().at(0)?.box;if(!K(_))return;let C=A.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${M.toString(A.address.uuid)} has ${C} pre-copied track(s)`),!(C>0)&&A.capture.targetVertex.ifSome(({box:W})=>{W instanceof da?Br.create(r.boxGraph,M.generate(),U=>{U.index.setValue(0),U.type.setValue(ve.Notes),U.target.refer(A),U.tracks.refer(A.tracks)}):W instanceof ca&&Br.create(r.boxGraph,M.generate(),U=>{U.index.setValue(0),U.type.setValue(ve.Audio),U.target.refer(A),U.tracks.refer(A.tracks)})})}),w},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new rt(e.slice(0,8));if(r.readInt()!==Kt.MAGIC_HEADER_OPEN||r.readInt()!==Kt.FORMAT_VERSION)return!1;let n=new Za(b.wrap(qa.create));if(Ct(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(mt(a,Br))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=iu.empty({createDefaultUser:!1,createOutputMaximizer:!1}),a=i.boxGraph,o=r.graph;a.beginTransaction(),t.decode(e,i),a.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:U})=>Ie(U,Xe)).find(U=>U.type.getValue()!==Ft.Output);if(Eb(s))return wr.err("Preset contains no valid audio unit. Please send the file to the developers.");let u=s.capture.targetVertex.mapOr(({box:U})=>U.name,""),d=r.capture.targetVertex.mapOr(({box:U})=>U.name,"");if(u!==d)return wr.err("Cannot replace incompatible instruments");let m=n?.keepMIDIEffects!==!0,x=n?.keepAudioEffects!==!0,g=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",m),console.debug("replaceAudioEffects",x),console.debug("replaceTimeline",g),ze(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),m?r.midiEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()),a.endTransaction()),x?r.audioEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:U})=>U.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&g&&r.tracks.pointerHub.incoming().forEach(({box:U})=>U.delete());let A=U=>!!(U.accept({visitCaptureMidiBox:ee=>!0,visitCaptureAudioBox:ee=>!0})===!0||!g&&Nt.excludeTimelinePredicate(U)),_=M.newSet(({source:U})=>U),C=Array.from(a.dependenciesOf(s,{excludeBox:A,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);_.addMany([{source:s.address.uuid,target:r.address.uuid},...C.map(({address:{uuid:U},name:ee})=>({source:U,target:ee===Li.ClassName||ee===ua.ClassName?U:M.generate()}))]);let W=M.newSet(U=>U);return C.forEach(U=>{(U instanceof Li||U instanceof ua)&&o.findBox(U.address.uuid).nonEmpty()&&W.add(U.address.uuid)}),N.decodeWith({map:(U,ee)=>ee.flatMap(re=>_.opt(re.uuid).match({some:({target:me})=>b.wrap(re.moveTo(me)),none:()=>o.findBox(re.uuid).nonEmpty()?b.wrap(re):b.None}))},()=>{C.forEach(U=>{if((U instanceof Li||U instanceof ua)&&W.opt(U.address.uuid).nonEmpty())return;let ee=new rt(U.toArrayBuffer()),re=U.name,me=_.get(U.address.uuid,"uuid mapping").target;o.createBox(re,me,$e=>$e.read(ee))})}),wr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return wr.err("Invalid preset header");let a=new rt(e.slice(0,8));if(a.readInt()!==Kt.MAGIC_HEADER_OPEN)return wr.err("Invalid preset header");let o=a.readInt();if(o!==Kt.FORMAT_VERSION)return wr.err(`Unsupported preset version ${o} (this build supports ${Kt.FORMAT_VERSION}).`);let s=new Za(b.wrap(qa.create)),u=Ct(()=>s.fromArrayBuffer(e.slice(8),!1));if(u.status==="failure")return wr.err(`Failed to decode preset: ${String(u.error)}`);let d=s.boxes().filter(Q=>mt(Q,Xe)).map(Q=>Ie(Q,Xe)).find(Q=>Q.type.getValue()!==Ft.Output);if(Eb(d))return wr.err("Preset contains no audio unit");let m=i===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,x=ai.collectIndexedBoxes(m);if(x.length===0)return wr.err("Preset contains no effects of the requested kind");let g=i===Kt.ChainKind.Audio?r.audioEffects:r.midiEffects,w=g.address,A=i===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,_=r.graph,C=x.length,W=ai.collectIndexedBoxes(g);for(let Q=W.length-1;Q>=0;Q--){let we=W[Q],Ge=we.index.getValue();Ge>=n&&we.index.setValue(Ge+C)}let U=Q=>Nt.shouldExclude(Q)||Nt.excludeTimelinePredicate(Q)||Q instanceof Xe,ee=new Set(x),re=Array.from(s.dependenciesOf(x,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:U}).boxes).filter(Q=>!ee.has(Q)),me=M.newSet(Q=>Q);re.forEach(Q=>{Q.resource==="preserved"&&_.findBox(Q.address.uuid).nonEmpty()&&me.add(Q.address.uuid)});let $e=M.newSet(({source:Q})=>Q);return $e.addMany([...x.map(Q=>({source:Q.address.uuid,target:M.generate()})),...re.map(Q=>({source:Q.address.uuid,target:Q.resource==="preserved"?Q.address.uuid:M.generate()}))]),N.decodeWith({map:(Q,we)=>Q.pointerType===A?b.wrap(w):we.flatMap(Ge=>$e.opt(Ge.uuid).match({some:({target:It})=>b.wrap(Ge.moveTo(It)),none:()=>_.findBox(Ge.uuid).nonEmpty()?b.wrap(Ge):b.None}))},()=>{x.forEach((Q,we)=>{let Ge=new rt(Q.toArrayBuffer()),It=$e.get(Q.address.uuid,"uuid mapping").target;_.createBox(Q.name,It,ea=>{ea.read(Ge),ai.isIndexedBox(ea)&&ea.index.setValue(n+we)})}),re.forEach(Q=>{if(me.hasKey(Q.address.uuid))return;let we=new rt(Q.toArrayBuffer()),Ge=$e.get(Q.address.uuid,"uuid mapping").target;_.createBox(Q.name,Ge,It=>It.read(we))})}),wr.Ok}})(IN||(IN={}));var BN;(function(t){t.encode=(e,r={})=>{let n=Yt.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=iu.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,u=[e],d=r.excludeEffect??(()=>!1),m=r.includeTimeline===!0,x=_=>Nt.shouldExclude(_)||!m&&Nt.excludeTimelinePredicate(_)||d(_);a.beginTransaction();let g=Array.from(e.graph.dependenciesOf(u,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes),w={};for(let _ of g)w[_.name]=(w[_.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${m}, deps=${g.length}`,w);let A=Nt.generateMap(u,g,o.audioUnits.address.uuid,s.address.uuid);return Nt.copyBoxes(A,a,u,g),Nt.reorderAudioUnits(A,u,o),a.endTransaction(),ce.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=Yt.create();n.writeInt(Kt.MAGIC_HEADER_OPEN),n.writeInt(Kt.FORMAT_VERSION);let i=iu.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let u=r===Kt.ChainKind.Audio?ca.create(a,M.generate()):da.create(a,M.generate()),d=Xe.create(a,M.generate(),m=>{m.collection.refer(o.audioUnits),m.output.refer(s.input),m.index.setValue(0),m.type.setValue(Ft.Instrument),m.capture.refer(u)});if(Du.create(a,M.generate(),m=>{m.host.refer(d.input)}),e.length>0){let m=e[0].graph,x=W=>Nt.shouldExclude(W)||Nt.excludeTimelinePredicate(W)||W instanceof Xe,g=new Set(e),w=Array.from(m.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:x}).boxes).filter(W=>!g.has(W)),A=M.newSet(({source:W})=>W);A.addMany([...e.map(W=>({source:W.address.uuid,target:M.generate()})),...w.map(W=>({source:W.address.uuid,target:W.resource==="preserved"?W.address.uuid:M.generate()}))]);let _=r===Kt.ChainKind.Audio?d.audioEffects:d.midiEffects,C=r===Kt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;N.decodeWith({map:(W,U)=>W.pointerType===C?b.wrap(_.address):U.flatMap(ee=>A.opt(ee.uuid).match({some:({target:re})=>b.wrap(ee.moveTo(re)),none:()=>a.findBox(ee.uuid).nonEmpty()?b.wrap(ee):b.None}))},()=>{e.forEach((W,U)=>{let ee=new rt(W.toArrayBuffer()),re=A.get(W.address.uuid,"uuid mapping").target;a.createBox(W.name,re,me=>{me.read(ee),ai.isIndexedBox(me)&&me.index.setValue(U)})}),w.forEach(W=>{let U=new rt(W.toArrayBuffer()),ee=A.get(W.address.uuid,"uuid mapping").target;a.createBox(W.name,ee,re=>re.read(U))})})}return a.endTransaction(),ce.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(BN||(BN={}));var TN;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=Ie(r,Xe).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof B?i.label.getValue():"N/A"})})(TN||(TN={}));var DN=ke.object({name:ke.string(),bpm:ke.number(),duration:ke.number(),sample_rate:ke.number(),origin:ke.enum(["openDAW","recording","import"]),custom:ke.string().optional()});var Joe=DN.extend({uuid:M.zType(ke)});var l2,u2,c2,d2,p2,f2;l2=new WeakMap,u2=new WeakMap,c2=new WeakMap,d2=new WeakMap,p2=new WeakMap,f2=new WeakMap;var m2,h2,g2,v2,x2,y2;m2=new WeakMap,h2=new WeakMap,g2=new WeakMap,v2=new WeakMap,x2=new WeakMap,y2=new WeakMap;var w2=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},lr=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)},Ss,b2,_2,eh,RN,tb,tE,th,A2,rE,CN,zN,iE,ON;b2=new WeakMap,_2=new WeakMap,eh=new WeakMap,RN=new WeakMap,tb=new WeakMap,tE=new WeakMap,th=new WeakMap,Ss=new WeakSet,A2=function(e){let r=lr(this,th,"f");w2(this,th,e.isEmpty()?b.None:b.wrap(e.unwrap()),"f"),r.ifSome(n=>lr(this,Ss,"m",rE).call(this,n)),lr(this,th,"f").ifSome(n=>{r.contains(n)||lr(this,Ss,"m",rE).call(this,n)})},rE=function(e){let r=lr(this,RN,"f").hasKey(e.address.uuid)&&!lr(this,th,"f").contains(e),n=lr(this,tb,"f").hasKey(e.address.uuid);r!==n&&(r?lr(this,tb,"f").add({user:e,terminable:lr(this,Ss,"m",CN).call(this,e)}):lr(this,tb,"f").removeByKey(e.address.uuid).terminable.terminate())},CN=function(e){let r=M.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=Ie(i.box,sa);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&lr(this,Ss,"m",zN).call(this,s,e)})},onRemoved:i=>{let a=Ie(i.box,sa),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&lr(this,Ss,"m",iE).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>lr(this,Ss,"m",iE).call(this,i.selectable,e)),r.clear()}}},zN=function(e,r){(lr(this,eh,"f").getOrNull(e.address)??lr(this,Ss,"m",ON).call(this,e)).owners.add(r),lr(this,tE,"f").proxy.onSelected(e,r)},iE=function(e,r){let n=lr(this,eh,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&lr(this,eh,"f").removeByKey(e.address),lr(this,tE,"f").proxy.onDeselected(e,r))},ON=function(e){let r={selectable:e,owners:M.newSet(n=>n.address.uuid)};return lr(this,eh,"f").add(r),r};var 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)},F2,S2,nE,aE,oE,E2,P2,$2;S2=new WeakMap,nE=new WeakMap,aE=new WeakMap,oE=new WeakMap,E2=new WeakMap,P2=new WeakMap,F2=new WeakSet,$2=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=Ie(r.box,sa);te(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),a={box:n,selectable:i};Kd(this,oE,"f").proxy.onSelected(i),te(Kd(this,nE,"f").add(a),"Could not add to entityMap"),te(Kd(this,aE,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=Ie(r.box,sa),i=Kd(this,nE,"f").removeByKey(n.address.uuid);te(i.box===n,"Broken selection");let a=i.selectable;Kd(this,oE,"f").proxy.onDeselected(a),Kd(this,aE,"f").removeByKey(a.address)}},l.Selection)};var UN=ke.object({name:ke.string(),size:ke.number().int(),url:ke.string(),license:ke.string(),origin:ke.enum(["openDAW","import"])});var xse=UN.extend({uuid:M.zType(ke)});var VN;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return b.None;if(X_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,b.wrap(e.copyTo({position:r,duration:a-r,loopOffset:$s(o+(r-i),s),consolidate:n}))}else return V("Not yet implemented")},t.clip=(e,r,n)=>{if(X_.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?V(`first part duration will be zero or negative(${r-i})`):a-n<=0?V(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:$s(o+(n-i),s)}))}else return V("Not yet implemented")}})(VN||(VN={}));var rb=class{#e;#t;#r=0;#i=0;#n=0;#a=0;constructor(e){this.#e=new Int32Array(e),this.#t=new Float64Array(e)}start(){let e=Atomics.load(this.#e,1),r=Atomics.load(this.#e,2),n=this.#t[2],i=this.#t[3];this.#o();let a=0;return this.#r>0&&this.#i===this.#r+1&&(a=this.#a-this.#n),this.#r=e,this.#i=r,this.#n=n,this.#a=i,a}end(){this.#o()}#o(){Atomics.add(this.#e,0,1),Atomics.notify(this.#e,0)}};var ib=class t{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#a=0;#o=0;#s=0;#c=0;constructor(e,r){this.#e=e,this.#t=r,this.#r=new Float32Array(4),this.#i=ce.create(()=>new Ih(t.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#a,this.#r[1]=this.#o,this.#r[2]=this.#s,this.#r[3]=this.#c})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#a=0,this.#o=0}process(e,r,n=0,i=na){let a=i-n,o=t.PEAK_DECAY**a,s=0,u=0;for(let d=n;d<i;d++){let m=Math.abs(e[d]),x=Math.abs(r[d]);m>s&&(s=m),x>u&&(u=x)}this.#a=Math.max(s,this.#a*o),this.#o=Math.max(u,this.#o*o),this.#s=this.#i[0].processBlock(e,n,i),this.#c=this.#i[1].processBlock(r,n,i)}processStereo([e,r],n=0,i=na){this.process(e,r,n,i)}terminate(){this.#n.terminate()}};var nb=class{#e;#t;#r;#i;#n=new Map;#a=[];constructor(e,r){this.#e=e,this.#t=new Uint32Array(r,0,2),this.#r=new Uint32Array(r,8),this.#i=(this.#r.length>>1)-1}send(e,r,n){let i=this.#n.get(e);if(fh(i)){if(i=this.#a.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#a.push(e),this.#e.postMessage({registerDevice:e,id:i})}let a=Atomics.load(this.#t,0),o=a+1&this.#i;if(o===Atomics.load(this.#t,1))return!1;let s=r.length,u=r[0]??0,d=r[1]??0,m=r[2]??0,x=s<<30|i<<24|u<<16|d<<8|m,g=n|0,w=a<<1;return this.#r[w]=x,this.#r[w+1]=g,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var ab=t=>{let e="",r=0,n=()=>(t[r++]??0)&63;for(;r<t.length;){let i=t[r++]??0,a=i<128?i:(i&224)===192?(i&31)<<6|n():(i&240)===224?(i&15)<<12|n()<<6|n():(i&248)===240?(i&7)<<18|n()<<12|n()<<6|n():65533;e+=a<=1114111?String.fromCodePoint(a):"\uFFFD"}return e};var sE=16,ob=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new nb(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*sE),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*sE).slice(),u=new DataView(s.buffer);for(let d=0;d<a;d++){let m=d*sE,x=u.getUint32(m,!0),g=Math.min(Math.max(u.getUint8(m+7),1),3),w=u.getFloat64(m+8,!0),A=this.#t[g-1];A[0]=u.getUint8(m+4),g>1&&(A[1]=u.getUint8(m+5)),g>2&&(A[2]=u.getUint8(m+6)),o.send(this.#i(e,r,x),A,w)}}#i(e,r,n){let i=this.#e.get(n);if(K(i))return i;let a=e.input_reserve(256),o=e.midi_out_device_id(n,a,256),s=o===0?"":ab(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};var jN=(t,e)=>{let r=t.panic_message_len();return r===0?"":ab(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var k2=["host_pull_events","host_pulse_to_offset","host_bind_parameter","host_bind_broadcast","host_broadcast_ptr","host_broadcast_active","host_update_parameters","host_first_update_position","host_next_update_position","host_resolve_sample","host_observe_sample","host_resolve_soundfont","host_observe_soundfont","host_observe_field","host_observe_target_string","host_bind_sidechain","host_resolve_input","host_self_uuid","host_panic","host_base_frequency"],sb=(t,e)=>{let r=0,n=0,i=e;for(;;){let a=t[i++];if(r|=(a&127)<<n,(a&128)===0)break;n+=7}return[r>>>0,i]},M2=t=>{let e=WebAssembly.Module.customSections(t,"dylink.0");if(e.length===0)return{memorySize:0,tableSize:0};let r=new Uint8Array(e[0]),n=0;for(;n<r.length;){let i=r[n++],[a,o]=sb(r,n);if(i===1){let[s,u]=sb(r,o),[,d]=sb(r,u),[m]=sb(r,d);return{memorySize:s,tableSize:m}}n=o+a}return{memorySize:0,tableSize:0}},KN=(t,e,r)=>{let n=r.length,i=t.input_reserve(n),a=new Uint8Array(e.buffer,i,n);for(let o=0;o<n;o++)a[o]=r.charCodeAt(o)&255;return n},WN=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:u}=M2(n),d=t.device_alloc(s),m=u>0?r.grow(u):r.length,x=t.device_alloc(262144),g={memory:e,__indirect_function_table:r,__memory_base:new WebAssembly.Global({value:"i32",mutable:!1},d),__table_base:new WebAssembly.Global({value:"i32",mutable:!1},m),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:!0},x+262144)};for(let W of k2){let U=t[W];if(typeof U!="function")throw new Error(`engine is missing the device host export '${W}'`);g[W]=U}Object.assign(g,o);let w=new WebAssembly.Instance(n,{env:g}).exports;w.__wasm_apply_data_relocs?.(),w.__wasm_call_ctors?.();let A=W=>{if(W===void 0)return 0;let U=r.grow(1);return r.set(U,W),U},_=r.grow(1);r.set(_,w.process_events??w.process);let C=t.device_register(_,w.state_size(a),w.kind(),A(w.init),A(w.parameter_changed),A(w.field_changed),A(w.sample_changed),A(w.soundfont_changed),A(w.reset),A(w.terminate),w.midi_effects_field?.()??0,w.audio_effects_field?.()??0,w.observe_param_collection_field?.()??0,w.observe_sample_collection_field?.()??0);t.device_set_box_type(C,KN(t,e,i))},LN=(t,e,r)=>{t.composite_register(KN(t,e,r.boxType),r.childrenField,r.indexKey,r.excludeKey,r.cellInstrumentField,r.cellMidiField,r.cellAudioField,r.childEnabledKey,r.childMuteKey,r.childSoloKey)};var N2=1,lb=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},I2=(t,e,r,n,i,a,o,s,u)=>{let d=e*40;t.setFloat64(d+0,n,!0),t.setUint32(d+8,0,!0),t.setUint32(d+12,r,!0),t.setUint32(d+16,i,!0),t.setUint32(d+20,a,!0),t.setFloat32(d+24,o,!0),t.setFloat32(d+28,s,!0),t.setFloat64(d+32,u,!0)},B2=(t,e)=>t==null?"process yielded undefined":typeof t.pitch!="number"||t.pitch!==t.pitch?`Invalid pitch: ${t.pitch}`:t.pitch<0||t.pitch>127?`Pitch out of range: ${t.pitch} (must be 0-127)`:typeof t.velocity!="number"||t.velocity!==t.velocity?`Invalid velocity: ${t.velocity}`:t.velocity<0||t.velocity>1?`Velocity out of range: ${t.velocity} (must be 0-1)`:typeof t.duration!="number"||t.duration!==t.duration?`Invalid duration: ${t.duration}`:t.duration<=0?`Duration must be positive: ${t.duration}`:typeof t.position!="number"||t.position!==t.position?`Invalid position: ${t.position}`:t.position<e?`Position ${t.position} is in the past (block starts at ${e})`:null,GN=(t,e,r,n,i,a,o,s,u,d,m,x,g)=>{let w=new DataView(r,n,i*40),A=new DataView(r,a,o*40),_=0,C=($e,Q,we,Ge,It,ea,He)=>{if(_>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);I2(A,_++,$e,Q,we,Ge,It,ea,He)};for(let $e=t.retained.length-1;$e>=0;$e--){let Q=t.retained[$e],we=Q.position+Q.duration;we<u&&(t.retained.splice($e,1),C(1,we,Q.id,Q.pitch,0,0,0))}let W=[];for(let $e=0;$e<i;$e++){let Q=$e*40,we=w.getUint32(Q+12,!0),Ge=w.getUint32(Q+16,!0),It=w.getFloat64(Q+0,!0),ea=w.getUint32(Q+20,!0);if(we===0)W.push({gate:!0,id:Ge,position:It,duration:w.getFloat64(Q+32,!0),pitch:ea,velocity:w.getFloat32(Q+24,!0),cent:w.getFloat32(Q+28,!0)});else if(we===1){let He=t.sourceToOutput.get(Ge);if(He!==void 0){for(let $t of He){let nh=t.retained.findIndex(ou=>ou.id===$t);if(nh>=0){let ou=t.retained.splice(nh,1)[0];C(1,It,ou.id,ou.pitch,0,0,0)}}t.sourceToOutput.delete(Ge)}W.push({gate:!1,id:Ge,position:It,pitch:ea})}}for(let $e=t.scheduled.length-1;$e>=0;$e--){let Q=t.scheduled[$e];Q.position>=s&&Q.position<u&&(t.scheduled.splice($e,1),C(0,Q.position,ZN(t,Q),Q.pitch,Q.velocity,Q.cent,Q.duration))}let U=-1,ee={[Symbol.iterator](){let $e=0;return{next(){if($e>=W.length)return U=-1,{done:!0,value:void 0};let Q=W[$e++];return Q.gate&&(U=Q.id),{done:!1,value:Q}}}}},re={from:s,to:u,bpm:d,s0:x,s1:g,flags:m},me=0;for(let $e of e.process(re,ee)){if(++me>128)throw new Error("Note flood: exceeded 128 notes per block");let Q=B2($e,s);if(Q!==null)throw new Error(Q);let we={position:$e.position,duration:$e.duration,pitch:$e.pitch,velocity:$e.velocity,cent:$e.cent??0};if(we.position>=u){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(we)}else{let Ge=ZN(t,we);if(U>=0){let It=t.sourceToOutput.get(U);It===void 0&&(It=new Set,t.sourceToOutput.set(U,It)),It.add(Ge)}C(0,we.position,Ge,we.pitch,we.velocity,we.cent,we.duration)}}return _},ZN=(t,e)=>{let r=N2++;return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var ub=128,T2=375,lE=0,qN=1,JN=2,D2={[lE]:"apparatProcessors",[qN]:"werkstattProcessors",[JN]:"spielwerkProcessors"},R2=0,HN=1e3,uE=class{constructor(e,r,n){this.uuid=e;this.kind=r;this.registryName=n}proc=null;currentUpdate=-1;silenced=!1;paramMappings=new Map;rawParams=new Map;sampleLabels=new Map;sampleHandles=new Map;limiter=null;spielwerk=null;missingCalls=0;warnedMissing=!1},C2=t=>{switch(t.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(t.min,t.max);case"exp":return E.exponential(t.min,t.max);case"int":return E.linearInteger(t.min,t.max);case"bool":return E.linearInteger(0,1);default:return E.unipolar()}},z2=(t,e,r)=>{for(let n=0;n<t.length;n++){let i=t[n];for(let a=e;a<r;a++){let o=i[a];if(o!==o)return`NaN detected in output channel ${n} at sample ${a}`;if(o>HN||o<-HN)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},cb=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#o=1;constructor(e,r,n,i=()=>{}){this.#e=e,this.#t=r,this.#r=n,this.#i=i}imports(){return{host_script_create:(e,r,n)=>this.#s(e,r,n),host_script_audio:(e,r,n,i,a,o,s,u,d,m,x,g)=>this.#l(e,r,n,i,a,o,s,u,d,m,x,g),host_script_note_on:(e,r,n,i,a)=>this.#u(e,r,n,i,a),host_script_note_off:(e,r)=>this.#p(e,r),host_script_reset:e=>this.#d(e),host_script_param:(e,r,n,i)=>this.#v(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#m(e,r,n,i),host_script_notes:(e,r,n,i,a,o,s,u,d,m,x)=>this.#w(e,r,n,i,a,o,s,u,d,m,x),host_script_release:e=>this.#g(e)}}#s(e,r,n){let i=M.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#g(a);let o=this.#o++;return this.#n.set(o,new uE(i,r,D2[r]??"werkstattProcessors")),this.#a.set(i,o),o}#c(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>T2&&(e.warnedMissing=!0,this.#i(e.uuid,`No Processor registered at globalThis.openDAW.${e.registryName}[${e.uuid}] \u2014 device is rendering silence`)),null;if(r!==void 0&&r.update!==e.currentUpdate)try{let n=new r.create;if(e.paramMappings=new Map(r.params.map(i=>[i.index,{label:i.label,mapping:C2(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===lE){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Bh(this.#r)}e.kind===JN&&(e.spielwerk=new lb),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#f(e,i,a.kind,a.value);for(let[i,a]of e.sampleHandles)this.#h(e,i,a)}catch(n){this.#x(e,`Failed to instantiate Processor: ${n}`)}return e.silenced?null:e.proc}#l(e,r,n,i,a,o,s,u,d,m,x,g){let w=this.#n.get(e);if(w===void 0)return 1;let A=this.#c(w);if(A===null)return 1;let _=this.#e.buffer,C=new Float32Array(_,i,ub),W=new Float32Array(_,a,ub),U={index:u,p0:d,p1:m,s0:o,s1:s,bpm:x,flags:g};try{if(w.kind===qN){let re={src:[new Float32Array(_,r,ub),new Float32Array(_,n,ub)],out:[C,W]};A.process(re,U)}else{for(let[re,me]of w.sampleHandles)this.#h(w,re,me);C.fill(0,o,s),W.fill(0,o,s),A.process([C,W],U)}}catch(re){return this.#x(w,`Runtime error: ${re}`),1}let ee=z2([C,W],o,s);return ee!==null?(C.fill(0,o,s),W.fill(0,o,s),this.#x(w,ee),1):(w.kind===lE&&w.limiter!==null&&w.limiter.replace({channels:()=>[C,W]},o,s),0)}#u(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#c(o)?.noteOn?.(r,n,i,a)}#p(e,r){let n=this.#n.get(e);n!==void 0&&this.#c(n)?.noteOff?.(r)}#d(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#v(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#f(a,r,n,i))}#f(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===R2?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#m(e,r,n,i){let a=this.#n.get(e);if(a===void 0)return;let o=i!==0?n:-1;a.sampleHandles.set(r,o),this.#h(a,r,o)}#w(e,r,n,i,a,o,s,u,d,m,x){let g=this.#n.get(e);if(g===void 0)return 0;let w=this.#c(g);if(w===null||g.spielwerk===null)return 0;try{return GN(g.spielwerk,w,this.#e.buffer,r,n,i,a,o,s,u,d,m,x)}catch(A){return this.#x(g,`Runtime error: ${A}`),0}}#h(e,r,n){if(e.proc===null)return;let i=e.sampleLabels.get(r);if(i===void 0)return;if(n<0){e.proc.samples[i]=null;return}let a=this.#t.input_reserve(16);if(this.#t.host_resolve_sample(n,a)===0){e.proc.samples[i]=null;return}let o=new DataView(this.#e.buffer,a,16),s=o.getUint32(0,!0),u=o.getUint32(4,!0),d=o.getUint32(8,!0),m=o.getFloat32(12,!0),x=[];for(let g=0;g<d;g++)x.push(new Float32Array(this.#e.buffer,s+g*u*4,u));e.proc.samples[i]={sampleRate:m,numberOfFrames:u,numberOfChannels:d,frames:x}}#x(e,r){e.silenced=!0,this.#i(e.uuid,r)}#g(e){let r=this.#n.get(e);K(r)&&(this.#n.delete(e),this.#a.get(r.uuid)===e&&this.#a.delete(r.uuid))}liveBridgeCount(){return this.#n.size}};var db=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},tt=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)},Pt,nu,au,rh,ih=class t{constructor(e,r=128){if(Pt.set(this,void 0),nu.set(this,void 0),au.set(this,void 0),rh.set(this,void 0),db(this,Pt,e,"f"),db(this,rh,r,"f"),db(this,nu,e._malloc(r*4),"f"),db(this,au,e._malloc(r*4),"f"),tt(this,nu,"f")===0||tt(this,au,"f")===0)throw new Error("Failed to allocate audio buffers")}static async create(e,r=128){let n=await e();return new t(n,r)}static fromModule(e,r=128){return new t(e,r)}dispose(){tt(this,Pt,"f")._free(tt(this,nu,"f")),tt(this,Pt,"f")._free(tt(this,au,"f"))}createInstance(){return tt(this,Pt,"f")._nam_createInstance()}destroyInstance(e){tt(this,Pt,"f")._nam_destroyInstance(e)}getInstanceCount(){return tt(this,Pt,"f")._nam_getInstanceCount()}loadModel(e,r){let n=tt(this,Pt,"f").lengthBytesUTF8(r)+1,i=tt(this,Pt,"f")._malloc(n);if(i===0)return!1;try{return tt(this,Pt,"f").stringToUTF8(r,i,n),tt(this,Pt,"f")._nam_loadModel(e,i)}finally{tt(this,Pt,"f")._free(i)}}unloadModel(e){tt(this,Pt,"f")._nam_unloadModel(e)}hasModel(e){return tt(this,Pt,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,tt(this,rh,"f")),a=tt(this,nu,"f")>>2,o=tt(this,au,"f")>>2;tt(this,Pt,"f").HEAPF32.set(r.subarray(0,i),a),tt(this,Pt,"f")._nam_process(e,tt(this,nu,"f"),tt(this,au,"f"),i),n.set(tt(this,Pt,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){tt(this,Pt,"f")._nam_setSampleRate(e)}getSampleRate(){return tt(this,Pt,"f")._nam_getSampleRate()}setMaxBufferSize(e){tt(this,Pt,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return tt(this,Pt,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return tt(this,Pt,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return tt(this,Pt,"f")._nam_hasModelLoudness(e)}reset(e){tt(this,Pt,"f")._nam_reset(e)}get bufferSize(){return tt(this,rh,"f")}};Pt=new WeakMap,nu=new WeakMap,au=new WeakMap,rh=new WeakMap;var cE;(function(t){t.parse=e=>JSON.parse(e),t.isArchitecture2=e=>e.architecture==="WaveNet"&&e.config.layers!==void 0&&e.config.layers.some(r=>r.gating_mode!==void 0||r.bottleneck!==void 0)})(cE||(cE={}));var O2=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((c,f)=>{n=c,i=f});var a=Object.assign({},r),o=[],s="./this.program",u=(c,f)=>{throw f},d=typeof window=="object",m=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g="";function w(c){return r.locateFile?r.locateFile(c,g):g+c}var A,_,C;(d||m)&&(m?g=self.location.href:typeof document<"u"&&document.currentScript&&(g=document.currentScript.src),t&&(g=t),g.indexOf("blob:")!==0?g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):g="",A=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.send(null),f.responseText},m&&(C=c=>{var f=new XMLHttpRequest;return f.open("GET",c,!1),f.responseType="arraybuffer",f.send(null),new Uint8Array(f.response)}),_=(c,f,h)=>{var y=new XMLHttpRequest;y.open("GET",c,!0),y.responseType="arraybuffer",y.onload=()=>{if(y.status==200||y.status==0&&y.response){f(y.response);return}h()},y.onerror=h,y.send(null)});var W=r.print||console.log.bind(console),U=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.arguments&&(o=r.arguments),r.thisProgram&&(s=r.thisProgram),r.quit&&(u=r.quit);var ee;r.wasmBinary&&(ee=r.wasmBinary),typeof WebAssembly!="object"&&su("no native wasm support detected");var re,me=!1,$e;function Q(c,f){c||su(f)}var we,Ge,It,ea,He,$t,nh,ou;function hE(){var c=re.buffer;r.HEAP8=we=new Int8Array(c),r.HEAP16=It=new Int16Array(c),r.HEAPU8=Ge=new Uint8Array(c),r.HEAPU16=ea=new Uint16Array(c),r.HEAP32=He=new Int32Array(c),r.HEAPU32=$t=new Uint32Array(c),r.HEAPF32=nh=new Float32Array(c),r.HEAPF64=ou=new Float64Array(c)}var gE=[],vE=[],xE=[],sI=!1;function lI(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)dI(r.preRun.shift());vb(gE)}function uI(){sI=!0,!r.noFSInit&&!v.init.initialized&&v.init(),v.ignorePermissions=!1,yo.init(),vb(vE)}function cI(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)fI(r.postRun.shift());vb(xE)}function dI(c){gE.unshift(c)}function pI(c){vE.unshift(c)}function fI(c){xE.unshift(c)}var Es=0,hb=null,Ld=null;function L2(c){return c}function gb(c){Es++,r.monitorRunDependencies?.(Es)}function ah(c){if(Es--,r.monitorRunDependencies?.(Es),Es==0&&(hb!==null&&(clearInterval(hb),hb=null),Ld)){var f=Ld;Ld=null,f()}}function su(c){r.onAbort?.(c),c="Aborted("+c+")",U(c),me=!0,$e=1,c+=". Build with -sASSERTIONS for more info.";var f=new WebAssembly.RuntimeError(c);throw i(f),f}var mI="data:application/octet-stream;base64,",yE=c=>c.startsWith(mI),Ps;r.locateFile?(Ps="nam.wasm",yE(Ps)||(Ps=w(Ps))):Ps=new URL("nam.wasm",import.meta.url).href;function wE(c){if(c==Ps&&ee)return new Uint8Array(ee);if(C)return C(c);throw"both async and sync fetching of the wasm failed"}function hI(c){return!ee&&(d||m)&&typeof fetch=="function"?fetch(c,{credentials:"same-origin"}).then(f=>{if(!f.ok)throw"failed to load wasm binary file at '"+c+"'";return f.arrayBuffer()}).catch(()=>wE(c)):Promise.resolve().then(()=>wE(c))}function bE(c,f,h){return hI(c).then(y=>WebAssembly.instantiate(y,f)).then(y=>y).then(h,y=>{U(`failed to asynchronously prepare wasm: ${y}`),su(y)})}function gI(c,f,h,y){return!c&&typeof WebAssembly.instantiateStreaming=="function"&&!yE(f)&&typeof fetch=="function"?fetch(f,{credentials:"same-origin"}).then(F=>{var T=WebAssembly.instantiateStreaming(F,h);return T.then(y,function(z){return U(`wasm streaming compile failed: ${z}`),U("falling back to ArrayBuffer instantiation"),bE(f,h,y)})}):bE(f,h,y)}function vI(){var c={a:XI};function f(y,F){return pt=y.exports,re=pt.l,hE(),pI(pt.m),ah("wasm-instantiate"),pt}gb("wasm-instantiate");function h(y){f(y.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(c,f)}catch(y){U(`Module.instantiateWasm callback failed with error: ${y}`),i(y)}return gI(ee,Ps,c,h).catch(i),{}}var qe,gr,vb=c=>{for(;c.length>0;)c.shift()(r)},Z2=r.noExitRuntime||!0;function xI(c){this.excPtr=c,this.ptr=c-24,this.set_type=function(f){$t[this.ptr+4>>2]=f},this.get_type=function(){return $t[this.ptr+4>>2]},this.set_destructor=function(f){$t[this.ptr+8>>2]=f},this.get_destructor=function(){return $t[this.ptr+8>>2]},this.set_caught=function(f){f=f?1:0,we[this.ptr+12>>0]=f},this.get_caught=function(){return we[this.ptr+12>>0]!=0},this.set_rethrown=function(f){f=f?1:0,we[this.ptr+13>>0]=f},this.get_rethrown=function(){return we[this.ptr+13>>0]!=0},this.init=function(f,h){this.set_adjusted_ptr(0),this.set_type(f),this.set_destructor(h)},this.set_adjusted_ptr=function(f){$t[this.ptr+16>>2]=f},this.get_adjusted_ptr=function(){return $t[this.ptr+16>>2]},this.get_exception_ptr=function(){var f=DE(this.get_type());if(f)return $t[this.excPtr>>2];var h=this.get_adjusted_ptr();return h!==0?h:this.excPtr}}var _E=0,yI=0,wI=(c,f,h)=>{var y=new xI(c);throw y.init(f,h),_E=c,yI++,_E},bI=()=>{su("")},_I=(c,f,h)=>Ge.copyWithin(c,f,f+h),AI=()=>536870912,FI=c=>{var f=re.buffer,h=(c-f.byteLength+65535)/65536;try{return re.grow(h),hE(),1}catch{}},SI=c=>{var f=Ge.length;c>>>=0;var h=AI();if(c>h)return!1;for(var y=(ne,Ne)=>ne+(Ne-ne%Ne)%Ne,F=1;F<=4;F*=2){var T=f*(1+.2/F);T=Math.min(T,c+100663296);var z=Math.min(h,y(Math.max(c,T),65536)),j=FI(z);if(j)return!0}return!1},xb={},EI=()=>s||"./this.program",Zd=()=>{if(!Zd.strings){var c=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",f={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:c,_:EI()};for(var h in xb)xb[h]===void 0?delete f[h]:f[h]=xb[h];var y=[];for(var h in f)y.push(`${h}=${f[h]}`);Zd.strings=y}return Zd.strings},PI=(c,f)=>{for(var h=0;h<c.length;++h)we[f++>>0]=c.charCodeAt(h);we[f>>0]=0},ut={isAbs:c=>c.charAt(0)==="/",splitPath:c=>{var f=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return f.exec(c).slice(1)},normalizeArray:(c,f)=>{for(var h=0,y=c.length-1;y>=0;y--){var F=c[y];F==="."?c.splice(y,1):F===".."?(c.splice(y,1),h++):h&&(c.splice(y,1),h--)}if(f)for(;h;h--)c.unshift("..");return c},normalize:c=>{var f=ut.isAbs(c),h=c.substr(-1)==="/";return c=ut.normalizeArray(c.split("/").filter(y=>!!y),!f).join("/"),!c&&!f&&(c="."),c&&h&&(c+="/"),(f?"/":"")+c},dirname:c=>{var f=ut.splitPath(c),h=f[0],y=f[1];return!h&&!y?".":(y&&(y=y.substr(0,y.length-1)),h+y)},basename:c=>{if(c==="/")return"/";c=ut.normalize(c),c=c.replace(/\/$/,"");var f=c.lastIndexOf("/");return f===-1?c:c.substr(f+1)},join:function(){var c=Array.prototype.slice.call(arguments);return ut.normalize(c.join("/"))},join2:(c,f)=>ut.normalize(c+"/"+f)},$I=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return c=>crypto.getRandomValues(c);su("initRandomDevice")},AE=c=>(AE=$I())(c),Ua={resolve:function(){for(var c="",f=!1,h=arguments.length-1;h>=-1&&!f;h--){var y=h>=0?arguments[h]:v.cwd();if(typeof y!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!y)return"";c=y+"/"+c,f=ut.isAbs(y)}return c=ut.normalizeArray(c.split("/").filter(F=>!!F),!f).join("/"),(f?"/":"")+c||"."},relative:(c,f)=>{c=Ua.resolve(c).substr(1),f=Ua.resolve(f).substr(1);function h(Ne){for(var We=0;We<Ne.length&&Ne[We]==="";We++);for(var nt=Ne.length-1;nt>=0&&Ne[nt]==="";nt--);return We>nt?[]:Ne.slice(We,nt-We+1)}for(var y=h(c.split("/")),F=h(f.split("/")),T=Math.min(y.length,F.length),z=T,j=0;j<T;j++)if(y[j]!==F[j]){z=j;break}for(var ne=[],j=z;j<y.length;j++)ne.push("..");return ne=ne.concat(F.slice(z)),ne.join("/")}},FE=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,lu=(c,f,h)=>{for(var y=f+h,F=f;c[F]&&!(F>=y);)++F;if(F-f>16&&c.buffer&&FE)return FE.decode(c.subarray(f,F));for(var T="";f<F;){var z=c[f++];if(!(z&128)){T+=String.fromCharCode(z);continue}var j=c[f++]&63;if((z&224)==192){T+=String.fromCharCode((z&31)<<6|j);continue}var ne=c[f++]&63;if((z&240)==224?z=(z&15)<<12|j<<6|ne:z=(z&7)<<18|j<<12|ne<<6|c[f++]&63,z<65536)T+=String.fromCharCode(z);else{var Ne=z-65536;T+=String.fromCharCode(55296|Ne>>10,56320|Ne&1023)}}return T},yb=[],oh=c=>{for(var f=0,h=0;h<c.length;++h){var y=c.charCodeAt(h);y<=127?f++:y<=2047?f+=2:y>=55296&&y<=57343?(f+=4,++h):f+=3}return f},wb=(c,f,h,y)=>{if(!(y>0))return 0;for(var F=h,T=h+y-1,z=0;z<c.length;++z){var j=c.charCodeAt(z);if(j>=55296&&j<=57343){var ne=c.charCodeAt(++z);j=65536+((j&1023)<<10)|ne&1023}if(j<=127){if(h>=T)break;f[h++]=j}else if(j<=2047){if(h+1>=T)break;f[h++]=192|j>>6,f[h++]=128|j&63}else if(j<=65535){if(h+2>=T)break;f[h++]=224|j>>12,f[h++]=128|j>>6&63,f[h++]=128|j&63}else{if(h+3>=T)break;f[h++]=240|j>>18,f[h++]=128|j>>12&63,f[h++]=128|j>>6&63,f[h++]=128|j&63}}return f[h]=0,h-F};function sh(c,f,h){var y=h>0?h:oh(c)+1,F=new Array(y),T=wb(c,F,0,F.length);return f&&(F.length=T),F}var kI=()=>{if(!yb.length){var c=null;if(typeof window<"u"&&typeof window.prompt=="function"?(c=window.prompt("Input: "),c!==null&&(c+=`
113
113
  `)):typeof readline=="function"&&(c=readline(),c!==null&&(c+=`
114
- `)),!c)return null;yb=sh(c,!0)}return yb.shift()},yo={ttys:[],init(){},shutdown(){},register(c,f){yo.ttys[c]={input:[],output:[],ops:f},v.registerDevice(c,yo.stream_ops)},stream_ops:{open(c){var f=yo.ttys[c.node.rdev];if(!f)throw new v.ErrnoError(43);c.tty=f,c.seekable=!1},close(c){c.tty.ops.fsync(c.tty)},fsync(c){c.tty.ops.fsync(c.tty)},read(c,f,h,y,F){if(!c.tty||!c.tty.ops.get_char)throw new v.ErrnoError(60);for(var T=0,z=0;z<y;z++){var j;try{j=c.tty.ops.get_char(c.tty)}catch{throw new v.ErrnoError(29)}if(j===void 0&&T===0)throw new v.ErrnoError(6);if(j==null)break;T++,f[h+z]=j}return T&&(c.node.timestamp=Date.now()),T},write(c,f,h,y,F){if(!c.tty||!c.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var T=0;T<y;T++)c.tty.ops.put_char(c.tty,f[h+T])}catch{throw new v.ErrnoError(29)}return y&&(c.node.timestamp=Date.now()),T}},default_tty_ops:{get_char(c){return kI()},put_char(c,f){f===null||f===10?(K(lu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(K(lu(c.output,0)),c.output=[])},ioctl_tcgets(c){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(c,f,h){return 0},ioctl_tiocgwinsz(c){return[24,80]}},default_tty1_ops:{put_char(c,f){f===null||f===10?(U(lu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(U(lu(c.output,0)),c.output=[])}}},SE=c=>{su()},Re={ops_table:null,mount(c){return Re.createNode(null,"/",16895,0)},createNode(c,f,h,y){if(v.isBlkdev(h)||v.isFIFO(h))throw new v.ErrnoError(63);Re.ops_table||={dir:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,lookup:Re.node_ops.lookup,mknod:Re.node_ops.mknod,rename:Re.node_ops.rename,unlink:Re.node_ops.unlink,rmdir:Re.node_ops.rmdir,readdir:Re.node_ops.readdir,symlink:Re.node_ops.symlink},stream:{llseek:Re.stream_ops.llseek}},file:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:{llseek:Re.stream_ops.llseek,read:Re.stream_ops.read,write:Re.stream_ops.write,allocate:Re.stream_ops.allocate,mmap:Re.stream_ops.mmap,msync:Re.stream_ops.msync}},link:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,readlink:Re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:v.chrdev_stream_ops}};var F=v.createNode(c,f,h,y);return v.isDir(F.mode)?(F.node_ops=Re.ops_table.dir.node,F.stream_ops=Re.ops_table.dir.stream,F.contents={}):v.isFile(F.mode)?(F.node_ops=Re.ops_table.file.node,F.stream_ops=Re.ops_table.file.stream,F.usedBytes=0,F.contents=null):v.isLink(F.mode)?(F.node_ops=Re.ops_table.link.node,F.stream_ops=Re.ops_table.link.stream):v.isChrdev(F.mode)&&(F.node_ops=Re.ops_table.chrdev.node,F.stream_ops=Re.ops_table.chrdev.stream),F.timestamp=Date.now(),c&&(c.contents[f]=F,c.timestamp=F.timestamp),F},getFileDataAsTypedArray(c){return c.contents?c.contents.subarray?c.contents.subarray(0,c.usedBytes):new Uint8Array(c.contents):new Uint8Array(0)},expandFileStorage(c,f){var h=c.contents?c.contents.length:0;if(!(h>=f)){var y=1024*1024;f=Math.max(f,h*(h<y?2:1.125)>>>0),h!=0&&(f=Math.max(f,256));var F=c.contents;c.contents=new Uint8Array(f),c.usedBytes>0&&c.contents.set(F.subarray(0,c.usedBytes),0)}},resizeFileStorage(c,f){if(c.usedBytes!=f)if(f==0)c.contents=null,c.usedBytes=0;else{var h=c.contents;c.contents=new Uint8Array(f),h&&c.contents.set(h.subarray(0,Math.min(f,c.usedBytes))),c.usedBytes=f}},node_ops:{getattr(c){var f={};return f.dev=v.isChrdev(c.mode)?c.id:1,f.ino=c.id,f.mode=c.mode,f.nlink=1,f.uid=0,f.gid=0,f.rdev=c.rdev,v.isDir(c.mode)?f.size=4096:v.isFile(c.mode)?f.size=c.usedBytes:v.isLink(c.mode)?f.size=c.link.length:f.size=0,f.atime=new Date(c.timestamp),f.mtime=new Date(c.timestamp),f.ctime=new Date(c.timestamp),f.blksize=4096,f.blocks=Math.ceil(f.size/f.blksize),f},setattr(c,f){f.mode!==void 0&&(c.mode=f.mode),f.timestamp!==void 0&&(c.timestamp=f.timestamp),f.size!==void 0&&Re.resizeFileStorage(c,f.size)},lookup(c,f){throw v.genericErrors[44]},mknod(c,f,h,y){return Re.createNode(c,f,h,y)},rename(c,f,h){if(v.isDir(c.mode)){var y;try{y=v.lookupNode(f,h)}catch{}if(y)for(var F in y.contents)throw new v.ErrnoError(55)}delete c.parent.contents[c.name],c.parent.timestamp=Date.now(),c.name=h,f.contents[h]=c,f.timestamp=c.parent.timestamp,c.parent=f},unlink(c,f){delete c.contents[f],c.timestamp=Date.now()},rmdir(c,f){var h=v.lookupNode(c,f);for(var y in h.contents)throw new v.ErrnoError(55);delete c.contents[f],c.timestamp=Date.now()},readdir(c){var f=[".",".."];for(var h of Object.keys(c.contents))f.push(h);return f},symlink(c,f,h){var y=Re.createNode(c,f,41471,0);return y.link=h,y},readlink(c){if(!v.isLink(c.mode))throw new v.ErrnoError(28);return c.link}},stream_ops:{read(c,f,h,y,F){var T=c.node.contents;if(F>=c.node.usedBytes)return 0;var z=Math.min(c.node.usedBytes-F,y);if(z>8&&T.subarray)f.set(T.subarray(F,F+z),h);else for(var j=0;j<z;j++)f[h+j]=T[F+j];return z},write(c,f,h,y,F,T){if(f.buffer===we.buffer&&(T=!1),!y)return 0;var z=c.node;if(z.timestamp=Date.now(),f.subarray&&(!z.contents||z.contents.subarray)){if(T)return z.contents=f.subarray(h,h+y),z.usedBytes=y,y;if(z.usedBytes===0&&F===0)return z.contents=f.slice(h,h+y),z.usedBytes=y,y;if(F+y<=z.usedBytes)return z.contents.set(f.subarray(h,h+y),F),y}if(Re.expandFileStorage(z,F+y),z.contents.subarray&&f.subarray)z.contents.set(f.subarray(h,h+y),F);else for(var j=0;j<y;j++)z.contents[F+j]=f[h+j];return z.usedBytes=Math.max(z.usedBytes,F+y),y},llseek(c,f,h){var y=f;if(h===1?y+=c.position:h===2&&v.isFile(c.node.mode)&&(y+=c.node.usedBytes),y<0)throw new v.ErrnoError(28);return y},allocate(c,f,h){Re.expandFileStorage(c.node,f+h),c.node.usedBytes=Math.max(c.node.usedBytes,f+h)},mmap(c,f,h,y,F){if(!v.isFile(c.node.mode))throw new v.ErrnoError(43);var T,z,j=c.node.contents;if(!(F&2)&&j.buffer===we.buffer)z=!1,T=j.byteOffset;else{if((h>0||h+f<j.length)&&(j.subarray?j=j.subarray(h,h+f):j=Array.prototype.slice.call(j,h,h+f)),z=!0,T=SE(f),!T)throw new v.ErrnoError(48);we.set(j,T)}return{ptr:T,allocated:z}},msync(c,f,h,y,F){return Re.stream_ops.write(c,f,0,y,h,!1),0}}},MI=(c,f,h,y)=>{var F=y?"":`al ${c}`;_(c,T=>{Q(T,`Loading data file "${c}" failed (no arrayBuffer).`),f(new Uint8Array(T)),F&&ah(F)},T=>{if(h)h();else throw`Loading data file "${c}" failed.`}),F&&gb(F)},NI=(c,f,h,y,F,T)=>{v.createDataFile(c,f,h,y,F,T)},II=r.preloadPlugins||[],BI=(c,f,h,y)=>{typeof Browser<"u"&&Browser.init();var F=!1;return II.forEach(T=>{F||T.canHandle(f)&&(T.handle(c,f,h,y),F=!0)}),F},TI=(c,f,h,y,F,T,z,j,ne,Ne)=>{var We=f?Ua.resolve(ut.join2(c,f)):c,nt=`cp ${We}`;function Se(be){function _e(Bt){Ne?.(),j||NI(c,f,Bt,y,F,ne),T?.(),ah(nt)}BI(be,We,_e,()=>{z?.(),ah(nt)})||_e(be)}gb(nt),typeof h=="string"?MI(h,be=>Se(be),z):Se(h)},DI=c=>{var f={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},h=f[c];if(typeof h>"u")throw new Error(`Unknown file open mode: ${c}`);return h},bb=(c,f)=>{var h=0;return c&&(h|=365),f&&(h|=146),h},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(c,f={}){if(c=Ua.resolve(c),!c)return{path:"",node:null};var h={follow_mount:!0,recurse_count:0};if(f=Object.assign(h,f),f.recurse_count>8)throw new v.ErrnoError(32);for(var y=c.split("/").filter(nt=>!!nt),F=v.root,T="/",z=0;z<y.length;z++){var j=z===y.length-1;if(j&&f.parent)break;if(F=v.lookupNode(F,y[z]),T=ut.join2(T,y[z]),v.isMountpoint(F)&&(!j||j&&f.follow_mount)&&(F=F.mounted.root),!j||f.follow)for(var ne=0;v.isLink(F.mode);){var Ne=v.readlink(T);T=Ua.resolve(ut.dirname(T),Ne);var We=v.lookupPath(T,{recurse_count:f.recurse_count+1});if(F=We.node,ne++>40)throw new v.ErrnoError(32)}}return{path:T,node:F}},getPath(c){for(var f;;){if(v.isRoot(c)){var h=c.mount.mountpoint;return f?h[h.length-1]!=="/"?`${h}/${f}`:h+f:h}f=f?`${c.name}/${f}`:c.name,c=c.parent}},hashName(c,f){for(var h=0,y=0;y<f.length;y++)h=(h<<5)-h+f.charCodeAt(y)|0;return(c+h>>>0)%v.nameTable.length},hashAddNode(c){var f=v.hashName(c.parent.id,c.name);c.name_next=v.nameTable[f],v.nameTable[f]=c},hashRemoveNode(c){var f=v.hashName(c.parent.id,c.name);if(v.nameTable[f]===c)v.nameTable[f]=c.name_next;else for(var h=v.nameTable[f];h;){if(h.name_next===c){h.name_next=c.name_next;break}h=h.name_next}},lookupNode(c,f){var h=v.mayLookup(c);if(h)throw new v.ErrnoError(h,c);for(var y=v.hashName(c.id,f),F=v.nameTable[y];F;F=F.name_next){var T=F.name;if(F.parent.id===c.id&&T===f)return F}return v.lookup(c,f)},createNode(c,f,h,y){var F=new v.FSNode(c,f,h,y);return v.hashAddNode(F),F},destroyNode(c){v.hashRemoveNode(c)},isRoot(c){return c===c.parent},isMountpoint(c){return!!c.mounted},isFile(c){return(c&61440)===32768},isDir(c){return(c&61440)===16384},isLink(c){return(c&61440)===40960},isChrdev(c){return(c&61440)===8192},isBlkdev(c){return(c&61440)===24576},isFIFO(c){return(c&61440)===4096},isSocket(c){return(c&49152)===49152},flagsToPermissionString(c){var f=["r","w","rw"][c&3];return c&512&&(f+="w"),f},nodePermissions(c,f){return v.ignorePermissions?0:f.includes("r")&&!(c.mode&292)||f.includes("w")&&!(c.mode&146)||f.includes("x")&&!(c.mode&73)?2:0},mayLookup(c){var f=v.nodePermissions(c,"x");return f||(c.node_ops.lookup?0:2)},mayCreate(c,f){try{var h=v.lookupNode(c,f);return 20}catch{}return v.nodePermissions(c,"wx")},mayDelete(c,f,h){var y;try{y=v.lookupNode(c,f)}catch(T){return T.errno}var F=v.nodePermissions(c,"wx");if(F)return F;if(h){if(!v.isDir(y.mode))return 54;if(v.isRoot(y)||v.getPath(y)===v.cwd())return 10}else if(v.isDir(y.mode))return 31;return 0},mayOpen(c,f){return c?v.isLink(c.mode)?32:v.isDir(c.mode)&&(v.flagsToPermissionString(f)!=="r"||f&512)?31:v.nodePermissions(c,v.flagsToPermissionString(f)):44},MAX_OPEN_FDS:4096,nextfd(){for(var c=0;c<=v.MAX_OPEN_FDS;c++)if(!v.streams[c])return c;throw new v.ErrnoError(33)},getStreamChecked(c){var f=v.getStream(c);if(!f)throw new v.ErrnoError(8);return f},getStream:c=>v.streams[c],createStream(c,f=-1){return v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get(){return this.node},set(h){this.node=h}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(h){this.shared.flags=h}},position:{get(){return this.shared.position},set(h){this.shared.position=h}}})),c=Object.assign(new v.FSStream,c),f==-1&&(f=v.nextfd()),c.fd=f,v.streams[f]=c,c},closeStream(c){v.streams[c]=null},chrdev_stream_ops:{open(c){var f=v.getDevice(c.node.rdev);c.stream_ops=f.stream_ops,c.stream_ops.open?.(c)},llseek(){throw new v.ErrnoError(70)}},major:c=>c>>8,minor:c=>c&255,makedev:(c,f)=>c<<8|f,registerDevice(c,f){v.devices[c]={stream_ops:f}},getDevice:c=>v.devices[c],getMounts(c){for(var f=[],h=[c];h.length;){var y=h.pop();f.push(y),h.push.apply(h,y.mounts)}return f},syncfs(c,f){typeof c=="function"&&(f=c,c=!1),v.syncFSRequests++,v.syncFSRequests>1&&U(`warning: ${v.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var h=v.getMounts(v.root.mount),y=0;function F(z){return v.syncFSRequests--,f(z)}function T(z){if(z)return T.errored?void 0:(T.errored=!0,F(z));++y>=h.length&&F(null)}h.forEach(z=>{if(!z.type.syncfs)return T(null);z.type.syncfs(z,c,T)})},mount(c,f,h){var y=h==="/",F=!h,T;if(y&&v.root)throw new v.ErrnoError(10);if(!y&&!F){var z=v.lookupPath(h,{follow_mount:!1});if(h=z.path,T=z.node,v.isMountpoint(T))throw new v.ErrnoError(10);if(!v.isDir(T.mode))throw new v.ErrnoError(54)}var j={type:c,opts:f,mountpoint:h,mounts:[]},ne=c.mount(j);return ne.mount=j,j.root=ne,y?v.root=ne:T&&(T.mounted=j,T.mount&&T.mount.mounts.push(j)),ne},unmount(c){var f=v.lookupPath(c,{follow_mount:!1});if(!v.isMountpoint(f.node))throw new v.ErrnoError(28);var h=f.node,y=h.mounted,F=v.getMounts(y);Object.keys(v.nameTable).forEach(z=>{for(var j=v.nameTable[z];j;){var ne=j.name_next;F.includes(j.mount)&&v.destroyNode(j),j=ne}}),h.mounted=null;var T=h.mount.mounts.indexOf(y);h.mount.mounts.splice(T,1)},lookup(c,f){return c.node_ops.lookup(c,f)},mknod(c,f,h){var y=v.lookupPath(c,{parent:!0}),F=y.node,T=ut.basename(c);if(!T||T==="."||T==="..")throw new v.ErrnoError(28);var z=v.mayCreate(F,T);if(z)throw new v.ErrnoError(z);if(!F.node_ops.mknod)throw new v.ErrnoError(63);return F.node_ops.mknod(F,T,f,h)},create(c,f){return f=f!==void 0?f:438,f&=4095,f|=32768,v.mknod(c,f,0)},mkdir(c,f){return f=f!==void 0?f:511,f&=1023,f|=16384,v.mknod(c,f,0)},mkdirTree(c,f){for(var h=c.split("/"),y="",F=0;F<h.length;++F)if(h[F]){y+="/"+h[F];try{v.mkdir(y,f)}catch(T){if(T.errno!=20)throw T}}},mkdev(c,f,h){return typeof h>"u"&&(h=f,f=438),f|=8192,v.mknod(c,f,h)},symlink(c,f){if(!Ua.resolve(c))throw new v.ErrnoError(44);var h=v.lookupPath(f,{parent:!0}),y=h.node;if(!y)throw new v.ErrnoError(44);var F=ut.basename(f),T=v.mayCreate(y,F);if(T)throw new v.ErrnoError(T);if(!y.node_ops.symlink)throw new v.ErrnoError(63);return y.node_ops.symlink(y,F,c)},rename(c,f){var h=ut.dirname(c),y=ut.dirname(f),F=ut.basename(c),T=ut.basename(f),z,j,ne;if(z=v.lookupPath(c,{parent:!0}),j=z.node,z=v.lookupPath(f,{parent:!0}),ne=z.node,!j||!ne)throw new v.ErrnoError(44);if(j.mount!==ne.mount)throw new v.ErrnoError(75);var Ne=v.lookupNode(j,F),We=Ua.relative(c,y);if(We.charAt(0)!==".")throw new v.ErrnoError(28);if(We=Ua.relative(f,h),We.charAt(0)!==".")throw new v.ErrnoError(55);var nt;try{nt=v.lookupNode(ne,T)}catch{}if(Ne!==nt){var Se=v.isDir(Ne.mode),be=v.mayDelete(j,F,Se);if(be)throw new v.ErrnoError(be);if(be=nt?v.mayDelete(ne,T,Se):v.mayCreate(ne,T),be)throw new v.ErrnoError(be);if(!j.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(Ne)||nt&&v.isMountpoint(nt))throw new v.ErrnoError(10);if(ne!==j&&(be=v.nodePermissions(j,"w"),be))throw new v.ErrnoError(be);v.hashRemoveNode(Ne);try{j.node_ops.rename(Ne,ne,T)}catch(_e){throw _e}finally{v.hashAddNode(Ne)}}},rmdir(c){var f=v.lookupPath(c,{parent:!0}),h=f.node,y=ut.basename(c),F=v.lookupNode(h,y),T=v.mayDelete(h,y,!0);if(T)throw new v.ErrnoError(T);if(!h.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(F))throw new v.ErrnoError(10);h.node_ops.rmdir(h,y),v.destroyNode(F)},readdir(c){var f=v.lookupPath(c,{follow:!0}),h=f.node;if(!h.node_ops.readdir)throw new v.ErrnoError(54);return h.node_ops.readdir(h)},unlink(c){var f=v.lookupPath(c,{parent:!0}),h=f.node;if(!h)throw new v.ErrnoError(44);var y=ut.basename(c),F=v.lookupNode(h,y),T=v.mayDelete(h,y,!1);if(T)throw new v.ErrnoError(T);if(!h.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(F))throw new v.ErrnoError(10);h.node_ops.unlink(h,y),v.destroyNode(F)},readlink(c){var f=v.lookupPath(c),h=f.node;if(!h)throw new v.ErrnoError(44);if(!h.node_ops.readlink)throw new v.ErrnoError(28);return Ua.resolve(v.getPath(h.parent),h.node_ops.readlink(h))},stat(c,f){var h=v.lookupPath(c,{follow:!f}),y=h.node;if(!y)throw new v.ErrnoError(44);if(!y.node_ops.getattr)throw new v.ErrnoError(63);return y.node_ops.getattr(y)},lstat(c){return v.stat(c,!0)},chmod(c,f,h){var y;if(typeof c=="string"){var F=v.lookupPath(c,{follow:!h});y=F.node}else y=c;if(!y.node_ops.setattr)throw new v.ErrnoError(63);y.node_ops.setattr(y,{mode:f&4095|y.mode&-4096,timestamp:Date.now()})},lchmod(c,f){v.chmod(c,f,!0)},fchmod(c,f){var h=v.getStreamChecked(c);v.chmod(h.node,f)},chown(c,f,h,y){var F;if(typeof c=="string"){var T=v.lookupPath(c,{follow:!y});F=T.node}else F=c;if(!F.node_ops.setattr)throw new v.ErrnoError(63);F.node_ops.setattr(F,{timestamp:Date.now()})},lchown(c,f,h){v.chown(c,f,h,!0)},fchown(c,f,h){var y=v.getStreamChecked(c);v.chown(y.node,f,h)},truncate(c,f){if(f<0)throw new v.ErrnoError(28);var h;if(typeof c=="string"){var y=v.lookupPath(c,{follow:!0});h=y.node}else h=c;if(!h.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(h.mode))throw new v.ErrnoError(31);if(!v.isFile(h.mode))throw new v.ErrnoError(28);var F=v.nodePermissions(h,"w");if(F)throw new v.ErrnoError(F);h.node_ops.setattr(h,{size:f,timestamp:Date.now()})},ftruncate(c,f){var h=v.getStreamChecked(c);if((h.flags&2097155)===0)throw new v.ErrnoError(28);v.truncate(h.node,f)},utime(c,f,h){var y=v.lookupPath(c,{follow:!0}),F=y.node;F.node_ops.setattr(F,{timestamp:Math.max(f,h)})},open(c,f,h){if(c==="")throw new v.ErrnoError(44);f=typeof f=="string"?DI(f):f,h=typeof h>"u"?438:h,f&64?h=h&4095|32768:h=0;var y;if(typeof c=="object")y=c;else{c=ut.normalize(c);try{var F=v.lookupPath(c,{follow:!(f&131072)});y=F.node}catch{}}var T=!1;if(f&64)if(y){if(f&128)throw new v.ErrnoError(20)}else y=v.mknod(c,h,0),T=!0;if(!y)throw new v.ErrnoError(44);if(v.isChrdev(y.mode)&&(f&=-513),f&65536&&!v.isDir(y.mode))throw new v.ErrnoError(54);if(!T){var z=v.mayOpen(y,f);if(z)throw new v.ErrnoError(z)}f&512&&!T&&v.truncate(y,0),f&=-131713;var j=v.createStream({node:y,path:v.getPath(y),flags:f,seekable:!0,position:0,stream_ops:y.stream_ops,ungotten:[],error:!1});return j.stream_ops.open&&j.stream_ops.open(j),r.logReadFiles&&!(f&1)&&(v.readFiles||(v.readFiles={}),c in v.readFiles||(v.readFiles[c]=1)),j},close(c){if(v.isClosed(c))throw new v.ErrnoError(8);c.getdents&&(c.getdents=null);try{c.stream_ops.close&&c.stream_ops.close(c)}catch(f){throw f}finally{v.closeStream(c.fd)}c.fd=null},isClosed(c){return c.fd===null},llseek(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(!c.seekable||!c.stream_ops.llseek)throw new v.ErrnoError(70);if(h!=0&&h!=1&&h!=2)throw new v.ErrnoError(28);return c.position=c.stream_ops.llseek(c,f,h),c.ungotten=[],c.position},read(c,f,h,y,F){if(y<0||F<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.read)throw new v.ErrnoError(28);var T=typeof F<"u";if(!T)F=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var z=c.stream_ops.read(c,f,h,y,F);return T||(c.position+=z),z},write(c,f,h,y,F,T){if(y<0||F<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.write)throw new v.ErrnoError(28);c.seekable&&c.flags&1024&&v.llseek(c,0,2);var z=typeof F<"u";if(!z)F=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var j=c.stream_ops.write(c,f,h,y,F,T);return z||(c.position+=j),j},allocate(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(f<0||h<=0)throw new v.ErrnoError(28);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(!v.isFile(c.node.mode)&&!v.isDir(c.node.mode))throw new v.ErrnoError(43);if(!c.stream_ops.allocate)throw new v.ErrnoError(138);c.stream_ops.allocate(c,f,h)},mmap(c,f,h,y,F){if((y&2)!==0&&(F&2)===0&&(c.flags&2097155)!==2)throw new v.ErrnoError(2);if((c.flags&2097155)===1)throw new v.ErrnoError(2);if(!c.stream_ops.mmap)throw new v.ErrnoError(43);return c.stream_ops.mmap(c,f,h,y,F)},msync(c,f,h,y,F){return c.stream_ops.msync?c.stream_ops.msync(c,f,h,y,F):0},munmap:c=>0,ioctl(c,f,h){if(!c.stream_ops.ioctl)throw new v.ErrnoError(59);return c.stream_ops.ioctl(c,f,h)},readFile(c,f={}){if(f.flags=f.flags||0,f.encoding=f.encoding||"binary",f.encoding!=="utf8"&&f.encoding!=="binary")throw new Error(`Invalid encoding type "${f.encoding}"`);var h,y=v.open(c,f.flags),F=v.stat(c),T=F.size,z=new Uint8Array(T);return v.read(y,z,0,T,0),f.encoding==="utf8"?h=lu(z,0):f.encoding==="binary"&&(h=z),v.close(y),h},writeFile(c,f,h={}){h.flags=h.flags||577;var y=v.open(c,h.flags,h.mode);if(typeof f=="string"){var F=new Uint8Array(oh(f)+1),T=wb(f,F,0,F.length);v.write(y,F,0,T,void 0,h.canOwn)}else if(ArrayBuffer.isView(f))v.write(y,f,0,f.byteLength,void 0,h.canOwn);else throw new Error("Unsupported data type");v.close(y)},cwd:()=>v.currentPath,chdir(c){var f=v.lookupPath(c,{follow:!0});if(f.node===null)throw new v.ErrnoError(44);if(!v.isDir(f.node.mode))throw new v.ErrnoError(54);var h=v.nodePermissions(f.node,"x");if(h)throw new v.ErrnoError(h);v.currentPath=f.path},createDefaultDirectories(){v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices(){v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(y,F,T,z,j)=>z}),v.mkdev("/dev/null",v.makedev(1,3)),yo.register(v.makedev(5,0),yo.default_tty_ops),yo.register(v.makedev(6,0),yo.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var c=new Uint8Array(1024),f=0,h=()=>(f===0&&(f=AE(c).byteLength),c[--f]);v.createDevice("/dev","random",h),v.createDevice("/dev","urandom",h),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories(){v.mkdir("/proc");var c=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount(){var f=v.createNode(c,"fd",16895,73);return f.node_ops={lookup(h,y){var F=+y,T=v.getStreamChecked(F),z={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>T.path}};return z.parent=z,z}},f}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?v.createDevice("/dev","stdin",r.stdin):v.symlink("/dev/tty","/dev/stdin"),r.stdout?v.createDevice("/dev","stdout",null,r.stdout):v.symlink("/dev/tty","/dev/stdout"),r.stderr?v.createDevice("/dev","stderr",null,r.stderr):v.symlink("/dev/tty1","/dev/stderr");var c=v.open("/dev/stdin",0),f=v.open("/dev/stdout",1),h=v.open("/dev/stderr",1)},ensureErrnoError(){v.ErrnoError||(v.ErrnoError=function(f,h){this.name="ErrnoError",this.node=h,this.setErrno=function(y){this.errno=y},this.setErrno(f),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(c=>{v.genericErrors[c]=new v.ErrnoError(c),v.genericErrors[c].stack="<generic error, no stack>"}))},staticInit(){v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(Re,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:Re}},init(c,f,h){v.init.initialized=!0,v.ensureErrnoError(),r.stdin=c||r.stdin,r.stdout=f||r.stdout,r.stderr=h||r.stderr,v.createStandardStreams()},quit(){v.init.initialized=!1;for(var c=0;c<v.streams.length;c++){var f=v.streams[c];f&&v.close(f)}},findObject(c,f){var h=v.analyzePath(c,f);return h.exists?h.object:null},analyzePath(c,f){try{var h=v.lookupPath(c,{follow:!f});c=h.path}catch{}var y={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var h=v.lookupPath(c,{parent:!0});y.parentExists=!0,y.parentPath=h.path,y.parentObject=h.node,y.name=ut.basename(c),h=v.lookupPath(c,{follow:!f}),y.exists=!0,y.path=h.path,y.object=h.node,y.name=h.node.name,y.isRoot=h.path==="/"}catch(F){y.error=F.errno}return y},createPath(c,f,h,y){c=typeof c=="string"?c:v.getPath(c);for(var F=f.split("/").reverse();F.length;){var T=F.pop();if(T){var z=ut.join2(c,T);try{v.mkdir(z)}catch{}c=z}}return z},createFile(c,f,h,y,F){var T=ut.join2(typeof c=="string"?c:v.getPath(c),f),z=bb(y,F);return v.create(T,z)},createDataFile(c,f,h,y,F,T){var z=f;c&&(c=typeof c=="string"?c:v.getPath(c),z=f?ut.join2(c,f):c);var j=bb(y,F),ne=v.create(z,j);if(h){if(typeof h=="string"){for(var Ne=new Array(h.length),We=0,nt=h.length;We<nt;++We)Ne[We]=h.charCodeAt(We);h=Ne}v.chmod(ne,j|146);var Se=v.open(ne,577);v.write(Se,h,0,h.length,0,T),v.close(Se),v.chmod(ne,j)}},createDevice(c,f,h,y){var F=ut.join2(typeof c=="string"?c:v.getPath(c),f),T=bb(!!h,!!y);v.createDevice.major||(v.createDevice.major=64);var z=v.makedev(v.createDevice.major++,0);return v.registerDevice(z,{open(j){j.seekable=!1},close(j){y?.buffer?.length&&y(10)},read(j,ne,Ne,We,nt){for(var Se=0,be=0;be<We;be++){var _e;try{_e=h()}catch{throw new v.ErrnoError(29)}if(_e===void 0&&Se===0)throw new v.ErrnoError(6);if(_e==null)break;Se++,ne[Ne+be]=_e}return Se&&(j.node.timestamp=Date.now()),Se},write(j,ne,Ne,We,nt){for(var Se=0;Se<We;Se++)try{y(ne[Ne+Se])}catch{throw new v.ErrnoError(29)}return We&&(j.node.timestamp=Date.now()),Se}}),v.mkdev(F,T,z)},forceLoadFile(c){if(c.isDevice||c.isFolder||c.link||c.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(A)try{c.contents=sh(A(c.url),!0),c.usedBytes=c.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(c,f,h,y,F){function T(){this.lengthKnown=!1,this.chunks=[]}if(T.prototype.get=function(be){if(!(be>this.length-1||be<0)){var _e=be%this.chunkSize,Bt=be/this.chunkSize|0;return this.getter(Bt)[_e]}},T.prototype.setDataGetter=function(be){this.getter=be},T.prototype.cacheLength=function(){var be=new XMLHttpRequest;if(be.open("HEAD",h,!1),be.send(null),!(be.status>=200&&be.status<300||be.status===304))throw new Error("Couldn't load "+h+". Status: "+be.status);var _e=Number(be.getResponseHeader("Content-length")),Bt,Ki=(Bt=be.getResponseHeader("Accept-Ranges"))&&Bt==="bytes",Wr=(Bt=be.getResponseHeader("Content-Encoding"))&&Bt==="gzip",q=1024*1024;Ki||(q=_e);var he=(At,Sn)=>{if(At>Sn)throw new Error("invalid range ("+At+", "+Sn+") or no bytes requested!");if(Sn>_e-1)throw new Error("only "+_e+" bytes available! programmer error!");var ur=new XMLHttpRequest;if(ur.open("GET",h,!1),_e!==q&&ur.setRequestHeader("Range","bytes="+At+"-"+Sn),ur.responseType="arraybuffer",ur.overrideMimeType&&ur.overrideMimeType("text/plain; charset=x-user-defined"),ur.send(null),!(ur.status>=200&&ur.status<300||ur.status===304))throw new Error("Couldn't load "+h+". Status: "+ur.status);return ur.response!==void 0?new Uint8Array(ur.response||[]):sh(ur.responseText||"",!0)},vr=this;vr.setDataGetter(At=>{var Sn=At*q,ur=(At+1)*q-1;if(ur=Math.min(ur,_e-1),typeof vr.chunks[At]>"u"&&(vr.chunks[At]=he(Sn,ur)),typeof vr.chunks[At]>"u")throw new Error("doXHR failed!");return vr.chunks[At]}),(Wr||!_e)&&(q=_e=1,_e=this.getter(0).length,q=_e,K("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=_e,this._chunkSize=q,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var z=new T;Object.defineProperties(z,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var j={isDevice:!1,contents:z}}else var j={isDevice:!1,url:h};var ne=v.createFile(c,f,j,y,F);j.contents?ne.contents=j.contents:j.url&&(ne.contents=null,ne.url=j.url),Object.defineProperties(ne,{usedBytes:{get:function(){return this.contents.length}}});var Ne={},We=Object.keys(ne.stream_ops);We.forEach(Se=>{var be=ne.stream_ops[Se];Ne[Se]=function(){return v.forceLoadFile(ne),be.apply(null,arguments)}});function nt(Se,be,_e,Bt,Ki){var Wr=Se.node.contents;if(Ki>=Wr.length)return 0;var q=Math.min(Wr.length-Ki,Bt);if(Wr.slice)for(var he=0;he<q;he++)be[_e+he]=Wr[Ki+he];else for(var he=0;he<q;he++)be[_e+he]=Wr.get(Ki+he);return q}return Ne.read=(Se,be,_e,Bt,Ki)=>(v.forceLoadFile(ne),nt(Se,be,_e,Bt,Ki)),Ne.mmap=(Se,be,_e,Bt,Ki)=>{v.forceLoadFile(ne);var Wr=SE(be);if(!Wr)throw new v.ErrnoError(48);return nt(Se,we,Wr,be,_e),{ptr:Wr,allocated:!0}},ne.stream_ops=Ne,ne}},lh=(c,f)=>c?lu(Ge,c,f):"",wo={DEFAULT_POLLMASK:5,calculateAt(c,f,h){if(ut.isAbs(f))return f;var y;if(c===-100)y=v.cwd();else{var F=wo.getStreamFromFD(c);y=F.path}if(f.length==0){if(!h)throw new v.ErrnoError(44);return y}return ut.join2(y,f)},doStat(c,f,h){try{var y=c(f)}catch(j){if(j&&j.node&&ut.normalize(f)!==ut.normalize(v.getPath(j.node)))return-54;throw j}He[h>>2]=y.dev,He[h+4>>2]=y.mode,$t[h+8>>2]=y.nlink,He[h+12>>2]=y.uid,He[h+16>>2]=y.gid,He[h+20>>2]=y.rdev,gr=[y.size>>>0,(qe=y.size,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+24>>2]=gr[0],He[h+28>>2]=gr[1],He[h+32>>2]=4096,He[h+36>>2]=y.blocks;var F=y.atime.getTime(),T=y.mtime.getTime(),z=y.ctime.getTime();return gr=[Math.floor(F/1e3)>>>0,(qe=Math.floor(F/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+40>>2]=gr[0],He[h+44>>2]=gr[1],$t[h+48>>2]=F%1e3*1e3,gr=[Math.floor(T/1e3)>>>0,(qe=Math.floor(T/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+56>>2]=gr[0],He[h+60>>2]=gr[1],$t[h+64>>2]=T%1e3*1e3,gr=[Math.floor(z/1e3)>>>0,(qe=Math.floor(z/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+72>>2]=gr[0],He[h+76>>2]=gr[1],$t[h+80>>2]=z%1e3*1e3,gr=[y.ino>>>0,(qe=y.ino,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+88>>2]=gr[0],He[h+92>>2]=gr[1],0},doMsync(c,f,h,y,F){if(!v.isFile(f.node.mode))throw new v.ErrnoError(43);if(y&2)return 0;var T=Ge.slice(c,c+h);v.msync(f,T,F,h,y)},varargs:void 0,get(){var c=He[+wo.varargs>>2];return wo.varargs+=4,c},getp(){return wo.get()},getStr(c){var f=lh(c);return f},getStreamFromFD(c){var f=v.getStreamChecked(c);return f}},RI=(c,f)=>{var h=0;return Zd().forEach((y,F)=>{var T=f+h;$t[c+F*4>>2]=T,PI(y,T),h+=y.length+1}),0},CI=(c,f)=>{var h=Zd();$t[c>>2]=h.length;var y=0;return h.forEach(F=>y+=F.length+1),$t[f>>2]=y,0};function zI(c){try{var f=wo.getStreamFromFD(c);return v.close(f),0}catch(h){if(typeof v>"u"||h.name!=="ErrnoError")throw h;return h.errno}}var OI=(c,f,h,y)=>{for(var F=0,T=0;T<h;T++){var z=$t[f>>2],j=$t[f+4>>2];f+=8;var ne=v.read(c,we,z,j,y);if(ne<0)return-1;if(F+=ne,ne<j)break;typeof y<"u"&&(y+=ne)}return F};function UI(c,f,h,y){try{var F=wo.getStreamFromFD(c),T=OI(F,f,h);return $t[y>>2]=T,0}catch(z){if(typeof v>"u"||z.name!=="ErrnoError")throw z;return z.errno}}var VI=(c,f)=>f+2097152>>>0<4194305-!!c?(c>>>0)+f*4294967296:NaN;function jI(c,f,h,y,F){var T=VI(f,h);try{if(isNaN(T))return 61;var z=wo.getStreamFromFD(c);return v.llseek(z,T,y),gr=[z.position>>>0,(qe=z.position,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[F>>2]=gr[0],He[F+4>>2]=gr[1],z.getdents&&T===0&&y===0&&(z.getdents=null),0}catch(j){if(typeof v>"u"||j.name!=="ErrnoError")throw j;return j.errno}}var KI=(c,f,h,y)=>{for(var F=0,T=0;T<h;T++){var z=$t[f>>2],j=$t[f+4>>2];f+=8;var ne=v.write(c,we,z,j,y);if(ne<0)return-1;F+=ne,typeof y<"u"&&(y+=ne)}return F};function WI(c,f,h,y){try{var F=wo.getStreamFromFD(c),T=KI(F,f,h);return $t[y>>2]=T,0}catch(z){if(typeof v>"u"||z.name!=="ErrnoError")throw z;return z.errno}}var uh=c=>c%4===0&&(c%100!==0||c%400===0),LI=(c,f)=>{for(var h=0,y=0;y<=f;h+=c[y++]);return h},EE=[31,29,31,30,31,30,31,31,30,31,30,31],PE=[31,28,31,30,31,30,31,31,30,31,30,31],ZI=(c,f)=>{for(var h=new Date(c.getTime());f>0;){var y=uh(h.getFullYear()),F=h.getMonth(),T=(y?EE:PE)[F];if(f>T-h.getDate())f-=T-h.getDate()+1,h.setDate(1),F<11?h.setMonth(F+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else return h.setDate(h.getDate()+f),h}return h},$E=(c,f)=>{we.set(c,f)},GI=(c,f,h,y)=>{var F=$t[y+40>>2],T={tm_sec:He[y>>2],tm_min:He[y+4>>2],tm_hour:He[y+8>>2],tm_mday:He[y+12>>2],tm_mon:He[y+16>>2],tm_year:He[y+20>>2],tm_wday:He[y+24>>2],tm_yday:He[y+28>>2],tm_isdst:He[y+32>>2],tm_gmtoff:He[y+36>>2],tm_zone:F?lh(F):""},z=lh(h),j={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ne in j)z=z.replace(new RegExp(ne,"g"),j[ne]);var Ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],We=["January","February","March","April","May","June","July","August","September","October","November","December"];function nt(q,he,vr){for(var At=typeof q=="number"?q.toString():q||"";At.length<he;)At=vr[0]+At;return At}function Se(q,he){return nt(q,he,"0")}function be(q,he){function vr(Sn){return Sn<0?-1:Sn>0?1:0}var At;return(At=vr(q.getFullYear()-he.getFullYear()))===0&&(At=vr(q.getMonth()-he.getMonth()))===0&&(At=vr(q.getDate()-he.getDate())),At}function _e(q){switch(q.getDay()){case 0:return new Date(q.getFullYear()-1,11,29);case 1:return q;case 2:return new Date(q.getFullYear(),0,3);case 3:return new Date(q.getFullYear(),0,2);case 4:return new Date(q.getFullYear(),0,1);case 5:return new Date(q.getFullYear()-1,11,31);case 6:return new Date(q.getFullYear()-1,11,30)}}function Bt(q){var he=ZI(new Date(q.tm_year+1900,0,1),q.tm_yday),vr=new Date(he.getFullYear(),0,4),At=new Date(he.getFullYear()+1,0,4),Sn=_e(vr),ur=_e(At);return be(Sn,he)<=0?be(ur,he)<=0?he.getFullYear()+1:he.getFullYear():he.getFullYear()-1}var Ki={"%a":q=>Ne[q.tm_wday].substring(0,3),"%A":q=>Ne[q.tm_wday],"%b":q=>We[q.tm_mon].substring(0,3),"%B":q=>We[q.tm_mon],"%C":q=>{var he=q.tm_year+1900;return Se(he/100|0,2)},"%d":q=>Se(q.tm_mday,2),"%e":q=>nt(q.tm_mday,2," "),"%g":q=>Bt(q).toString().substring(2),"%G":q=>Bt(q),"%H":q=>Se(q.tm_hour,2),"%I":q=>{var he=q.tm_hour;return he==0?he=12:he>12&&(he-=12),Se(he,2)},"%j":q=>Se(q.tm_mday+LI(uh(q.tm_year+1900)?EE:PE,q.tm_mon-1),3),"%m":q=>Se(q.tm_mon+1,2),"%M":q=>Se(q.tm_min,2),"%n":()=>`
115
- `,"%p":q=>q.tm_hour>=0&&q.tm_hour<12?"AM":"PM","%S":q=>Se(q.tm_sec,2),"%t":()=>" ","%u":q=>q.tm_wday||7,"%U":q=>{var he=q.tm_yday+7-q.tm_wday;return Se(Math.floor(he/7),2)},"%V":q=>{var he=Math.floor((q.tm_yday+7-(q.tm_wday+6)%7)/7);if((q.tm_wday+371-q.tm_yday-2)%7<=2&&he++,he){if(he==53){var At=(q.tm_wday+371-q.tm_yday)%7;At!=4&&(At!=3||!uh(q.tm_year))&&(he=1)}}else{he=52;var vr=(q.tm_wday+7-q.tm_yday-1)%7;(vr==4||vr==5&&uh(q.tm_year%400-1))&&he++}return Se(he,2)},"%w":q=>q.tm_wday,"%W":q=>{var he=q.tm_yday+7-(q.tm_wday+6)%7;return Se(Math.floor(he/7),2)},"%y":q=>(q.tm_year+1900).toString().substring(2),"%Y":q=>q.tm_year+1900,"%z":q=>{var he=q.tm_gmtoff,vr=he>=0;return he=Math.abs(he)/60,he=he/60*100+he%60,(vr?"+":"-")+("0000"+he).slice(-4)},"%Z":q=>q.tm_zone,"%%":()=>"%"};z=z.replace(/%%/g,"\0\0");for(var ne in Ki)z.includes(ne)&&(z=z.replace(new RegExp(ne,"g"),Ki[ne](T)));z=z.replace(/\0\0/g,"%");var Wr=sh(z,!1);return Wr.length>f?0:($E(Wr,c),Wr.length-1)},HI=(c,f,h,y,F)=>GI(c,f,h,y),kE=c=>{var f=r["_"+c];return f},ME=(c,f,h)=>wb(c,Ge,f,h),qI=c=>{var f=oh(c)+1,h=_b(f);return ME(c,h,f),h},NE=(c,f,h,y,F)=>{var T={string:_e=>{var Bt=0;return _e!=null&&_e!==0&&(Bt=qI(_e)),Bt},array:_e=>{var Bt=_b(_e.length);return $E(_e,Bt),Bt}};function z(_e){return f==="string"?lh(_e):f==="boolean"?!!_e:_e}var j=kE(c),ne=[],Ne=0;if(y)for(var We=0;We<y.length;We++){var nt=T[h[We]];nt?(Ne===0&&(Ne=BE()),ne[We]=nt(y[We])):ne[We]=y[We]}var Se=j.apply(null,ne);function be(_e){return Ne!==0&&TE(Ne),z(_e)}return Se=be(Se),Se},JI=(c,f,h,y)=>{var F=!h||h.every(z=>z==="number"||z==="boolean"),T=f!=="string";return T&&F&&!y?kE(c):function(){return NE(c,f,h,arguments,y)}},IE=function(c,f,h,y){c||(c=this),this.parent=c,this.mount=c.mount,this.mounted=null,this.id=v.nextInode++,this.name=f,this.mode=h,this.node_ops={},this.stream_ops={},this.rdev=y},ch=365,dh=146;Object.defineProperties(IE.prototype,{read:{get:function(){return(this.mode&ch)===ch},set:function(c){c?this.mode|=ch:this.mode&=~ch}},write:{get:function(){return(this.mode&dh)===dh},set:function(c){c?this.mode|=dh:this.mode&=~dh}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=IE,v.createPreloadedFile=TI,v.staticInit();var XI={a:wI,b:bI,k:_I,i:SI,e:RI,f:CI,g:zI,h:UI,j:jI,c:WI,d:HI},pt=vI(),YI=()=>(YI=pt.m)(),QI=r._nam_createInstance=()=>(QI=r._nam_createInstance=pt.n)(),eB=r._nam_destroyInstance=c=>(eB=r._nam_destroyInstance=pt.o)(c),tB=r._nam_getInstanceCount=()=>(tB=r._nam_getInstanceCount=pt.p)(),rB=r._nam_loadModel=(c,f)=>(rB=r._nam_loadModel=pt.q)(c,f),iB=r._nam_unloadModel=c=>(iB=r._nam_unloadModel=pt.r)(c),nB=r._nam_hasModel=c=>(nB=r._nam_hasModel=pt.s)(c),aB=r._nam_process=(c,f,h,y)=>(aB=r._nam_process=pt.t)(c,f,h,y),oB=r._nam_setSampleRate=c=>(oB=r._nam_setSampleRate=pt.u)(c),sB=r._nam_getSampleRate=()=>(sB=r._nam_getSampleRate=pt.v)(),lB=r._nam_setMaxBufferSize=c=>(lB=r._nam_setMaxBufferSize=pt.w)(c),uB=r._nam_getMaxBufferSize=()=>(uB=r._nam_getMaxBufferSize=pt.x)(),cB=r._nam_getModelLoudness=c=>(cB=r._nam_getModelLoudness=pt.y)(c),dB=r._nam_hasModelLoudness=c=>(dB=r._nam_hasModelLoudness=pt.z)(c),pB=r._nam_reset=c=>(pB=r._nam_reset=pt.A)(c),fB=r._free=c=>(fB=r._free=pt.B)(c),mB=r._malloc=c=>(mB=r._malloc=pt.C)(c),hB=()=>(hB=pt.__errno_location)(),BE=()=>(BE=pt.E)(),TE=c=>(TE=pt.F)(c),_b=c=>(_b=pt.G)(c),gB=c=>(gB=pt.__cxa_increment_exception_refcount)(c),DE=c=>(DE=pt.H)(c);r.ccall=NE,r.cwrap=JI,r.stringToUTF8=ME,r.lengthBytesUTF8=oh;var ph;Ld=function c(){ph||RE(),ph||(Ld=c)};function RE(){if(Es>0||(lI(),Es>0))return;function c(){ph||(ph=!0,r.calledRun=!0,!me&&(uI(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),cI()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),c()},1)):c()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return RE(),e.ready})})(),dE=O2;var pE=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},U2=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},pb=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#o=null;#s=null;#c=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#c;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#u(e),host_nam_load:(e,r,n)=>this.#p(e,r,n),host_nam_set_mono:(e,r)=>this.#d(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#v(e,r,n,i,a,o,s),host_nam_reset:e=>this.#f(e),host_nam_release:e=>this.#m(e)}}#u(e){let r=M.toString(new Uint8Array(this.#e.buffer,e,16).slice()),n=this.#n.get(r);if(W(n))return n;let i=this.#a++;return this.#i.set(i,new pE(r)),this.#n.set(r,i),i}#p(e,r,n){let i=this.#i.get(e);if(!W(i))return;if(n===0){i.json=null,this.#x(i);return}let a=new Uint8Array(this.#e.buffer,r,n).slice();W(i.json)&&U2(i.json,a)||(i.json=a,W(this.#s)?this.#h(i):this.#w())}#d(e,r){let n=this.#i.get(e);if(!W(n))return;n.mono=r;let i=this.#s;W(i)&&(r?n.instances[1]>=0&&(i.unloadModel(n.instances[1]),i.destroyInstance(n.instances[1]),n.instances[1]=-1):n.instances[1]<0&&(n.instances[1]=i.createInstance(),W(n.json)&&n.loaded&&(n.loaded=this.#g(n.instances[1],n.json)&&n.loaded)))}#v(e,r,n,i,a,o,s){let u=this.#i.get(e),d=this.#s;if(!W(u)||!W(d)||!u.loaded||u.instances[0]<0)return 0;let m=this.#e.buffer;if(d.process(u.instances[0],new Float32Array(m,r,o),new Float32Array(m,i,o)),s>1){if(u.instances[1]<0)return 0;d.process(u.instances[1],new Float32Array(m,n,o),new Float32Array(m,a,o))}return 1}#f(e){let r=this.#i.get(e),n=this.#s;if(!(!W(r)||!W(n)))for(let i of r.instances)i>=0&&n.reset(i)}#m(e){let r=this.#i.get(e);if(!W(r))return;let n=this.#s;if(W(n))for(let i of r.instances)i>=0&&(n.unloadModel(i),n.destroyInstance(i));this.#i.delete(e),this.#n.get(r.uuid)===e&&this.#n.delete(r.uuid)}#w(){this.#c||this.#l||W(this.#s)||(this.#c=!0,this.#t().then(e=>dE({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#o=e;let r=ih.fromModule(e);r.setSampleRate(this.#r),this.#s=r,this.#c=!1;for(let n of this.#i.values())W(n.json)&&this.#h(n)}).catch(e=>{this.#c=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#h(e){let r=this.#s;!W(r)||!W(e.json)||(e.instances[0]<0&&(e.instances[0]=r.createInstance()),!e.mono&&e.instances[1]<0&&(e.instances[1]=r.createInstance()),e.loaded=this.#g(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#g(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#s;if(W(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#g(e,r){let n=this.#o;if(!W(n))return!1;let i=n._malloc(r.length+1);n.HEAPU8.set(r,i),n.HEAPU8[i+r.length]=0;let a=n._nam_loadModel(e,i);return n._free(i),a||console.error("NAM loadModel failed"),!!a}};var Fn={Pan:17,AttackVolEnv:34,DecayVolEnv:36,SustainVolEnv:37,ReleaseVolEnv:38,KeyRange:43,VelRange:44,CoarseTune:51,FineTune:52,SampleId:53,SampleModes:54,OverridingRootKey:58},V2=1330857522,j2=32,XN=24,YN=40,QN=8,K2=({samples:t,presets:e})=>{let r=e.reduce((g,w)=>g+w.length,0),n=j2,i=n+t.length*XN,a=i+r*YN,o=a+e.length*QN,s=t.reduce((g,w)=>g+w.pcm.length,0),u=new ArrayBuffer(o+s*4),d=new DataView(u);d.setUint32(0,V2,!0),d.setUint32(4,1,!0),d.setUint32(8,t.length,!0),d.setUint32(12,r,!0),d.setUint32(16,e.length,!0),d.setUint32(20,n,!0),d.setUint32(24,i,!0),d.setUint32(28,a,!0);let m=o;t.forEach((g,w)=>{let A=n+w*XN;d.setUint32(A,m,!0),d.setUint32(A+4,g.pcm.length,!0),d.setFloat32(A+8,g.sampleRate,!0),d.setUint32(A+12,g.loopStart,!0),d.setUint32(A+16,g.loopEnd,!0),new Float32Array(u,m,g.pcm.length).set(g.pcm),m+=g.pcm.length*4});let x=0;return e.forEach((g,w)=>{let A=a+w*QN;d.setUint32(A,x,!0),d.setUint32(A+4,g.length,!0);for(let _ of g){let C=i+x*YN;d.setUint8(C,_.keyLo),d.setUint8(C+1,_.keyHi),d.setUint8(C+2,_.velLo),d.setUint8(C+3,_.velHi),d.setUint32(C+4,_.sampleIndex,!0),d.setUint32(C+8,_.rootKey,!0),d.setUint32(C+12,_.loopMode,!0),d.setFloat32(C+16,_.pan,!0),d.setFloat32(C+20,_.attack,!0),d.setFloat32(C+24,_.decay,!0),d.setFloat32(C+28,_.sustain,!0),d.setFloat32(C+32,_.release,!0),x++}}),u},mb=(t,e)=>t.generators[e]?.value,Wd=(t,e,r)=>mb(e,r)??mb(t,r),fE=t=>t!==void 0?Math.pow(2,t/1200):.005,fb=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},eI=t=>{let e=[],r=new Map,n=a=>{let o=r.get(a);if(o!==void 0)return o;let s=new Float32Array(a.data.length);for(let d=0;d<s.length;d++)s[d]=a.data[d]/32768;let u=e.length;return e.push({pcm:s,sampleRate:a.header.sampleRate,loopStart:a.header.startLoop,loopEnd:a.header.endLoop}),r.set(a,u),u},i=t.presets.map(a=>{let o=[];for(let s of a.zones){let u=fb(s,Fn.KeyRange),d=fb(s,Fn.VelRange);for(let m of s.instrument.zones){let x=fb(m,Fn.KeyRange),g=fb(m,Fn.VelRange),w=Math.max(u.lo,x.lo),A=Math.min(u.hi,x.hi),_=Math.max(d.lo,g.lo),C=Math.min(d.hi,g.hi);if(w>A||_>C)continue;let K=m.sample??t.samples[mb(m,Fn.SampleId)??0];if(K===void 0)continue;let U=n(K),ee=mb(m,Fn.OverridingRootKey)??K.header.originalPitch??60,re=Wd(s,m,Fn.SampleModes)??0,me=Wd(s,m,Fn.SustainVolEnv);o.push({keyLo:w,keyHi:A,velLo:_,velHi:C,sampleIndex:U,rootKey:ee,loopMode:re===1||re===3?1:0,pan:(Wd(s,m,Fn.Pan)??0)/1e3,attack:fE(Wd(s,m,Fn.AttackVolEnv)),decay:fE(Wd(s,m,Fn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:fE(Wd(s,m,Fn.ReleaseVolEnv))})}}return o});return K2({samples:e,presets:i})};var W2=512,tI=(t,e,r)=>{let n=Ct(()=>jN(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},rI=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:W2,element:"anyfunc"}),a=W(globalThis.performance)?()=>performance.now()*1e3:()=>Date.now()*1e3,o=new WebAssembly.Instance(t.engineModule,{env:{memory:e,__indirect_function_table:i,host_perf_now:a}}).exports;o.init(r);let s=new cb(e,o,r,(m,x)=>n.deviceMessage(m,x)),u=new pb(e,()=>n.fetchNamWasm(),r),d={...s.imports(),...u.imports()};return t.deviceModules.forEach((m,x)=>WN(o,e,i,m,t.deviceBoxTypes[x],r,d)),t.composites.forEach(m=>LN(o,e,m)),o},iI=(t,e,r,n,i,a)=>{let o=s=>{let u=s.catch(a);n.add(u),u.finally(()=>n.delete(u))};for(;;){let s=t.input_reserve(16),u=t.sample_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchAudio(d).then(m=>{let{numberOfFrames:x,numberOfChannels:g,sampleRate:w,frames:A}=m,_=x*Float32Array.BYTES_PER_ELEMENT,C=t.sample_allocate(u,g*_);if(C!==0){for(let K=0;K<g;K++)new Float32Array(e.buffer,C+K*_,x).set(A[K]);t.sample_set_ready(u,x,g,w)}},m=>{t.sample_allocate(u,4),t.sample_set_ready(u,1,1,i),r.log(`sample load failed: ${m}`)}))}for(;;){let s=t.input_reserve(16),u=t.soundfont_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchSoundfont(d).then(m=>{let x=new Uint8Array(eI(m)),g=t.soundfont_allocate(u,x.byteLength);g!==0&&(new Uint8Array(e.buffer,g,x.byteLength).set(x),t.soundfont_set_ready(u))},m=>r.log(`soundfont load failed: ${m}`)))}};var nI="engine-wasm-processor",aI="engine-sync-bytes",oI="engine-frozen-audio";var mE=class extends AudioWorkletProcessor{#e=new X;#t;#r;#i;#n=new Float32Array(cy);#a;#o;#s;#c;#l;#u=[];#p;#d;#v=new ob;#f=new Set;#m=-1;#w=[];#h=!1;#x=!0;#g=!1;#_=!1;#A=!1;#S=0;#F=0;constructor({processorOptions:e}){super();let{syncStreamBuffer:r,controlFlagsBuffer:n,hrClockBuffer:i,variant:a}=e,{engineModule:o,deviceModules:s,deviceBoxTypes:u,composites:d,memory:m}=a;this.#t=m;let x=JE.for(this.port);this.#a=En.sender(x.channel("engine-to-client"),_=>new class{log(C){_.dispatchAndForget(this.log,C)}error(C){_.dispatchAndForget(this.error,C)}deviceMessage(C,K){_.dispatchAndForget(this.deviceMessage,C,K)}fetchAudio(C){return _.dispatchAndReturn(this.fetchAudio,C)}fetchSoundfont(C){return _.dispatchAndReturn(this.fetchSoundfont,C)}fetchNamWasm(){return _.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(C){_.dispatchAndForget(this.notifyClipSequenceChanges,C)}switchMarkerState(C){_.dispatchAndForget(this.switchMarkerState,C)}ready(){_.dispatchAndForget(this.ready)}});let g=rI({engineModule:o,deviceModules:s,deviceBoxTypes:u,composites:d},m,sampleRate,this.#a);this.#r=g,this.#c=new Int32Array(n),this.#i=new rb(i),this.#s=Fh.writer(l$(),r,_=>{let C=new DataView(this.#t.buffer,g.engine_state_ptr(),g.engine_state_len());_.position=C.getFloat32(0),_.bpm=C.getFloat32(4),_.playbackTimestamp=this.#F,_.countInBeatsRemaining=C.getFloat32(12),_.isPlaying=C.getUint8(16)===1,_.isCountingIn=C.getUint8(17)===1,_.isRecording=C.getUint8(18)===1,this.#A&&(_.perfBuffer.set(this.#n),_.perfIndex=this.#S)}),this.#l=this.#e.own(Oh.create(x,"engine-live-data")),this.#p=this.#e.own(new ib(this.#l,dd.PEAKS)),this.#d=new Eh;let w=new Float32Array(this.#d.numBins()),A=new Float32Array(this.#d.numBins());this.#o=new ap(x.channel("engine-preferences"),EN.parse({})),this.#e.ownAll(this.#l.broadcastFloats(dd.SPECTRUM,w,_=>{_&&(w.set(this.#d.bins()),this.#d.decay=!0)}),this.#l.broadcastFloats(dd.WAVEFORM,A,_=>{_&&A.set(this.#d.waveform())}),this.#o.catchupAndSubscribe(_=>g.set_metronome_enabled(_?1:0),"metronome","enabled"),this.#o.catchupAndSubscribe(_=>g.set_metronome_gain(_),"metronome","gain"),this.#o.catchupAndSubscribe(_=>g.set_metronome_beat_sub_division(_),"metronome","beatSubDivision"),this.#o.catchupAndSubscribe(_=>g.set_metronome_monophonic(_?1:0),"metronome","monophonic"),this.#o.catchupAndSubscribe(_=>g.set_allow_takes(_?1:0),"recording","allowTakes"),this.#o.catchupAndSubscribe(_=>g.set_pause_on_loop_disabled(_?1:0),"playback","pauseOnLoopDisabled"),this.#o.catchupAndSubscribe(_=>g.set_truncate_notes_at_region_end(_?1:0),"playback","truncateNotesAtRegionEnd"),this.#o.catchupAndSubscribe(_=>this.#A=_,"debug","dspLoadMeasurement"),En.executor(x.channel(aI),{applyUpdates:_=>this.#y(()=>this.#B(_)),checksum:_=>this.#E(_)}),En.executor(x.channel(oI),{frozenAllocate:(_,C)=>{let{status:K,value:U,error:ee}=Ct(()=>g.frozen_allocate(_,C));return K==="failure"?(this.#b(ee),Promise.reject(ee)):Promise.resolve(U)},frozenAttach:(_,C,K,U)=>this.#y(()=>{let ee=g.input_reserve(16);new Uint8Array(this.#t.buffer,ee,16).set(_),g.set_frozen_audio(C,K,U)}),frozenClear:_=>this.#y(()=>{let C=g.input_reserve(16);new Uint8Array(this.#t.buffer,C,16).set(_),g.clear_frozen_audio()})}),En.executor(x.channel("engine-commands"),{play:()=>this.#y(()=>this.#N()),stop:_=>this.#y(()=>this.#I(_)),setPosition:_=>this.#y(()=>{this.#F=_,g.set_position(_)}),prepareRecordingState:_=>this.#y(()=>{this.#_=!0,g.prepare_recording_state(_?1:0,this.#o.settings.recording.countInBars)}),stopRecording:()=>this.#y(()=>{this.#_=!1,g.stop_recording()}),queryLoadingComplete:()=>Promise.all(this.#f).then(()=>!0),panic:()=>{this.#g=!0},loadClickSound:(_,C)=>this.#y(()=>{let{frames:K,numberOfFrames:U,numberOfChannels:ee,sampleRate:re}=C,me=Math.min(ee,2),$e=g.click_allocate(U,me);for(let Q=0;Q<me;Q++)new Float32Array(this.#t.buffer,$e+Q*U*4,U).set(K[Q]);g.set_click_sound(_,U,me,re)}),setFrozenAudio:(_,C)=>this.#y(()=>{if(C===null){let we=g.input_reserve(16);new Uint8Array(this.#t.buffer,we,16).set(_),g.clear_frozen_audio();return}let{frames:K,numberOfFrames:U,numberOfChannels:ee,sampleRate:re}=C,me=Math.min(ee,2),$e=g.frozen_allocate(U,me);if($e===0)return;for(let we=0;we<me;we++)new Float32Array(this.#t.buffer,$e+we*U*4,U).set(K[we]);let Q=g.input_reserve(16);new Uint8Array(this.#t.buffer,Q,16).set(_),g.set_frozen_audio(U,me,re)}),updateMonitoringMap:_=>this.#y(()=>{this.#w=_;let C=g.input_reserve(_.length*24),K=new DataView(this.#t.buffer,C,_.length*24);_.forEach(({uuid:U,channels:ee},re)=>{new Uint8Array(this.#t.buffer,C+re*24,16).set(U),K.setInt32(re*24+16,ee[0],!0),K.setInt32(re*24+20,ee.length>1?ee[1]:-1,!0)}),g.set_monitoring_map(_.length)}),noteSignal:_=>this.#y(()=>this.#M(_)),ignoreNoteRegion:_=>this.#y(()=>{let C=g.input_reserve(16);new Uint8Array(this.#t.buffer,C,16).set(_),g.ignore_note_region()}),scheduleClipPlay:_=>this.#y(()=>_.forEach(C=>{let K=g.input_reserve(16);new Uint8Array(this.#t.buffer,K,16).set(C),g.schedule_clip_play()})),scheduleClipStop:_=>this.#y(()=>_.forEach(C=>{let K=g.input_reserve(16);new Uint8Array(this.#t.buffer,K,16).set(C),g.schedule_clip_stop()})),setupMIDI:(_,C)=>this.#v.connect(_,C),terminate:()=>{this.#x=!1,this.#u.forEach(_=>_.terminate()),this.#u.length=0,this.#e.terminate()}})),this.#a.ready()}process(e,r){if(!this.#x)return!1;if(Atomics.load(this.#c,0)===1)return this.#s.tryWrite(),!0;let{status:n,error:i}=Ct(()=>this.#P(e,r));return n==="failure"?(this.#b(i),!1):!0}#b(e){console.debug(e),this.#x=!1,this.#a.error(tI(this.#r,this.#t,e)),this.#e.terminate()}#y(e){let{status:r,error:n}=Ct(e);r==="failure"&&this.#b(n)}#E(e){let r=new Int8Array(this.#t.buffer,this.#r.checksum_ptr(),32);if(e.length===r.length&&e.every((i,a)=>i===r[a]))return Promise.resolve();let n=new Error("box-graph checksum mismatch: the engine mirror diverged from the source graph");return this.#a.error(n),Promise.reject(n)}#P(e,[r,n]){if(this.#g)return V("Manual Panic");let i=this.#A?this.#i.start():0,a=this.#r,o=this.#w;if(o.length>0){let g=e[0]??[],w=new Float32Array(this.#t.buffer,a.monitor_input_ptr(),8*na);w.fill(0);for(let{channels:A}of o)for(let _ of A){let C=g[_];C!==void 0&&_<8&&w.set(C,_*na)}}if(a.render(),o.length>0&&n!==void 0){let g=new Float32Array(this.#t.buffer,a.monitor_output_ptr(),8*na);for(let{channels:w}of o)for(let A of w){let _=n[A];_!==void 0&&A<8&&_.set(g.subarray(A*na,(A+1)*na))}}let s=r[0].length,u=this.#t.buffer,d=a.output_ptr(),m=new Float32Array(u,d,s),x=new Float32Array(u,d+s*Float32Array.BYTES_PER_ELEMENT,s);r[0].set(m),r.length>1&&r[1].set(x),this.#p.process(r[0],r[1]??r[0]),this.#d.process(r[0],r[1]??r[0],0,na),this.#T(),this.#A&&(this.#i.end(),this.#n[this.#S]=i,this.#S=(this.#S+1)%cy),this.#l.flush(),this.#s.tryWrite(),this.#$(),this.#k(),this.#v.drain(a,this.#t)}#$(){let e=this.#r,r=e.clip_changes_count();if(r===0)return;let n=e.input_reserve(r*20),i=e.clip_changes_take(n),a=new DataView(this.#t.buffer,n,i*20),o=[],s=[],u=[];for(let d=0;d<i;d++){let m=new Uint8Array(this.#t.buffer,n+d*20,16).slice(),x=a.getUint32(d*20+16,!0);x===0?o.push(m):x===1?s.push(m):u.push(m)}this.#a.notifyClipSequenceChanges({started:o,stopped:s,obsolete:u})}#k(){let e=this.#r,r=e.marker_changes_count();if(r===0)return;let n=e.input_reserve(r*24),i=e.marker_changes_take(n),a=new DataView(this.#t.buffer,n,i*24);for(let o=0;o<i;o++)if(a.getUint32(o*24+20,!0)===1){let u=new Uint8Array(this.#t.buffer,n+o*24,16).slice();this.#a.switchMarkerState([u,a.getUint32(o*24+16,!0)])}else this.#a.switchMarkerState(null)}#M(e){let r=this.#r.input_reserve(16);new Uint8Array(this.#t.buffer,r,16).set(e.uuid),ho.isOn(e)?this.#r.note_signal_on(e.pitch,e.velocity):ho.isOff(e)?this.#r.note_signal_off(e.pitch):ho.isAudition(e)&&this.#r.note_signal_audition(e.pitch,e.duration,e.velocity)}#N(){this.#o.settings.playback.timestampEnabled&&this.#r.set_position(this.#F),this.#_=!0,this.#r.play()}#I(e){let r=new DataView(this.#t.buffer,this.#r.engine_state_ptr(),this.#r.engine_state_len()),n=this.#_||r.getUint8(16)===1,i=r.getUint8(17)===1||r.getUint8(18)===1;this.#_=!1,this.#r.pause(),i&&this.#r.set_position(this.#o.settings.playback.timestampEnabled?this.#F:0),(e||!n)&&(this.#r.stop(),this.#F=0,this.#p.clear())}#B(e){let r=new Uint8Array(e),n=this.#r.input_reserve(r.length);new Uint8Array(this.#t.buffer,n,r.length).set(r);let i=this.#r.apply_updates(r.length);if(i!==0){this.#a.error(new Error(`apply_updates rejected a transaction (code ${i})`));return}!this.#h&&this.#r.bind()===0&&(this.#h=!0),iI(this.#r,this.#t,this.#a,this.#f,sampleRate,a=>this.#b(a))}#T(){let e=this.#r.broadcast_generation();if(e===this.#m)return;this.#m=e,this.#u.forEach(n=>n.terminate()),this.#u.length=0;let r=this.#r.broadcast_count();for(let n=0;n<r;n++){let i=this.#r.input_reserve(48);if(this.#r.broadcast_entry(n,i)===0)continue;let a=new DataView(this.#t.buffer,i,48),o=new Uint8Array(this.#t.buffer,i,16).slice(),s=a.getUint32(16,!0),u=a.getUint32(20,!0),d=a.getUint32(24,!0),m=a.getUint32(28,!0),x=[];for(let w=0;w<m;w++)x.push(a.getUint16(32+w*2,!0));let g=Oe.compose(o,...x);if(s===0){let w=new Float32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastFloat(g,()=>w[0]))}else if(s===2){let w=new Int32Array(this.#t.buffer,u,d),A=new Int32Array(this.#t.buffer,u+4,d-1);this.#u.push(this.#l.broadcastIntegers(g,A,()=>{A[Math.min(w[0],A.length-1)]=0,w[0]=0}))}else if(s===3){let w=new Int32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastIntegers(g,w,()=>{}))}else{let w=new Float32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastFloats(g,w,A=>this.#r.broadcast_set_active(n,A?1:0)))}}}};registerProcessor(nI,mE);
114
+ `)),!c)return null;yb=sh(c,!0)}return yb.shift()},yo={ttys:[],init(){},shutdown(){},register(c,f){yo.ttys[c]={input:[],output:[],ops:f},v.registerDevice(c,yo.stream_ops)},stream_ops:{open(c){var f=yo.ttys[c.node.rdev];if(!f)throw new v.ErrnoError(43);c.tty=f,c.seekable=!1},close(c){c.tty.ops.fsync(c.tty)},fsync(c){c.tty.ops.fsync(c.tty)},read(c,f,h,y,F){if(!c.tty||!c.tty.ops.get_char)throw new v.ErrnoError(60);for(var T=0,z=0;z<y;z++){var j;try{j=c.tty.ops.get_char(c.tty)}catch{throw new v.ErrnoError(29)}if(j===void 0&&T===0)throw new v.ErrnoError(6);if(j==null)break;T++,f[h+z]=j}return T&&(c.node.timestamp=Date.now()),T},write(c,f,h,y,F){if(!c.tty||!c.tty.ops.put_char)throw new v.ErrnoError(60);try{for(var T=0;T<y;T++)c.tty.ops.put_char(c.tty,f[h+T])}catch{throw new v.ErrnoError(29)}return y&&(c.node.timestamp=Date.now()),T}},default_tty_ops:{get_char(c){return kI()},put_char(c,f){f===null||f===10?(W(lu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(W(lu(c.output,0)),c.output=[])},ioctl_tcgets(c){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(c,f,h){return 0},ioctl_tiocgwinsz(c){return[24,80]}},default_tty1_ops:{put_char(c,f){f===null||f===10?(U(lu(c.output,0)),c.output=[]):f!=0&&c.output.push(f)},fsync(c){c.output&&c.output.length>0&&(U(lu(c.output,0)),c.output=[])}}},SE=c=>{su()},Re={ops_table:null,mount(c){return Re.createNode(null,"/",16895,0)},createNode(c,f,h,y){if(v.isBlkdev(h)||v.isFIFO(h))throw new v.ErrnoError(63);Re.ops_table||={dir:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,lookup:Re.node_ops.lookup,mknod:Re.node_ops.mknod,rename:Re.node_ops.rename,unlink:Re.node_ops.unlink,rmdir:Re.node_ops.rmdir,readdir:Re.node_ops.readdir,symlink:Re.node_ops.symlink},stream:{llseek:Re.stream_ops.llseek}},file:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:{llseek:Re.stream_ops.llseek,read:Re.stream_ops.read,write:Re.stream_ops.write,allocate:Re.stream_ops.allocate,mmap:Re.stream_ops.mmap,msync:Re.stream_ops.msync}},link:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr,readlink:Re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Re.node_ops.getattr,setattr:Re.node_ops.setattr},stream:v.chrdev_stream_ops}};var F=v.createNode(c,f,h,y);return v.isDir(F.mode)?(F.node_ops=Re.ops_table.dir.node,F.stream_ops=Re.ops_table.dir.stream,F.contents={}):v.isFile(F.mode)?(F.node_ops=Re.ops_table.file.node,F.stream_ops=Re.ops_table.file.stream,F.usedBytes=0,F.contents=null):v.isLink(F.mode)?(F.node_ops=Re.ops_table.link.node,F.stream_ops=Re.ops_table.link.stream):v.isChrdev(F.mode)&&(F.node_ops=Re.ops_table.chrdev.node,F.stream_ops=Re.ops_table.chrdev.stream),F.timestamp=Date.now(),c&&(c.contents[f]=F,c.timestamp=F.timestamp),F},getFileDataAsTypedArray(c){return c.contents?c.contents.subarray?c.contents.subarray(0,c.usedBytes):new Uint8Array(c.contents):new Uint8Array(0)},expandFileStorage(c,f){var h=c.contents?c.contents.length:0;if(!(h>=f)){var y=1024*1024;f=Math.max(f,h*(h<y?2:1.125)>>>0),h!=0&&(f=Math.max(f,256));var F=c.contents;c.contents=new Uint8Array(f),c.usedBytes>0&&c.contents.set(F.subarray(0,c.usedBytes),0)}},resizeFileStorage(c,f){if(c.usedBytes!=f)if(f==0)c.contents=null,c.usedBytes=0;else{var h=c.contents;c.contents=new Uint8Array(f),h&&c.contents.set(h.subarray(0,Math.min(f,c.usedBytes))),c.usedBytes=f}},node_ops:{getattr(c){var f={};return f.dev=v.isChrdev(c.mode)?c.id:1,f.ino=c.id,f.mode=c.mode,f.nlink=1,f.uid=0,f.gid=0,f.rdev=c.rdev,v.isDir(c.mode)?f.size=4096:v.isFile(c.mode)?f.size=c.usedBytes:v.isLink(c.mode)?f.size=c.link.length:f.size=0,f.atime=new Date(c.timestamp),f.mtime=new Date(c.timestamp),f.ctime=new Date(c.timestamp),f.blksize=4096,f.blocks=Math.ceil(f.size/f.blksize),f},setattr(c,f){f.mode!==void 0&&(c.mode=f.mode),f.timestamp!==void 0&&(c.timestamp=f.timestamp),f.size!==void 0&&Re.resizeFileStorage(c,f.size)},lookup(c,f){throw v.genericErrors[44]},mknod(c,f,h,y){return Re.createNode(c,f,h,y)},rename(c,f,h){if(v.isDir(c.mode)){var y;try{y=v.lookupNode(f,h)}catch{}if(y)for(var F in y.contents)throw new v.ErrnoError(55)}delete c.parent.contents[c.name],c.parent.timestamp=Date.now(),c.name=h,f.contents[h]=c,f.timestamp=c.parent.timestamp,c.parent=f},unlink(c,f){delete c.contents[f],c.timestamp=Date.now()},rmdir(c,f){var h=v.lookupNode(c,f);for(var y in h.contents)throw new v.ErrnoError(55);delete c.contents[f],c.timestamp=Date.now()},readdir(c){var f=[".",".."];for(var h of Object.keys(c.contents))f.push(h);return f},symlink(c,f,h){var y=Re.createNode(c,f,41471,0);return y.link=h,y},readlink(c){if(!v.isLink(c.mode))throw new v.ErrnoError(28);return c.link}},stream_ops:{read(c,f,h,y,F){var T=c.node.contents;if(F>=c.node.usedBytes)return 0;var z=Math.min(c.node.usedBytes-F,y);if(z>8&&T.subarray)f.set(T.subarray(F,F+z),h);else for(var j=0;j<z;j++)f[h+j]=T[F+j];return z},write(c,f,h,y,F,T){if(f.buffer===we.buffer&&(T=!1),!y)return 0;var z=c.node;if(z.timestamp=Date.now(),f.subarray&&(!z.contents||z.contents.subarray)){if(T)return z.contents=f.subarray(h,h+y),z.usedBytes=y,y;if(z.usedBytes===0&&F===0)return z.contents=f.slice(h,h+y),z.usedBytes=y,y;if(F+y<=z.usedBytes)return z.contents.set(f.subarray(h,h+y),F),y}if(Re.expandFileStorage(z,F+y),z.contents.subarray&&f.subarray)z.contents.set(f.subarray(h,h+y),F);else for(var j=0;j<y;j++)z.contents[F+j]=f[h+j];return z.usedBytes=Math.max(z.usedBytes,F+y),y},llseek(c,f,h){var y=f;if(h===1?y+=c.position:h===2&&v.isFile(c.node.mode)&&(y+=c.node.usedBytes),y<0)throw new v.ErrnoError(28);return y},allocate(c,f,h){Re.expandFileStorage(c.node,f+h),c.node.usedBytes=Math.max(c.node.usedBytes,f+h)},mmap(c,f,h,y,F){if(!v.isFile(c.node.mode))throw new v.ErrnoError(43);var T,z,j=c.node.contents;if(!(F&2)&&j.buffer===we.buffer)z=!1,T=j.byteOffset;else{if((h>0||h+f<j.length)&&(j.subarray?j=j.subarray(h,h+f):j=Array.prototype.slice.call(j,h,h+f)),z=!0,T=SE(f),!T)throw new v.ErrnoError(48);we.set(j,T)}return{ptr:T,allocated:z}},msync(c,f,h,y,F){return Re.stream_ops.write(c,f,0,y,h,!1),0}}},MI=(c,f,h,y)=>{var F=y?"":`al ${c}`;_(c,T=>{Q(T,`Loading data file "${c}" failed (no arrayBuffer).`),f(new Uint8Array(T)),F&&ah(F)},T=>{if(h)h();else throw`Loading data file "${c}" failed.`}),F&&gb(F)},NI=(c,f,h,y,F,T)=>{v.createDataFile(c,f,h,y,F,T)},II=r.preloadPlugins||[],BI=(c,f,h,y)=>{typeof Browser<"u"&&Browser.init();var F=!1;return II.forEach(T=>{F||T.canHandle(f)&&(T.handle(c,f,h,y),F=!0)}),F},TI=(c,f,h,y,F,T,z,j,ne,Ne)=>{var We=f?Ua.resolve(ut.join2(c,f)):c,nt=`cp ${We}`;function Se(be){function _e(Bt){Ne?.(),j||NI(c,f,Bt,y,F,ne),T?.(),ah(nt)}BI(be,We,_e,()=>{z?.(),ah(nt)})||_e(be)}gb(nt),typeof h=="string"?MI(h,be=>Se(be),z):Se(h)},DI=c=>{var f={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},h=f[c];if(typeof h>"u")throw new Error(`Unknown file open mode: ${c}`);return h},bb=(c,f)=>{var h=0;return c&&(h|=365),f&&(h|=146),h},v={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(c,f={}){if(c=Ua.resolve(c),!c)return{path:"",node:null};var h={follow_mount:!0,recurse_count:0};if(f=Object.assign(h,f),f.recurse_count>8)throw new v.ErrnoError(32);for(var y=c.split("/").filter(nt=>!!nt),F=v.root,T="/",z=0;z<y.length;z++){var j=z===y.length-1;if(j&&f.parent)break;if(F=v.lookupNode(F,y[z]),T=ut.join2(T,y[z]),v.isMountpoint(F)&&(!j||j&&f.follow_mount)&&(F=F.mounted.root),!j||f.follow)for(var ne=0;v.isLink(F.mode);){var Ne=v.readlink(T);T=Ua.resolve(ut.dirname(T),Ne);var We=v.lookupPath(T,{recurse_count:f.recurse_count+1});if(F=We.node,ne++>40)throw new v.ErrnoError(32)}}return{path:T,node:F}},getPath(c){for(var f;;){if(v.isRoot(c)){var h=c.mount.mountpoint;return f?h[h.length-1]!=="/"?`${h}/${f}`:h+f:h}f=f?`${c.name}/${f}`:c.name,c=c.parent}},hashName(c,f){for(var h=0,y=0;y<f.length;y++)h=(h<<5)-h+f.charCodeAt(y)|0;return(c+h>>>0)%v.nameTable.length},hashAddNode(c){var f=v.hashName(c.parent.id,c.name);c.name_next=v.nameTable[f],v.nameTable[f]=c},hashRemoveNode(c){var f=v.hashName(c.parent.id,c.name);if(v.nameTable[f]===c)v.nameTable[f]=c.name_next;else for(var h=v.nameTable[f];h;){if(h.name_next===c){h.name_next=c.name_next;break}h=h.name_next}},lookupNode(c,f){var h=v.mayLookup(c);if(h)throw new v.ErrnoError(h,c);for(var y=v.hashName(c.id,f),F=v.nameTable[y];F;F=F.name_next){var T=F.name;if(F.parent.id===c.id&&T===f)return F}return v.lookup(c,f)},createNode(c,f,h,y){var F=new v.FSNode(c,f,h,y);return v.hashAddNode(F),F},destroyNode(c){v.hashRemoveNode(c)},isRoot(c){return c===c.parent},isMountpoint(c){return!!c.mounted},isFile(c){return(c&61440)===32768},isDir(c){return(c&61440)===16384},isLink(c){return(c&61440)===40960},isChrdev(c){return(c&61440)===8192},isBlkdev(c){return(c&61440)===24576},isFIFO(c){return(c&61440)===4096},isSocket(c){return(c&49152)===49152},flagsToPermissionString(c){var f=["r","w","rw"][c&3];return c&512&&(f+="w"),f},nodePermissions(c,f){return v.ignorePermissions?0:f.includes("r")&&!(c.mode&292)||f.includes("w")&&!(c.mode&146)||f.includes("x")&&!(c.mode&73)?2:0},mayLookup(c){var f=v.nodePermissions(c,"x");return f||(c.node_ops.lookup?0:2)},mayCreate(c,f){try{var h=v.lookupNode(c,f);return 20}catch{}return v.nodePermissions(c,"wx")},mayDelete(c,f,h){var y;try{y=v.lookupNode(c,f)}catch(T){return T.errno}var F=v.nodePermissions(c,"wx");if(F)return F;if(h){if(!v.isDir(y.mode))return 54;if(v.isRoot(y)||v.getPath(y)===v.cwd())return 10}else if(v.isDir(y.mode))return 31;return 0},mayOpen(c,f){return c?v.isLink(c.mode)?32:v.isDir(c.mode)&&(v.flagsToPermissionString(f)!=="r"||f&512)?31:v.nodePermissions(c,v.flagsToPermissionString(f)):44},MAX_OPEN_FDS:4096,nextfd(){for(var c=0;c<=v.MAX_OPEN_FDS;c++)if(!v.streams[c])return c;throw new v.ErrnoError(33)},getStreamChecked(c){var f=v.getStream(c);if(!f)throw new v.ErrnoError(8);return f},getStream:c=>v.streams[c],createStream(c,f=-1){return v.FSStream||(v.FSStream=function(){this.shared={}},v.FSStream.prototype={},Object.defineProperties(v.FSStream.prototype,{object:{get(){return this.node},set(h){this.node=h}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(h){this.shared.flags=h}},position:{get(){return this.shared.position},set(h){this.shared.position=h}}})),c=Object.assign(new v.FSStream,c),f==-1&&(f=v.nextfd()),c.fd=f,v.streams[f]=c,c},closeStream(c){v.streams[c]=null},chrdev_stream_ops:{open(c){var f=v.getDevice(c.node.rdev);c.stream_ops=f.stream_ops,c.stream_ops.open?.(c)},llseek(){throw new v.ErrnoError(70)}},major:c=>c>>8,minor:c=>c&255,makedev:(c,f)=>c<<8|f,registerDevice(c,f){v.devices[c]={stream_ops:f}},getDevice:c=>v.devices[c],getMounts(c){for(var f=[],h=[c];h.length;){var y=h.pop();f.push(y),h.push.apply(h,y.mounts)}return f},syncfs(c,f){typeof c=="function"&&(f=c,c=!1),v.syncFSRequests++,v.syncFSRequests>1&&U(`warning: ${v.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var h=v.getMounts(v.root.mount),y=0;function F(z){return v.syncFSRequests--,f(z)}function T(z){if(z)return T.errored?void 0:(T.errored=!0,F(z));++y>=h.length&&F(null)}h.forEach(z=>{if(!z.type.syncfs)return T(null);z.type.syncfs(z,c,T)})},mount(c,f,h){var y=h==="/",F=!h,T;if(y&&v.root)throw new v.ErrnoError(10);if(!y&&!F){var z=v.lookupPath(h,{follow_mount:!1});if(h=z.path,T=z.node,v.isMountpoint(T))throw new v.ErrnoError(10);if(!v.isDir(T.mode))throw new v.ErrnoError(54)}var j={type:c,opts:f,mountpoint:h,mounts:[]},ne=c.mount(j);return ne.mount=j,j.root=ne,y?v.root=ne:T&&(T.mounted=j,T.mount&&T.mount.mounts.push(j)),ne},unmount(c){var f=v.lookupPath(c,{follow_mount:!1});if(!v.isMountpoint(f.node))throw new v.ErrnoError(28);var h=f.node,y=h.mounted,F=v.getMounts(y);Object.keys(v.nameTable).forEach(z=>{for(var j=v.nameTable[z];j;){var ne=j.name_next;F.includes(j.mount)&&v.destroyNode(j),j=ne}}),h.mounted=null;var T=h.mount.mounts.indexOf(y);h.mount.mounts.splice(T,1)},lookup(c,f){return c.node_ops.lookup(c,f)},mknod(c,f,h){var y=v.lookupPath(c,{parent:!0}),F=y.node,T=ut.basename(c);if(!T||T==="."||T==="..")throw new v.ErrnoError(28);var z=v.mayCreate(F,T);if(z)throw new v.ErrnoError(z);if(!F.node_ops.mknod)throw new v.ErrnoError(63);return F.node_ops.mknod(F,T,f,h)},create(c,f){return f=f!==void 0?f:438,f&=4095,f|=32768,v.mknod(c,f,0)},mkdir(c,f){return f=f!==void 0?f:511,f&=1023,f|=16384,v.mknod(c,f,0)},mkdirTree(c,f){for(var h=c.split("/"),y="",F=0;F<h.length;++F)if(h[F]){y+="/"+h[F];try{v.mkdir(y,f)}catch(T){if(T.errno!=20)throw T}}},mkdev(c,f,h){return typeof h>"u"&&(h=f,f=438),f|=8192,v.mknod(c,f,h)},symlink(c,f){if(!Ua.resolve(c))throw new v.ErrnoError(44);var h=v.lookupPath(f,{parent:!0}),y=h.node;if(!y)throw new v.ErrnoError(44);var F=ut.basename(f),T=v.mayCreate(y,F);if(T)throw new v.ErrnoError(T);if(!y.node_ops.symlink)throw new v.ErrnoError(63);return y.node_ops.symlink(y,F,c)},rename(c,f){var h=ut.dirname(c),y=ut.dirname(f),F=ut.basename(c),T=ut.basename(f),z,j,ne;if(z=v.lookupPath(c,{parent:!0}),j=z.node,z=v.lookupPath(f,{parent:!0}),ne=z.node,!j||!ne)throw new v.ErrnoError(44);if(j.mount!==ne.mount)throw new v.ErrnoError(75);var Ne=v.lookupNode(j,F),We=Ua.relative(c,y);if(We.charAt(0)!==".")throw new v.ErrnoError(28);if(We=Ua.relative(f,h),We.charAt(0)!==".")throw new v.ErrnoError(55);var nt;try{nt=v.lookupNode(ne,T)}catch{}if(Ne!==nt){var Se=v.isDir(Ne.mode),be=v.mayDelete(j,F,Se);if(be)throw new v.ErrnoError(be);if(be=nt?v.mayDelete(ne,T,Se):v.mayCreate(ne,T),be)throw new v.ErrnoError(be);if(!j.node_ops.rename)throw new v.ErrnoError(63);if(v.isMountpoint(Ne)||nt&&v.isMountpoint(nt))throw new v.ErrnoError(10);if(ne!==j&&(be=v.nodePermissions(j,"w"),be))throw new v.ErrnoError(be);v.hashRemoveNode(Ne);try{j.node_ops.rename(Ne,ne,T)}catch(_e){throw _e}finally{v.hashAddNode(Ne)}}},rmdir(c){var f=v.lookupPath(c,{parent:!0}),h=f.node,y=ut.basename(c),F=v.lookupNode(h,y),T=v.mayDelete(h,y,!0);if(T)throw new v.ErrnoError(T);if(!h.node_ops.rmdir)throw new v.ErrnoError(63);if(v.isMountpoint(F))throw new v.ErrnoError(10);h.node_ops.rmdir(h,y),v.destroyNode(F)},readdir(c){var f=v.lookupPath(c,{follow:!0}),h=f.node;if(!h.node_ops.readdir)throw new v.ErrnoError(54);return h.node_ops.readdir(h)},unlink(c){var f=v.lookupPath(c,{parent:!0}),h=f.node;if(!h)throw new v.ErrnoError(44);var y=ut.basename(c),F=v.lookupNode(h,y),T=v.mayDelete(h,y,!1);if(T)throw new v.ErrnoError(T);if(!h.node_ops.unlink)throw new v.ErrnoError(63);if(v.isMountpoint(F))throw new v.ErrnoError(10);h.node_ops.unlink(h,y),v.destroyNode(F)},readlink(c){var f=v.lookupPath(c),h=f.node;if(!h)throw new v.ErrnoError(44);if(!h.node_ops.readlink)throw new v.ErrnoError(28);return Ua.resolve(v.getPath(h.parent),h.node_ops.readlink(h))},stat(c,f){var h=v.lookupPath(c,{follow:!f}),y=h.node;if(!y)throw new v.ErrnoError(44);if(!y.node_ops.getattr)throw new v.ErrnoError(63);return y.node_ops.getattr(y)},lstat(c){return v.stat(c,!0)},chmod(c,f,h){var y;if(typeof c=="string"){var F=v.lookupPath(c,{follow:!h});y=F.node}else y=c;if(!y.node_ops.setattr)throw new v.ErrnoError(63);y.node_ops.setattr(y,{mode:f&4095|y.mode&-4096,timestamp:Date.now()})},lchmod(c,f){v.chmod(c,f,!0)},fchmod(c,f){var h=v.getStreamChecked(c);v.chmod(h.node,f)},chown(c,f,h,y){var F;if(typeof c=="string"){var T=v.lookupPath(c,{follow:!y});F=T.node}else F=c;if(!F.node_ops.setattr)throw new v.ErrnoError(63);F.node_ops.setattr(F,{timestamp:Date.now()})},lchown(c,f,h){v.chown(c,f,h,!0)},fchown(c,f,h){var y=v.getStreamChecked(c);v.chown(y.node,f,h)},truncate(c,f){if(f<0)throw new v.ErrnoError(28);var h;if(typeof c=="string"){var y=v.lookupPath(c,{follow:!0});h=y.node}else h=c;if(!h.node_ops.setattr)throw new v.ErrnoError(63);if(v.isDir(h.mode))throw new v.ErrnoError(31);if(!v.isFile(h.mode))throw new v.ErrnoError(28);var F=v.nodePermissions(h,"w");if(F)throw new v.ErrnoError(F);h.node_ops.setattr(h,{size:f,timestamp:Date.now()})},ftruncate(c,f){var h=v.getStreamChecked(c);if((h.flags&2097155)===0)throw new v.ErrnoError(28);v.truncate(h.node,f)},utime(c,f,h){var y=v.lookupPath(c,{follow:!0}),F=y.node;F.node_ops.setattr(F,{timestamp:Math.max(f,h)})},open(c,f,h){if(c==="")throw new v.ErrnoError(44);f=typeof f=="string"?DI(f):f,h=typeof h>"u"?438:h,f&64?h=h&4095|32768:h=0;var y;if(typeof c=="object")y=c;else{c=ut.normalize(c);try{var F=v.lookupPath(c,{follow:!(f&131072)});y=F.node}catch{}}var T=!1;if(f&64)if(y){if(f&128)throw new v.ErrnoError(20)}else y=v.mknod(c,h,0),T=!0;if(!y)throw new v.ErrnoError(44);if(v.isChrdev(y.mode)&&(f&=-513),f&65536&&!v.isDir(y.mode))throw new v.ErrnoError(54);if(!T){var z=v.mayOpen(y,f);if(z)throw new v.ErrnoError(z)}f&512&&!T&&v.truncate(y,0),f&=-131713;var j=v.createStream({node:y,path:v.getPath(y),flags:f,seekable:!0,position:0,stream_ops:y.stream_ops,ungotten:[],error:!1});return j.stream_ops.open&&j.stream_ops.open(j),r.logReadFiles&&!(f&1)&&(v.readFiles||(v.readFiles={}),c in v.readFiles||(v.readFiles[c]=1)),j},close(c){if(v.isClosed(c))throw new v.ErrnoError(8);c.getdents&&(c.getdents=null);try{c.stream_ops.close&&c.stream_ops.close(c)}catch(f){throw f}finally{v.closeStream(c.fd)}c.fd=null},isClosed(c){return c.fd===null},llseek(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(!c.seekable||!c.stream_ops.llseek)throw new v.ErrnoError(70);if(h!=0&&h!=1&&h!=2)throw new v.ErrnoError(28);return c.position=c.stream_ops.llseek(c,f,h),c.ungotten=[],c.position},read(c,f,h,y,F){if(y<0||F<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===1)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.read)throw new v.ErrnoError(28);var T=typeof F<"u";if(!T)F=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var z=c.stream_ops.read(c,f,h,y,F);return T||(c.position+=z),z},write(c,f,h,y,F,T){if(y<0||F<0)throw new v.ErrnoError(28);if(v.isClosed(c))throw new v.ErrnoError(8);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(v.isDir(c.node.mode))throw new v.ErrnoError(31);if(!c.stream_ops.write)throw new v.ErrnoError(28);c.seekable&&c.flags&1024&&v.llseek(c,0,2);var z=typeof F<"u";if(!z)F=c.position;else if(!c.seekable)throw new v.ErrnoError(70);var j=c.stream_ops.write(c,f,h,y,F,T);return z||(c.position+=j),j},allocate(c,f,h){if(v.isClosed(c))throw new v.ErrnoError(8);if(f<0||h<=0)throw new v.ErrnoError(28);if((c.flags&2097155)===0)throw new v.ErrnoError(8);if(!v.isFile(c.node.mode)&&!v.isDir(c.node.mode))throw new v.ErrnoError(43);if(!c.stream_ops.allocate)throw new v.ErrnoError(138);c.stream_ops.allocate(c,f,h)},mmap(c,f,h,y,F){if((y&2)!==0&&(F&2)===0&&(c.flags&2097155)!==2)throw new v.ErrnoError(2);if((c.flags&2097155)===1)throw new v.ErrnoError(2);if(!c.stream_ops.mmap)throw new v.ErrnoError(43);return c.stream_ops.mmap(c,f,h,y,F)},msync(c,f,h,y,F){return c.stream_ops.msync?c.stream_ops.msync(c,f,h,y,F):0},munmap:c=>0,ioctl(c,f,h){if(!c.stream_ops.ioctl)throw new v.ErrnoError(59);return c.stream_ops.ioctl(c,f,h)},readFile(c,f={}){if(f.flags=f.flags||0,f.encoding=f.encoding||"binary",f.encoding!=="utf8"&&f.encoding!=="binary")throw new Error(`Invalid encoding type "${f.encoding}"`);var h,y=v.open(c,f.flags),F=v.stat(c),T=F.size,z=new Uint8Array(T);return v.read(y,z,0,T,0),f.encoding==="utf8"?h=lu(z,0):f.encoding==="binary"&&(h=z),v.close(y),h},writeFile(c,f,h={}){h.flags=h.flags||577;var y=v.open(c,h.flags,h.mode);if(typeof f=="string"){var F=new Uint8Array(oh(f)+1),T=wb(f,F,0,F.length);v.write(y,F,0,T,void 0,h.canOwn)}else if(ArrayBuffer.isView(f))v.write(y,f,0,f.byteLength,void 0,h.canOwn);else throw new Error("Unsupported data type");v.close(y)},cwd:()=>v.currentPath,chdir(c){var f=v.lookupPath(c,{follow:!0});if(f.node===null)throw new v.ErrnoError(44);if(!v.isDir(f.node.mode))throw new v.ErrnoError(54);var h=v.nodePermissions(f.node,"x");if(h)throw new v.ErrnoError(h);v.currentPath=f.path},createDefaultDirectories(){v.mkdir("/tmp"),v.mkdir("/home"),v.mkdir("/home/web_user")},createDefaultDevices(){v.mkdir("/dev"),v.registerDevice(v.makedev(1,3),{read:()=>0,write:(y,F,T,z,j)=>z}),v.mkdev("/dev/null",v.makedev(1,3)),yo.register(v.makedev(5,0),yo.default_tty_ops),yo.register(v.makedev(6,0),yo.default_tty1_ops),v.mkdev("/dev/tty",v.makedev(5,0)),v.mkdev("/dev/tty1",v.makedev(6,0));var c=new Uint8Array(1024),f=0,h=()=>(f===0&&(f=AE(c).byteLength),c[--f]);v.createDevice("/dev","random",h),v.createDevice("/dev","urandom",h),v.mkdir("/dev/shm"),v.mkdir("/dev/shm/tmp")},createSpecialDirectories(){v.mkdir("/proc");var c=v.mkdir("/proc/self");v.mkdir("/proc/self/fd"),v.mount({mount(){var f=v.createNode(c,"fd",16895,73);return f.node_ops={lookup(h,y){var F=+y,T=v.getStreamChecked(F),z={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>T.path}};return z.parent=z,z}},f}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?v.createDevice("/dev","stdin",r.stdin):v.symlink("/dev/tty","/dev/stdin"),r.stdout?v.createDevice("/dev","stdout",null,r.stdout):v.symlink("/dev/tty","/dev/stdout"),r.stderr?v.createDevice("/dev","stderr",null,r.stderr):v.symlink("/dev/tty1","/dev/stderr");var c=v.open("/dev/stdin",0),f=v.open("/dev/stdout",1),h=v.open("/dev/stderr",1)},ensureErrnoError(){v.ErrnoError||(v.ErrnoError=function(f,h){this.name="ErrnoError",this.node=h,this.setErrno=function(y){this.errno=y},this.setErrno(f),this.message="FS error"},v.ErrnoError.prototype=new Error,v.ErrnoError.prototype.constructor=v.ErrnoError,[44].forEach(c=>{v.genericErrors[c]=new v.ErrnoError(c),v.genericErrors[c].stack="<generic error, no stack>"}))},staticInit(){v.ensureErrnoError(),v.nameTable=new Array(4096),v.mount(Re,{},"/"),v.createDefaultDirectories(),v.createDefaultDevices(),v.createSpecialDirectories(),v.filesystems={MEMFS:Re}},init(c,f,h){v.init.initialized=!0,v.ensureErrnoError(),r.stdin=c||r.stdin,r.stdout=f||r.stdout,r.stderr=h||r.stderr,v.createStandardStreams()},quit(){v.init.initialized=!1;for(var c=0;c<v.streams.length;c++){var f=v.streams[c];f&&v.close(f)}},findObject(c,f){var h=v.analyzePath(c,f);return h.exists?h.object:null},analyzePath(c,f){try{var h=v.lookupPath(c,{follow:!f});c=h.path}catch{}var y={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var h=v.lookupPath(c,{parent:!0});y.parentExists=!0,y.parentPath=h.path,y.parentObject=h.node,y.name=ut.basename(c),h=v.lookupPath(c,{follow:!f}),y.exists=!0,y.path=h.path,y.object=h.node,y.name=h.node.name,y.isRoot=h.path==="/"}catch(F){y.error=F.errno}return y},createPath(c,f,h,y){c=typeof c=="string"?c:v.getPath(c);for(var F=f.split("/").reverse();F.length;){var T=F.pop();if(T){var z=ut.join2(c,T);try{v.mkdir(z)}catch{}c=z}}return z},createFile(c,f,h,y,F){var T=ut.join2(typeof c=="string"?c:v.getPath(c),f),z=bb(y,F);return v.create(T,z)},createDataFile(c,f,h,y,F,T){var z=f;c&&(c=typeof c=="string"?c:v.getPath(c),z=f?ut.join2(c,f):c);var j=bb(y,F),ne=v.create(z,j);if(h){if(typeof h=="string"){for(var Ne=new Array(h.length),We=0,nt=h.length;We<nt;++We)Ne[We]=h.charCodeAt(We);h=Ne}v.chmod(ne,j|146);var Se=v.open(ne,577);v.write(Se,h,0,h.length,0,T),v.close(Se),v.chmod(ne,j)}},createDevice(c,f,h,y){var F=ut.join2(typeof c=="string"?c:v.getPath(c),f),T=bb(!!h,!!y);v.createDevice.major||(v.createDevice.major=64);var z=v.makedev(v.createDevice.major++,0);return v.registerDevice(z,{open(j){j.seekable=!1},close(j){y?.buffer?.length&&y(10)},read(j,ne,Ne,We,nt){for(var Se=0,be=0;be<We;be++){var _e;try{_e=h()}catch{throw new v.ErrnoError(29)}if(_e===void 0&&Se===0)throw new v.ErrnoError(6);if(_e==null)break;Se++,ne[Ne+be]=_e}return Se&&(j.node.timestamp=Date.now()),Se},write(j,ne,Ne,We,nt){for(var Se=0;Se<We;Se++)try{y(ne[Ne+Se])}catch{throw new v.ErrnoError(29)}return We&&(j.node.timestamp=Date.now()),Se}}),v.mkdev(F,T,z)},forceLoadFile(c){if(c.isDevice||c.isFolder||c.link||c.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(A)try{c.contents=sh(A(c.url),!0),c.usedBytes=c.contents.length}catch{throw new v.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(c,f,h,y,F){function T(){this.lengthKnown=!1,this.chunks=[]}if(T.prototype.get=function(be){if(!(be>this.length-1||be<0)){var _e=be%this.chunkSize,Bt=be/this.chunkSize|0;return this.getter(Bt)[_e]}},T.prototype.setDataGetter=function(be){this.getter=be},T.prototype.cacheLength=function(){var be=new XMLHttpRequest;if(be.open("HEAD",h,!1),be.send(null),!(be.status>=200&&be.status<300||be.status===304))throw new Error("Couldn't load "+h+". Status: "+be.status);var _e=Number(be.getResponseHeader("Content-length")),Bt,Ki=(Bt=be.getResponseHeader("Accept-Ranges"))&&Bt==="bytes",Wr=(Bt=be.getResponseHeader("Content-Encoding"))&&Bt==="gzip",q=1024*1024;Ki||(q=_e);var he=(At,Sn)=>{if(At>Sn)throw new Error("invalid range ("+At+", "+Sn+") or no bytes requested!");if(Sn>_e-1)throw new Error("only "+_e+" bytes available! programmer error!");var ur=new XMLHttpRequest;if(ur.open("GET",h,!1),_e!==q&&ur.setRequestHeader("Range","bytes="+At+"-"+Sn),ur.responseType="arraybuffer",ur.overrideMimeType&&ur.overrideMimeType("text/plain; charset=x-user-defined"),ur.send(null),!(ur.status>=200&&ur.status<300||ur.status===304))throw new Error("Couldn't load "+h+". Status: "+ur.status);return ur.response!==void 0?new Uint8Array(ur.response||[]):sh(ur.responseText||"",!0)},vr=this;vr.setDataGetter(At=>{var Sn=At*q,ur=(At+1)*q-1;if(ur=Math.min(ur,_e-1),typeof vr.chunks[At]>"u"&&(vr.chunks[At]=he(Sn,ur)),typeof vr.chunks[At]>"u")throw new Error("doXHR failed!");return vr.chunks[At]}),(Wr||!_e)&&(q=_e=1,_e=this.getter(0).length,q=_e,W("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=_e,this._chunkSize=q,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var z=new T;Object.defineProperties(z,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var j={isDevice:!1,contents:z}}else var j={isDevice:!1,url:h};var ne=v.createFile(c,f,j,y,F);j.contents?ne.contents=j.contents:j.url&&(ne.contents=null,ne.url=j.url),Object.defineProperties(ne,{usedBytes:{get:function(){return this.contents.length}}});var Ne={},We=Object.keys(ne.stream_ops);We.forEach(Se=>{var be=ne.stream_ops[Se];Ne[Se]=function(){return v.forceLoadFile(ne),be.apply(null,arguments)}});function nt(Se,be,_e,Bt,Ki){var Wr=Se.node.contents;if(Ki>=Wr.length)return 0;var q=Math.min(Wr.length-Ki,Bt);if(Wr.slice)for(var he=0;he<q;he++)be[_e+he]=Wr[Ki+he];else for(var he=0;he<q;he++)be[_e+he]=Wr.get(Ki+he);return q}return Ne.read=(Se,be,_e,Bt,Ki)=>(v.forceLoadFile(ne),nt(Se,be,_e,Bt,Ki)),Ne.mmap=(Se,be,_e,Bt,Ki)=>{v.forceLoadFile(ne);var Wr=SE(be);if(!Wr)throw new v.ErrnoError(48);return nt(Se,we,Wr,be,_e),{ptr:Wr,allocated:!0}},ne.stream_ops=Ne,ne}},lh=(c,f)=>c?lu(Ge,c,f):"",wo={DEFAULT_POLLMASK:5,calculateAt(c,f,h){if(ut.isAbs(f))return f;var y;if(c===-100)y=v.cwd();else{var F=wo.getStreamFromFD(c);y=F.path}if(f.length==0){if(!h)throw new v.ErrnoError(44);return y}return ut.join2(y,f)},doStat(c,f,h){try{var y=c(f)}catch(j){if(j&&j.node&&ut.normalize(f)!==ut.normalize(v.getPath(j.node)))return-54;throw j}He[h>>2]=y.dev,He[h+4>>2]=y.mode,$t[h+8>>2]=y.nlink,He[h+12>>2]=y.uid,He[h+16>>2]=y.gid,He[h+20>>2]=y.rdev,gr=[y.size>>>0,(qe=y.size,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+24>>2]=gr[0],He[h+28>>2]=gr[1],He[h+32>>2]=4096,He[h+36>>2]=y.blocks;var F=y.atime.getTime(),T=y.mtime.getTime(),z=y.ctime.getTime();return gr=[Math.floor(F/1e3)>>>0,(qe=Math.floor(F/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+40>>2]=gr[0],He[h+44>>2]=gr[1],$t[h+48>>2]=F%1e3*1e3,gr=[Math.floor(T/1e3)>>>0,(qe=Math.floor(T/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+56>>2]=gr[0],He[h+60>>2]=gr[1],$t[h+64>>2]=T%1e3*1e3,gr=[Math.floor(z/1e3)>>>0,(qe=Math.floor(z/1e3),+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+72>>2]=gr[0],He[h+76>>2]=gr[1],$t[h+80>>2]=z%1e3*1e3,gr=[y.ino>>>0,(qe=y.ino,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[h+88>>2]=gr[0],He[h+92>>2]=gr[1],0},doMsync(c,f,h,y,F){if(!v.isFile(f.node.mode))throw new v.ErrnoError(43);if(y&2)return 0;var T=Ge.slice(c,c+h);v.msync(f,T,F,h,y)},varargs:void 0,get(){var c=He[+wo.varargs>>2];return wo.varargs+=4,c},getp(){return wo.get()},getStr(c){var f=lh(c);return f},getStreamFromFD(c){var f=v.getStreamChecked(c);return f}},RI=(c,f)=>{var h=0;return Zd().forEach((y,F)=>{var T=f+h;$t[c+F*4>>2]=T,PI(y,T),h+=y.length+1}),0},CI=(c,f)=>{var h=Zd();$t[c>>2]=h.length;var y=0;return h.forEach(F=>y+=F.length+1),$t[f>>2]=y,0};function zI(c){try{var f=wo.getStreamFromFD(c);return v.close(f),0}catch(h){if(typeof v>"u"||h.name!=="ErrnoError")throw h;return h.errno}}var OI=(c,f,h,y)=>{for(var F=0,T=0;T<h;T++){var z=$t[f>>2],j=$t[f+4>>2];f+=8;var ne=v.read(c,we,z,j,y);if(ne<0)return-1;if(F+=ne,ne<j)break;typeof y<"u"&&(y+=ne)}return F};function UI(c,f,h,y){try{var F=wo.getStreamFromFD(c),T=OI(F,f,h);return $t[y>>2]=T,0}catch(z){if(typeof v>"u"||z.name!=="ErrnoError")throw z;return z.errno}}var VI=(c,f)=>f+2097152>>>0<4194305-!!c?(c>>>0)+f*4294967296:NaN;function jI(c,f,h,y,F){var T=VI(f,h);try{if(isNaN(T))return 61;var z=wo.getStreamFromFD(c);return v.llseek(z,T,y),gr=[z.position>>>0,(qe=z.position,+Math.abs(qe)>=1?qe>0?+Math.floor(qe/4294967296)>>>0:~~+Math.ceil((qe-+(~~qe>>>0))/4294967296)>>>0:0)],He[F>>2]=gr[0],He[F+4>>2]=gr[1],z.getdents&&T===0&&y===0&&(z.getdents=null),0}catch(j){if(typeof v>"u"||j.name!=="ErrnoError")throw j;return j.errno}}var KI=(c,f,h,y)=>{for(var F=0,T=0;T<h;T++){var z=$t[f>>2],j=$t[f+4>>2];f+=8;var ne=v.write(c,we,z,j,y);if(ne<0)return-1;F+=ne,typeof y<"u"&&(y+=ne)}return F};function WI(c,f,h,y){try{var F=wo.getStreamFromFD(c),T=KI(F,f,h);return $t[y>>2]=T,0}catch(z){if(typeof v>"u"||z.name!=="ErrnoError")throw z;return z.errno}}var uh=c=>c%4===0&&(c%100!==0||c%400===0),LI=(c,f)=>{for(var h=0,y=0;y<=f;h+=c[y++]);return h},EE=[31,29,31,30,31,30,31,31,30,31,30,31],PE=[31,28,31,30,31,30,31,31,30,31,30,31],ZI=(c,f)=>{for(var h=new Date(c.getTime());f>0;){var y=uh(h.getFullYear()),F=h.getMonth(),T=(y?EE:PE)[F];if(f>T-h.getDate())f-=T-h.getDate()+1,h.setDate(1),F<11?h.setMonth(F+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else return h.setDate(h.getDate()+f),h}return h},$E=(c,f)=>{we.set(c,f)},GI=(c,f,h,y)=>{var F=$t[y+40>>2],T={tm_sec:He[y>>2],tm_min:He[y+4>>2],tm_hour:He[y+8>>2],tm_mday:He[y+12>>2],tm_mon:He[y+16>>2],tm_year:He[y+20>>2],tm_wday:He[y+24>>2],tm_yday:He[y+28>>2],tm_isdst:He[y+32>>2],tm_gmtoff:He[y+36>>2],tm_zone:F?lh(F):""},z=lh(h),j={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ne in j)z=z.replace(new RegExp(ne,"g"),j[ne]);var Ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],We=["January","February","March","April","May","June","July","August","September","October","November","December"];function nt(q,he,vr){for(var At=typeof q=="number"?q.toString():q||"";At.length<he;)At=vr[0]+At;return At}function Se(q,he){return nt(q,he,"0")}function be(q,he){function vr(Sn){return Sn<0?-1:Sn>0?1:0}var At;return(At=vr(q.getFullYear()-he.getFullYear()))===0&&(At=vr(q.getMonth()-he.getMonth()))===0&&(At=vr(q.getDate()-he.getDate())),At}function _e(q){switch(q.getDay()){case 0:return new Date(q.getFullYear()-1,11,29);case 1:return q;case 2:return new Date(q.getFullYear(),0,3);case 3:return new Date(q.getFullYear(),0,2);case 4:return new Date(q.getFullYear(),0,1);case 5:return new Date(q.getFullYear()-1,11,31);case 6:return new Date(q.getFullYear()-1,11,30)}}function Bt(q){var he=ZI(new Date(q.tm_year+1900,0,1),q.tm_yday),vr=new Date(he.getFullYear(),0,4),At=new Date(he.getFullYear()+1,0,4),Sn=_e(vr),ur=_e(At);return be(Sn,he)<=0?be(ur,he)<=0?he.getFullYear()+1:he.getFullYear():he.getFullYear()-1}var Ki={"%a":q=>Ne[q.tm_wday].substring(0,3),"%A":q=>Ne[q.tm_wday],"%b":q=>We[q.tm_mon].substring(0,3),"%B":q=>We[q.tm_mon],"%C":q=>{var he=q.tm_year+1900;return Se(he/100|0,2)},"%d":q=>Se(q.tm_mday,2),"%e":q=>nt(q.tm_mday,2," "),"%g":q=>Bt(q).toString().substring(2),"%G":q=>Bt(q),"%H":q=>Se(q.tm_hour,2),"%I":q=>{var he=q.tm_hour;return he==0?he=12:he>12&&(he-=12),Se(he,2)},"%j":q=>Se(q.tm_mday+LI(uh(q.tm_year+1900)?EE:PE,q.tm_mon-1),3),"%m":q=>Se(q.tm_mon+1,2),"%M":q=>Se(q.tm_min,2),"%n":()=>`
115
+ `,"%p":q=>q.tm_hour>=0&&q.tm_hour<12?"AM":"PM","%S":q=>Se(q.tm_sec,2),"%t":()=>" ","%u":q=>q.tm_wday||7,"%U":q=>{var he=q.tm_yday+7-q.tm_wday;return Se(Math.floor(he/7),2)},"%V":q=>{var he=Math.floor((q.tm_yday+7-(q.tm_wday+6)%7)/7);if((q.tm_wday+371-q.tm_yday-2)%7<=2&&he++,he){if(he==53){var At=(q.tm_wday+371-q.tm_yday)%7;At!=4&&(At!=3||!uh(q.tm_year))&&(he=1)}}else{he=52;var vr=(q.tm_wday+7-q.tm_yday-1)%7;(vr==4||vr==5&&uh(q.tm_year%400-1))&&he++}return Se(he,2)},"%w":q=>q.tm_wday,"%W":q=>{var he=q.tm_yday+7-(q.tm_wday+6)%7;return Se(Math.floor(he/7),2)},"%y":q=>(q.tm_year+1900).toString().substring(2),"%Y":q=>q.tm_year+1900,"%z":q=>{var he=q.tm_gmtoff,vr=he>=0;return he=Math.abs(he)/60,he=he/60*100+he%60,(vr?"+":"-")+("0000"+he).slice(-4)},"%Z":q=>q.tm_zone,"%%":()=>"%"};z=z.replace(/%%/g,"\0\0");for(var ne in Ki)z.includes(ne)&&(z=z.replace(new RegExp(ne,"g"),Ki[ne](T)));z=z.replace(/\0\0/g,"%");var Wr=sh(z,!1);return Wr.length>f?0:($E(Wr,c),Wr.length-1)},HI=(c,f,h,y,F)=>GI(c,f,h,y),kE=c=>{var f=r["_"+c];return f},ME=(c,f,h)=>wb(c,Ge,f,h),qI=c=>{var f=oh(c)+1,h=_b(f);return ME(c,h,f),h},NE=(c,f,h,y,F)=>{var T={string:_e=>{var Bt=0;return _e!=null&&_e!==0&&(Bt=qI(_e)),Bt},array:_e=>{var Bt=_b(_e.length);return $E(_e,Bt),Bt}};function z(_e){return f==="string"?lh(_e):f==="boolean"?!!_e:_e}var j=kE(c),ne=[],Ne=0;if(y)for(var We=0;We<y.length;We++){var nt=T[h[We]];nt?(Ne===0&&(Ne=BE()),ne[We]=nt(y[We])):ne[We]=y[We]}var Se=j.apply(null,ne);function be(_e){return Ne!==0&&TE(Ne),z(_e)}return Se=be(Se),Se},JI=(c,f,h,y)=>{var F=!h||h.every(z=>z==="number"||z==="boolean"),T=f!=="string";return T&&F&&!y?kE(c):function(){return NE(c,f,h,arguments,y)}},IE=function(c,f,h,y){c||(c=this),this.parent=c,this.mount=c.mount,this.mounted=null,this.id=v.nextInode++,this.name=f,this.mode=h,this.node_ops={},this.stream_ops={},this.rdev=y},ch=365,dh=146;Object.defineProperties(IE.prototype,{read:{get:function(){return(this.mode&ch)===ch},set:function(c){c?this.mode|=ch:this.mode&=~ch}},write:{get:function(){return(this.mode&dh)===dh},set:function(c){c?this.mode|=dh:this.mode&=~dh}},isFolder:{get:function(){return v.isDir(this.mode)}},isDevice:{get:function(){return v.isChrdev(this.mode)}}}),v.FSNode=IE,v.createPreloadedFile=TI,v.staticInit();var XI={a:wI,b:bI,k:_I,i:SI,e:RI,f:CI,g:zI,h:UI,j:jI,c:WI,d:HI},pt=vI(),YI=()=>(YI=pt.m)(),QI=r._nam_createInstance=()=>(QI=r._nam_createInstance=pt.n)(),eB=r._nam_destroyInstance=c=>(eB=r._nam_destroyInstance=pt.o)(c),tB=r._nam_getInstanceCount=()=>(tB=r._nam_getInstanceCount=pt.p)(),rB=r._nam_loadModel=(c,f)=>(rB=r._nam_loadModel=pt.q)(c,f),iB=r._nam_unloadModel=c=>(iB=r._nam_unloadModel=pt.r)(c),nB=r._nam_hasModel=c=>(nB=r._nam_hasModel=pt.s)(c),aB=r._nam_process=(c,f,h,y)=>(aB=r._nam_process=pt.t)(c,f,h,y),oB=r._nam_setSampleRate=c=>(oB=r._nam_setSampleRate=pt.u)(c),sB=r._nam_getSampleRate=()=>(sB=r._nam_getSampleRate=pt.v)(),lB=r._nam_setMaxBufferSize=c=>(lB=r._nam_setMaxBufferSize=pt.w)(c),uB=r._nam_getMaxBufferSize=()=>(uB=r._nam_getMaxBufferSize=pt.x)(),cB=r._nam_getModelLoudness=c=>(cB=r._nam_getModelLoudness=pt.y)(c),dB=r._nam_hasModelLoudness=c=>(dB=r._nam_hasModelLoudness=pt.z)(c),pB=r._nam_reset=c=>(pB=r._nam_reset=pt.A)(c),fB=r._free=c=>(fB=r._free=pt.B)(c),mB=r._malloc=c=>(mB=r._malloc=pt.C)(c),hB=()=>(hB=pt.__errno_location)(),BE=()=>(BE=pt.E)(),TE=c=>(TE=pt.F)(c),_b=c=>(_b=pt.G)(c),gB=c=>(gB=pt.__cxa_increment_exception_refcount)(c),DE=c=>(DE=pt.H)(c);r.ccall=NE,r.cwrap=JI,r.stringToUTF8=ME,r.lengthBytesUTF8=oh;var ph;Ld=function c(){ph||RE(),ph||(Ld=c)};function RE(){if(Es>0||(lI(),Es>0))return;function c(){ph||(ph=!0,r.calledRun=!0,!me&&(uI(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),cI()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),c()},1)):c()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return RE(),e.ready})})(),dE=O2;var pE=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},U2=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},pb=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#o=null;#s=null;#c=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#c;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#u(e),host_nam_load:(e,r,n)=>this.#p(e,r,n),host_nam_set_mono:(e,r)=>this.#d(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#v(e,r,n,i,a,o,s),host_nam_reset:e=>this.#f(e),host_nam_release:e=>this.#m(e)}}#u(e){let r=M.toString(new Uint8Array(this.#e.buffer,e,16).slice()),n=this.#n.get(r);if(K(n))return n;let i=this.#a++;return this.#i.set(i,new pE(r)),this.#n.set(r,i),i}#p(e,r,n){let i=this.#i.get(e);if(!K(i))return;if(n===0){i.json=null,this.#x(i);return}let a=new Uint8Array(this.#e.buffer,r,n).slice();K(i.json)&&U2(i.json,a)||(i.json=a,K(this.#s)?this.#h(i):this.#w())}#d(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#s;K(i)&&(r?n.instances[1]>=0&&(i.unloadModel(n.instances[1]),i.destroyInstance(n.instances[1]),n.instances[1]=-1):n.instances[1]<0&&(n.instances[1]=i.createInstance(),K(n.json)&&n.loaded&&(n.loaded=this.#g(n.instances[1],n.json)&&n.loaded)))}#v(e,r,n,i,a,o,s){let u=this.#i.get(e),d=this.#s;if(!K(u)||!K(d)||!u.loaded||u.instances[0]<0)return 0;let m=this.#e.buffer;if(d.process(u.instances[0],new Float32Array(m,r,o),new Float32Array(m,i,o)),s>1){if(u.instances[1]<0)return 0;d.process(u.instances[1],new Float32Array(m,n,o),new Float32Array(m,a,o))}return 1}#f(e){let r=this.#i.get(e),n=this.#s;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#m(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#s;if(K(n))for(let i of r.instances)i>=0&&(n.unloadModel(i),n.destroyInstance(i));this.#i.delete(e),this.#n.get(r.uuid)===e&&this.#n.delete(r.uuid)}#w(){this.#c||this.#l||K(this.#s)||(this.#c=!0,this.#t().then(e=>dE({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#o=e;let r=ih.fromModule(e);r.setSampleRate(this.#r),this.#s=r,this.#c=!1;for(let n of this.#i.values())K(n.json)&&this.#h(n)}).catch(e=>{this.#c=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#h(e){let r=this.#s;!K(r)||!K(e.json)||(e.instances[0]<0&&(e.instances[0]=r.createInstance()),!e.mono&&e.instances[1]<0&&(e.instances[1]=r.createInstance()),e.loaded=this.#g(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#g(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#s;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#g(e,r){let n=this.#o;if(!K(n))return!1;let i=n._malloc(r.length+1);n.HEAPU8.set(r,i),n.HEAPU8[i+r.length]=0;let a=n._nam_loadModel(e,i);return n._free(i),a||console.error("NAM loadModel failed"),!!a}};var Fn={Pan:17,AttackVolEnv:34,DecayVolEnv:36,SustainVolEnv:37,ReleaseVolEnv:38,KeyRange:43,VelRange:44,CoarseTune:51,FineTune:52,SampleId:53,SampleModes:54,OverridingRootKey:58},V2=1330857522,j2=32,XN=24,YN=40,QN=8,K2=({samples:t,presets:e})=>{let r=e.reduce((g,w)=>g+w.length,0),n=j2,i=n+t.length*XN,a=i+r*YN,o=a+e.length*QN,s=t.reduce((g,w)=>g+w.pcm.length,0),u=new ArrayBuffer(o+s*4),d=new DataView(u);d.setUint32(0,V2,!0),d.setUint32(4,1,!0),d.setUint32(8,t.length,!0),d.setUint32(12,r,!0),d.setUint32(16,e.length,!0),d.setUint32(20,n,!0),d.setUint32(24,i,!0),d.setUint32(28,a,!0);let m=o;t.forEach((g,w)=>{let A=n+w*XN;d.setUint32(A,m,!0),d.setUint32(A+4,g.pcm.length,!0),d.setFloat32(A+8,g.sampleRate,!0),d.setUint32(A+12,g.loopStart,!0),d.setUint32(A+16,g.loopEnd,!0),new Float32Array(u,m,g.pcm.length).set(g.pcm),m+=g.pcm.length*4});let x=0;return e.forEach((g,w)=>{let A=a+w*QN;d.setUint32(A,x,!0),d.setUint32(A+4,g.length,!0);for(let _ of g){let C=i+x*YN;d.setUint8(C,_.keyLo),d.setUint8(C+1,_.keyHi),d.setUint8(C+2,_.velLo),d.setUint8(C+3,_.velHi),d.setUint32(C+4,_.sampleIndex,!0),d.setUint32(C+8,_.rootKey,!0),d.setUint32(C+12,_.loopMode,!0),d.setFloat32(C+16,_.pan,!0),d.setFloat32(C+20,_.attack,!0),d.setFloat32(C+24,_.decay,!0),d.setFloat32(C+28,_.sustain,!0),d.setFloat32(C+32,_.release,!0),x++}}),u},mb=(t,e)=>t.generators[e]?.value,Wd=(t,e,r)=>mb(e,r)??mb(t,r),fE=t=>t!==void 0?Math.pow(2,t/1200):.005,fb=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},eI=t=>{let e=[],r=new Map,n=a=>{let o=r.get(a);if(o!==void 0)return o;let s=new Float32Array(a.data.length);for(let d=0;d<s.length;d++)s[d]=a.data[d]/32768;let u=e.length;return e.push({pcm:s,sampleRate:a.header.sampleRate,loopStart:a.header.startLoop,loopEnd:a.header.endLoop}),r.set(a,u),u},i=t.presets.map(a=>{let o=[];for(let s of a.zones){let u=fb(s,Fn.KeyRange),d=fb(s,Fn.VelRange);for(let m of s.instrument.zones){let x=fb(m,Fn.KeyRange),g=fb(m,Fn.VelRange),w=Math.max(u.lo,x.lo),A=Math.min(u.hi,x.hi),_=Math.max(d.lo,g.lo),C=Math.min(d.hi,g.hi);if(w>A||_>C)continue;let W=m.sample??t.samples[mb(m,Fn.SampleId)??0];if(W===void 0)continue;let U=n(W),ee=mb(m,Fn.OverridingRootKey)??W.header.originalPitch??60,re=Wd(s,m,Fn.SampleModes)??0,me=Wd(s,m,Fn.SustainVolEnv);o.push({keyLo:w,keyHi:A,velLo:_,velHi:C,sampleIndex:U,rootKey:ee,loopMode:re===1||re===3?1:0,pan:(Wd(s,m,Fn.Pan)??0)/1e3,attack:fE(Wd(s,m,Fn.AttackVolEnv)),decay:fE(Wd(s,m,Fn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:fE(Wd(s,m,Fn.ReleaseVolEnv))})}}return o});return K2({samples:e,presets:i})};var W2=512,tI=(t,e,r)=>{let n=Ct(()=>jN(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},rI=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:W2,element:"anyfunc"}),a=K(globalThis.performance)?()=>performance.now()*1e3:()=>Date.now()*1e3,o=new WebAssembly.Instance(t.engineModule,{env:{memory:e,__indirect_function_table:i,host_perf_now:a}}).exports;o.init(r);let s=new cb(e,o,r,(m,x)=>n.deviceMessage(m,x)),u=new pb(e,()=>n.fetchNamWasm(),r),d={...s.imports(),...u.imports()};return t.deviceModules.forEach((m,x)=>WN(o,e,i,m,t.deviceBoxTypes[x],r,d)),t.composites.forEach(m=>LN(o,e,m)),o},iI=(t,e,r,n,i,a)=>{let o=s=>{let u=s.catch(a);n.add(u),u.finally(()=>n.delete(u))};for(;;){let s=t.input_reserve(16),u=t.sample_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchAudio(d).then(m=>{let{numberOfFrames:x,numberOfChannels:g,sampleRate:w,frames:A}=m,_=x*Float32Array.BYTES_PER_ELEMENT,C=t.sample_allocate(u,g*_);if(C!==0){for(let W=0;W<g;W++)new Float32Array(e.buffer,C+W*_,x).set(A[W]);t.sample_set_ready(u,x,g,w)}},m=>{t.sample_allocate(u,4),t.sample_set_ready(u,1,1,i),r.log(`sample load failed: ${m}`)}))}for(;;){let s=t.input_reserve(16),u=t.soundfont_take_request(s);if(u<0)break;let d=new Uint8Array(e.buffer,s,16).slice();o(r.fetchSoundfont(d).then(m=>{let x=new Uint8Array(eI(m)),g=t.soundfont_allocate(u,x.byteLength);g!==0&&(new Uint8Array(e.buffer,g,x.byteLength).set(x),t.soundfont_set_ready(u))},m=>r.log(`soundfont load failed: ${m}`)))}};var nI="engine-wasm-processor",aI="engine-sync-bytes",oI="engine-frozen-audio";var mE=class extends AudioWorkletProcessor{#e=new X;#t;#r;#i;#n=new Float32Array(cy);#a;#o;#s;#c;#l;#u=[];#p;#d;#v=new ob;#f=new Set;#m=-1;#w=[];#h=!1;#x=!0;#g=!1;#_=!1;#A=!1;#S=0;#F=0;constructor({processorOptions:e}){super();let{syncStreamBuffer:r,controlFlagsBuffer:n,hrClockBuffer:i,variant:a}=e,{engineModule:o,deviceModules:s,deviceBoxTypes:u,composites:d,memory:m}=a;this.#t=m;let x=JE.for(this.port);this.#a=En.sender(x.channel("engine-to-client"),_=>new class{log(C){_.dispatchAndForget(this.log,C)}error(C){_.dispatchAndForget(this.error,C)}deviceMessage(C,W){_.dispatchAndForget(this.deviceMessage,C,W)}fetchAudio(C){return _.dispatchAndReturn(this.fetchAudio,C)}fetchSoundfont(C){return _.dispatchAndReturn(this.fetchSoundfont,C)}fetchNamWasm(){return _.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(C){_.dispatchAndForget(this.notifyClipSequenceChanges,C)}switchMarkerState(C){_.dispatchAndForget(this.switchMarkerState,C)}ready(){_.dispatchAndForget(this.ready)}});let g=rI({engineModule:o,deviceModules:s,deviceBoxTypes:u,composites:d},m,sampleRate,this.#a);this.#r=g,this.#c=new Int32Array(n),this.#i=new rb(i),this.#s=Fh.writer(l$(),r,_=>{let C=new DataView(this.#t.buffer,g.engine_state_ptr(),g.engine_state_len());_.position=C.getFloat32(0),_.bpm=C.getFloat32(4),_.playbackTimestamp=this.#F,_.countInBeatsRemaining=C.getFloat32(12),_.isPlaying=C.getUint8(16)===1,_.isCountingIn=C.getUint8(17)===1,_.isRecording=C.getUint8(18)===1,this.#A&&(_.perfBuffer.set(this.#n),_.perfIndex=this.#S)}),this.#l=this.#e.own(Oh.create(x,"engine-live-data")),this.#p=this.#e.own(new ib(this.#l,dd.PEAKS)),this.#d=new Eh;let w=new Float32Array(this.#d.numBins()),A=new Float32Array(this.#d.numBins());this.#o=new ap(x.channel("engine-preferences"),EN.parse({})),this.#e.ownAll(this.#l.broadcastFloats(dd.SPECTRUM,w,_=>{_&&(w.set(this.#d.bins()),this.#d.decay=!0)}),this.#l.broadcastFloats(dd.WAVEFORM,A,_=>{_&&A.set(this.#d.waveform())}),this.#o.catchupAndSubscribe(_=>g.set_metronome_enabled(_?1:0),"metronome","enabled"),this.#o.catchupAndSubscribe(_=>g.set_metronome_gain(_),"metronome","gain"),this.#o.catchupAndSubscribe(_=>g.set_metronome_beat_sub_division(_),"metronome","beatSubDivision"),this.#o.catchupAndSubscribe(_=>g.set_metronome_monophonic(_?1:0),"metronome","monophonic"),this.#o.catchupAndSubscribe(_=>g.set_allow_takes(_?1:0),"recording","allowTakes"),this.#o.catchupAndSubscribe(_=>g.set_pause_on_loop_disabled(_?1:0),"playback","pauseOnLoopDisabled"),this.#o.catchupAndSubscribe(_=>g.set_truncate_notes_at_region_end(_?1:0),"playback","truncateNotesAtRegionEnd"),this.#o.catchupAndSubscribe(_=>this.#A=_,"debug","dspLoadMeasurement"),En.executor(x.channel(aI),{applyUpdates:_=>this.#y(()=>this.#B(_)),checksum:_=>this.#E(_)}),En.executor(x.channel(oI),{frozenAllocate:(_,C)=>{let{status:W,value:U,error:ee}=Ct(()=>g.frozen_allocate(_,C));return W==="failure"?(this.#b(ee),Promise.reject(ee)):Promise.resolve(U)},frozenAttach:(_,C,W,U)=>this.#y(()=>{let ee=g.input_reserve(16);new Uint8Array(this.#t.buffer,ee,16).set(_),g.set_frozen_audio(C,W,U)}),frozenClear:_=>this.#y(()=>{let C=g.input_reserve(16);new Uint8Array(this.#t.buffer,C,16).set(_),g.clear_frozen_audio()})}),En.executor(x.channel("engine-commands"),{play:()=>this.#y(()=>this.#N()),stop:_=>this.#y(()=>this.#I(_)),setPosition:_=>this.#y(()=>{this.#F=_,g.set_position(_)}),prepareRecordingState:_=>this.#y(()=>{this.#_=!0,g.prepare_recording_state(_?1:0,this.#o.settings.recording.countInBars)}),stopRecording:()=>this.#y(()=>{this.#_=!1,g.stop_recording()}),queryLoadingComplete:()=>Promise.all(this.#f).then(()=>!0),panic:()=>{this.#g=!0},loadClickSound:(_,C)=>this.#y(()=>{let{frames:W,numberOfFrames:U,numberOfChannels:ee,sampleRate:re}=C,me=Math.min(ee,2),$e=g.click_allocate(U,me);for(let Q=0;Q<me;Q++)new Float32Array(this.#t.buffer,$e+Q*U*4,U).set(W[Q]);g.set_click_sound(_,U,me,re)}),setFrozenAudio:(_,C)=>this.#y(()=>{if(C===null){let we=g.input_reserve(16);new Uint8Array(this.#t.buffer,we,16).set(_),g.clear_frozen_audio();return}let{frames:W,numberOfFrames:U,numberOfChannels:ee,sampleRate:re}=C,me=Math.min(ee,2),$e=g.frozen_allocate(U,me);if($e===0)return;for(let we=0;we<me;we++)new Float32Array(this.#t.buffer,$e+we*U*4,U).set(W[we]);let Q=g.input_reserve(16);new Uint8Array(this.#t.buffer,Q,16).set(_),g.set_frozen_audio(U,me,re)}),updateMonitoringMap:_=>this.#y(()=>{this.#w=_;let C=g.input_reserve(_.length*24),W=new DataView(this.#t.buffer,C,_.length*24);_.forEach(({uuid:U,channels:ee},re)=>{new Uint8Array(this.#t.buffer,C+re*24,16).set(U),W.setInt32(re*24+16,ee[0],!0),W.setInt32(re*24+20,ee.length>1?ee[1]:-1,!0)}),g.set_monitoring_map(_.length)}),noteSignal:_=>this.#y(()=>this.#M(_)),ignoreNoteRegion:_=>this.#y(()=>{let C=g.input_reserve(16);new Uint8Array(this.#t.buffer,C,16).set(_),g.ignore_note_region()}),scheduleClipPlay:_=>this.#y(()=>_.forEach(C=>{let W=g.input_reserve(16);new Uint8Array(this.#t.buffer,W,16).set(C),g.schedule_clip_play()})),scheduleClipStop:_=>this.#y(()=>_.forEach(C=>{let W=g.input_reserve(16);new Uint8Array(this.#t.buffer,W,16).set(C),g.schedule_clip_stop()})),setupMIDI:(_,C)=>this.#v.connect(_,C),terminate:()=>{this.#x=!1,this.#u.forEach(_=>_.terminate()),this.#u.length=0,this.#e.terminate()}})),this.#a.ready()}process(e,r){if(!this.#x)return!1;if(Atomics.load(this.#c,0)===1)return this.#s.tryWrite(),!0;let{status:n,error:i}=Ct(()=>this.#P(e,r));return n==="failure"?(this.#b(i),!1):!0}#b(e){console.debug(e),this.#x=!1,this.#a.error(tI(this.#r,this.#t,e)),this.#e.terminate()}#y(e){let{status:r,error:n}=Ct(e);r==="failure"&&this.#b(n)}#E(e){let r=new Int8Array(this.#t.buffer,this.#r.checksum_ptr(),32);if(e.length===r.length&&e.every((i,a)=>i===r[a]))return Promise.resolve();let n=new Error("box-graph checksum mismatch: the engine mirror diverged from the source graph");return this.#a.error(n),Promise.reject(n)}#P(e,[r,n]){if(this.#g)return V("Manual Panic");let i=this.#A?this.#i.start():0,a=this.#r,o=this.#w;if(o.length>0){let g=e[0]??[],w=new Float32Array(this.#t.buffer,a.monitor_input_ptr(),8*na);w.fill(0);for(let{channels:A}of o)for(let _ of A){let C=g[_];C!==void 0&&_<8&&w.set(C,_*na)}}if(a.render(),o.length>0&&n!==void 0){let g=new Float32Array(this.#t.buffer,a.monitor_output_ptr(),8*na);for(let{channels:w}of o)for(let A of w){let _=n[A];_!==void 0&&A<8&&_.set(g.subarray(A*na,(A+1)*na))}}let s=r[0].length,u=this.#t.buffer,d=a.output_ptr(),m=new Float32Array(u,d,s),x=new Float32Array(u,d+s*Float32Array.BYTES_PER_ELEMENT,s);r[0].set(m),r.length>1&&r[1].set(x),this.#p.process(r[0],r[1]??r[0]),this.#d.process(r[0],r[1]??r[0],0,na),this.#T(),this.#A&&(this.#i.end(),this.#n[this.#S]=i,this.#S=(this.#S+1)%cy),this.#l.flush(),this.#s.tryWrite(),this.#$(),this.#k(),this.#v.drain(a,this.#t)}#$(){let e=this.#r,r=e.clip_changes_count();if(r===0)return;let n=e.input_reserve(r*20),i=e.clip_changes_take(n),a=new DataView(this.#t.buffer,n,i*20),o=[],s=[],u=[];for(let d=0;d<i;d++){let m=new Uint8Array(this.#t.buffer,n+d*20,16).slice(),x=a.getUint32(d*20+16,!0);x===0?o.push(m):x===1?s.push(m):u.push(m)}this.#a.notifyClipSequenceChanges({started:o,stopped:s,obsolete:u})}#k(){let e=this.#r,r=e.marker_changes_count();if(r===0)return;let n=e.input_reserve(r*24),i=e.marker_changes_take(n),a=new DataView(this.#t.buffer,n,i*24);for(let o=0;o<i;o++)if(a.getUint32(o*24+20,!0)===1){let u=new Uint8Array(this.#t.buffer,n+o*24,16).slice();this.#a.switchMarkerState([u,a.getUint32(o*24+16,!0)])}else this.#a.switchMarkerState(null)}#M(e){let r=this.#r.input_reserve(16);new Uint8Array(this.#t.buffer,r,16).set(e.uuid),ho.isOn(e)?this.#r.note_signal_on(e.pitch,e.velocity):ho.isOff(e)?this.#r.note_signal_off(e.pitch):ho.isAudition(e)&&this.#r.note_signal_audition(e.pitch,e.duration,e.velocity)}#N(){this.#o.settings.playback.timestampEnabled&&this.#r.set_position(this.#F),this.#_=!0,this.#r.play()}#I(e){let r=new DataView(this.#t.buffer,this.#r.engine_state_ptr(),this.#r.engine_state_len()),n=this.#_||r.getUint8(16)===1,i=r.getUint8(17)===1||r.getUint8(18)===1;this.#_=!1,this.#r.pause(),i&&this.#r.set_position(this.#o.settings.playback.timestampEnabled?this.#F:0),(e||!n)&&(this.#r.stop(),this.#F=0,this.#p.clear())}#B(e){let r=new Uint8Array(e),n=this.#r.input_reserve(r.length);new Uint8Array(this.#t.buffer,n,r.length).set(r);let i=this.#r.apply_updates(r.length);if(i!==0){this.#a.error(new Error(`apply_updates rejected a transaction (code ${i})`));return}!this.#h&&this.#r.bind()===0&&(this.#h=!0),iI(this.#r,this.#t,this.#a,this.#f,sampleRate,a=>this.#b(a))}#T(){let e=this.#r.broadcast_generation();if(e===this.#m)return;this.#m=e,this.#u.forEach(n=>n.terminate()),this.#u.length=0;let r=this.#r.broadcast_count();for(let n=0;n<r;n++){let i=this.#r.input_reserve(48);if(this.#r.broadcast_entry(n,i)===0)continue;let a=new DataView(this.#t.buffer,i,48),o=new Uint8Array(this.#t.buffer,i,16).slice(),s=a.getUint32(16,!0),u=a.getUint32(20,!0),d=a.getUint32(24,!0),m=a.getUint32(28,!0),x=[];for(let w=0;w<m;w++)x.push(a.getUint16(32+w*2,!0));let g=Oe.compose(o,...x);if(s===0){let w=new Float32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastFloat(g,()=>w[0]))}else if(s===2){let w=new Int32Array(this.#t.buffer,u,d),A=new Int32Array(this.#t.buffer,u+4,d-1);this.#u.push(this.#l.broadcastIntegers(g,A,()=>{A[Math.min(w[0],A.length-1)]=0,w[0]=0}))}else if(s===3){let w=new Int32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastIntegers(g,w,()=>{}))}else{let w=new Float32Array(this.#t.buffer,u,d);this.#u.push(this.#l.broadcastFloats(g,w,A=>this.#r.broadcast_set_active(n,A?1:0)))}}}};registerProcessor(nI,mE);
116
116
  /*! Bundled license information:
117
117
 
118
118
  @opendaw/nam-wasm/dist/index.js: