UNPKG

@oletizi/audio-tools

Version:

Monorepo for hardware sampler utilities and format parsers

1 lines 56.2 kB
(()=>{var a={};a.id=618,a.ids=[618],a.modules={846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1430:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>at,patchFetch:()=>as,routeModule:()=>ao,serverHooks:()=>ar,workAsyncStorage:()=>ap,workUnitAsyncStorage:()=>aq});var d,e={};c.r(e),c.d(e,{POST:()=>an});var f=c(6617),g=c(5190),h=c(3677),i=c(205),j=c(5319),k=c(2642),l=c(5357),m=c(1811),n=c(1605),o=c(4614),p=c(5672),q=c(9138),r=c(7808),s=c(5769),t=c(6439),u=c(4135),v=c(6152),w=c(9748),x=c(9646),y=c(6459),z=c(5529),A=(a,b,c)=>new Promise((d,e)=>{var f=a=>{try{h(c.next(a))}catch(a){e(a)}},g=a=>{try{h(c.throw(a))}catch(a){e(a)}},h=a=>a.done?d(a.value):Promise.resolve(a.value).then(f,g);h((c=c.apply(a,b)).next())}),B=()=>{var a=(()=>{var a=Object.defineProperty,b=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,d=Object.prototype.hasOwnProperty,e={};((b,c)=>{for(var d in c)a(b,d,{get:c[d],enumerable:!0})})(e,{zeptomatch:()=>ad});var f=a=>Array.isArray(a),g=(a,b)=>f(a)?h(a,b):"string"==typeof a?j(a,b):i(a,b),h=(a,b)=>{let c={};for(let b of a){if(1!==b.length)throw Error(`Invalid character: "${b}"`);c[b.charCodeAt(0)]=!0}return a=>{let d=a.index,e=a.input;for(;a.index<e.length&&e.charCodeAt(a.index)in c;)a.index+=1;let f=a.index;if(f>d){if(void 0!==b&&!a.options.silent){let c=a.input.slice(d,f),g="function"==typeof b?b(c,e,String(d)):b;void 0===g||a.output.push(g)}a.indexMax=Math.max(a.indexMax,a.index)}return!0}},i=(a,b)=>{let c=new RegExp(a.source,a.flags.replace(/y|$/,"y"));return q(a=>{c.lastIndex=a.index;let d=c.exec(a.input);if(!d)return!1;if(void 0!==b&&!a.options.silent){let c="function"==typeof b?b(...d,a.input,String(a.index)):b;void 0===c||a.output.push(c)}return a.index+=d[0].length,a.indexMax=Math.max(a.indexMax,a.index),!0})},j=(a,b)=>c=>{if(!c.input.startsWith(a,c.index))return!1;if(void 0!==b&&!c.options.silent){let d="function"==typeof b?b(a,c.input,String(c.index)):b;void 0===d||c.output.push(d)}return c.index+=a.length,c.indexMax=Math.max(c.indexMax,c.index),!0},k=(a,b,c,d)=>{let e=s(a);return q(p(o(a=>{let d=0;for(;d<c;){let b=a.index;if(!e(a)||(d+=1,a.index===b))break}return d>=b})))},l=(a,b)=>k(a,0,1/0),m=(a,b)=>{let c=a.map(s);return q(p(o(a=>{for(let b=0,d=c.length;b<d;b++)if(!c[b](a))return!1;return!0})))},n=(a,b)=>{let c=a.map(s);return q(p(a=>{for(let b=0,d=c.length;b<d;b++)if(c[b](a))return!0;return!1}))},o=(a,b=!1)=>{let c=s(a);return a=>{let d=a.index,e=a.output.length,f=c(a);return(!f||b)&&(a.index=d,a.output.length!==e&&(a.output.length=e)),f}},p=(a,b)=>s(a),q=(()=>{let a=0;return b=>{let c=s(b),d=a+=1;return a=>{var b,e;if(!1===a.options.memoization)return c(a);let f=a.index,g=(e=a.cache)[d]||(e[d]=new Map),h=g.get(f);if(!1===h)return!1;if("number"==typeof h)return a.index=h,!0;if(h)return a.index=h.index,(null==(b=h.output)?void 0:b.length)&&a.output.push(...h.output),!0;{let b=a.output.length;if(!c(a))return g.set(f,!1),!1;{let c=a.index,d=a.output.length;if(d>b){let e=a.output.slice(b,d);g.set(f,{index:c,output:e})}else g.set(f,c);return!0}}}}})(),r=a=>{let b;return c=>(b||(b=s(a())),b(c))},s=(a=>{let b=new Map;return c=>{let d=b.get(c);if(d)return d;let e=a(c);return b.set(c,e),e}})(a=>{if("function"==typeof a)return 0===a.length?r(a):a;if("string"==typeof a||a instanceof RegExp)return g(a);if(f(a))return m(a);if((a=>"object"==typeof a&&null!==a)(a))return n(Object.values(a));throw Error("Invalid rule")}),t="abcdefghijklmnopqrstuvwxyz",u=a=>{let b="";for(;a>0;)b=t[(a-1)%26]+b,a=Math.floor((a-1)/26);return b},v=a=>{let b=0;for(let c=0,d=a.length;c<d;c++)b=26*b+t.indexOf(a[c])+1;return b},w=(a,b)=>{if(b<a)return w(b,a);let c=[];for(;a<=b;)c.push(a++);return c},x=(a,b)=>w(v(a),v(b)).map(u),y=a=>a,z=a=>A(b=>((a,b,c={})=>{let d={cache:{},input:a,index:0,indexMax:0,options:c,output:[]};if(s(b)(d)&&d.index===a.length)return d.output;throw Error(`Failed to parse at index ${d.indexMax}`)})(b,a,{memoization:!1}).join("")),A=a=>{let b={};return c=>{var d;return null!=(d=b[c])?d:b[c]=a(c)}},B=g(/^\*\*\/\*$/,".*"),C=g(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(a,b,c)=>`.*${b?"":"(?:^|/)"}${c.replaceAll(".","\\.")}`),D=g(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(a,b,c,d)=>`.*${b?"":"(?:^|/)"}${c.replaceAll(".","\\.")}(?:${d.replaceAll(",","|").replaceAll(".","\\.")})`),E=g(/\\./,y),F=g(/[$.*+?^(){}[\]\|]/,a=>`\\${a}`),G=g(/./,y),H=n([g(/^(?:!!)*!(.*)$/,(a,b)=>`(?!^${$(b)}$).*?`),g(/^(!!)+/,"")]),I=n([g(/\/(\*\*\/)+/,"(?:/.+/|/)"),g(/^(\*\*\/)+/,"(?:^|.*/)"),g(/\/(\*\*)$/,"(?:/.*|$)"),g(/\*\*/,".*")]),J=n([g(/\*\/(?!\*\*\/)/,"[^/]*/"),g(/\*/,"[^/]*")]),K=g("?","[^/]"),L=g("[",y),M=g("]",y),N=g(/[!^]/,"^/"),O=g(/[a-z]-[a-z]|[0-9]-[0-9]/i,y),P=n([E,g(/[$.*+?^(){}[\|]/,a=>`\\${a}`),O,g(/[^\]]/,y)]),Q=m([L,k(N,0,1),l(P),M]),R=g("{","(?:"),S=g("}",")"),T=m([R,n([g(/(\d+)\.\.(\d+)/,(a,b,c)=>{let d,e,f;return(d=+b,e=+c,f=Math.min(b.length,c.length),w(d,e).map(a=>String(a).padStart(f,"0"))).join("|")}),g(/([a-z]+)\.\.([a-z]+)/,(a,b,c)=>x(b,c).join("|")),g(/([A-Z]+)\.\.([A-Z]+)/,(a,b,c)=>x(b.toLowerCase(),c.toLowerCase()).join("|").toUpperCase())]),S]),U=g("{","(?:"),V=g("}",")"),W=g(",","|"),X=g(/[$.*+?^(){[\]\|]/,a=>`\\${a}`),Y=g(/[^}]/,y),Z=m([U,l(n([I,J,K,Q,T,r(()=>Z),E,X,W,Y])),V]),$=z(l(n([B,C,D,H,I,J,K,Q,T,Z,E,F,G]))),_=g(/\\./,y),aa=g(/./,y),ab=z(l(n([_,g(/\*\*\*+/,"*"),g(/([^/{[(!])\*\*/,(a,b)=>`${b}*`),g(/(^|.)\*\*(?=[^*/)\]}])/,(a,b)=>`${b}*`),aa]))),ac=(a,b)=>{let c=Array.isArray(a)?a:[a];if(!c.length)return!1;let d=c.map(ac.compile),e=c.every(a=>/(\/(?:\*\*)?|\[\/\])$/.test(a)),f=b.replace(/[\\\/]+/g,"/").replace(/\/$/,e?"/":"");return d.some(a=>a.test(f))};ac.compile=a=>RegExp(`^${$(ab(a))}$`,"s");var ad=ac;return((e,f,g,h)=>{if("object"==typeof f||"function"==typeof f)for(let g of c(f))d.call(e,g)||void 0===g||a(e,g,{get:()=>f[g],enumerable:!(h=b(f,g))||h.enumerable});return e})(a({},"__esModule",{value:!0}),e)})();return a.default||a},C=/^[A-Za-z]:\//;function D(a=""){return a?a.replace(/\\/g,"/").replace(C,a=>a.toUpperCase()):a}var E=/^[/\\]{2}/,F=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,G=/^[A-Za-z]:$/,H=/^\/([A-Za-z]:)?$/,I=/.(\.[^./]+|\.)$/,J=/^[/\\]|^[a-zA-Z]:[/\\]/,K=function(a){if(0===a.length)return".";let b=(a=D(a)).match(E),c=N(a),d="/"===a[a.length-1];return 0===(a=M(a,!c)).length?c?"/":d?"./":".":(d&&(a+="/"),G.test(a)&&(a+="/"),b)?c?`//${a}`:`//./${a}`:c&&!N(a)?`/${a}`:a},L=function(...a){a=a.map(a=>D(a));let b="",c=!1;for(let d=a.length-1;d>=-1&&!c;d--){let e=d>=0?a[d]:"undefined"!=typeof process&&"function"==typeof process.cwd?process.cwd().replace(/\\/g,"/"):"/";e&&0!==e.length&&(b=`${e}/${b}`,c=N(e))}return(b=M(b,!c),c&&!N(b))?`/${b}`:b.length>0?b:"."};function M(a,b){let c="",d=0,e=-1,f=0,g=null;for(let h=0;h<=a.length;++h){if(h<a.length)g=a[h];else if("/"===g)break;else g="/";if("/"===g){if(e===h-1||1===f);else if(2===f){if(c.length<2||2!==d||"."!==c[c.length-1]||"."!==c[c.length-2]){if(c.length>2){let a=c.lastIndexOf("/");-1===a?(c="",d=0):d=(c=c.slice(0,a)).length-1-c.lastIndexOf("/"),e=h,f=0;continue}else if(c.length>0){c="",d=0,e=h,f=0;continue}}b&&(c+=c.length>0?"/..":"..",d=2)}else c.length>0?c+=`/${a.slice(e+1,h)}`:c=a.slice(e+1,h),d=h-e-1;e=h,f=0}else"."===g&&-1!==f?++f:f=-1}return c}var N=function(a){return F.test(a)},O=function(a){if(".."===a)return"";let b=I.exec(D(a));return b&&b[1]||""},P=function(a){let b=D(a).replace(/\/$/,"").split("/").slice(0,-1);return 1===b.length&&G.test(b[0])&&(b[0]+="/"),b.join("/")||(N(a)?"/":".")},Q=function(a,b){let c=D(a).split("/"),d="";for(let a=c.length-1;a>=0;a--){let b=c[a];if(b){d=b;break}}return b&&d.endsWith(b)?d.slice(0,-b.length):d},R={__proto__:null,basename:Q,dirname:P,extname:O,format:function(a){var b,c;let d=a.ext?a.ext.startsWith(".")?a.ext:`.${a.ext}`:"",e=[a.root,a.dir,null!=(c=a.base)?c:(null!=(b=a.name)?b:"")+d].filter(Boolean);return D(a.root?L(...e):e.join("/"))},isAbsolute:N,join:function(...a){let b="";for(let c of a)if(c)if(b.length>0){let a="/"===b[b.length-1],d="/"===c[0];a&&d?b+=c.slice(1):b+=a||d?c:`/${c}`}else b+=c;return K(b)},matchesGlob:(a,b)=>{var c;return c=K(a),d||(d=B(),B=null),d(b,c)},normalize:K,normalizeString:M,parse:function(a){var b,c;let d=(null==(c=null==(b=J.exec(a))?void 0:b[0])?void 0:c.replace(/\\/g,"/"))||"",e=Q(a),f=O(e);return{root:d,dir:P(a),base:e,ext:f,name:e.slice(0,e.length-f.length)}},relative:function(a,b){let c=L(a).replace(H,"$1").split("/"),d=L(b).replace(H,"$1").split("/");if(":"===d[0][1]&&":"===c[0][1]&&c[0]!==d[0])return d.join("/");for(let a of[...c]){if(d[0]!==a)break;c.shift(),d.shift()}return[...c.map(()=>".."),...d].join("/")},resolve:L,sep:"/",toNamespacedPath:function(a){return D(a)}},S=(()=>{var a;return(null==(a=globalThis.process)?void 0:a.platform)==="win32"?";":":"})(),T={posix:void 0,win32:void 0},U=(a=S)=>new Proxy(R,{get:(b,c)=>"delimiter"===c?a:"posix"===c?V:"win32"===c?W:T[c]||R[c]}),V=U(":"),W=U(";"),X=["0","1","2","3","4","5","6","7","8","9"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","#","+","-","."];function Y(a){let b="";for(let c of a)b+=c<X.length?X[c]:"?";return b}function Z(a){a=a.toUpperCase();let b=[];for(let c=0;c<12;c++){let d=10;if(a.length>c){let b=a.charAt(c);for(let a=0;a<X.length;a++)X[a]===b&&(d=a)}b.push(d)}return b}function $(a,b){return b.value=(0,y.GW)(a[b.offset],a[b.offset+1]),b.offset+=2,b}function _(a,b,c){let d,e=(0,y.Zv)(!1,"parseProgramHeader"),f={value:0,offset:2*b};function g(){return f.offset/2}e.log("KGRP1: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.KGRP1=(0,y.IV)(d),e.log("PRNAME: offset: "+g()),c.PRNAMELabel="Program Name",c.PRNAME="";for(let b=0;b<12;b++)$(a,f),c.PRNAME+=Y([f.value]),e.log("PRNAME at "+b+": "+c.PRNAME);e.log("PRGNUM: offset: "+g()),c.PRGNUMLabel="Program Number",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PRGNUM=(0,y.IV)(d),e.log("PMCHAN: offset: "+g()),c.PMCHANLabel="MIDI Channel",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PMCHAN=(0,y.IV)(d),e.log("POLYPH: offset: "+g()),c.POLYPHLabel="Polyphony",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.POLYPH=(0,y.IV)(d),e.log("PRIORT: offset: "+g()),c.PRIORTLabel="Voice Priority",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PRIORT=(0,y.IV)(d),e.log("PLAYLO: offset: "+g()),c.PLAYLOLabel="Low Note",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PLAYLO=(0,y.IV)(d),e.log("PLAYHI: offset: "+g()),c.PLAYHILabel="High Note",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PLAYHI=(0,y.IV)(d),e.log("OSHIFT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.OSHIFT=(0,y.IV)(d),e.log("OUTPUT: offset: "+g()),c.OUTPUTLabel="Output",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.OUTPUT=(0,y.IV)(d),e.log("STEREO: offset: "+g()),c.STEREOLabel="Stereo Output Lvl",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.STEREO=(0,y.IV)(d),e.log("PANPOS: offset: "+g()),c.PANPOSLabel="Pan",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PANPOS=(0,y.IV)(d),e.log("PRLOUD: offset: "+g()),c.PRLOUDLabel="Program Level",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PRLOUD=(0,y.IV)(d),e.log("V_LOUD: offset: "+g()),c.V_LOUDLabel="Vel -> Amp",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_LOUD=(0,y.IV)(d),e.log("K_LOUD: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_LOUD=(0,y.IV)(d),e.log("P_LOUD: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.P_LOUD=(0,y.IV)(d),e.log("PANRAT: offset: "+g()),c.PANRATLabel="Pan (LFO2) Rate",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PANRAT=(0,y.IV)(d),e.log("PANDEP: offset: "+g()),c.PANDEPLabel="Pan (LFO2) Depth",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PANDEP=(0,y.IV)(d),e.log("PANDEL: offset: "+g()),c.PANDELLabel="Pan (LFO2) Delay",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PANDEL=(0,y.IV)(d),e.log("K_PANP: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_PANP=(0,y.IV)(d),e.log("LFORAT: offset: "+g()),c.LFORATLabel="LFO1 Rate",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFORAT=(0,y.IV)(d),e.log("LFODEP: offset: "+g()),c.LFODEPLabel="LFO1 Depth",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFODEP=(0,y.IV)(d),e.log("LFODEL: offset: "+g()),c.LFODELLabel="LFO1 Delay",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFODEL=(0,y.IV)(d),e.log("MWLDEP: offset: "+g()),c.MWLDEPLabel="Modwheel -> LFO1",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MWLDEP=(0,y.IV)(d),e.log("PRSDEP: offset: "+g()),c.PRSDEPLabel="After -> LFO1",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PRSDEP=(0,y.IV)(d),e.log("VELDEP: offset: "+g()),c.VELDEPLabel="Vel -> LFO1",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VELDEP=(0,y.IV)(d),e.log("B_PTCH: offset: "+g()),c.B_PTCHLabel="Bend Up -> Pitch",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.B_PTCH=(0,y.IV)(d),e.log("P_PTCH: offset: "+g()),c.P_PTCHLabel="Pressure -> Pitch",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.P_PTCH=(0,y.IV)(d),e.log("KXFADE: offset: "+g()),c.KXFADELabel="Crossfade [on | off]",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KXFADE=(0,y.IV)(d),e.log("GROUPS: offset: "+g()),c.GROUPSLabel="Keygroup Count",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.GROUPS=(0,y.IV)(d),e.log("TPNUM: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.TPNUM=(0,y.IV)(d),e.log("TEMPER: offset: "+g()),c.TEMPERLabel="Key",c.TEMPER="";for(let b=0;b<12;b++)$(a,f),c.TEMPER+=Y([f.value]),e.log("TEMPER at "+b+": "+c.TEMPER);e.log("ECHOUT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ECHOUT=(0,y.IV)(d),e.log("MW_PAN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MW_PAN=(0,y.IV)(d),e.log("COHERE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.COHERE=(0,y.IV)(d),e.log("DESYNC: offset: "+g()),c.DESYNCLabel="LFO desync [on | off]",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.DESYNC=(0,y.IV)(d),e.log("PLAW: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PLAW=(0,y.IV)(d),e.log("VASSOQ: offset: "+g()),c.VASSOQLabel="Stealing [age | vel]",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VASSOQ=(0,y.IV)(d),e.log("SPLOUD: offset: "+g()),c.SPLOUDLabel="Pedal -> Amp",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.SPLOUD=(0,y.IV)(d),e.log("SPATT: offset: "+g()),c.SPATTLabel="Pedal -> Attack",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.SPATT=(0,y.IV)(d),e.log("SPFILT: offset: "+g()),c.SPFILTLabel="Pedal -> Cutoff",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.SPFILT=(0,y.IV)(d),e.log("PTUNO: offset: "+g()),c.PTUNOLabel="Tuning",d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.PTUNO=(0,y.IV)(d),e.log("K_LRAT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_LRAT=(0,y.IV)(d),e.log("K_LDEP: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_LDEP=(0,y.IV)(d),e.log("K_LDEL: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_LDEL=(0,y.IV)(d),e.log("VOSCL: offset: "+g()),c.VOSCLLabel="VOSCL",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VOSCL=(0,y.IV)(d),e.log("VSSCL: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VSSCL=(0,y.IV)(d),e.log("LEGATO: offset: "+g()),c.LEGATOLabel="Legato [on | off]",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LEGATO=(0,y.IV)(d),e.log("B_PTCHD: offset: "+g()),c.B_PTCHDLabel="Bend Down -> Pitch",d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.B_PTCHD=(0,y.IV)(d),e.log("B_MODE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.B_MODE=(0,y.IV)(d),e.log("TRANSPOSE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.TRANSPOSE=(0,y.IV)(d),e.log("MODSPAN1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSPAN1=(0,y.IV)(d),e.log("MODSPAN2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSPAN2=(0,y.IV)(d),e.log("MODSPAN3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSPAN3=(0,y.IV)(d),e.log("MODSAMP1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSAMP1=(0,y.IV)(d),e.log("MODSAMP2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSAMP2=(0,y.IV)(d),e.log("MODSLFOT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFOT=(0,y.IV)(d),e.log("MODSLFOL: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFOL=(0,y.IV)(d),e.log("MODSLFOD: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFOD=(0,y.IV)(d),e.log("MODSFILT1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSFILT1=(0,y.IV)(d),e.log("MODSFILT2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSFILT2=(0,y.IV)(d),e.log("MODSFILT3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSFILT3=(0,y.IV)(d),e.log("MODSPITCH: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSPITCH=(0,y.IV)(d),e.log("MODSAMP3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSAMP3=(0,y.IV)(d),e.log("MODVPAN1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVPAN1=(0,y.IV)(d),e.log("MODVPAN2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVPAN2=(0,y.IV)(d),e.log("MODVPAN3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVPAN3=(0,y.IV)(d),e.log("MODVAMP1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVAMP1=(0,y.IV)(d),e.log("MODVAMP2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVAMP2=(0,y.IV)(d),e.log("MODVLFOR: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVLFOR=(0,y.IV)(d),e.log("MODVLVOL: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVLVOL=(0,y.IV)(d),e.log("MODVLFOD: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVLFOD=(0,y.IV)(d),e.log("LFO1WAVE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFO1WAVE=(0,y.IV)(d),e.log("LFO2WAVE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFO2WAVE=(0,y.IV)(d),e.log("MODSLFLT2_1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFLT2_1=(0,y.IV)(d),e.log("MODSLFLT2_2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFLT2_2=(0,y.IV)(d),e.log("MODSLFLT2_3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODSLFLT2_3=(0,y.IV)(d),e.log("LFO2TRIG: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LFO2TRIG=(0,y.IV)(d),e.log("RESERVED_1: offset: "+g()),d=[];for(let b=0;b<7;b++)d.push($(a,f).value);c.RESERVED_1=(0,y.IV)(d),e.log("PORTIME: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PORTIME=(0,y.IV)(d),e.log("PORTYPE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PORTYPE=(0,y.IV)(d),e.log("PORTEN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PORTEN=(0,y.IV)(d),e.log("PFXCHAN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PFXCHAN=(0,y.IV)(d)}var aa=class{constructor(a,b){this.device=a,this.header=b}getHeader(){return this.header}save(){return A(this,null,function*(){return this.device.sendRaw(this.header.raw)})}getProgramName(){return this.header.PRNAME}setProgramName(a){let b=(0,y.Zv)(!1,"setProgramName");!function(a,b){(0,y.Zv)(!1,"ProgramHeader_writePRNAME").log("Offset: 13");let c=Z(b);for(let b=13,d=0;b<37;b+=2,d++){let e=(0,y.tw)(c[d]);a.raw[b]=e[0],a.raw[b+1]=e[1]}}(this.header,a),b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getProgramNumber(){return this.header.PRGNUM}setProgramNumber(a){let b=(0,y.Zv)(!1,"setProgramNumber");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePRGNUM").log("Offset: 37");let d=(0,y.tw)(a);c.raw[37]=d[0],c.raw[38]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getMidiChannel(){return this.header.PMCHAN}setMidiChannel(a){let b=(0,y.Zv)(!1,"setMidiChannel");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePMCHAN").log("Offset: 39");let d=(0,y.tw)(a);c.raw[39]=d[0],c.raw[40]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getPolyphony(){return this.header.POLYPH}setPolyphony(a){let b=(0,y.Zv)(!1,"setPolyphony");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePOLYPH").log("Offset: 41");let d=(0,y.tw)(a);c.raw[41]=d[0],c.raw[42]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getVoicePriority(){return this.header.PRIORT}setVoicePriority(a){let b=(0,y.Zv)(!1,"setVoicePriority");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePRIORT").log("Offset: 43");let d=(0,y.tw)(a);c.raw[43]=d[0],c.raw[44]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getLowNote(){return this.header.PLAYLO}setLowNote(a){let b=(0,y.Zv)(!1,"setLowNote");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePLAYLO").log("Offset: 45");let d=(0,y.tw)(a);c.raw[45]=d[0],c.raw[46]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getHighNote(){return this.header.PLAYHI}setHighNote(a){let b=(0,y.Zv)(!1,"setHighNote");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePLAYHI").log("Offset: 47");let d=(0,y.tw)(a);c.raw[47]=d[0],c.raw[48]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getOutput(){return this.header.OUTPUT}setOutput(a){let b=(0,y.Zv)(!1,"setOutput");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writeOUTPUT").log("Offset: 51");let d=(0,y.tw)(a);c.raw[51]=d[0],c.raw[52]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getOutputLevel(){return this.header.STEREO}setOutputLevel(a){let b=(0,y.Zv)(!1,"setOutputLevel");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writeSTEREO").log("Offset: 53");let d=(0,y.tw)(a);c.raw[53]=d[0],c.raw[54]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getPan(){return this.header.PANPOS}setPan(a){let b=(0,y.Zv)(!1,"setPan");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePANPOS").log("Offset: 55");let d=(0,y.tw)(a);c.raw[55]=d[0],c.raw[56]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getProgramLevel(){return this.header.PRLOUD}setProgramLevel(a){let b=(0,y.Zv)(!1,"setProgramLevel");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePRLOUD").log("Offset: 57");let d=(0,y.tw)(a);c.raw[57]=d[0],c.raw[58]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getVelocityToAmp(){return this.header.V_LOUD}setVelocityToAmp(a){let b=(0,y.Zv)(!1,"setVelocityToAmp");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writeV_LOUD").log("Offset: 59");let d=(0,y.tw)(a);c.raw[59]=d[0],c.raw[60]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getLfo2Rate(){return this.header.PANRAT}setLfo2Rate(a){let b=(0,y.Zv)(!1,"setLfo2Rate");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePANRAT").log("Offset: 65");let d=(0,y.tw)(a);c.raw[65]=d[0],c.raw[66]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getLfo2Depth(){return this.header.PANDEP}setLfo2Depth(a){let b=(0,y.Zv)(!1,"setLfo2Depth");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePANDEP").log("Offset: 67");let d=(0,y.tw)(a);c.raw[67]=d[0],c.raw[68]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}getLfo2Delay(){return this.header.PANDEL}setLfo2Delay(a){let b=(0,y.Zv)(!1,"setLfo2Delay");var c=this.header;(0,y.Zv)(!1,"ProgramHeader_writePANDEL").log("Offset: 69");let d=(0,y.tw)(a);c.raw[69]=d[0],c.raw[70]=d[1],b.log("Parsing header from 7 with header offset: 1"),_(this.header.raw.slice(7,this.header.raw.length-1),1,this.header)}};function ab(a,b,c){let d,e=(0,y.Zv)(!1,"parseKeygroupHeader"),f={value:0,offset:2*b};function g(){return f.offset/2}e.log("KGIDENT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KGIDENT=(0,y.IV)(d),e.log("NXTKG: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.NXTKG=(0,y.IV)(d),e.log("LONOTE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LONOTE=(0,y.IV)(d),e.log("HINOTE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HINOTE=(0,y.IV)(d),e.log("KGTUNO: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.KGTUNO=(0,y.IV)(d),e.log("FILFRQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FILFRQ=(0,y.IV)(d),e.log("K_FREQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_FREQ=(0,y.IV)(d),e.log("V_FREQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_FREQ=(0,y.IV)(d),e.log("P_FREQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.P_FREQ=(0,y.IV)(d),e.log("E_FREQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.E_FREQ=(0,y.IV)(d),e.log("ATTAK1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ATTAK1=(0,y.IV)(d),e.log("DECAY1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.DECAY1=(0,y.IV)(d),e.log("SUSTN1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.SUSTN1=(0,y.IV)(d),e.log("RELSE1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.RELSE1=(0,y.IV)(d),e.log("V_ATT1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_ATT1=(0,y.IV)(d),e.log("V_REL1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_REL1=(0,y.IV)(d),e.log("O_REL1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.O_REL1=(0,y.IV)(d),e.log("K_DAR1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_DAR1=(0,y.IV)(d),e.log("ENV2R1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2R1=(0,y.IV)(d),e.log("ENV2R3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2R3=(0,y.IV)(d),e.log("ENV2L3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2L3=(0,y.IV)(d),e.log("ENV2R4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2R4=(0,y.IV)(d),e.log("V_ATT2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_ATT2=(0,y.IV)(d),e.log("V_REL2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_REL2=(0,y.IV)(d),e.log("O_REL2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.O_REL2=(0,y.IV)(d),e.log("K_DAR2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_DAR2=(0,y.IV)(d),e.log("V_ENV2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_ENV2=(0,y.IV)(d),e.log("E_PTCH: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.E_PTCH=(0,y.IV)(d),e.log("VXFADE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VXFADE=(0,y.IV)(d),e.log("VZONES: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VZONES=(0,y.IV)(d),e.log("LKXF: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LKXF=(0,y.IV)(d),e.log("RKXF: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.RKXF=(0,y.IV)(d),e.log("SNAME1: offset: "+g()),c.SNAME1="";for(let b=0;b<12;b++)$(a,f),c.SNAME1+=Y([f.value]),e.log("SNAME1 at "+b+": "+c.SNAME1);e.log("LOVEL1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LOVEL1=(0,y.IV)(d),e.log("HIVEL1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HIVEL1=(0,y.IV)(d),e.log("VTUNO1: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VTUNO1=(0,y.IV)(d),e.log("VLOUD1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VLOUD1=(0,y.IV)(d),e.log("VFREQ1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VFREQ1=(0,y.IV)(d),e.log("VPANO1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VPANO1=(0,y.IV)(d),e.log("ZPLAY1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ZPLAY1=(0,y.IV)(d),e.log("LVXF1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LVXF1=(0,y.IV)(d),e.log("HVXF1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HVXF1=(0,y.IV)(d),e.log("SBADD1: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.SBADD1=(0,y.IV)(d),e.log("SNAME2: offset: "+g()),c.SNAME2="";for(let b=0;b<12;b++)$(a,f),c.SNAME2+=Y([f.value]),e.log("SNAME2 at "+b+": "+c.SNAME2);e.log("LOVEL2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LOVEL2=(0,y.IV)(d),e.log("HIVEL2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HIVEL2=(0,y.IV)(d),e.log("VTUNO2: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VTUNO2=(0,y.IV)(d),e.log("VLOUD2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VLOUD2=(0,y.IV)(d),e.log("VFREQ2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VFREQ2=(0,y.IV)(d),e.log("VPANO2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VPANO2=(0,y.IV)(d),e.log("ZPLAY2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ZPLAY2=(0,y.IV)(d),e.log("LVXF2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LVXF2=(0,y.IV)(d),e.log("HVXF2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HVXF2=(0,y.IV)(d),e.log("SBADD2: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.SBADD2=(0,y.IV)(d),e.log("SNAME3: offset: "+g()),c.SNAME3="";for(let b=0;b<12;b++)$(a,f),c.SNAME3+=Y([f.value]),e.log("SNAME3 at "+b+": "+c.SNAME3);e.log("LOVEL3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LOVEL3=(0,y.IV)(d),e.log("HIVEL3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HIVEL3=(0,y.IV)(d),e.log("VTUNO3: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VTUNO3=(0,y.IV)(d),e.log("VLOUD3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VLOUD3=(0,y.IV)(d),e.log("VFREQ3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VFREQ3=(0,y.IV)(d),e.log("VPANO3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VPANO3=(0,y.IV)(d),e.log("ZPLAY3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ZPLAY3=(0,y.IV)(d),e.log("LVXF3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LVXF3=(0,y.IV)(d),e.log("HVXF3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HVXF3=(0,y.IV)(d),e.log("SBADD3: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.SBADD3=(0,y.IV)(d),e.log("SNAME4: offset: "+g()),c.SNAME4="";for(let b=0;b<12;b++)$(a,f),c.SNAME4+=Y([f.value]),e.log("SNAME4 at "+b+": "+c.SNAME4);e.log("LOVEL4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LOVEL4=(0,y.IV)(d),e.log("HIVEL4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HIVEL4=(0,y.IV)(d),e.log("VTUNO4: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VTUNO4=(0,y.IV)(d),e.log("VLOUD4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VLOUD4=(0,y.IV)(d),e.log("VFREQ4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VFREQ4=(0,y.IV)(d),e.log("VPANO4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VPANO4=(0,y.IV)(d),e.log("ZPLAY4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ZPLAY4=(0,y.IV)(d),e.log("LVXF4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LVXF4=(0,y.IV)(d),e.log("HVXF4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.HVXF4=(0,y.IV)(d),e.log("SBADD4: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.SBADD4=(0,y.IV)(d),e.log("KBEAT: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KBEAT=(0,y.IV)(d),e.log("AHOLD: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.AHOLD=(0,y.IV)(d),e.log("CP1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.CP1=(0,y.IV)(d),e.log("CP2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.CP2=(0,y.IV)(d),e.log("CP3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.CP3=(0,y.IV)(d),e.log("CP4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.CP4=(0,y.IV)(d),e.log("VZOUT1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VZOUT1=(0,y.IV)(d),e.log("VZOUT2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VZOUT2=(0,y.IV)(d),e.log("VZOUT3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VZOUT3=(0,y.IV)(d),e.log("VZOUT4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.VZOUT4=(0,y.IV)(d),e.log("VSS1: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VSS1=(0,y.IV)(d),e.log("VSS2: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VSS2=(0,y.IV)(d),e.log("VSS3: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VSS3=(0,y.IV)(d),e.log("VSS4: offset: "+g()),d=[];for(let b=0;b<2;b++)d.push($(a,f).value);c.VSS4=(0,y.IV)(d),e.log("KV_LO: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KV_LO=(0,y.IV)(d),e.log("FILQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FILQ=(0,y.IV)(d),e.log("L_PTCH: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.L_PTCH=(0,y.IV)(d),e.log("MODVFILT1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFILT1=(0,y.IV)(d),e.log("MODVFILT2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFILT2=(0,y.IV)(d),e.log("MODVFILT3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFILT3=(0,y.IV)(d),e.log("MODVPITCH: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVPITCH=(0,y.IV)(d),e.log("MODVAMP3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVAMP3=(0,y.IV)(d),e.log("ENV2L1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2L1=(0,y.IV)(d),e.log("ENV2R2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2R2=(0,y.IV)(d),e.log("ENV2L2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2L2=(0,y.IV)(d),e.log("ENV2L4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV2L4=(0,y.IV)(d),e.log("KGMUTE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KGMUTE=(0,y.IV)(d),e.log("PFXCHAN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PFXCHAN=(0,y.IV)(d),e.log("PFXSLEV: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.PFXSLEV=(0,y.IV)(d),e.log("Reserved_1: offset: "+g()),d=[];for(let b=0;b<5;b++)d.push($(a,f).value);c.Reserved_1=(0,y.IV)(d),e.log("LSI2_ON: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.LSI2_ON=(0,y.IV)(d),e.log("FLT2GAIN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FLT2GAIN=(0,y.IV)(d),e.log("FLT2MODE: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FLT2MODE=(0,y.IV)(d),e.log("FLT2Q: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FLT2Q=(0,y.IV)(d),e.log("TONEFREQ: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.TONEFREQ=(0,y.IV)(d),e.log("TONESLOP: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.TONESLOP=(0,y.IV)(d),e.log("MODVFLT2_1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFLT2_1=(0,y.IV)(d),e.log("MODVFLT2_2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFLT2_2=(0,y.IV)(d),e.log("MODVFLT2_3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.MODVFLT2_3=(0,y.IV)(d),e.log("FIL2FR: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.FIL2FR=(0,y.IV)(d),e.log("K_FRQ2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_FRQ2=(0,y.IV)(d),e.log("ATTAK3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ATTAK3=(0,y.IV)(d),e.log("ENV3L1: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3L1=(0,y.IV)(d),e.log("ENV3R2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3R2=(0,y.IV)(d),e.log("ENV3L2: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3L2=(0,y.IV)(d),e.log("ENV3R3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3R3=(0,y.IV)(d),e.log("ENV3L3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3L3=(0,y.IV)(d),e.log("ENV3R4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3R4=(0,y.IV)(d),e.log("ENV3L4: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.ENV3L4=(0,y.IV)(d),e.log("V_ATT3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_ATT3=(0,y.IV)(d),e.log("V_REL3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_REL3=(0,y.IV)(d),e.log("O_REL3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.O_REL3=(0,y.IV)(d),e.log("K_DAR3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.K_DAR3=(0,y.IV)(d),e.log("V_ENV3: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.V_ENV3=(0,y.IV)(d),e.log("KFXCHAN: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KFXCHAN=(0,y.IV)(d),e.log("KFXSLEV: offset: "+g()),d=[];for(let b=0;b<1;b++)d.push($(a,f).value);c.KFXSLEV=(0,y.IV)(d)}var ac=class{constructor(a,b){this.device=a,this.header=b}getHeader(){return this.header}save(){return A(this,null,function*(){return this.device.sendRaw(this.header.raw)})}getLowNote(){return this.header.LONOTE}setLowNote(a){let b=(0,y.Zv)(!1,"setLowNote");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeLONOTE").log("Offset: 13");let d=(0,y.tw)(a);c.raw[13]=d[0],c.raw[14]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getHighNote(){return this.header.HINOTE}setHighNote(a){let b=(0,y.Zv)(!1,"setHighNote");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeHINOTE").log("Offset: 15");let d=(0,y.tw)(a);c.raw[15]=d[0],c.raw[16]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getSampleName1(){return this.header.SNAME1}setSampleName1(a){let b=(0,y.Zv)(!1,"setSampleName1");!function(a,b){(0,y.Zv)(!1,"KeygroupHeader_writeSNAME1").log("Offset: 75");let c=Z(b);for(let b=75,d=0;b<99;b+=2,d++){let e=(0,y.tw)(c[d]);a.raw[b]=e[0],a.raw[b+1]=e[1]}}(this.header,a),b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getLowVelocity1(){return this.header.LOVEL1}setLowVelocity1(a){let b=(0,y.Zv)(!1,"setLowVelocity1");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeLOVEL1").log("Offset: 99");let d=(0,y.tw)(a);c.raw[99]=d[0],c.raw[100]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getHighVelocity1(){return this.header.HIVEL1}setHighVelocity1(a){let b=(0,y.Zv)(!1,"setHighVelocity1");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeHIVEL1").log("Offset: 101");let d=(0,y.tw)(a);c.raw[101]=d[0],c.raw[102]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getSampleName2(){return this.header.SNAME2}setSampleName2(a){let b=(0,y.Zv)(!1,"setSampleName2");!function(a,b){(0,y.Zv)(!1,"KeygroupHeader_writeSNAME2").log("Offset: 123");let c=Z(b);for(let b=123,d=0;b<147;b+=2,d++){let e=(0,y.tw)(c[d]);a.raw[b]=e[0],a.raw[b+1]=e[1]}}(this.header,a),b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getLowVelocity2(){return this.header.LOVEL2}setLowVelocity2(a){let b=(0,y.Zv)(!1,"setLowVelocity2");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeLOVEL2").log("Offset: 147");let d=(0,y.tw)(a);c.raw[147]=d[0],c.raw[148]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getHighVelocity2(){return this.header.HIVEL2}setHighVelocity2(a){let b=(0,y.Zv)(!1,"setHighVelocity2");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeHIVEL2").log("Offset: 149");let d=(0,y.tw)(a);c.raw[149]=d[0],c.raw[150]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getSampleName3(){return this.header.SNAME3}setSampleName3(a){let b=(0,y.Zv)(!1,"setSampleName3");!function(a,b){(0,y.Zv)(!1,"KeygroupHeader_writeSNAME3").log("Offset: 171");let c=Z(b);for(let b=171,d=0;b<195;b+=2,d++){let e=(0,y.tw)(c[d]);a.raw[b]=e[0],a.raw[b+1]=e[1]}}(this.header,a),b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getLowVelocity3(){return this.header.LOVEL3}setLowVelocity3(a){let b=(0,y.Zv)(!1,"setLowVelocity3");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeLOVEL3").log("Offset: 195");let d=(0,y.tw)(a);c.raw[195]=d[0],c.raw[196]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getHighVelocity3(){return this.header.HIVEL3}setHighVelocity3(a){let b=(0,y.Zv)(!1,"setHighVelocity3");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeHIVEL3").log("Offset: 197");let d=(0,y.tw)(a);c.raw[197]=d[0],c.raw[198]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getSampleName4(){return this.header.SNAME4}setSampleName4(a){let b=(0,y.Zv)(!1,"setSampleName4");!function(a,b){(0,y.Zv)(!1,"KeygroupHeader_writeSNAME4").log("Offset: 219");let c=Z(b);for(let b=219,d=0;b<243;b+=2,d++){let e=(0,y.tw)(c[d]);a.raw[b]=e[0],a.raw[b+1]=e[1]}}(this.header,a),b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getLowVelocity4(){return this.header.LOVEL4}setLowVelocity4(a){let b=(0,y.Zv)(!1,"setLowVelocity4");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeLOVEL4").log("Offset: 243");let d=(0,y.tw)(a);c.raw[243]=d[0],c.raw[244]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}getHighVelocity4(){return this.header.HIVEL4}setHighVelocity4(a){let b=(0,y.Zv)(!1,"setHighVelocity4");var c=this.header;(0,y.Zv)(!1,"KeygroupHeader_writeHIVEL4").log("Offset: 245");let d=(0,y.tw)(a);c.raw[245]=d[0],c.raw[246]=d[1],b.log("Parsing header from 7 with header offset: 0"),ab(this.header.raw.slice(7,this.header.raw.length-1),0,this.header)}},ad=(a=>(a.NULL="NULL",a.PARTITION="S3000 PARTITION",a.VOLUME="S3000 VOLUME",a.PROGRAM="S3000 PROGRAM",a.SAMPLE="S3000 SAMPLE",a))(ad||{}),ae=class{constructor(a){this.c=a}remoteMount(a){return ag(this.c,a)}remoteUnmount(a){return af(this.c,a)}remoteVolumes(){return ai(this.c)}parseRemoteVolumes(a){return ah(a)}readAkaiDisk(){return function(a,b){return A(this,null,function*(){let c=V.parse(a.diskFile),d={timestamp:new Date().getTime(),name:c.name+c.ext,partitions:[]},e={data:d,errors:[]};for(let c=1;c<50;c++){let f=yield b(a,"/",c);if(f.errors.length>0)if(f.errors[0].message.includes("Operation not supported by device"))break;else{e.errors=e.errors.concat(f.errors);break}let g={block:0,name:String(c),size:0,type:"S3000 PARTITION",volumes:[]};for(let a of(d.partitions.push(g),f.data))switch(a.type){case"S3000 VOLUME":g.volumes.push({block:a.block,name:a.name,records:[],size:a.size,type:"S3000 VOLUME"});break;case"S3000 PROGRAM":case"S3000 SAMPLE":g.volumes.forEach(b=>{a.name.startsWith(b.name)&&(console.log(`Pushing r: ${a.name} to v: ${b.name}`),b.records.push(a))})}}return e})}(this.c,this.akaiList.bind(this))}readAkaiProgram(a){return function(a){return A(this,null,function*(){let b=yield function(a){return A(this,null,function*(){let b=yield w.readFile(a),c=[];for(let a=0;a<b.length;a++){let d=(0,y.tw)(b[a]);c.push(d[0]),c.push(d[1])}return c})}(a),c={},d=[];_(b,1,c),c.raw=Array(7).fill(0).concat(b);for(let a=0;a<c.GROUPS;a++){let c={},e=b.slice(384+384*a);ab(e,0,c),c.raw=Array(7).fill(0).concat(e),d.push(c)}let e={};return{keygroups:d.map(a=>new ac(e,a)),program:new aa(e,c)}})}(a)}writeAkaiProgram(a,b){return function(a,b){return A(this,null,function*(){let c=b.program.getHeader().raw.slice(7);for(let a=0;a<b.keygroups.length;a++){let d=b.keygroups[a].getHeader().raw.slice(7);for(let b=0;b<d.length;b++)c[384+384*a+b]=d[b]}yield aj(a,c)})}(a,b)}writeAkaiSample(a,b){return function(a,b){return A(this,null,function*(){let c=b.raw.slice(7);yield aj(a,c)})}(a,b)}akaiFormat(a=60,b=1){return function(a,b=1,c=1){return A(this,null,function*(){return process.env.PERL5LIB=a.akaiToolsPath,am(V.join(a.akaiToolsPath,"akaiformat"),["-f",String(a.diskFile)].concat(Array(c).fill(b)),{onData:al,onStart:a=>{a.stdin instanceof z.Writable&&a.stdin.write("y\n")}})})}(this.c,a,b)}akaiWrite(a,b,c){return function(a,b,c,d=1){return A(this,null,function*(){return process.env.PERL5LIB=a.akaiToolsPath,console.log(`akaiwrite: sourcePath: ${b}`),console.log(`akaiwrite: targetPath: ${c}`),am(V.join(a.akaiToolsPath,"akaiwrite"),["-f",a.diskFile,"-p",String(d),"-d",`"${c}"`,`"${b}"`])})}(this.c,a,b,c)}akaiRead(a,b,c,d){return function(a,b,c,d=1,e=!0){return A(this,null,function*(){return process.env.PERL5LIB=a.akaiToolsPath,console.log(`akairead: sourcePath: ${b}`),console.log(`akairead: targetPath: ${c}`),am(V.join(a.akaiToolsPath,"akairead"),["-f",a.diskFile,"-p",String(d),"-d",`"${c}"`,e?"-R":"",`"${b}"`])})}(this.c,a,b,c,d)}wav2Akai(a,b,c){return function(a,b,c,d){return A(this,null,function*(){return process.env.PERL5LIB=a.akaiToolsPath,am(V.join(a.akaiToolsPath,"wav2akai"),["-n",d,"-d",`"${c}"`,`"${b}"`])})}(this.c,a,b,c)}akaiList(a,b){return function(a,b="/",c=1){return A(this,null,function*(){yield function(a){return A(this,null,function*(){let b;try{b=yield w.stat(a.diskFile)}catch(a){}if(null==b?void 0:b.isDirectory())throw Error(`Akai disk file is a directory: ${a.diskFile}`);if(!(b=yield w.stat(a.akaiToolsPath)).isDirectory())throw Error(`Akai tools path is not a directory: ${a.akaiToolsPath}`);if(!new Set(["akai2wav","akailist","akaiconv","akaiformat","akailist","akaimkdir","akairead","akaiwrite","any2akai","akai2wav"]).isSubsetOf(new Set((yield w.readdir(a.akaiToolsPath)))))throw Error("Akai tools path does not contain expected executables.")})}(a);let d={data:[],errors:[]},e=V.join(a.akaiToolsPath,"akailist"),f=["-f",`${a.diskFile}`,"-l","-R","-p",String(c),"-u",`"${b}"`];process.env.PERL5LIB=a.akaiToolsPath;let g=yield am(e,f,{onStart:()=>{},onData:a=>{ak(String(a)).forEach(a=>d.data.push(a))}});return d.errors=d.errors.concat(g.errors),d})}(this.c,a,b)}remoteSync(){return function(a){return A(this,null,function*(){let b,c={code:-1,errors:[]};if(!a.piscsiHost||void 0===a.scsiId)return c.errors.push(Error("Remote host not defined.")),c;console.log("Listing remote volumes...");let d=yield ai(a);if(c.errors=c.errors.concat(d.errors),0!==d.errors.length)return c;for(let c of d.data)if(c.scsiId===a.scsiId){b=c;break}let e=V.parse(a.diskFile),f=`"~/images/${e.name}${e.ext}"`;if(b){let d=yield af(a,b);if(0!==d.errors.length)return c.errors=c.errors.concat(d.errors),c}b={image:f,scsiId:a.scsiId};let g=yield am("scp",[`"${a.diskFile}"`,`${a.piscsiHost}:${b.image}`]);0!==g.errors.length&&(c.errors=c.errors.concat(g.errors));let h=yield ag(a,b);return 0!==h.errors.length?c.errors=c.errors.concat(h.errors):c.code=c.errors.length,c})}(this.c)}parseAkaiList(a){return ak(a)}};function af(a,b){return A(this,null,function*(){let c={code:-1,errors:[]};if(a.piscsiHost){let d=yield am("ssh",[a.piscsiHost,`"scsictl -c d -i ${b.scsiId}"`]);c.code=d.code,c.errors=c.errors.concat(d.errors)}else c.errors.push(Error("Piscsi host is not defined."));return c})}function ag(a,b){return A(this,null,function*(){let c={code:-1,errors:[]};if(a.piscsiHost){let d=yield am("ssh",[a.piscsiHost,`"scsictl -c a -i ${b.scsiId} -f ${b.image}"`]);c.code=d.code,c.errors=c.errors.concat(d.errors)}else c.errors.push(Error("Piscsi host is not defined"));return c})}function ah(a){let b=[];return a.split("\n").forEach(a=>{a.match(/\|\s*(\d+).*/)&&b.push({scsiId:Number.parseInt(a.substring(2,4)),lun:Number.parseInt(a.substring(6,10)),image:a.substring(19).trim()})}),b}function ai(a){return A(this,null,function*(){let b={data:[],errors:[]};return a.piscsiHost?yield am("ssh",[a.piscsiHost,'"scsictl -l"'],{onData:a=>{b.data=b.data.concat(ah(String(a)))},onStart:()=>{}}):b.errors.push(Error("Piscsi host is not defined.")),b})}function aj(a,b){return A(this,null,function*(){let c=[];for(let a=0;a<b.length;a+=2)c.push((0,y.GW)(b[a],b[a+1]));yield w.writeFile(a,Buffer.from(c))})}function ak(a){let b=[];for(let c of String(a).split("\n")){if(""===c.trim())continue;let a={block:0,name:"",size:0,type:"NULL"};a.type=c.slice(0,15).trim(),a.block=Number.parseInt(c.slice(15,25).trim()),a.size=Number.parseInt(c.slice(25,34).trim()),a.name=c.slice(35).trim(),b.push(a)}return b}function al(){}function am(a,b,c={onData:al,onStart:al}){return new Promise((d,e)=>{let f={errors:[],code:-1};console.log(`akaitools: ${a} ${b.join(" ")}`);let g=(0,x.spawn)(a,b,{shell:!0});g.stdout.setEncoding("utf8"),c.onStart(g),g.stdout.on("data",a=>{c.onData(a,g)}),g.on("error",a=>{f.errors.push(a),d(f)}),g.on("close",a=>{null!==a?(f.code=a,d(f)):e(Error("Process terminated without an exit code."))}),g.stderr.on("data",a=>{process.stderr.write(a),f.errors.push(Error(a))}),setTimeout(()=>e(Error(`Timout executing ${a}.`)),3e4)})}async function an(a){try{var b;let a=(b=await function(){return A(this,null,function*(){let a=yield(0,y.Mx)();return{piscsiHost:a.piscsiHost,scsiId:a.s3kScsiId,akaiToolsPath:a.akaiTools,diskFile:a.akaiDisk}})}(),new ae(b)),c=await a.remoteSync();if(c.errors.length>0)return c.errors.forEach(a=>console.error(a)),v.NextResponse.json({message:"Not Found",status:404});return v.NextResponse.json({data:c.code})}catch(a){return console.error(a),v.NextResponse.json({message:"Not Found",status:404})}}let ao=new f.AppRouteRouteModule({definition:{kind:g.RouteKind.APP_ROUTE,page:"/api/t/syn