isomorfeus-asset-manager 0.15.5 → 0.15.7

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,15 +1,15 @@
1
- var Ue=Object.defineProperty;var Ne=(t,e)=>{for(var r in e)Ue(t,r,{get:e[r],enumerable:!0})};var ge={};Ne(ge,{analyzeMetafile:()=>rt,analyzeMetafileSync:()=>ot,build:()=>Xe,buildSync:()=>nt,default:()=>ut,formatMessages:()=>tt,formatMessagesSync:()=>it,initialize:()=>st,serve:()=>Ze,transform:()=>et,transformSync:()=>lt,version:()=>Ge});function ye(t){let e=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(Q(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let a of s)e(a)}else{let a=Object.keys(s);r.write8(6),r.write32(a.length);for(let i of a)r.write(Q(i)),e(s[i])}},r=new se;return r.write32(0),r.write32(t.id<<1|+!t.isRequest),e(t.value),me(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Oe(t){let e=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return Z(r.read());case 4:return r.read();case 5:{let u=r.read32(),l=[];for(let g=0;g<u;g++)l.push(e());return l}case 6:{let u=r.read32(),l={};for(let g=0;g<u;g++)l[Z(r.read())]=e();return l}default:throw new Error("Invalid packet")}},r=new se(t),s=r.read32(),a=(s&1)===0;s>>>=1;let i=e();if(r.ptr!==t.length)throw new Error("Invalid packet");return{id:s,isRequest:a,value:i}}var se=class{constructor(e=new Uint8Array(1024)){this.buf=e;this.len=0;this.ptr=0}_write(e){if(this.len+e>this.buf.length){let r=new Uint8Array((this.len+e)*2);r.set(this.buf),this.buf=r}return this.len+=e,this.len-e}write8(e){let r=this._write(1);this.buf[r]=e}write32(e){let r=this._write(4);me(this.buf,e,r)}write(e){let r=this._write(4+e.length);me(this.buf,e.length,r),this.buf.set(e,r+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return he(this.buf,this._read(4))}read(){let e=this.read32(),r=new Uint8Array(e),s=this._read(r.length);return r.set(this.buf.subarray(s,s+e)),r}},Q,Z;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let t=new TextEncoder,e=new TextDecoder;Q=r=>t.encode(r),Z=r=>e.decode(r)}else if(typeof Buffer!="undefined")Q=t=>{let e=Buffer.from(t);return e instanceof Uint8Array||(e=new Uint8Array(e)),e},Z=t=>{let{buffer:e,byteOffset:r,byteLength:s}=t;return Buffer.from(e,r,s).toString()};else throw new Error("No UTF-8 codec found");function he(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function me(t,e,r){t[r++]=e,t[r++]=e>>8,t[r++]=e>>16,t[r++]=e>>24}var xe="warning",Se="silent";function Ee(t){if(t+="",t.indexOf(",")>=0)throw new Error(`Invalid target: ${t}`);return t}var fe=()=>null,U=t=>typeof t=="boolean"?null:"a boolean",Le=t=>typeof t=="boolean"||typeof t=="object"&&!Array.isArray(t)?null:"a boolean or an object",h=t=>typeof t=="string"?null:"a string",ce=t=>t instanceof RegExp?null:"a RegExp object",ne=t=>typeof t=="number"&&t===(t|0)?null:"an integer",be=t=>typeof t=="function"?null:"a function",q=t=>Array.isArray(t)?null:"an array",H=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",We=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",qe=t=>typeof t=="object"&&t!==null?null:"an array or an object",ke=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",Me=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",Ie=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",ze=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",Ae=t=>typeof t=="string"||t instanceof Uint8Array?null:"a string or a Uint8Array";function n(t,e,r,s){let a=t[r];if(e[r+""]=!0,a===void 0)return;let i=s(a);if(i!==null)throw new Error(`"${r}" must be ${i}`);return a}function K(t,e,r){for(let s in t)if(!(s in e))throw new Error(`Invalid option ${r}: "${s}"`)}function Ce(t){let e=Object.create(null),r=n(t,e,"wasmURL",h),s=n(t,e,"wasmModule",We),a=n(t,e,"worker",U);return K(t,e,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:a}}function De(t){let e;if(t!==void 0){e=Object.create(null);for(let r of Object.keys(t)){let s=t[r];if(typeof s=="string"||s===!1)e[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return e}function de(t,e,r,s,a){let i=n(e,r,"color",U),u=n(e,r,"logLevel",h),l=n(e,r,"logLimit",ne);i!==void 0?t.push(`--color=${i}`):s&&t.push("--color=true"),t.push(`--log-level=${u||a}`),t.push(`--log-limit=${l||0}`)}function Be(t,e,r){let s=n(e,r,"legalComments",h),a=n(e,r,"sourceRoot",h),i=n(e,r,"sourcesContent",U),u=n(e,r,"target",ze),l=n(e,r,"format",h),g=n(e,r,"globalName",h),S=n(e,r,"mangleProps",ce),E=n(e,r,"reserveProps",ce),k=n(e,r,"mangleQuoted",U),B=n(e,r,"minify",U),F=n(e,r,"minifySyntax",U),N=n(e,r,"minifyWhitespace",U),I=n(e,r,"minifyIdentifiers",U),j=n(e,r,"drop",q),V=n(e,r,"charset",h),w=n(e,r,"treeShaking",U),d=n(e,r,"ignoreAnnotations",U),o=n(e,r,"jsx",h),f=n(e,r,"jsxFactory",h),y=n(e,r,"jsxFragment",h),x=n(e,r,"jsxImportSource",h),O=n(e,r,"jsxDev",U),c=n(e,r,"jsxSideEffects",U),p=n(e,r,"define",H),b=n(e,r,"logOverride",H),$=n(e,r,"supported",H),R=n(e,r,"pure",q),C=n(e,r,"keepNames",U),M=n(e,r,"platform",h);if(s&&t.push(`--legal-comments=${s}`),a!==void 0&&t.push(`--source-root=${a}`),i!==void 0&&t.push(`--sources-content=${i}`),u&&(Array.isArray(u)?t.push(`--target=${Array.from(u).map(Ee).join(",")}`):t.push(`--target=${Ee(u)}`)),l&&t.push(`--format=${l}`),g&&t.push(`--global-name=${g}`),M&&t.push(`--platform=${M}`),B&&t.push("--minify"),F&&t.push("--minify-syntax"),N&&t.push("--minify-whitespace"),I&&t.push("--minify-identifiers"),V&&t.push(`--charset=${V}`),w!==void 0&&t.push(`--tree-shaking=${w}`),d&&t.push("--ignore-annotations"),j)for(let v of j)t.push(`--drop:${v}`);if(S&&t.push(`--mangle-props=${S.source}`),E&&t.push(`--reserve-props=${E.source}`),k!==void 0&&t.push(`--mangle-quoted=${k}`),o&&t.push(`--jsx=${o}`),f&&t.push(`--jsx-factory=${f}`),y&&t.push(`--jsx-fragment=${y}`),x&&t.push(`--jsx-import-source=${x}`),O&&t.push("--jsx-dev"),c&&t.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);t.push(`--define:${v}=${p[v]}`)}if(b)for(let v in b){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);t.push(`--log-override:${v}=${b[v]}`)}if($)for(let v in $){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);t.push(`--supported:${v}=${$[v]}`)}if(R)for(let v of R)t.push(`--pure:${v}`);C&&t.push("--keep-names")}function Ke(t,e,r,s,a){var Y;let i=[],u=[],l=Object.create(null),g=null,S=null,E=null;de(i,e,l,r,s),Be(i,e,l);let k=n(e,l,"sourcemap",Me),B=n(e,l,"bundle",U),F=n(e,l,"watch",Le),N=n(e,l,"splitting",U),I=n(e,l,"preserveSymlinks",U),j=n(e,l,"metafile",U),V=n(e,l,"outfile",h),w=n(e,l,"outdir",h),d=n(e,l,"outbase",h),o=n(e,l,"tsconfig",h),f=n(e,l,"resolveExtensions",q),y=n(e,l,"nodePaths",q),x=n(e,l,"mainFields",q),O=n(e,l,"conditions",q),c=n(e,l,"external",q),p=n(e,l,"loader",H),b=n(e,l,"outExtension",H),$=n(e,l,"publicPath",h),R=n(e,l,"entryNames",h),C=n(e,l,"chunkNames",h),M=n(e,l,"assetNames",h),v=n(e,l,"inject",q),D=n(e,l,"banner",H),L=n(e,l,"footer",H),z=n(e,l,"entryPoints",qe),W=n(e,l,"absWorkingDir",h),A=n(e,l,"stdin",H),P=(Y=n(e,l,"write",U))!=null?Y:a,_=n(e,l,"allowOverwrite",U),J=n(e,l,"incremental",U)===!0,X=n(e,l,"mangleCache",H);if(l.plugins=!0,K(e,l,`in ${t}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),B&&i.push("--bundle"),_&&i.push("--allow-overwrite"),F)if(i.push("--watch"),typeof F=="boolean")E={};else{let m=Object.create(null),T=n(F,m,"onRebuild",be);K(F,m,`on "watch" in ${t}() call`),E={onRebuild:T}}if(N&&i.push("--splitting"),I&&i.push("--preserve-symlinks"),j&&i.push("--metafile"),V&&i.push(`--outfile=${V}`),w&&i.push(`--outdir=${w}`),d&&i.push(`--outbase=${d}`),o&&i.push(`--tsconfig=${o}`),f){let m=[];for(let T of f){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${T}`);m.push(T)}i.push(`--resolve-extensions=${m.join(",")}`)}if($&&i.push(`--public-path=${$}`),R&&i.push(`--entry-names=${R}`),C&&i.push(`--chunk-names=${C}`),M&&i.push(`--asset-names=${M}`),x){let m=[];for(let T of x){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid main field: ${T}`);m.push(T)}i.push(`--main-fields=${m.join(",")}`)}if(O){let m=[];for(let T of O){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid condition: ${T}`);m.push(T)}i.push(`--conditions=${m.join(",")}`)}if(c)for(let m of c)i.push(`--external:${m}`);if(D)for(let m in D){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);i.push(`--banner:${m}=${D[m]}`)}if(L)for(let m in L){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);i.push(`--footer:${m}=${L[m]}`)}if(v)for(let m of v)i.push(`--inject:${m}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);i.push(`--loader:${m}=${p[m]}`)}if(b)for(let m in b){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);i.push(`--out-extension:${m}=${b[m]}`)}if(z)if(Array.isArray(z))for(let m of z)u.push(["",m+""]);else for(let[m,T]of Object.entries(z))u.push([m+"",T+""]);if(A){let m=Object.create(null),T=n(A,m,"contents",Ae),oe=n(A,m,"resolveDir",h),ve=n(A,m,"sourcefile",h),Re=n(A,m,"loader",h);K(A,m,'in "stdin" object'),ve&&i.push(`--sourcefile=${ve}`),Re&&i.push(`--loader=${Re}`),oe&&(S=oe+""),typeof T=="string"?g=Q(T):T instanceof Uint8Array&&(g=T)}let te=[];if(y)for(let m of y)m+="",te.push(m);return{entries:u,flags:i,write:P,stdinContents:g,stdinResolveDir:S,absWorkingDir:W,incremental:J,nodePaths:te,watch:E,mangleCache:De(X)}}function _e(t,e,r,s){let a=[],i=Object.create(null);de(a,e,i,r,s),Be(a,e,i);let u=n(e,i,"sourcemap",Me),l=n(e,i,"tsconfigRaw",Ie),g=n(e,i,"sourcefile",h),S=n(e,i,"loader",h),E=n(e,i,"banner",h),k=n(e,i,"footer",h),B=n(e,i,"mangleCache",H);return K(e,i,`in ${t}() call`),u&&a.push(`--sourcemap=${u===!0?"external":u}`),l&&a.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),g&&a.push(`--sourcefile=${g}`),S&&a.push(`--loader=${S}`),E&&a.push(`--banner=${E}`),k&&a.push(`--footer=${k}`),{flags:a,mangleCache:De(B)}}function Pe(t){let e={},r={didClose:!1,reason:""},s={},a=0,i=0,u=new Uint8Array(16*1024),l=0,g=d=>{let o=l+d.length;if(o>u.length){let y=new Uint8Array(o*2);y.set(u),u=y}u.set(d,l),l+=d.length;let f=0;for(;f+4<=l;){let y=he(u,f);if(f+4+y>l)break;f+=4,N(u.subarray(f,f+y)),f+=y}f>0&&(u.copyWithin(0,f,l),l-=f)},S=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let o="The service was stopped"+r.reason;for(let f in s)s[f](o,null);s={}},E=(d,o,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let y=a++;s[y]=(x,O)=>{try{f(x,O)}finally{d&&d.unref()}},d&&d.ref(),t.writeToStdin(ye({id:y,isRequest:!0,value:o}))},k=(d,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);t.writeToStdin(ye({id:d,isRequest:!1,value:o}))},B=async(d,o)=>{try{if(o.command==="ping"){k(d,{});return}if(typeof o.key=="number"){let f=e[o.key];if(f){let y=f[o.command];if(y){await y(d,o);return}}}throw new Error("Invalid command: "+o.command)}catch(f){k(d,{errors:[le(f,t,null,void 0,"")]})}},F=!0,N=d=>{if(F){F=!1;let f=String.fromCharCode(...d);if(f!=="0.15.9")throw new Error(`Cannot start service: Host version "0.15.9" does not match binary version ${JSON.stringify(f)}`);return}let o=Oe(d);if(o.isRequest)B(o.id,o.value);else{let f=s[o.id];delete s[o.id],o.value.error?f(o.value.error,{}):f(null,o.value)}};return{readFromStdout:g,afterClose:S,service:{buildOrServe:({callName:d,refs:o,serveOptions:f,options:y,isTTY:x,defaultWD:O,callback:c})=>{let p=0,b=i++,$={},R={ref(){++p===1&&o&&o.ref()},unref(){--p===0&&(delete e[b],o&&o.unref())}};e[b]=$,R.ref(),Ve(d,b,E,k,R,t,$,y,f,x,O,r,(C,M)=>{try{c(C,M)}finally{R.unref()}})},transform:({callName:d,refs:o,input:f,options:y,isTTY:x,fs:O,callback:c})=>{let p=Te(),b=$=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:R,mangleCache:C}=_e(d,y,x,Se),M={command:"transform",flags:R,inputFS:$!==null,input:$!==null?Q($):typeof f=="string"?Q(f):f};C&&(M.mangleCache=C),E(o,M,(v,D)=>{if(v)return c(new Error(v),null);let L=G(D.errors,p),z=G(D.warnings,p),W=1,A=()=>{if(--W===0){let P={warnings:z,code:D.code,map:D.map};D.mangleCache&&(P.mangleCache=D==null?void 0:D.mangleCache),c(null,P)}};if(L.length>0)return c(re("Transform failed",L,z),null);D.codeFS&&(W++,O.readFile(D.code,(P,_)=>{P!==null?c(P,null):(D.code=_,A())})),D.mapFS&&(W++,O.readFile(D.map,(P,_)=>{P!==null?c(P,null):(D.map=_,A())})),A()})}catch(R){let C=[];try{de(C,y,{},x,Se)}catch(v){}let M=le(R,t,p,void 0,"");E(o,{command:"error",flags:C,error:M},()=>{M.detail=p.load(M.detail),c(re("Transform failed",[M],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let $=b;b=()=>O.writeFile(f,$)}b(null)},formatMessages:({callName:d,refs:o,messages:f,options:y,callback:x})=>{let O=ee(f,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${d}() call`);let c={},p=n(y,c,"kind",h),b=n(y,c,"color",U),$=n(y,c,"terminalWidth",ne);if(K(y,c,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:O,isWarning:p==="warning"};b!==void 0&&(R.color=b),$!==void 0&&(R.terminalWidth=$),E(o,R,(C,M)=>{if(C)return x(new Error(C),null);x(null,M.messages)})},analyzeMetafile:({callName:d,refs:o,metafile:f,options:y,callback:x})=>{y===void 0&&(y={});let O={},c=n(y,O,"color",U),p=n(y,O,"verbose",U);K(y,O,`in ${d}() call`);let b={command:"analyze-metafile",metafile:f};c!==void 0&&(b.color=c),p!==void 0&&(b.verbose=p),E(o,b,($,R)=>{if($)return x(new Error($),null);x(null,R.result)})}}}}function Ve(t,e,r,s,a,i,u,l,g,S,E,k,B){let F=Te(),N=(w,d,o,f)=>{let y=[];try{de(y,l,{},S,xe)}catch(O){}let x=le(w,i,F,o,d);r(a,{command:"error",flags:y,error:x},()=>{x.detail=F.load(x.detail),f(x)})},I=(w,d)=>{N(w,d,void 0,o=>{B(re("Build failed",[o],[]),null)})},j;if(typeof l=="object"){let w=l.plugins;if(w!==void 0){if(!Array.isArray(w))throw new Error('"plugins" must be an array');j=w}}if(j&&j.length>0){if(i.isSync){I(new Error("Cannot use plugins in synchronous API calls"),"");return}Ye(e,r,s,a,i,u,l,j,F).then(w=>{if(!w.ok){I(w.error,w.pluginName);return}try{V(w.requestPlugins,w.runOnEndCallbacks)}catch(d){I(d,"")}},w=>I(w,""));return}try{V(null,(w,d,o)=>o())}catch(w){I(w,"")}function V(w,d){let o=!i.isWriteUnavailable,{entries:f,flags:y,write:x,stdinContents:O,stdinResolveDir:c,absWorkingDir:p,incremental:b,nodePaths:$,watch:R,mangleCache:C}=Ke(t,l,S,xe,o),M={command:"build",key:e,entries:f,flags:y,write:x,stdinContents:O,stdinResolveDir:c,absWorkingDir:p||E,incremental:b,nodePaths:$};w&&(M.plugins=w),C&&(M.mangleCache=C);let v=g&&Je(e,r,s,a,u,g,M),D,L,z=(A,P)=>{A.outputFiles&&(P.outputFiles=A.outputFiles.map(Qe)),A.metafile&&(P.metafile=JSON.parse(A.metafile)),A.mangleCache&&(P.mangleCache=A.mangleCache),A.writeToStdout!==void 0&&console.log(Z(A.writeToStdout).replace(/\n$/,""))},W=(A,P)=>{let _={errors:G(A.errors,F),warnings:G(A.warnings,F)};z(A,_),d(_,N,()=>{if(_.errors.length>0)return P(re("Build failed",_.errors,_.warnings),null);if(A.rebuild){if(!D){let J=!1;D=()=>new Promise((X,te)=>{if(J||k.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:e},(Y,m)=>{if(Y)return P(re("Build failed",[{id:"",pluginName:"",text:Y,location:null,notes:[],detail:void 0}],[]),null);W(m,(T,oe)=>{T?te(T):X(oe)})})}),a.ref(),D.dispose=()=>{J||(J=!0,r(a,{command:"rebuild-dispose",key:e},()=>{}),a.unref())}}_.rebuild=D}if(A.watch){if(!L){let J=!1;a.ref(),L=()=>{J||(J=!0,delete u["watch-rebuild"],r(a,{command:"watch-stop",key:e},()=>{}),a.unref())},R&&(u["watch-rebuild"]=(X,te)=>{try{let Y=te.args,m={errors:G(Y.errors,F),warnings:G(Y.warnings,F)};z(Y,m),d(m,N,()=>{if(m.errors.length>0){R.onRebuild&&R.onRebuild(re("Build failed",m.errors,m.warnings),null);return}m.stop=L,R.onRebuild&&R.onRebuild(null,m)})}catch(Y){console.error(Y)}s(X,{})})}_.stop=L}P(null,_)})};if(x&&i.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(b&&i.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(R&&i.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,M,(A,P)=>{if(A)return B(new Error(A),null);if(v){let _=P,J=!1;a.ref();let X={port:_.port,host:_.host,wait:v.wait,stop(){J||(J=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,X)}return W(P,B)})}}var Je=(t,e,r,s,a,i,u)=>{let l={},g=n(i,l,"port",ne),S=n(i,l,"host",h),E=n(i,l,"servedir",h),k=n(i,l,"onRequest",be),B=new Promise((F,N)=>{a["serve-wait"]=(I,j)=>{j.error!==null?N(new Error(j.error)):F(),r(I,{})}});return u.serve={},K(i,l,"in serve() call"),g!==void 0&&(u.serve.port=g),S!==void 0&&(u.serve.host=S),E!==void 0&&(u.serve.servedir=E),a["serve-request"]=(F,N)=>{k&&k(N.args),r(F,{})},{wait:B,stop(){e(s,{command:"serve-stop",key:t},()=>{})}}},Ye=async(t,e,r,s,a,i,u,l,g)=>{let S=[],E=[],k={},B={},F=0,N=0,I=[],j=!1;l=[...l];for(let w of l){let d={};if(typeof w!="object")throw new Error(`Plugin at index ${N} must be an object`);let o=n(w,d,"name",h);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let f=n(w,d,"setup",be);if(typeof f!="function")throw new Error("Plugin is missing a setup function");K(w,d,`on plugin ${JSON.stringify(o)}`);let y={name:o,onResolve:[],onLoad:[]};N++;let O=f({initialOptions:u,resolve:(c,p={})=>{if(!j)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let b=Object.create(null),$=n(p,b,"pluginName",h),R=n(p,b,"importer",h),C=n(p,b,"namespace",h),M=n(p,b,"resolveDir",h),v=n(p,b,"kind",h),D=n(p,b,"pluginData",fe);return K(p,b,"in resolve() call"),new Promise((L,z)=>{let W={command:"resolve",path:c,key:t,pluginName:o};$!=null&&(W.pluginName=$),R!=null&&(W.importer=R),C!=null&&(W.namespace=C),M!=null&&(W.resolveDir=M),v!=null&&(W.kind=v),D!=null&&(W.pluginData=g.store(D)),e(s,W,(A,P)=>{A!==null?z(new Error(A)):L({errors:G(P.errors,g),warnings:G(P.warnings,g),path:P.path,external:P.external,sideEffects:P.sideEffects,namespace:P.namespace,suffix:P.suffix,pluginData:g.load(P.pluginData)})})})},onStart(c){let p='This error came from the "onStart" callback registered here:',b=ae(new Error(p),a,"onStart");S.push({name:o,callback:c,note:b})},onEnd(c){let p='This error came from the "onEnd" callback registered here:',b=ae(new Error(p),a,"onEnd");E.push({name:o,callback:c,note:b})},onResolve(c,p){let b='This error came from the "onResolve" callback registered here:',$=ae(new Error(b),a,"onResolve"),R={},C=n(c,R,"filter",ce),M=n(c,R,"namespace",h);if(K(c,R,`in onResolve() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onResolve() call is missing a filter");let v=F++;k[v]={name:o,callback:p,note:$},y.onResolve.push({id:v,filter:C.source,namespace:M||""})},onLoad(c,p){let b='This error came from the "onLoad" callback registered here:',$=ae(new Error(b),a,"onLoad"),R={},C=n(c,R,"filter",ce),M=n(c,R,"namespace",h);if(K(c,R,`in onLoad() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onLoad() call is missing a filter");let v=F++;B[v]={name:o,callback:p,note:$},y.onLoad.push({id:v,filter:C.source,namespace:M||""})},esbuild:a.esbuild});O&&await O,I.push(y)}catch(f){return{ok:!1,error:f,pluginName:o}}}i["on-start"]=async(w,d)=>{let o={errors:[],warnings:[]};await Promise.all(S.map(async({name:f,callback:y,note:x})=>{try{let O=await y();if(O!=null){if(typeof O!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(f)} to return an object`);let c={},p=n(O,c,"errors",q),b=n(O,c,"warnings",q);K(O,c,`from onStart() callback in plugin ${JSON.stringify(f)}`),p!=null&&o.errors.push(...ee(p,"errors",g,f)),b!=null&&o.warnings.push(...ee(b,"warnings",g,f))}}catch(O){o.errors.push(le(O,a,g,x&&x(),f))}})),r(w,o)},i["on-resolve"]=async(w,d)=>{let o={},f="",y,x;for(let O of d.ids)try{({name:f,callback:y,note:x}=k[O]);let c=await y({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:g.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(f)} to return an object`);let p={},b=n(c,p,"pluginName",h),$=n(c,p,"path",h),R=n(c,p,"namespace",h),C=n(c,p,"suffix",h),M=n(c,p,"external",U),v=n(c,p,"sideEffects",U),D=n(c,p,"pluginData",fe),L=n(c,p,"errors",q),z=n(c,p,"warnings",q),W=n(c,p,"watchFiles",q),A=n(c,p,"watchDirs",q);K(c,p,`from onResolve() callback in plugin ${JSON.stringify(f)}`),o.id=O,b!=null&&(o.pluginName=b),$!=null&&(o.path=$),R!=null&&(o.namespace=R),C!=null&&(o.suffix=C),M!=null&&(o.external=M),v!=null&&(o.sideEffects=v),D!=null&&(o.pluginData=g.store(D)),L!=null&&(o.errors=ee(L,"errors",g,f)),z!=null&&(o.warnings=ee(z,"warnings",g,f)),W!=null&&(o.watchFiles=ue(W,"watchFiles")),A!=null&&(o.watchDirs=ue(A,"watchDirs"));break}}catch(c){o={id:O,errors:[le(c,a,g,x&&x(),f)]};break}r(w,o)},i["on-load"]=async(w,d)=>{let o={},f="",y,x;for(let O of d.ids)try{({name:f,callback:y,note:x}=B[O]);let c=await y({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:g.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(f)} to return an object`);let p={},b=n(c,p,"pluginName",h),$=n(c,p,"contents",Ae),R=n(c,p,"resolveDir",h),C=n(c,p,"pluginData",fe),M=n(c,p,"loader",h),v=n(c,p,"errors",q),D=n(c,p,"warnings",q),L=n(c,p,"watchFiles",q),z=n(c,p,"watchDirs",q);K(c,p,`from onLoad() callback in plugin ${JSON.stringify(f)}`),o.id=O,b!=null&&(o.pluginName=b),$ instanceof Uint8Array?o.contents=$:$!=null&&(o.contents=Q($)),R!=null&&(o.resolveDir=R),C!=null&&(o.pluginData=g.store(C)),M!=null&&(o.loader=M),v!=null&&(o.errors=ee(v,"errors",g,f)),D!=null&&(o.warnings=ee(D,"warnings",g,f)),L!=null&&(o.watchFiles=ue(L,"watchFiles")),z!=null&&(o.watchDirs=ue(z,"watchDirs"));break}}catch(c){o={id:O,errors:[le(c,a,g,x&&x(),f)]};break}r(w,o)};let V=(w,d,o)=>o();return E.length>0&&(V=(w,d,o)=>{(async()=>{for(let{name:f,callback:y,note:x}of E)try{await y(w)}catch(O){w.errors.push(await new Promise(c=>d(O,f,x&&x(),c)))}})().then(o)}),j=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:V}};function Te(){let t=new Map,e=0;return{load(r){return t.get(r)},store(r){if(r===void 0)return-1;let s=e++;return t.set(s,r),s}}}function ae(t,e,r){let s,a=!1;return()=>{if(a)return s;a=!0;try{let i=(t.stack+"").split(`
1
+ var Ue=Object.defineProperty;var Ne=(t,e)=>{for(var r in e)Ue(t,r,{get:e[r],enumerable:!0})};var ge={};Ne(ge,{analyzeMetafile:()=>rt,analyzeMetafileSync:()=>ot,build:()=>Xe,buildSync:()=>nt,default:()=>ut,formatMessages:()=>tt,formatMessagesSync:()=>it,initialize:()=>st,serve:()=>Ze,transform:()=>et,transformSync:()=>lt,version:()=>Ge});function ye(t){let e=s=>{if(s===null)r.write8(0);else if(typeof s=="boolean")r.write8(1),r.write8(+s);else if(typeof s=="number")r.write8(2),r.write32(s|0);else if(typeof s=="string")r.write8(3),r.write(Q(s));else if(s instanceof Uint8Array)r.write8(4),r.write(s);else if(s instanceof Array){r.write8(5),r.write32(s.length);for(let a of s)e(a)}else{let a=Object.keys(s);r.write8(6),r.write32(a.length);for(let i of a)r.write(Q(i)),e(s[i])}},r=new se;return r.write32(0),r.write32(t.id<<1|+!t.isRequest),e(t.value),me(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Oe(t){let e=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return Z(r.read());case 4:return r.read();case 5:{let u=r.read32(),l=[];for(let g=0;g<u;g++)l.push(e());return l}case 6:{let u=r.read32(),l={};for(let g=0;g<u;g++)l[Z(r.read())]=e();return l}default:throw new Error("Invalid packet")}},r=new se(t),s=r.read32(),a=(s&1)===0;s>>>=1;let i=e();if(r.ptr!==t.length)throw new Error("Invalid packet");return{id:s,isRequest:a,value:i}}var se=class{constructor(e=new Uint8Array(1024)){this.buf=e;this.len=0;this.ptr=0}_write(e){if(this.len+e>this.buf.length){let r=new Uint8Array((this.len+e)*2);r.set(this.buf),this.buf=r}return this.len+=e,this.len-e}write8(e){let r=this._write(1);this.buf[r]=e}write32(e){let r=this._write(4);me(this.buf,e,r)}write(e){let r=this._write(4+e.length);me(this.buf,e.length,r),this.buf.set(e,r+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return he(this.buf,this._read(4))}read(){let e=this.read32(),r=new Uint8Array(e),s=this._read(r.length);return r.set(this.buf.subarray(s,s+e)),r}},Q,Z;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let t=new TextEncoder,e=new TextDecoder;Q=r=>t.encode(r),Z=r=>e.decode(r)}else if(typeof Buffer!="undefined")Q=t=>{let e=Buffer.from(t);return e instanceof Uint8Array||(e=new Uint8Array(e)),e},Z=t=>{let{buffer:e,byteOffset:r,byteLength:s}=t;return Buffer.from(e,r,s).toString()};else throw new Error("No UTF-8 codec found");function he(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function me(t,e,r){t[r++]=e,t[r++]=e>>8,t[r++]=e>>16,t[r++]=e>>24}var xe="warning",Se="silent";function Ee(t){if(t+="",t.indexOf(",")>=0)throw new Error(`Invalid target: ${t}`);return t}var fe=()=>null,U=t=>typeof t=="boolean"?null:"a boolean",Le=t=>typeof t=="boolean"||typeof t=="object"&&!Array.isArray(t)?null:"a boolean or an object",h=t=>typeof t=="string"?null:"a string",ce=t=>t instanceof RegExp?null:"a RegExp object",ne=t=>typeof t=="number"&&t===(t|0)?null:"an integer",be=t=>typeof t=="function"?null:"a function",q=t=>Array.isArray(t)?null:"an array",H=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",We=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",qe=t=>typeof t=="object"&&t!==null?null:"an array or an object",ke=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",Me=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",Ie=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",ze=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",Ae=t=>typeof t=="string"||t instanceof Uint8Array?null:"a string or a Uint8Array";function n(t,e,r,s){let a=t[r];if(e[r+""]=!0,a===void 0)return;let i=s(a);if(i!==null)throw new Error(`"${r}" must be ${i}`);return a}function K(t,e,r){for(let s in t)if(!(s in e))throw new Error(`Invalid option ${r}: "${s}"`)}function Ce(t){let e=Object.create(null),r=n(t,e,"wasmURL",h),s=n(t,e,"wasmModule",We),a=n(t,e,"worker",U);return K(t,e,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:a}}function De(t){let e;if(t!==void 0){e=Object.create(null);for(let r of Object.keys(t)){let s=t[r];if(typeof s=="string"||s===!1)e[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return e}function de(t,e,r,s,a){let i=n(e,r,"color",U),u=n(e,r,"logLevel",h),l=n(e,r,"logLimit",ne);i!==void 0?t.push(`--color=${i}`):s&&t.push("--color=true"),t.push(`--log-level=${u||a}`),t.push(`--log-limit=${l||0}`)}function Be(t,e,r){let s=n(e,r,"legalComments",h),a=n(e,r,"sourceRoot",h),i=n(e,r,"sourcesContent",U),u=n(e,r,"target",ze),l=n(e,r,"format",h),g=n(e,r,"globalName",h),S=n(e,r,"mangleProps",ce),E=n(e,r,"reserveProps",ce),k=n(e,r,"mangleQuoted",U),B=n(e,r,"minify",U),F=n(e,r,"minifySyntax",U),N=n(e,r,"minifyWhitespace",U),I=n(e,r,"minifyIdentifiers",U),j=n(e,r,"drop",q),V=n(e,r,"charset",h),w=n(e,r,"treeShaking",U),d=n(e,r,"ignoreAnnotations",U),o=n(e,r,"jsx",h),f=n(e,r,"jsxFactory",h),y=n(e,r,"jsxFragment",h),x=n(e,r,"jsxImportSource",h),O=n(e,r,"jsxDev",U),c=n(e,r,"jsxSideEffects",U),p=n(e,r,"define",H),b=n(e,r,"logOverride",H),$=n(e,r,"supported",H),R=n(e,r,"pure",q),C=n(e,r,"keepNames",U),M=n(e,r,"platform",h);if(s&&t.push(`--legal-comments=${s}`),a!==void 0&&t.push(`--source-root=${a}`),i!==void 0&&t.push(`--sources-content=${i}`),u&&(Array.isArray(u)?t.push(`--target=${Array.from(u).map(Ee).join(",")}`):t.push(`--target=${Ee(u)}`)),l&&t.push(`--format=${l}`),g&&t.push(`--global-name=${g}`),M&&t.push(`--platform=${M}`),B&&t.push("--minify"),F&&t.push("--minify-syntax"),N&&t.push("--minify-whitespace"),I&&t.push("--minify-identifiers"),V&&t.push(`--charset=${V}`),w!==void 0&&t.push(`--tree-shaking=${w}`),d&&t.push("--ignore-annotations"),j)for(let v of j)t.push(`--drop:${v}`);if(S&&t.push(`--mangle-props=${S.source}`),E&&t.push(`--reserve-props=${E.source}`),k!==void 0&&t.push(`--mangle-quoted=${k}`),o&&t.push(`--jsx=${o}`),f&&t.push(`--jsx-factory=${f}`),y&&t.push(`--jsx-fragment=${y}`),x&&t.push(`--jsx-import-source=${x}`),O&&t.push("--jsx-dev"),c&&t.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);t.push(`--define:${v}=${p[v]}`)}if(b)for(let v in b){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);t.push(`--log-override:${v}=${b[v]}`)}if($)for(let v in $){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);t.push(`--supported:${v}=${$[v]}`)}if(R)for(let v of R)t.push(`--pure:${v}`);C&&t.push("--keep-names")}function Ke(t,e,r,s,a){var Y;let i=[],u=[],l=Object.create(null),g=null,S=null,E=null;de(i,e,l,r,s),Be(i,e,l);let k=n(e,l,"sourcemap",Me),B=n(e,l,"bundle",U),F=n(e,l,"watch",Le),N=n(e,l,"splitting",U),I=n(e,l,"preserveSymlinks",U),j=n(e,l,"metafile",U),V=n(e,l,"outfile",h),w=n(e,l,"outdir",h),d=n(e,l,"outbase",h),o=n(e,l,"tsconfig",h),f=n(e,l,"resolveExtensions",q),y=n(e,l,"nodePaths",q),x=n(e,l,"mainFields",q),O=n(e,l,"conditions",q),c=n(e,l,"external",q),p=n(e,l,"loader",H),b=n(e,l,"outExtension",H),$=n(e,l,"publicPath",h),R=n(e,l,"entryNames",h),C=n(e,l,"chunkNames",h),M=n(e,l,"assetNames",h),v=n(e,l,"inject",q),D=n(e,l,"banner",H),L=n(e,l,"footer",H),z=n(e,l,"entryPoints",qe),W=n(e,l,"absWorkingDir",h),A=n(e,l,"stdin",H),P=(Y=n(e,l,"write",U))!=null?Y:a,_=n(e,l,"allowOverwrite",U),J=n(e,l,"incremental",U)===!0,X=n(e,l,"mangleCache",H);if(l.plugins=!0,K(e,l,`in ${t}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),B&&i.push("--bundle"),_&&i.push("--allow-overwrite"),F)if(i.push("--watch"),typeof F=="boolean")E={};else{let m=Object.create(null),T=n(F,m,"onRebuild",be);K(F,m,`on "watch" in ${t}() call`),E={onRebuild:T}}if(N&&i.push("--splitting"),I&&i.push("--preserve-symlinks"),j&&i.push("--metafile"),V&&i.push(`--outfile=${V}`),w&&i.push(`--outdir=${w}`),d&&i.push(`--outbase=${d}`),o&&i.push(`--tsconfig=${o}`),f){let m=[];for(let T of f){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${T}`);m.push(T)}i.push(`--resolve-extensions=${m.join(",")}`)}if($&&i.push(`--public-path=${$}`),R&&i.push(`--entry-names=${R}`),C&&i.push(`--chunk-names=${C}`),M&&i.push(`--asset-names=${M}`),x){let m=[];for(let T of x){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid main field: ${T}`);m.push(T)}i.push(`--main-fields=${m.join(",")}`)}if(O){let m=[];for(let T of O){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid condition: ${T}`);m.push(T)}i.push(`--conditions=${m.join(",")}`)}if(c)for(let m of c)i.push(`--external:${m}`);if(D)for(let m in D){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);i.push(`--banner:${m}=${D[m]}`)}if(L)for(let m in L){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);i.push(`--footer:${m}=${L[m]}`)}if(v)for(let m of v)i.push(`--inject:${m}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);i.push(`--loader:${m}=${p[m]}`)}if(b)for(let m in b){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);i.push(`--out-extension:${m}=${b[m]}`)}if(z)if(Array.isArray(z))for(let m of z)u.push(["",m+""]);else for(let[m,T]of Object.entries(z))u.push([m+"",T+""]);if(A){let m=Object.create(null),T=n(A,m,"contents",Ae),oe=n(A,m,"resolveDir",h),ve=n(A,m,"sourcefile",h),Re=n(A,m,"loader",h);K(A,m,'in "stdin" object'),ve&&i.push(`--sourcefile=${ve}`),Re&&i.push(`--loader=${Re}`),oe&&(S=oe+""),typeof T=="string"?g=Q(T):T instanceof Uint8Array&&(g=T)}let te=[];if(y)for(let m of y)m+="",te.push(m);return{entries:u,flags:i,write:P,stdinContents:g,stdinResolveDir:S,absWorkingDir:W,incremental:J,nodePaths:te,watch:E,mangleCache:De(X)}}function _e(t,e,r,s){let a=[],i=Object.create(null);de(a,e,i,r,s),Be(a,e,i);let u=n(e,i,"sourcemap",Me),l=n(e,i,"tsconfigRaw",Ie),g=n(e,i,"sourcefile",h),S=n(e,i,"loader",h),E=n(e,i,"banner",h),k=n(e,i,"footer",h),B=n(e,i,"mangleCache",H);return K(e,i,`in ${t}() call`),u&&a.push(`--sourcemap=${u===!0?"external":u}`),l&&a.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),g&&a.push(`--sourcefile=${g}`),S&&a.push(`--loader=${S}`),E&&a.push(`--banner=${E}`),k&&a.push(`--footer=${k}`),{flags:a,mangleCache:De(B)}}function Pe(t){let e={},r={didClose:!1,reason:""},s={},a=0,i=0,u=new Uint8Array(16*1024),l=0,g=d=>{let o=l+d.length;if(o>u.length){let y=new Uint8Array(o*2);y.set(u),u=y}u.set(d,l),l+=d.length;let f=0;for(;f+4<=l;){let y=he(u,f);if(f+4+y>l)break;f+=4,N(u.subarray(f,f+y)),f+=y}f>0&&(u.copyWithin(0,f,l),l-=f)},S=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let o="The service was stopped"+r.reason;for(let f in s)s[f](o,null);s={}},E=(d,o,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let y=a++;s[y]=(x,O)=>{try{f(x,O)}finally{d&&d.unref()}},d&&d.ref(),t.writeToStdin(ye({id:y,isRequest:!0,value:o}))},k=(d,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);t.writeToStdin(ye({id:d,isRequest:!1,value:o}))},B=async(d,o)=>{try{if(o.command==="ping"){k(d,{});return}if(typeof o.key=="number"){let f=e[o.key];if(f){let y=f[o.command];if(y){await y(d,o);return}}}throw new Error("Invalid command: "+o.command)}catch(f){k(d,{errors:[le(f,t,null,void 0,"")]})}},F=!0,N=d=>{if(F){F=!1;let f=String.fromCharCode(...d);if(f!=="0.15.12")throw new Error(`Cannot start service: Host version "0.15.12" does not match binary version ${JSON.stringify(f)}`);return}let o=Oe(d);if(o.isRequest)B(o.id,o.value);else{let f=s[o.id];delete s[o.id],o.value.error?f(o.value.error,{}):f(null,o.value)}};return{readFromStdout:g,afterClose:S,service:{buildOrServe:({callName:d,refs:o,serveOptions:f,options:y,isTTY:x,defaultWD:O,callback:c})=>{let p=0,b=i++,$={},R={ref(){++p===1&&o&&o.ref()},unref(){--p===0&&(delete e[b],o&&o.unref())}};e[b]=$,R.ref(),Ve(d,b,E,k,R,t,$,y,f,x,O,r,(C,M)=>{try{c(C,M)}finally{R.unref()}})},transform:({callName:d,refs:o,input:f,options:y,isTTY:x,fs:O,callback:c})=>{let p=Te(),b=$=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:R,mangleCache:C}=_e(d,y,x,Se),M={command:"transform",flags:R,inputFS:$!==null,input:$!==null?Q($):typeof f=="string"?Q(f):f};C&&(M.mangleCache=C),E(o,M,(v,D)=>{if(v)return c(new Error(v),null);let L=G(D.errors,p),z=G(D.warnings,p),W=1,A=()=>{if(--W===0){let P={warnings:z,code:D.code,map:D.map};D.mangleCache&&(P.mangleCache=D==null?void 0:D.mangleCache),c(null,P)}};if(L.length>0)return c(re("Transform failed",L,z),null);D.codeFS&&(W++,O.readFile(D.code,(P,_)=>{P!==null?c(P,null):(D.code=_,A())})),D.mapFS&&(W++,O.readFile(D.map,(P,_)=>{P!==null?c(P,null):(D.map=_,A())})),A()})}catch(R){let C=[];try{de(C,y,{},x,Se)}catch(v){}let M=le(R,t,p,void 0,"");E(o,{command:"error",flags:C,error:M},()=>{M.detail=p.load(M.detail),c(re("Transform failed",[M],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let $=b;b=()=>O.writeFile(f,$)}b(null)},formatMessages:({callName:d,refs:o,messages:f,options:y,callback:x})=>{let O=ee(f,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${d}() call`);let c={},p=n(y,c,"kind",h),b=n(y,c,"color",U),$=n(y,c,"terminalWidth",ne);if(K(y,c,`in ${d}() call`),p===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(p!=="error"&&p!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:O,isWarning:p==="warning"};b!==void 0&&(R.color=b),$!==void 0&&(R.terminalWidth=$),E(o,R,(C,M)=>{if(C)return x(new Error(C),null);x(null,M.messages)})},analyzeMetafile:({callName:d,refs:o,metafile:f,options:y,callback:x})=>{y===void 0&&(y={});let O={},c=n(y,O,"color",U),p=n(y,O,"verbose",U);K(y,O,`in ${d}() call`);let b={command:"analyze-metafile",metafile:f};c!==void 0&&(b.color=c),p!==void 0&&(b.verbose=p),E(o,b,($,R)=>{if($)return x(new Error($),null);x(null,R.result)})}}}}function Ve(t,e,r,s,a,i,u,l,g,S,E,k,B){let F=Te(),N=(w,d,o,f)=>{let y=[];try{de(y,l,{},S,xe)}catch(O){}let x=le(w,i,F,o,d);r(a,{command:"error",flags:y,error:x},()=>{x.detail=F.load(x.detail),f(x)})},I=(w,d)=>{N(w,d,void 0,o=>{B(re("Build failed",[o],[]),null)})},j;if(typeof l=="object"){let w=l.plugins;if(w!==void 0){if(!Array.isArray(w))throw new Error('"plugins" must be an array');j=w}}if(j&&j.length>0){if(i.isSync){I(new Error("Cannot use plugins in synchronous API calls"),"");return}Ye(e,r,s,a,i,u,l,j,F).then(w=>{if(!w.ok){I(w.error,w.pluginName);return}try{V(w.requestPlugins,w.runOnEndCallbacks)}catch(d){I(d,"")}},w=>I(w,""));return}try{V(null,(w,d,o)=>o())}catch(w){I(w,"")}function V(w,d){let o=!i.isWriteUnavailable,{entries:f,flags:y,write:x,stdinContents:O,stdinResolveDir:c,absWorkingDir:p,incremental:b,nodePaths:$,watch:R,mangleCache:C}=Ke(t,l,S,xe,o),M={command:"build",key:e,entries:f,flags:y,write:x,stdinContents:O,stdinResolveDir:c,absWorkingDir:p||E,incremental:b,nodePaths:$};w&&(M.plugins=w),C&&(M.mangleCache=C);let v=g&&Je(e,r,s,a,u,g,M),D,L,z=(A,P)=>{A.outputFiles&&(P.outputFiles=A.outputFiles.map(Qe)),A.metafile&&(P.metafile=JSON.parse(A.metafile)),A.mangleCache&&(P.mangleCache=A.mangleCache),A.writeToStdout!==void 0&&console.log(Z(A.writeToStdout).replace(/\n$/,""))},W=(A,P)=>{let _={errors:G(A.errors,F),warnings:G(A.warnings,F)};z(A,_),d(_,N,()=>{if(_.errors.length>0)return P(re("Build failed",_.errors,_.warnings),null);if(A.rebuild){if(!D){let J=!1;D=()=>new Promise((X,te)=>{if(J||k.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:e},(Y,m)=>{if(Y)return P(re("Build failed",[{id:"",pluginName:"",text:Y,location:null,notes:[],detail:void 0}],[]),null);W(m,(T,oe)=>{T?te(T):X(oe)})})}),a.ref(),D.dispose=()=>{J||(J=!0,r(a,{command:"rebuild-dispose",key:e},()=>{}),a.unref())}}_.rebuild=D}if(A.watch){if(!L){let J=!1;a.ref(),L=()=>{J||(J=!0,delete u["watch-rebuild"],r(a,{command:"watch-stop",key:e},()=>{}),a.unref())},R&&(u["watch-rebuild"]=(X,te)=>{try{let Y=te.args,m={errors:G(Y.errors,F),warnings:G(Y.warnings,F)};z(Y,m),d(m,N,()=>{if(m.errors.length>0){R.onRebuild&&R.onRebuild(re("Build failed",m.errors,m.warnings),null);return}m.stop=L,R.onRebuild&&R.onRebuild(null,m)})}catch(Y){console.error(Y)}s(X,{})})}_.stop=L}P(null,_)})};if(x&&i.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(b&&i.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(R&&i.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,M,(A,P)=>{if(A)return B(new Error(A),null);if(v){let _=P,J=!1;a.ref();let X={port:_.port,host:_.host,wait:v.wait,stop(){J||(J=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,X)}return W(P,B)})}}var Je=(t,e,r,s,a,i,u)=>{let l={},g=n(i,l,"port",ne),S=n(i,l,"host",h),E=n(i,l,"servedir",h),k=n(i,l,"onRequest",be),B=new Promise((F,N)=>{a["serve-wait"]=(I,j)=>{j.error!==null?N(new Error(j.error)):F(),r(I,{})}});return u.serve={},K(i,l,"in serve() call"),g!==void 0&&(u.serve.port=g),S!==void 0&&(u.serve.host=S),E!==void 0&&(u.serve.servedir=E),a["serve-request"]=(F,N)=>{k&&k(N.args),r(F,{})},{wait:B,stop(){e(s,{command:"serve-stop",key:t},()=>{})}}},Ye=async(t,e,r,s,a,i,u,l,g)=>{let S=[],E=[],k={},B={},F=0,N=0,I=[],j=!1;l=[...l];for(let w of l){let d={};if(typeof w!="object")throw new Error(`Plugin at index ${N} must be an object`);let o=n(w,d,"name",h);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let f=n(w,d,"setup",be);if(typeof f!="function")throw new Error("Plugin is missing a setup function");K(w,d,`on plugin ${JSON.stringify(o)}`);let y={name:o,onResolve:[],onLoad:[]};N++;let O=f({initialOptions:u,resolve:(c,p={})=>{if(!j)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let b=Object.create(null),$=n(p,b,"pluginName",h),R=n(p,b,"importer",h),C=n(p,b,"namespace",h),M=n(p,b,"resolveDir",h),v=n(p,b,"kind",h),D=n(p,b,"pluginData",fe);return K(p,b,"in resolve() call"),new Promise((L,z)=>{let W={command:"resolve",path:c,key:t,pluginName:o};$!=null&&(W.pluginName=$),R!=null&&(W.importer=R),C!=null&&(W.namespace=C),M!=null&&(W.resolveDir=M),v!=null&&(W.kind=v),D!=null&&(W.pluginData=g.store(D)),e(s,W,(A,P)=>{A!==null?z(new Error(A)):L({errors:G(P.errors,g),warnings:G(P.warnings,g),path:P.path,external:P.external,sideEffects:P.sideEffects,namespace:P.namespace,suffix:P.suffix,pluginData:g.load(P.pluginData)})})})},onStart(c){let p='This error came from the "onStart" callback registered here:',b=ae(new Error(p),a,"onStart");S.push({name:o,callback:c,note:b})},onEnd(c){let p='This error came from the "onEnd" callback registered here:',b=ae(new Error(p),a,"onEnd");E.push({name:o,callback:c,note:b})},onResolve(c,p){let b='This error came from the "onResolve" callback registered here:',$=ae(new Error(b),a,"onResolve"),R={},C=n(c,R,"filter",ce),M=n(c,R,"namespace",h);if(K(c,R,`in onResolve() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onResolve() call is missing a filter");let v=F++;k[v]={name:o,callback:p,note:$},y.onResolve.push({id:v,filter:C.source,namespace:M||""})},onLoad(c,p){let b='This error came from the "onLoad" callback registered here:',$=ae(new Error(b),a,"onLoad"),R={},C=n(c,R,"filter",ce),M=n(c,R,"namespace",h);if(K(c,R,`in onLoad() call for plugin ${JSON.stringify(o)}`),C==null)throw new Error("onLoad() call is missing a filter");let v=F++;B[v]={name:o,callback:p,note:$},y.onLoad.push({id:v,filter:C.source,namespace:M||""})},esbuild:a.esbuild});O&&await O,I.push(y)}catch(f){return{ok:!1,error:f,pluginName:o}}}i["on-start"]=async(w,d)=>{let o={errors:[],warnings:[]};await Promise.all(S.map(async({name:f,callback:y,note:x})=>{try{let O=await y();if(O!=null){if(typeof O!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(f)} to return an object`);let c={},p=n(O,c,"errors",q),b=n(O,c,"warnings",q);K(O,c,`from onStart() callback in plugin ${JSON.stringify(f)}`),p!=null&&o.errors.push(...ee(p,"errors",g,f)),b!=null&&o.warnings.push(...ee(b,"warnings",g,f))}}catch(O){o.errors.push(le(O,a,g,x&&x(),f))}})),r(w,o)},i["on-resolve"]=async(w,d)=>{let o={},f="",y,x;for(let O of d.ids)try{({name:f,callback:y,note:x}=k[O]);let c=await y({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:g.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(f)} to return an object`);let p={},b=n(c,p,"pluginName",h),$=n(c,p,"path",h),R=n(c,p,"namespace",h),C=n(c,p,"suffix",h),M=n(c,p,"external",U),v=n(c,p,"sideEffects",U),D=n(c,p,"pluginData",fe),L=n(c,p,"errors",q),z=n(c,p,"warnings",q),W=n(c,p,"watchFiles",q),A=n(c,p,"watchDirs",q);K(c,p,`from onResolve() callback in plugin ${JSON.stringify(f)}`),o.id=O,b!=null&&(o.pluginName=b),$!=null&&(o.path=$),R!=null&&(o.namespace=R),C!=null&&(o.suffix=C),M!=null&&(o.external=M),v!=null&&(o.sideEffects=v),D!=null&&(o.pluginData=g.store(D)),L!=null&&(o.errors=ee(L,"errors",g,f)),z!=null&&(o.warnings=ee(z,"warnings",g,f)),W!=null&&(o.watchFiles=ue(W,"watchFiles")),A!=null&&(o.watchDirs=ue(A,"watchDirs"));break}}catch(c){o={id:O,errors:[le(c,a,g,x&&x(),f)]};break}r(w,o)},i["on-load"]=async(w,d)=>{let o={},f="",y,x;for(let O of d.ids)try{({name:f,callback:y,note:x}=B[O]);let c=await y({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:g.load(d.pluginData)});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(f)} to return an object`);let p={},b=n(c,p,"pluginName",h),$=n(c,p,"contents",Ae),R=n(c,p,"resolveDir",h),C=n(c,p,"pluginData",fe),M=n(c,p,"loader",h),v=n(c,p,"errors",q),D=n(c,p,"warnings",q),L=n(c,p,"watchFiles",q),z=n(c,p,"watchDirs",q);K(c,p,`from onLoad() callback in plugin ${JSON.stringify(f)}`),o.id=O,b!=null&&(o.pluginName=b),$ instanceof Uint8Array?o.contents=$:$!=null&&(o.contents=Q($)),R!=null&&(o.resolveDir=R),C!=null&&(o.pluginData=g.store(C)),M!=null&&(o.loader=M),v!=null&&(o.errors=ee(v,"errors",g,f)),D!=null&&(o.warnings=ee(D,"warnings",g,f)),L!=null&&(o.watchFiles=ue(L,"watchFiles")),z!=null&&(o.watchDirs=ue(z,"watchDirs"));break}}catch(c){o={id:O,errors:[le(c,a,g,x&&x(),f)]};break}r(w,o)};let V=(w,d,o)=>o();return E.length>0&&(V=(w,d,o)=>{(async()=>{for(let{name:f,callback:y,note:x}of E)try{await y(w)}catch(O){w.errors.push(await new Promise(c=>d(O,f,x&&x(),c)))}})().then(o)}),j=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:V}};function Te(){let t=new Map,e=0;return{load(r){return t.get(r)},store(r){if(r===void 0)return-1;let s=e++;return t.set(s,r),s}}}function ae(t,e,r){let s,a=!1;return()=>{if(a)return s;a=!0;try{let i=(t.stack+"").split(`
2
2
  `);i.splice(1,1);let u=Fe(e,i,r);if(u)return s={text:t.message,location:u},s}catch(i){}}}function le(t,e,r,s,a){let i="Internal error",u=null;try{i=(t&&t.message||t)+""}catch(l){}try{u=Fe(e,(t.stack+"").split(`
3
3
  `),"")}catch(l){}return{id:"",pluginName:a,text:i,location:u,notes:s?[s]:[],detail:r?r.store(t):-1}}function Fe(t,e,r){let s=" at ";if(t.readFileSync&&!e[0].startsWith(s)&&e[1].startsWith(s))for(let a=1;a<e.length;a++){let i=e[a];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let u=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(u){i=u[1];continue}if(u=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),u){i=u[1];continue}if(u=/^(\S+):(\d+):(\d+)$/.exec(i),u){let l;try{l=t.readFileSync(u[1],"utf8")}catch(k){break}let g=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+u[2]-1]||"",S=+u[3]-1,E=g.slice(S,S+r.length)===r?r.length:0;return{file:u[1],namespace:"file",line:+u[2],column:Q(g.slice(0,S)).length,length:Q(g.slice(S,S+E)).length,lineText:g+`
4
4
  `+e.slice(1).join(`
5
5
  `),suggestion:""}}break}}return null}function re(t,e,r){let s=5,a=e.length<1?"":` with ${e.length} error${e.length<2?"":"s"}:`+e.slice(0,s+1).map((u,l)=>{if(l===s)return`
6
6
  ...`;if(!u.location)return`
7
7
  error: ${u.text}`;let{file:g,line:S,column:E}=u.location,k=u.pluginName?`[plugin: ${u.pluginName}] `:"";return`
8
- ${g}:${S}:${E}: ERROR: ${k}${u.text}`}).join(""),i=new Error(`${t}${a}`);return i.errors=e,i.warnings=r,i}function G(t,e){for(let r of t)r.detail=e.load(r.detail);return t}function $e(t,e){if(t==null)return null;let r={},s=n(t,r,"file",h),a=n(t,r,"namespace",h),i=n(t,r,"line",ne),u=n(t,r,"column",ne),l=n(t,r,"length",ne),g=n(t,r,"lineText",h),S=n(t,r,"suggestion",h);return K(t,r,e),{file:s||"",namespace:a||"",line:i||0,column:u||0,length:l||0,lineText:g||"",suggestion:S||""}}function ee(t,e,r,s){let a=[],i=0;for(let u of t){let l={},g=n(u,l,"id",h),S=n(u,l,"pluginName",h),E=n(u,l,"text",h),k=n(u,l,"location",ke),B=n(u,l,"notes",q),F=n(u,l,"detail",fe),N=`in element ${i} of "${e}"`;K(u,l,N);let I=[];if(B)for(let j of B){let V={},w=n(j,V,"text",h),d=n(j,V,"location",ke);K(j,V,N),I.push({text:w||"",location:$e(d,N)})}a.push({id:g||"",pluginName:S||s,text:E||"",location:$e(k,N),notes:I,detail:r?r.store(F):-1}),i++}return a}function ue(t,e){let r=[];for(let s of t){if(typeof s!="string")throw new Error(`${JSON.stringify(e)} must be an array of strings`);r.push(s)}return r}function Qe({path:t,contents:e}){let r=null;return{path:t,contents:e,get text(){let s=this.contents;return(r===null||s!==e)&&(e=s,r=Z(s)),r}}}var Ge="0.15.9",Xe=t=>pe().build(t),Ze=()=>{throw new Error('The "serve" API only works in node')},et=(t,e)=>pe().transform(t,e),tt=(t,e)=>pe().formatMessages(t,e),rt=(t,e)=>pe().analyzeMetafile(t,e),nt=()=>{throw new Error('The "buildSync" API only works in node')},lt=()=>{throw new Error('The "transformSync" API only works in node')},it=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ot=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ie,we,pe=()=>{if(we)return we;throw ie?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},st=t=>{t=Ce(t||{});let e=t.wasmURL,r=t.wasmModule,s=t.worker!==!1;if(!e&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ie)throw new Error('Cannot call "initialize" more than once');return ie=at(e||"",r,s),ie.catch(()=>{ie=void 0}),ie},at=async(t,e,r)=>{let s;if(e)s=e;else{let l=await fetch(t);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(t)}`);s=await l.arrayBuffer()}let a;if(r){let l=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.15.9"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});a=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
8
+ ${g}:${S}:${E}: ERROR: ${k}${u.text}`}).join(""),i=new Error(`${t}${a}`);return i.errors=e,i.warnings=r,i}function G(t,e){for(let r of t)r.detail=e.load(r.detail);return t}function $e(t,e){if(t==null)return null;let r={},s=n(t,r,"file",h),a=n(t,r,"namespace",h),i=n(t,r,"line",ne),u=n(t,r,"column",ne),l=n(t,r,"length",ne),g=n(t,r,"lineText",h),S=n(t,r,"suggestion",h);return K(t,r,e),{file:s||"",namespace:a||"",line:i||0,column:u||0,length:l||0,lineText:g||"",suggestion:S||""}}function ee(t,e,r,s){let a=[],i=0;for(let u of t){let l={},g=n(u,l,"id",h),S=n(u,l,"pluginName",h),E=n(u,l,"text",h),k=n(u,l,"location",ke),B=n(u,l,"notes",q),F=n(u,l,"detail",fe),N=`in element ${i} of "${e}"`;K(u,l,N);let I=[];if(B)for(let j of B){let V={},w=n(j,V,"text",h),d=n(j,V,"location",ke);K(j,V,N),I.push({text:w||"",location:$e(d,N)})}a.push({id:g||"",pluginName:S||s,text:E||"",location:$e(k,N),notes:I,detail:r?r.store(F):-1}),i++}return a}function ue(t,e){let r=[];for(let s of t){if(typeof s!="string")throw new Error(`${JSON.stringify(e)} must be an array of strings`);r.push(s)}return r}function Qe({path:t,contents:e}){let r=null;return{path:t,contents:e,get text(){let s=this.contents;return(r===null||s!==e)&&(e=s,r=Z(s)),r}}}var Ge="0.15.12",Xe=t=>pe().build(t),Ze=()=>{throw new Error('The "serve" API only works in node')},et=(t,e)=>pe().transform(t,e),tt=(t,e)=>pe().formatMessages(t,e),rt=(t,e)=>pe().analyzeMetafile(t,e),nt=()=>{throw new Error('The "buildSync" API only works in node')},lt=()=>{throw new Error('The "transformSync" API only works in node')},it=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ot=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ie,we,pe=()=>{if(we)return we;throw ie?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},st=t=>{t=Ce(t||{});let e=t.wasmURL,r=t.wasmModule,s=t.worker!==!1;if(!e&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ie)throw new Error('Cannot call "initialize" more than once');return ie=at(e||"",r,s),ie.catch(()=>{ie=void 0}),ie},at=async(t,e,r)=>{let s;if(e)s=e;else{let l=await fetch(t);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(t)}`);s=await l.arrayBuffer()}let a;if(r){let l=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.15.12"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});a=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
9
9
  // Copyright 2018 The Go Authors. All rights reserved.
10
10
  // Use of this source code is governed by a BSD-style
11
11
  // license that can be found in the LICENSE file.
12
12
  let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`
13
13
  `);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`
14
14
  `);d.length>1&&console.log(d.slice(0,-1).join(`
15
- `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.15.9"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(g=>a.onmessage({data:g}));a={onmessage:null,postMessage:g=>setTimeout(()=>l({data:g})),terminate(){}}}a.postMessage(s),a.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:u}=Pe({writeToStdin(l){a.postMessage(l)},isSync:!1,isWriteUnavailable:!0,esbuild:ge});we={build:l=>new Promise((g,S)=>u.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(E,k)=>E?S(E):g(k)})),transform:(l,g)=>new Promise((S,E)=>u.transform({callName:"transform",refs:null,input:l,options:g||{},isTTY:!1,fs:{readFile(k,B){B(new Error("Internal error"),null)},writeFile(k,B){B(null)}},callback:(k,B)=>k?E(k):S(B)})),formatMessages:(l,g)=>new Promise((S,E)=>u.formatMessages({callName:"formatMessages",refs:null,messages:l,options:g,callback:(k,B)=>k?E(k):S(B)})),analyzeMetafile:(l,g)=>new Promise((S,E)=>u.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:g,callback:(k,B)=>k?E(k):S(B)}))}},ut=ge;export{rt as analyzeMetafile,ot as analyzeMetafileSync,Xe as build,nt as buildSync,ut as default,tt as formatMessages,it as formatMessagesSync,st as initialize,Ze as serve,et as transform,lt as transformSync,Ge as version};
15
+ `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.15.12"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(g=>a.onmessage({data:g}));a={onmessage:null,postMessage:g=>setTimeout(()=>l({data:g})),terminate(){}}}a.postMessage(s),a.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:u}=Pe({writeToStdin(l){a.postMessage(l)},isSync:!1,isWriteUnavailable:!0,esbuild:ge});we={build:l=>new Promise((g,S)=>u.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(E,k)=>E?S(E):g(k)})),transform:(l,g)=>new Promise((S,E)=>u.transform({callName:"transform",refs:null,input:l,options:g||{},isTTY:!1,fs:{readFile(k,B){B(new Error("Internal error"),null)},writeFile(k,B){B(null)}},callback:(k,B)=>k?E(k):S(B)})),formatMessages:(l,g)=>new Promise((S,E)=>u.formatMessages({callName:"formatMessages",refs:null,messages:l,options:g,callback:(k,B)=>k?E(k):S(B)})),analyzeMetafile:(l,g)=>new Promise((S,E)=>u.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:g,callback:(k,B)=>k?E(k):S(B)}))}},ut=ge;export{rt as analyzeMetafile,ot as analyzeMetafileSync,Xe as build,nt as buildSync,ut as default,tt as formatMessages,it as formatMessagesSync,st as initialize,Ze as serve,et as transform,lt as transformSync,Ge as version};
@@ -252,11 +252,15 @@ export interface ServeResult {
252
252
  export interface TransformOptions extends CommonOptions {
253
253
  tsconfigRaw?: string | {
254
254
  compilerOptions?: {
255
+ alwaysStrict?: boolean,
256
+ importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
257
+ jsx?: 'react' | 'react-jsx' | 'react-jsxdev' | 'preserve',
255
258
  jsxFactory?: string,
256
259
  jsxFragmentFactory?: string,
257
- useDefineForClassFields?: boolean,
258
- importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
260
+ jsxImportSource?: string,
259
261
  preserveValueImports?: boolean,
262
+ target?: string,
263
+ useDefineForClassFields?: boolean,
260
264
  },
261
265
  };
262
266
 
@@ -448,6 +452,7 @@ export interface Metafile {
448
452
  }[]
449
453
  exports: string[]
450
454
  entryPoint?: string
455
+ cssBundle?: string
451
456
  }
452
457
  }
453
458
  }
@@ -724,8 +724,8 @@ function createChannel(streamIn) {
724
724
  if (isFirstPacket) {
725
725
  isFirstPacket = false;
726
726
  let binaryVersion = String.fromCharCode(...bytes);
727
- if (binaryVersion !== "0.15.9") {
728
- throw new Error(`Cannot start service: Host version "${"0.15.9"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
727
+ if (binaryVersion !== "0.15.12") {
728
+ throw new Error(`Cannot start service: Host version "${"0.15.12"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
729
729
  }
730
730
  return;
731
731
  }
@@ -1675,7 +1675,7 @@ function convertOutputFiles({ path, contents }) {
1675
1675
  }
1676
1676
 
1677
1677
  // lib/npm/browser.ts
1678
- var version = "0.15.9";
1678
+ var version = "0.15.12";
1679
1679
  var build = (options) => ensureServiceIsRunning().build(options);
1680
1680
  var serve = () => {
1681
1681
  throw new Error(`The "serve" API only works in node`);
@@ -1731,7 +1731,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
1731
1731
  }
1732
1732
  let worker;
1733
1733
  if (useWorker) {
1734
- let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.15.9"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1734
+ let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(\n () => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n },\n getInt64(sp + 8) + 1\n ));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.15.12"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1735
1735
  worker = new Worker(URL.createObjectURL(blob));
1736
1736
  } else {
1737
1737
  let onmessage = ((postMessage) => {
@@ -2335,7 +2335,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
2335
2335
  callback(null, count);
2336
2336
  };
2337
2337
  let go = new globalThis.Go();
2338
- go.argv = ["", `--service=${"0.15.9"}`];
2338
+ go.argv = ["", `--service=${"0.15.12"}`];
2339
2339
  if (wasm instanceof WebAssembly.Module) {
2340
2340
  WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));
2341
2341
  } else {