isomorfeus-asset-manager 0.15.10 → 0.16.0

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,17 +1,22 @@
1
1
  (module=>{
2
- "use strict";var ye=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var We=Object.prototype.hasOwnProperty;var qe=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})},Ie=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Le(e))!We.call(t,a)&&a!==r&&ye(t,a,{get:()=>e[a],enumerable:!(s=je(e,a))||s.enumerable});return t};var ze=t=>Ie(ye({},"__esModule",{value:!0}),t);var H=(t,e,r)=>new Promise((s,a)=>{var i=d=>{try{l(r.next(d))}catch(R){a(R)}},u=d=>{try{l(r.throw(d))}catch(R){a(R)}},l=d=>d.done?s(d.value):Promise.resolve(d.value).then(i,u);l((r=r.apply(t,e)).next())});var me={};qe(me,{analyzeMetafile:()=>at,analyzeMetafileSync:()=>dt,build:()=>lt,buildSync:()=>ut,default:()=>mt,formatMessages:()=>st,formatMessagesSync:()=>ct,initialize:()=>pt,serve:()=>it,transform:()=>ot,transformSync:()=>ft,version:()=>nt});module.exports=ze(me);function be(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 ae;return r.write32(0),r.write32(t.id<<1|+!t.isRequest),e(t.value),he(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Se(t){let e=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ee(r.read());case 4:return r.read();case 5:{let u=r.read32(),l=[];for(let d=0;d<u;d++)l.push(e());return l}case 6:{let u=r.read32(),l={};for(let d=0;d<u;d++)l[ee(r.read())]=e();return l}default:throw new Error("Invalid packet")}},r=new ae(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 ae=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);he(this.buf,e,r)}write(e){let r=this._write(4+e.length);he(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 we(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,ee;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let t=new TextEncoder,e=new TextDecoder;Q=r=>t.encode(r),ee=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},ee=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 we(t,e){return t[e++]|t[e++]<<8|t[e++]<<16|t[e++]<<24}function he(t,e,r){t[r++]=e,t[r++]=e>>8,t[r++]=e>>16,t[r++]=e>>24}var Ee="warning",ke="silent";function $e(t){if(t+="",t.indexOf(",")>=0)throw new Error(`Invalid target: ${t}`);return t}var ce=()=>null,U=t=>typeof t=="boolean"?null:"a boolean",_e=t=>typeof t=="boolean"||typeof t=="object"&&!Array.isArray(t)?null:"a boolean or an object",h=t=>typeof t=="string"?null:"a string",de=t=>t instanceof RegExp?null:"a RegExp object",le=t=>typeof t=="number"&&t===(t|0)?null:"an integer",ve=t=>typeof t=="function"?null:"a function",q=t=>Array.isArray(t)?null:"an array",G=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"an object",Ve=t=>t instanceof WebAssembly.Module?null:"a WebAssembly.Module",Je=t=>typeof t=="object"&&t!==null?null:"an array or an object",Me=t=>typeof t=="object"&&!Array.isArray(t)?null:"an object or null",Ce=t=>typeof t=="string"||typeof t=="boolean"?null:"a string or a boolean",Ye=t=>typeof t=="string"||typeof t=="object"&&t!==null&&!Array.isArray(t)?null:"a string or an object",Qe=t=>typeof t=="string"||Array.isArray(t)?null:"a string or an array",De=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 Be(t){let e=Object.create(null),r=n(t,e,"wasmURL",h),s=n(t,e,"wasmModule",Ve),a=n(t,e,"worker",U);return K(t,e,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:a}}function Pe(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 pe(t,e,r,s,a){let i=n(e,r,"color",U),u=n(e,r,"logLevel",h),l=n(e,r,"logLimit",le);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 Te(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",Qe),l=n(e,r,"format",h),d=n(e,r,"globalName",h),R=n(e,r,"mangleProps",de),E=n(e,r,"reserveProps",de),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),p=n(e,r,"ignoreAnnotations",U),o=n(e,r,"jsx",h),c=n(e,r,"jsxFactory",h),y=n(e,r,"jsxFragment",h),x=n(e,r,"jsxImportSource",h),M=n(e,r,"jsxDev",U),f=n(e,r,"jsxSideEffects",U),g=n(e,r,"define",G),b=n(e,r,"logOverride",G),S=n(e,r,"supported",G),O=n(e,r,"pure",q),C=n(e,r,"keepNames",U),$=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($e).join(",")}`):t.push(`--target=${$e(u)}`)),l&&t.push(`--format=${l}`),d&&t.push(`--global-name=${d}`),$&&t.push(`--platform=${$}`),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}`),p&&t.push("--ignore-annotations"),j)for(let v of j)t.push(`--drop:${v}`);if(R&&t.push(`--mangle-props=${R.source}`),E&&t.push(`--reserve-props=${E.source}`),k!==void 0&&t.push(`--mangle-quoted=${k}`),o&&t.push(`--jsx=${o}`),c&&t.push(`--jsx-factory=${c}`),y&&t.push(`--jsx-fragment=${y}`),x&&t.push(`--jsx-import-source=${x}`),M&&t.push("--jsx-dev"),f&&t.push("--jsx-side-effects"),g)for(let v in g){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);t.push(`--define:${v}=${g[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(S)for(let v in S){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);t.push(`--supported:${v}=${S[v]}`)}if(O)for(let v of O)t.push(`--pure:${v}`);C&&t.push("--keep-names")}function He(t,e,r,s,a){var Y;let i=[],u=[],l=Object.create(null),d=null,R=null,E=null;pe(i,e,l,r,s),Te(i,e,l);let k=n(e,l,"sourcemap",Ce),B=n(e,l,"bundle",U),F=n(e,l,"watch",_e),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),p=n(e,l,"outbase",h),o=n(e,l,"tsconfig",h),c=n(e,l,"resolveExtensions",q),y=n(e,l,"nodePaths",q),x=n(e,l,"mainFields",q),M=n(e,l,"conditions",q),f=n(e,l,"external",q),g=n(e,l,"loader",G),b=n(e,l,"outExtension",G),S=n(e,l,"publicPath",h),O=n(e,l,"entryNames",h),C=n(e,l,"chunkNames",h),$=n(e,l,"assetNames",h),v=n(e,l,"inject",q),D=n(e,l,"banner",G),L=n(e,l,"footer",G),z=n(e,l,"entryPoints",Je),W=n(e,l,"absWorkingDir",h),A=n(e,l,"stdin",G),P=(Y=n(e,l,"write",U))!=null?Y:a,_=n(e,l,"allowOverwrite",U),J=n(e,l,"incremental",U)===!0,Z=n(e,l,"mangleCache",G);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",ve);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}`),p&&i.push(`--outbase=${p}`),o&&i.push(`--tsconfig=${o}`),c){let m=[];for(let T of c){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${T}`);m.push(T)}i.push(`--resolve-extensions=${m.join(",")}`)}if(S&&i.push(`--public-path=${S}`),O&&i.push(`--entry-names=${O}`),C&&i.push(`--chunk-names=${C}`),$&&i.push(`--asset-names=${$}`),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(M){let m=[];for(let T of M){if(T+="",T.indexOf(",")>=0)throw new Error(`Invalid condition: ${T}`);m.push(T)}i.push(`--conditions=${m.join(",")}`)}if(f)for(let m of f)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(g)for(let m in g){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);i.push(`--loader:${m}=${g[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",De),se=n(A,m,"resolveDir",h),Oe=n(A,m,"sourcefile",h),xe=n(A,m,"loader",h);K(A,m,'in "stdin" object'),Oe&&i.push(`--sourcefile=${Oe}`),xe&&i.push(`--loader=${xe}`),se&&(R=se+""),typeof T=="string"?d=Q(T):T instanceof Uint8Array&&(d=T)}let re=[];if(y)for(let m of y)m+="",re.push(m);return{entries:u,flags:i,write:P,stdinContents:d,stdinResolveDir:R,absWorkingDir:W,incremental:J,nodePaths:re,watch:E,mangleCache:Pe(Z)}}function Ge(t,e,r,s){let a=[],i=Object.create(null);pe(a,e,i,r,s),Te(a,e,i);let u=n(e,i,"sourcemap",Ce),l=n(e,i,"tsconfigRaw",Ye),d=n(e,i,"sourcefile",h),R=n(e,i,"loader",h),E=n(e,i,"banner",h),k=n(e,i,"footer",h),B=n(e,i,"mangleCache",G);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)}`),d&&a.push(`--sourcefile=${d}`),R&&a.push(`--loader=${R}`),E&&a.push(`--banner=${E}`),k&&a.push(`--footer=${k}`),{flags:a,mangleCache:Pe(B)}}function Fe(t){let e={},r={didClose:!1,reason:""},s={},a=0,i=0,u=new Uint8Array(16*1024),l=0,d=p=>{let o=l+p.length;if(o>u.length){let y=new Uint8Array(o*2);y.set(u),u=y}u.set(p,l),l+=p.length;let c=0;for(;c+4<=l;){let y=we(u,c);if(c+4+y>l)break;c+=4,N(u.subarray(c,c+y)),c+=y}c>0&&(u.copyWithin(0,c,l),l-=c)},R=p=>{r.didClose=!0,p&&(r.reason=": "+(p.message||p));let o="The service was stopped"+r.reason;for(let c in s)s[c](o,null);s={}},E=(p,o,c)=>{if(r.didClose)return c("The service is no longer running"+r.reason,null);let y=a++;s[y]=(x,M)=>{try{c(x,M)}finally{p&&p.unref()}},p&&p.ref(),t.writeToStdin(be({id:y,isRequest:!0,value:o}))},k=(p,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);t.writeToStdin(be({id:p,isRequest:!1,value:o}))},B=(p,o)=>H(this,null,function*(){try{if(o.command==="ping"){k(p,{});return}if(typeof o.key=="number"){let c=e[o.key];if(c){let y=c[o.command];if(y){yield y(p,o);return}}}throw new Error("Invalid command: "+o.command)}catch(c){k(p,{errors:[ie(c,t,null,void 0,"")]})}}),F=!0,N=p=>{if(F){F=!1;let c=String.fromCharCode(...p);if(c!=="0.15.15")throw new Error(`Cannot start service: Host version "0.15.15" does not match binary version ${JSON.stringify(c)}`);return}let o=Se(p);if(o.isRequest)B(o.id,o.value);else{let c=s[o.id];delete s[o.id],o.value.error?c(o.value.error,{}):c(null,o.value)}};return{readFromStdout:d,afterClose:R,service:{buildOrServe:({callName:p,refs:o,serveOptions:c,options:y,isTTY:x,defaultWD:M,callback:f})=>{let g=0,b=i++,S={},O={ref(){++g===1&&o&&o.ref()},unref(){--g===0&&(delete e[b],o&&o.unref())}};e[b]=S,O.ref(),Xe(p,b,E,k,O,t,S,y,c,x,M,r,(C,$)=>{try{f(C,$)}finally{O.unref()}})},transform:({callName:p,refs:o,input:c,options:y,isTTY:x,fs:M,callback:f})=>{let g=Ue(),b=S=>{try{if(typeof c!="string"&&!(c instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:C}=Ge(p,y,x,ke),$={command:"transform",flags:O,inputFS:S!==null,input:S!==null?Q(S):typeof c=="string"?Q(c):c};C&&($.mangleCache=C),E(o,$,(v,D)=>{if(v)return f(new Error(v),null);let L=X(D.errors,g),z=X(D.warnings,g),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),f(null,P)}};if(L.length>0)return f(ne("Transform failed",L,z),null);D.codeFS&&(W++,M.readFile(D.code,(P,_)=>{P!==null?f(P,null):(D.code=_,A())})),D.mapFS&&(W++,M.readFile(D.map,(P,_)=>{P!==null?f(P,null):(D.map=_,A())})),A()})}catch(O){let C=[];try{pe(C,y,{},x,ke)}catch(v){}let $=ie(O,t,g,void 0,"");E(o,{command:"error",flags:C,error:$},()=>{$.detail=g.load($.detail),f(ne("Transform failed",[$],[]),null)})}};if((typeof c=="string"||c instanceof Uint8Array)&&c.length>1024*1024){let S=b;b=()=>M.writeFile(c,S)}b(null)},formatMessages:({callName:p,refs:o,messages:c,options:y,callback:x})=>{let M=te(c,"messages",null,"");if(!y)throw new Error(`Missing second argument in ${p}() call`);let f={},g=n(y,f,"kind",h),b=n(y,f,"color",U),S=n(y,f,"terminalWidth",le);if(K(y,f,`in ${p}() call`),g===void 0)throw new Error(`Missing "kind" in ${p}() call`);if(g!=="error"&&g!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${p}() call`);let O={command:"format-msgs",messages:M,isWarning:g==="warning"};b!==void 0&&(O.color=b),S!==void 0&&(O.terminalWidth=S),E(o,O,(C,$)=>{if(C)return x(new Error(C),null);x(null,$.messages)})},analyzeMetafile:({callName:p,refs:o,metafile:c,options:y,callback:x})=>{y===void 0&&(y={});let M={},f=n(y,M,"color",U),g=n(y,M,"verbose",U);K(y,M,`in ${p}() call`);let b={command:"analyze-metafile",metafile:c};f!==void 0&&(b.color=f),g!==void 0&&(b.verbose=g),E(o,b,(S,O)=>{if(S)return x(new Error(S),null);x(null,O.result)})}}}}function Xe(t,e,r,s,a,i,u,l,d,R,E,k,B){let F=Ue(),N=(w,p,o,c)=>{let y=[];try{pe(y,l,{},R,Ee)}catch(M){}let x=ie(w,i,F,o,p);r(a,{command:"error",flags:y,error:x},()=>{x.detail=F.load(x.detail),c(x)})},I=(w,p)=>{N(w,p,void 0,o=>{B(ne("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}et(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(p){I(p,"")}},w=>I(w,""));return}try{V(null,(w,p,o)=>o())}catch(w){I(w,"")}function V(w,p){let o=!i.isWriteUnavailable,{entries:c,flags:y,write:x,stdinContents:M,stdinResolveDir:f,absWorkingDir:g,incremental:b,nodePaths:S,watch:O,mangleCache:C}=He(t,l,R,Ee,o),$={command:"build",key:e,entries:c,flags:y,write:x,stdinContents:M,stdinResolveDir:f,absWorkingDir:g||E,incremental:b,nodePaths:S};w&&($.plugins=w),C&&($.mangleCache=C);let v=d&&Ze(e,r,s,a,u,d,$),D,L,z=(A,P)=>{A.outputFiles&&(P.outputFiles=A.outputFiles.map(tt)),A.metafile&&(P.metafile=JSON.parse(A.metafile)),A.mangleCache&&(P.mangleCache=A.mangleCache),A.writeToStdout!==void 0&&console.log(ee(A.writeToStdout).replace(/\n$/,""))},W=(A,P)=>{let _={errors:X(A.errors,F),warnings:X(A.warnings,F)};z(A,_),p(_,N,()=>{if(_.errors.length>0)return P(ne("Build failed",_.errors,_.warnings),null);if(A.rebuild){if(!D){let J=!1;D=()=>new Promise((Z,re)=>{if(J||k.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:e},(Y,m)=>{if(Y)return P(ne("Build failed",[{id:"",pluginName:"",text:Y,location:null,notes:[],detail:void 0}],[]),null);W(m,(T,se)=>{T?re(T):Z(se)})})}),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())},O&&(u["watch-rebuild"]=(Z,re)=>{try{let Y=re.args,m={errors:X(Y.errors,F),warnings:X(Y.warnings,F)};z(Y,m),p(m,N,()=>{if(m.errors.length>0){O.onRebuild&&O.onRebuild(ne("Build failed",m.errors,m.warnings),null);return}m.stop=L,O.onRebuild&&O.onRebuild(null,m)})}catch(Y){console.error(Y)}s(Z,{})})}_.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(O&&i.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,$,(A,P)=>{if(A)return B(new Error(A),null);if(v){let _=P,J=!1;a.ref();let Z={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,Z)}return W(P,B)})}}var Ze=(t,e,r,s,a,i,u)=>{let l={},d=n(i,l,"port",le),R=n(i,l,"host",h),E=n(i,l,"servedir",h),k=n(i,l,"onRequest",ve),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"),d!==void 0&&(u.serve.port=d),R!==void 0&&(u.serve.host=R),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},()=>{})}}},et=(t,e,r,s,a,i,u,l,d)=>H(void 0,null,function*(){let R=[],E=[],k={},B={},F=0,N=0,I=[],j=!1;l=[...l];for(let w of l){let p={};if(typeof w!="object")throw new Error(`Plugin at index ${N} must be an object`);let o=n(w,p,"name",h);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let c=n(w,p,"setup",ve);if(typeof c!="function")throw new Error("Plugin is missing a setup function");K(w,p,`on plugin ${JSON.stringify(o)}`);let y={name:o,onResolve:[],onLoad:[]};N++;let M=c({initialOptions:u,resolve:(f,g={})=>{if(!j)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof f!="string")throw new Error("The path to resolve must be a string");let b=Object.create(null),S=n(g,b,"pluginName",h),O=n(g,b,"importer",h),C=n(g,b,"namespace",h),$=n(g,b,"resolveDir",h),v=n(g,b,"kind",h),D=n(g,b,"pluginData",ce);return K(g,b,"in resolve() call"),new Promise((L,z)=>{let W={command:"resolve",path:f,key:t,pluginName:o};S!=null&&(W.pluginName=S),O!=null&&(W.importer=O),C!=null&&(W.namespace=C),$!=null&&(W.resolveDir=$),v!=null&&(W.kind=v),D!=null&&(W.pluginData=d.store(D)),e(s,W,(A,P)=>{A!==null?z(new Error(A)):L({errors:X(P.errors,d),warnings:X(P.warnings,d),path:P.path,external:P.external,sideEffects:P.sideEffects,namespace:P.namespace,suffix:P.suffix,pluginData:d.load(P.pluginData)})})})},onStart(f){let g='This error came from the "onStart" callback registered here:',b=ue(new Error(g),a,"onStart");R.push({name:o,callback:f,note:b})},onEnd(f){let g='This error came from the "onEnd" callback registered here:',b=ue(new Error(g),a,"onEnd");E.push({name:o,callback:f,note:b})},onResolve(f,g){let b='This error came from the "onResolve" callback registered here:',S=ue(new Error(b),a,"onResolve"),O={},C=n(f,O,"filter",de),$=n(f,O,"namespace",h);if(K(f,O,`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:g,note:S},y.onResolve.push({id:v,filter:C.source,namespace:$||""})},onLoad(f,g){let b='This error came from the "onLoad" callback registered here:',S=ue(new Error(b),a,"onLoad"),O={},C=n(f,O,"filter",de),$=n(f,O,"namespace",h);if(K(f,O,`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:g,note:S},y.onLoad.push({id:v,filter:C.source,namespace:$||""})},esbuild:a.esbuild});M&&(yield M),I.push(y)}catch(c){return{ok:!1,error:c,pluginName:o}}}i["on-start"]=(w,p)=>H(void 0,null,function*(){let o={errors:[],warnings:[]};yield Promise.all(R.map(M=>H(void 0,[M],function*({name:c,callback:y,note:x}){try{let f=yield y();if(f!=null){if(typeof f!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"errors",q),S=n(f,g,"warnings",q);K(f,g,`from onStart() callback in plugin ${JSON.stringify(c)}`),b!=null&&o.errors.push(...te(b,"errors",d,c)),S!=null&&o.warnings.push(...te(S,"warnings",d,c))}}catch(f){o.errors.push(ie(f,a,d,x&&x(),c))}}))),r(w,o)}),i["on-resolve"]=(w,p)=>H(void 0,null,function*(){let o={},c="",y,x;for(let M of p.ids)try{({name:c,callback:y,note:x}=k[M]);let f=yield y({path:p.path,importer:p.importer,namespace:p.namespace,resolveDir:p.resolveDir,kind:p.kind,pluginData:d.load(p.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"pluginName",h),S=n(f,g,"path",h),O=n(f,g,"namespace",h),C=n(f,g,"suffix",h),$=n(f,g,"external",U),v=n(f,g,"sideEffects",U),D=n(f,g,"pluginData",ce),L=n(f,g,"errors",q),z=n(f,g,"warnings",q),W=n(f,g,"watchFiles",q),A=n(f,g,"watchDirs",q);K(f,g,`from onResolve() callback in plugin ${JSON.stringify(c)}`),o.id=M,b!=null&&(o.pluginName=b),S!=null&&(o.path=S),O!=null&&(o.namespace=O),C!=null&&(o.suffix=C),$!=null&&(o.external=$),v!=null&&(o.sideEffects=v),D!=null&&(o.pluginData=d.store(D)),L!=null&&(o.errors=te(L,"errors",d,c)),z!=null&&(o.warnings=te(z,"warnings",d,c)),W!=null&&(o.watchFiles=fe(W,"watchFiles")),A!=null&&(o.watchDirs=fe(A,"watchDirs"));break}}catch(f){o={id:M,errors:[ie(f,a,d,x&&x(),c)]};break}r(w,o)}),i["on-load"]=(w,p)=>H(void 0,null,function*(){let o={},c="",y,x;for(let M of p.ids)try{({name:c,callback:y,note:x}=B[M]);let f=yield y({path:p.path,namespace:p.namespace,suffix:p.suffix,pluginData:d.load(p.pluginData)});if(f!=null){if(typeof f!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(c)} to return an object`);let g={},b=n(f,g,"pluginName",h),S=n(f,g,"contents",De),O=n(f,g,"resolveDir",h),C=n(f,g,"pluginData",ce),$=n(f,g,"loader",h),v=n(f,g,"errors",q),D=n(f,g,"warnings",q),L=n(f,g,"watchFiles",q),z=n(f,g,"watchDirs",q);K(f,g,`from onLoad() callback in plugin ${JSON.stringify(c)}`),o.id=M,b!=null&&(o.pluginName=b),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Q(S)),O!=null&&(o.resolveDir=O),C!=null&&(o.pluginData=d.store(C)),$!=null&&(o.loader=$),v!=null&&(o.errors=te(v,"errors",d,c)),D!=null&&(o.warnings=te(D,"warnings",d,c)),L!=null&&(o.watchFiles=fe(L,"watchFiles")),z!=null&&(o.watchDirs=fe(z,"watchDirs"));break}}catch(f){o={id:M,errors:[ie(f,a,d,x&&x(),c)]};break}r(w,o)});let V=(w,p,o)=>o();return E.length>0&&(V=(w,p,o)=>{(()=>H(void 0,null,function*(){for(let{name:c,callback:y,note:x}of E)try{yield y(w)}catch(M){w.errors.push(yield new Promise(f=>p(M,c,x&&x(),f)))}}))().then(o)}),j=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:V}});function Ue(){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 ue(t,e,r){let s,a=!1;return()=>{if(a)return s;a=!0;try{let i=(t.stack+"").split(`
3
- `);i.splice(1,1);let u=Ne(e,i,r);if(u)return s={text:t.message,location:u},s}catch(i){}}}function ie(t,e,r,s,a){let i="Internal error",u=null;try{i=(t&&t.message||t)+""}catch(l){}try{u=Ne(e,(t.stack+"").split(`
4
- `),"")}catch(l){}return{id:"",pluginName:a,text:i,location:u,notes:s?[s]:[],detail:r?r.store(t):-1}}function Ne(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 d=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+u[2]-1]||"",R=+u[3]-1,E=d.slice(R,R+r.length)===r?r.length:0;return{file:u[1],namespace:"file",line:+u[2],column:Q(d.slice(0,R)).length,length:Q(d.slice(R,R+E)).length,lineText:d+`
5
- `+e.slice(1).join(`
6
- `),suggestion:""}}break}}return null}function ne(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`
7
- ...`;if(!u.location)return`
8
- error: ${u.text}`;let{file:d,line:R,column:E}=u.location,k=u.pluginName?`[plugin: ${u.pluginName}] `:"";return`
9
- ${d}:${R}:${E}: ERROR: ${k}${u.text}`}).join(""),i=new Error(`${t}${a}`);return i.errors=e,i.warnings=r,i}function X(t,e){for(let r of t)r.detail=e.load(r.detail);return t}function Ae(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",le),u=n(t,r,"column",le),l=n(t,r,"length",le),d=n(t,r,"lineText",h),R=n(t,r,"suggestion",h);return K(t,r,e),{file:s||"",namespace:a||"",line:i||0,column:u||0,length:l||0,lineText:d||"",suggestion:R||""}}function te(t,e,r,s){let a=[],i=0;for(let u of t){let l={},d=n(u,l,"id",h),R=n(u,l,"pluginName",h),E=n(u,l,"text",h),k=n(u,l,"location",Me),B=n(u,l,"notes",q),F=n(u,l,"detail",ce),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),p=n(j,V,"location",Me);K(j,V,N),I.push({text:w||"",location:Ae(p,N)})}a.push({id:d||"",pluginName:R||s,text:E||"",location:Ae(k,N),notes:I,detail:r?r.store(F):-1}),i++}return a}function fe(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 tt({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=ee(s)),r}}}var nt="0.15.15",lt=t=>ge().build(t),it=()=>{throw new Error('The "serve" API only works in node')},ot=(t,e)=>ge().transform(t,e),st=(t,e)=>ge().formatMessages(t,e),at=(t,e)=>ge().analyzeMetafile(t,e),ut=()=>{throw new Error('The "buildSync" API only works in node')},ft=()=>{throw new Error('The "transformSync" API only works in node')},ct=()=>{throw new Error('The "formatMessagesSync" API only works in node')},dt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},oe,Re,ge=()=>{if(Re)return Re;throw oe?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')},pt=t=>{t=Be(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(oe)throw new Error('Cannot call "initialize" more than once');return oe=gt(e||"",r,s),oe.catch(()=>{oe=void 0}),oe},gt=(t,e,r)=>H(void 0,null,function*(){let s;if(e)s=e;else{let l=yield fetch(t);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(t)}`);s=yield 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.\nvar y=(r,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`\n`);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,c,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,l){l(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 g=new TextEncoder("utf-8"),f=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 h=(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 a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;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,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.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),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(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(l(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)),a=c(e+32),m=Reflect.apply(o,t,a);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=c(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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=c(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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,h(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),h(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(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=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,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=g.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,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.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(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.15.15"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});a=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
2
+ "use strict";var be=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var _e=(e,t)=>{for(var r in t)be(e,r,{get:t[r],enumerable:!0})},Ve=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ze(t))!Ke.call(e,a)&&a!==r&&be(e,a,{get:()=>t[a],enumerable:!(i=qe(t,a))||i.enumerable});return e};var Ye=e=>Ve(be({},"__esModule",{value:!0}),e);var ee=(e,t,r)=>new Promise((i,a)=>{var l=g=>{try{s(r.next(g))}catch(y){a(y)}},c=g=>{try{s(r.throw(g))}catch(y){a(y)}},s=g=>g.done?i(g.value):Promise.resolve(g.value).then(l,c);s((r=r.apply(e,t)).next())});var he={};_e(he,{analyzeMetafile:()=>pt,analyzeMetafileSync:()=>ht,build:()=>ut,buildSync:()=>gt,default:()=>vt,formatMessages:()=>dt,formatMessagesSync:()=>yt,initialize:()=>bt,serve:()=>ft,transform:()=>ct,transformSync:()=>mt,version:()=>at});module.exports=Ye(he);function Re(e){let t=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(H(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let a of i)t(a)}else{let a=Object.keys(i);r.write8(6),r.write32(a.length);for(let l of a)r.write(H(l)),t(i[l])}},r=new fe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),ve(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Me(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ne(r.read());case 4:return r.read();case 5:{let c=r.read32(),s=[];for(let g=0;g<c;g++)s.push(t());return s}case 6:{let c=r.read32(),s={};for(let g=0;g<c;g++)s[ne(r.read())]=t();return s}default:throw new Error("Invalid packet")}},r=new fe(e),i=r.read32(),a=(i&1)===0;i>>>=1;let l=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var fe=class{constructor(t=new Uint8Array(1024)){this.buf=t;this.len=0;this.ptr=0}_write(t){if(this.len+t>this.buf.length){let r=new Uint8Array((this.len+t)*2);r.set(this.buf),this.buf=r}return this.len+=t,this.len-t}write8(t){let r=this._write(1);this.buf[r]=t}write32(t){let r=this._write(4);ve(this.buf,t,r)}write(t){let r=this._write(4+t.length);ve(this.buf,t.length,r),this.buf.set(t,r+4)}_read(t){if(this.ptr+t>this.buf.length)throw new Error("Invalid packet");return this.ptr+=t,this.ptr-t}read8(){return this.buf[this._read(1)]}read32(){return xe(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),i=this._read(r.length);return r.set(this.buf.subarray(i,i+t)),r}},H,ne,we;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;H=r=>e.encode(r),ne=r=>t.decode(r),we='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")H=e=>Buffer.from(e),ne=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).toString()},we='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(H("")instanceof Uint8Array))throw new Error(`Invariant violation: "${we} instanceof Uint8Array" is incorrectly false
3
+
4
+ This indicates that your JavaScript environment is broken. You cannot use
5
+ esbuild in this environment because esbuild relies on this invariant. This
6
+ is not a problem with esbuild. You need to fix your environment instead.
7
+ `);function xe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function ve(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,Ae="warning",Ce="silent";function De(e){if(V(e,"target"),e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var pe=()=>null,F=e=>typeof e=="boolean"?null:"a boolean",Qe=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",b=e=>typeof e=="string"?null:"a string",ge=e=>e instanceof RegExp?null:"a RegExp object",oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Oe=e=>typeof e=="function"?null:"a function",W=e=>Array.isArray(e)?null:"an array",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",He=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ge=e=>typeof e=="object"&&e!==null?null:"an array or an object",Pe=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Be=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Xe=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ze=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",Ue=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",et=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function n(e,t,r,i){let a=e[r];if(t[r+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${J(r)} must be ${l}`);return a}function z(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: ${J(i)}`)}function Fe(e){let t=Object.create(null),r=n(e,t,"wasmURL",et),i=n(e,t,"wasmModule",He),a=n(e,t,"worker",F);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:i,worker:a}}function je(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function me(e,t,r,i,a){let l=n(t,r,"color",F),c=n(t,r,"logLevel",b),s=n(t,r,"logLimit",oe);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${c||a}`),e.push(`--log-limit=${s||0}`)}function V(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Ne(e,t,r){let i=n(t,r,"legalComments",b),a=n(t,r,"sourceRoot",b),l=n(t,r,"sourcesContent",F),c=n(t,r,"target",Ze),s=n(t,r,"format",b),g=n(t,r,"globalName",b),y=n(t,r,"mangleProps",ge),R=n(t,r,"reserveProps",ge),C=n(t,r,"mangleQuoted",F),B=n(t,r,"minify",F),$=n(t,r,"minifySyntax",F),T=n(t,r,"minifyWhitespace",F),q=n(t,r,"minifyIdentifiers",F),L=n(t,r,"drop",W),Y=n(t,r,"charset",b),x=n(t,r,"treeShaking",F),d=n(t,r,"ignoreAnnotations",F),o=n(t,r,"jsx",b),f=n(t,r,"jsxFactory",b),h=n(t,r,"jsxFragment",b),E=n(t,r,"jsxImportSource",b),D=n(t,r,"jsxDev",F),u=n(t,r,"jsxSideEffects",F),p=n(t,r,"define",Z),w=n(t,r,"logOverride",Z),S=n(t,r,"supported",Z),O=n(t,r,"pure",W),P=n(t,r,"keepNames",F),k=n(t,r,"platform",b);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(De).join(",")}`):e.push(`--target=${De(c)}`)),s&&e.push(`--format=${s}`),g&&e.push(`--global-name=${g}`),k&&e.push(`--platform=${k}`),B&&e.push("--minify"),$&&e.push("--minify-syntax"),T&&e.push("--minify-whitespace"),q&&e.push("--minify-identifiers"),Y&&e.push(`--charset=${Y}`),x!==void 0&&e.push(`--tree-shaking=${x}`),d&&e.push("--ignore-annotations"),L)for(let v of L)e.push(`--drop:${V(v,"drop")}`);if(y&&e.push(`--mangle-props=${y.source}`),R&&e.push(`--reserve-props=${R.source}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),o&&e.push(`--jsx=${o}`),f&&e.push(`--jsx-factory=${f}`),h&&e.push(`--jsx-fragment=${h}`),E&&e.push(`--jsx-import-source=${E}`),D&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),p)for(let v in p){if(v.indexOf("=")>=0)throw new Error(`Invalid define: ${v}`);e.push(`--define:${v}=${V(p[v],"define",v)}`)}if(w)for(let v in w){if(v.indexOf("=")>=0)throw new Error(`Invalid log override: ${v}`);e.push(`--log-override:${v}=${V(w[v],"log override",v)}`)}if(S)for(let v in S){if(v.indexOf("=")>=0)throw new Error(`Invalid supported: ${v}`);let M=S[v];if(typeof M!="boolean")throw new Error(`Expected value for supported ${J(v)} to be a boolean, got ${typeof M} instead`);e.push(`--supported:${v}=${M}`)}if(O)for(let v of O)e.push(`--pure:${V(v,"pure")}`);P&&e.push("--keep-names")}function tt(e,t,r,i,a){var Q;let l=[],c=[],s=Object.create(null),g=null,y=null,R=null;me(l,t,s,r,i),Ne(l,t,s);let C=n(t,s,"sourcemap",Be),B=n(t,s,"bundle",F),$=n(t,s,"watch",Qe),T=n(t,s,"splitting",F),q=n(t,s,"preserveSymlinks",F),L=n(t,s,"metafile",F),Y=n(t,s,"outfile",b),x=n(t,s,"outdir",b),d=n(t,s,"outbase",b),o=n(t,s,"tsconfig",b),f=n(t,s,"resolveExtensions",W),h=n(t,s,"nodePaths",W),E=n(t,s,"mainFields",W),D=n(t,s,"conditions",W),u=n(t,s,"external",W),p=n(t,s,"alias",Z),w=n(t,s,"loader",Z),S=n(t,s,"outExtension",Z),O=n(t,s,"publicPath",b),P=n(t,s,"entryNames",b),k=n(t,s,"chunkNames",b),v=n(t,s,"assetNames",b),M=n(t,s,"inject",W),I=n(t,s,"banner",Z),K=n(t,s,"footer",Z),j=n(t,s,"entryPoints",Ge),U=n(t,s,"absWorkingDir",b),A=n(t,s,"stdin",Z),_=(Q=n(t,s,"write",F))!=null?Q:a,G=n(t,s,"allowOverwrite",F),re=n(t,s,"incremental",F)===!0,ue=n(t,s,"mangleCache",Z);if(s.plugins=!0,z(t,s,`in ${e}() call`),C&&l.push(`--sourcemap${C===!0?"":`=${C}`}`),B&&l.push("--bundle"),G&&l.push("--allow-overwrite"),$)if(l.push("--watch"),typeof $=="boolean")R={};else{let m=Object.create(null),N=n($,m,"onRebuild",Oe);z($,m,`on "watch" in ${e}() call`),R={onRebuild:N}}if(T&&l.push("--splitting"),q&&l.push("--preserve-symlinks"),L&&l.push("--metafile"),Y&&l.push(`--outfile=${Y}`),x&&l.push(`--outdir=${x}`),d&&l.push(`--outbase=${d}`),o&&l.push(`--tsconfig=${o}`),f){let m=[];for(let N of f){if(V(N,"resolve extension"),N.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${N}`);m.push(N)}l.push(`--resolve-extensions=${m.join(",")}`)}if(O&&l.push(`--public-path=${O}`),P&&l.push(`--entry-names=${P}`),k&&l.push(`--chunk-names=${k}`),v&&l.push(`--asset-names=${v}`),E){let m=[];for(let N of E){if(V(N,"main field"),N.indexOf(",")>=0)throw new Error(`Invalid main field: ${N}`);m.push(N)}l.push(`--main-fields=${m.join(",")}`)}if(D){let m=[];for(let N of D){if(V(N,"condition"),N.indexOf(",")>=0)throw new Error(`Invalid condition: ${N}`);m.push(N)}l.push(`--conditions=${m.join(",")}`)}if(u)for(let m of u)l.push(`--external:${V(m,"external")}`);if(p)for(let m in p){if(m.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${m}`);l.push(`--alias:${m}=${V(p[m],"alias",m)}`)}if(I)for(let m in I){if(m.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${m}`);l.push(`--banner:${m}=${V(I[m],"banner",m)}`)}if(K)for(let m in K){if(m.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${m}`);l.push(`--footer:${m}=${V(K[m],"footer",m)}`)}if(M)for(let m of M)l.push(`--inject:${V(m,"inject")}`);if(w)for(let m in w){if(m.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${m}`);l.push(`--loader:${m}=${V(w[m],"loader",m)}`)}if(S)for(let m in S){if(m.indexOf("=")>=0)throw new Error(`Invalid out extension: ${m}`);l.push(`--out-extension:${m}=${V(S[m],"out extension",m)}`)}if(j)if(Array.isArray(j))for(let m of j)c.push(["",V(m,"entry point")]);else for(let m in j)c.push([m,V(j[m],"entry point",m)]);if(A){let m=Object.create(null),N=n(A,m,"contents",Ue),Ee=n(A,m,"resolveDir",b),$e=n(A,m,"sourcefile",b),ke=n(A,m,"loader",b);z(A,m,'in "stdin" object'),$e&&l.push(`--sourcefile=${$e}`),ke&&l.push(`--loader=${ke}`),Ee&&(y=Ee),typeof N=="string"?g=H(N):N instanceof Uint8Array&&(g=N)}let X=[];if(h)for(let m of h)m+="",X.push(m);return{entries:c,flags:l,write:_,stdinContents:g,stdinResolveDir:y,absWorkingDir:U,incremental:re,nodePaths:X,watch:R,mangleCache:je(ue)}}function rt(e,t,r,i){let a=[],l=Object.create(null);me(a,t,l,r,i),Ne(a,t,l);let c=n(t,l,"sourcemap",Be),s=n(t,l,"tsconfigRaw",Xe),g=n(t,l,"sourcefile",b),y=n(t,l,"loader",b),R=n(t,l,"banner",b),C=n(t,l,"footer",b),B=n(t,l,"mangleCache",Z);return z(t,l,`in ${e}() call`),c&&a.push(`--sourcemap=${c===!0?"external":c}`),s&&a.push(`--tsconfig-raw=${typeof s=="string"?s:JSON.stringify(s)}`),g&&a.push(`--sourcefile=${g}`),y&&a.push(`--loader=${y}`),R&&a.push(`--banner=${R}`),C&&a.push(`--footer=${C}`),{flags:a,mangleCache:je(B)}}function Le(e){let t={},r={didClose:!1,reason:""},i={},a=0,l=0,c=new Uint8Array(16*1024),s=0,g=d=>{let o=s+d.length;if(o>c.length){let h=new Uint8Array(o*2);h.set(c),c=h}c.set(d,s),s+=d.length;let f=0;for(;f+4<=s;){let h=xe(c,f);if(f+4+h>s)break;f+=4,T(c.subarray(f,f+h)),f+=h}f>0&&(c.copyWithin(0,f,s),s-=f)},y=d=>{r.didClose=!0,d&&(r.reason=": "+(d.message||d));let o="The service was stopped"+r.reason;for(let f in i)i[f](o,null);i={}},R=(d,o,f)=>{if(r.didClose)return f("The service is no longer running"+r.reason,null);let h=a++;i[h]=(E,D)=>{try{f(E,D)}finally{d&&d.unref()}},d&&d.ref(),e.writeToStdin(Re({id:h,isRequest:!0,value:o}))},C=(d,o)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(Re({id:d,isRequest:!1,value:o}))},B=(d,o)=>ee(this,null,function*(){try{if(o.command==="ping"){C(d,{});return}if(typeof o.key=="number"){let f=t[o.key];if(f){let h=f[o.command];if(h){yield h(d,o);return}}}throw new Error("Invalid command: "+o.command)}catch(f){C(d,{errors:[se(f,e,null,void 0,"")]})}}),$=!0,T=d=>{if($){$=!1;let f=String.fromCharCode(...d);if(f!=="0.16.1")throw new Error(`Cannot start service: Host version "0.16.1" does not match binary version ${J(f)}`);return}let o=Me(d);if(o.isRequest)B(o.id,o.value);else{let f=i[o.id];delete i[o.id],o.value.error?f(o.value.error,{}):f(null,o.value)}};return{readFromStdout:g,afterClose:y,service:{buildOrServe:({callName:d,refs:o,serveOptions:f,options:h,isTTY:E,defaultWD:D,callback:u})=>{let p=0,w=l++,S={},O={ref(){++p===1&&o&&o.ref()},unref(){--p===0&&(delete t[w],o&&o.unref())}};t[w]=S,O.ref(),nt(d,w,R,C,O,e,S,h,f,E,D,r,(P,k)=>{try{u(P,k)}finally{O.unref()}})},transform:({callName:d,refs:o,input:f,options:h,isTTY:E,fs:D,callback:u})=>{let p=Ie(),w=S=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:O,mangleCache:P}=rt(d,h,E,Ce),k={command:"transform",flags:O,inputFS:S!==null,input:S!==null?H(S):typeof f=="string"?H(f):f};P&&(k.mangleCache=P),R(o,k,(v,M)=>{if(v)return u(new Error(v),null);let I=te(M.errors,p),K=te(M.warnings,p),j=1,U=()=>{if(--j===0){let A={warnings:K,code:M.code,map:M.map};M.mangleCache&&(A.mangleCache=M==null?void 0:M.mangleCache),u(null,A)}};if(I.length>0)return u(ie("Transform failed",I,K),null);M.codeFS&&(j++,D.readFile(M.code,(A,_)=>{A!==null?u(A,null):(M.code=_,U())})),M.mapFS&&(j++,D.readFile(M.map,(A,_)=>{A!==null?u(A,null):(M.map=_,U())})),U()})}catch(O){let P=[];try{me(P,h,{},E,Ce)}catch(v){}let k=se(O,e,p,void 0,"");R(o,{command:"error",flags:P,error:k},()=>{k.detail=p.load(k.detail),u(ie("Transform failed",[k],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let S=w;w=()=>D.writeFile(f,S)}w(null)},formatMessages:({callName:d,refs:o,messages:f,options:h,callback:E})=>{let D=le(f,"messages",null,"");if(!h)throw new Error(`Missing second argument in ${d}() call`);let u={},p=n(h,u,"kind",b),w=n(h,u,"color",F),S=n(h,u,"terminalWidth",oe);if(z(h,u,`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 O={command:"format-msgs",messages:D,isWarning:p==="warning"};w!==void 0&&(O.color=w),S!==void 0&&(O.terminalWidth=S),R(o,O,(P,k)=>{if(P)return E(new Error(P),null);E(null,k.messages)})},analyzeMetafile:({callName:d,refs:o,metafile:f,options:h,callback:E})=>{h===void 0&&(h={});let D={},u=n(h,D,"color",F),p=n(h,D,"verbose",F);z(h,D,`in ${d}() call`);let w={command:"analyze-metafile",metafile:f};u!==void 0&&(w.color=u),p!==void 0&&(w.verbose=p),R(o,w,(S,O)=>{if(S)return E(new Error(S),null);E(null,O.result)})}}}}function nt(e,t,r,i,a,l,c,s,g,y,R,C,B){let $=Ie(),T=(x,d,o,f)=>{let h=[];try{me(h,s,{},y,Ae)}catch(D){}let E=se(x,l,$,o,d);r(a,{command:"error",flags:h,error:E},()=>{E.detail=$.load(E.detail),f(E)})},q=(x,d)=>{T(x,d,void 0,o=>{B(ie("Build failed",[o],[]),null)})},L;if(typeof s=="object"){let x=s.plugins;if(x!==void 0){if(!Array.isArray(x))throw new Error('"plugins" must be an array');L=x}}if(L&&L.length>0){if(l.isSync){q(new Error("Cannot use plugins in synchronous API calls"),"");return}it(t,r,i,a,l,c,s,L,$).then(x=>{if(!x.ok){q(x.error,x.pluginName);return}try{Y(x.requestPlugins,x.runOnEndCallbacks)}catch(d){q(d,"")}},x=>q(x,""));return}try{Y(null,(x,d,o)=>o())}catch(x){q(x,"")}function Y(x,d){let o=!l.isWriteUnavailable,{entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p,incremental:w,nodePaths:S,watch:O,mangleCache:P}=tt(e,s,y,Ae,o),k={command:"build",key:t,entries:f,flags:h,write:E,stdinContents:D,stdinResolveDir:u,absWorkingDir:p||R,incremental:w,nodePaths:S};x&&(k.plugins=x),P&&(k.mangleCache=P);let v=g&&lt(t,r,i,a,c,g,k),M,I,K=(U,A)=>{U.outputFiles&&(A.outputFiles=U.outputFiles.map(ot)),U.metafile&&(A.metafile=JSON.parse(U.metafile)),U.mangleCache&&(A.mangleCache=U.mangleCache),U.writeToStdout!==void 0&&console.log(ne(U.writeToStdout).replace(/\n$/,""))},j=(U,A)=>{let _={errors:te(U.errors,$),warnings:te(U.warnings,$)};K(U,_),d(_,T,()=>{if(_.errors.length>0)return A(ie("Build failed",_.errors,_.warnings),null);if(U.rebuild){if(!M){let G=!1;M=()=>new Promise((re,ue)=>{if(G||C.didClose)throw new Error("Cannot rebuild");r(a,{command:"rebuild",key:t},(X,Q)=>{if(X)return A(ie("Build failed",[{id:"",pluginName:"",text:X,location:null,notes:[],detail:void 0}],[]),null);j(Q,(m,N)=>{m?ue(m):re(N)})})}),a.ref(),M.dispose=()=>{G||(G=!0,r(a,{command:"rebuild-dispose",key:t},()=>{}),a.unref())}}_.rebuild=M}if(U.watch){if(!I){let G=!1;a.ref(),I=()=>{G||(G=!0,delete c["watch-rebuild"],r(a,{command:"watch-stop",key:t},()=>{}),a.unref())},O&&(c["watch-rebuild"]=(re,ue)=>{try{let X=ue.args,Q={errors:te(X.errors,$),warnings:te(X.warnings,$)};K(X,Q),d(Q,T,()=>{if(Q.errors.length>0){O.onRebuild&&O.onRebuild(ie("Build failed",Q.errors,Q.warnings),null);return}Q.stop=I,O.onRebuild&&O.onRebuild(null,Q)})}catch(X){console.error(X)}i(re,{})})}_.stop=I}A(null,_)})};if(E&&l.isWriteUnavailable)throw new Error('The "write" option is unavailable in this environment');if(w&&l.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(O&&l.isSync)throw new Error('Cannot use "watch" with a synchronous build');r(a,k,(U,A)=>{if(U)return B(new Error(U),null);if(v){let _=A,G=!1;a.ref();let re={port:_.port,host:_.host,wait:v.wait,stop(){G||(G=!0,v.stop(),a.unref())}};return a.ref(),v.wait.then(a.unref,a.unref),B(null,re)}return j(A,B)})}}var lt=(e,t,r,i,a,l,c)=>{let s={},g=n(l,s,"port",oe),y=n(l,s,"host",b),R=n(l,s,"servedir",b),C=n(l,s,"onRequest",Oe),B=new Promise(($,T)=>{a["serve-wait"]=(q,L)=>{L.error!==null?T(new Error(L.error)):$(),r(q,{})}});return c.serve={},z(l,s,"in serve() call"),g!==void 0&&(c.serve.port=g),y!==void 0&&(c.serve.host=y),R!==void 0&&(c.serve.servedir=R),a["serve-request"]=($,T)=>{C&&C(T.args),r($,{})},{wait:B,stop(){t(i,{command:"serve-stop",key:e},()=>{})}}},it=(e,t,r,i,a,l,c,s,g)=>ee(void 0,null,function*(){let y=[],R=[],C={},B={},$=0,T=0,q=[],L=!1;s=[...s];for(let x of s){let d={};if(typeof x!="object")throw new Error(`Plugin at index ${T} must be an object`);let o=n(x,d,"name",b);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${T} is missing a name`);try{let f=n(x,d,"setup",Oe);if(typeof f!="function")throw new Error("Plugin is missing a setup function");z(x,d,`on plugin ${J(o)}`);let h={name:o,onResolve:[],onLoad:[]};T++;let D=f({initialOptions:c,resolve:(u,p={})=>{if(!L)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!="string")throw new Error("The path to resolve must be a string");let w=Object.create(null),S=n(p,w,"pluginName",b),O=n(p,w,"importer",b),P=n(p,w,"namespace",b),k=n(p,w,"resolveDir",b),v=n(p,w,"kind",b),M=n(p,w,"pluginData",pe);return z(p,w,"in resolve() call"),new Promise((I,K)=>{let j={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(j.pluginName=S),O!=null&&(j.importer=O),P!=null&&(j.namespace=P),k!=null&&(j.resolveDir=k),v!=null)j.kind=v;else throw new Error('Must specify "kind" when calling "resolve"');M!=null&&(j.pluginData=g.store(M)),t(i,j,(U,A)=>{U!==null?K(new Error(U)):I({errors:te(A.errors,g),warnings:te(A.warnings,g),path:A.path,external:A.external,sideEffects:A.sideEffects,namespace:A.namespace,suffix:A.suffix,pluginData:g.load(A.pluginData)})})})},onStart(u){let p='This error came from the "onStart" callback registered here:',w=ce(new Error(p),a,"onStart");y.push({name:o,callback:u,note:w})},onEnd(u){let p='This error came from the "onEnd" callback registered here:',w=ce(new Error(p),a,"onEnd");R.push({name:o,callback:u,note:w})},onResolve(u,p){let w='This error came from the "onResolve" callback registered here:',S=ce(new Error(w),a,"onResolve"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onResolve() call for plugin ${J(o)}`),P==null)throw new Error("onResolve() call is missing a filter");let v=$++;C[v]={name:o,callback:p,note:S},h.onResolve.push({id:v,filter:P.source,namespace:k||""})},onLoad(u,p){let w='This error came from the "onLoad" callback registered here:',S=ce(new Error(w),a,"onLoad"),O={},P=n(u,O,"filter",ge),k=n(u,O,"namespace",b);if(z(u,O,`in onLoad() call for plugin ${J(o)}`),P==null)throw new Error("onLoad() call is missing a filter");let v=$++;B[v]={name:o,callback:p,note:S},h.onLoad.push({id:v,filter:P.source,namespace:k||""})},esbuild:a.esbuild});D&&(yield D),q.push(h)}catch(f){return{ok:!1,error:f,pluginName:o}}}l["on-start"]=(x,d)=>ee(void 0,null,function*(){let o={errors:[],warnings:[]};yield Promise.all(y.map(D=>ee(void 0,[D],function*({name:f,callback:h,note:E}){try{let u=yield h();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"errors",W),S=n(u,p,"warnings",W);z(u,p,`from onStart() callback in plugin ${J(f)}`),w!=null&&o.errors.push(...le(w,"errors",g,f)),S!=null&&o.warnings.push(...le(S,"warnings",g,f))}}catch(u){o.errors.push(se(u,a,g,E&&E(),f))}}))),r(x,o)}),l["on-resolve"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=C[D]);let u=yield h({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"path",b),O=n(u,p,"namespace",b),P=n(u,p,"suffix",b),k=n(u,p,"external",F),v=n(u,p,"sideEffects",F),M=n(u,p,"pluginData",pe),I=n(u,p,"errors",W),K=n(u,p,"warnings",W),j=n(u,p,"watchFiles",W),U=n(u,p,"watchDirs",W);z(u,p,`from onResolve() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S!=null&&(o.path=S),O!=null&&(o.namespace=O),P!=null&&(o.suffix=P),k!=null&&(o.external=k),v!=null&&(o.sideEffects=v),M!=null&&(o.pluginData=g.store(M)),I!=null&&(o.errors=le(I,"errors",g,f)),K!=null&&(o.warnings=le(K,"warnings",g,f)),j!=null&&(o.watchFiles=de(j,"watchFiles")),U!=null&&(o.watchDirs=de(U,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)}),l["on-load"]=(x,d)=>ee(void 0,null,function*(){let o={},f="",h,E;for(let D of d.ids)try{({name:f,callback:h,note:E}=B[D]);let u=yield h({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:g.load(d.pluginData)});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${J(f)} to return an object`);let p={},w=n(u,p,"pluginName",b),S=n(u,p,"contents",Ue),O=n(u,p,"resolveDir",b),P=n(u,p,"pluginData",pe),k=n(u,p,"loader",b),v=n(u,p,"errors",W),M=n(u,p,"warnings",W),I=n(u,p,"watchFiles",W),K=n(u,p,"watchDirs",W);z(u,p,`from onLoad() callback in plugin ${J(f)}`),o.id=D,w!=null&&(o.pluginName=w),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=H(S)),O!=null&&(o.resolveDir=O),P!=null&&(o.pluginData=g.store(P)),k!=null&&(o.loader=k),v!=null&&(o.errors=le(v,"errors",g,f)),M!=null&&(o.warnings=le(M,"warnings",g,f)),I!=null&&(o.watchFiles=de(I,"watchFiles")),K!=null&&(o.watchDirs=de(K,"watchDirs"));break}}catch(u){o={id:D,errors:[se(u,a,g,E&&E(),f)]};break}r(x,o)});let Y=(x,d,o)=>o();return R.length>0&&(Y=(x,d,o)=>{(()=>ee(void 0,null,function*(){for(let{name:f,callback:h,note:E}of R)try{yield h(x)}catch(D){x.errors.push(yield new Promise(u=>d(D,f,E&&E(),u)))}}))().then(o)}),L=!0,{ok:!0,requestPlugins:q,runOnEndCallbacks:Y}});function Ie(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function ce(e,t,r){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
8
+ `);l.splice(1,1);let c=We(t,l,r);if(c)return i={text:e.message,location:c},i}catch(l){}}}function se(e,t,r,i,a){let l="Internal error",c=null;try{l=(e&&e.message||e)+""}catch(s){}try{c=We(t,(e.stack+"").split(`
9
+ `),"")}catch(s){}return{id:"",pluginName:a,text:l,location:c,notes:i?[i]:[],detail:r?r.store(e):-1}}function We(e,t,r){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let a=1;a<t.length;a++){let l=t[a];if(!!l.startsWith(i))for(l=l.slice(i.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(c){l=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),c){l=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(l),c){let s;try{s=e.readFileSync(c[1],"utf8")}catch(C){break}let g=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",y=+c[3]-1,R=g.slice(y,y+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:H(g.slice(0,y)).length,length:H(g.slice(y,y+R)).length,lineText:g+`
10
+ `+t.slice(1).join(`
11
+ `),suggestion:""}}break}}return null}function ie(e,t,r){let i=5,a=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((c,s)=>{if(s===i)return`
12
+ ...`;if(!c.location)return`
13
+ error: ${c.text}`;let{file:g,line:y,column:R}=c.location,C=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
14
+ ${g}:${y}:${R}: ERROR: ${C}${c.text}`}).join(""),l=new Error(`${e}${a}`);return l.errors=t,l.warnings=r,l}function te(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Te(e,t){if(e==null)return null;let r={},i=n(e,r,"file",b),a=n(e,r,"namespace",b),l=n(e,r,"line",oe),c=n(e,r,"column",oe),s=n(e,r,"length",oe),g=n(e,r,"lineText",b),y=n(e,r,"suggestion",b);return z(e,r,t),{file:i||"",namespace:a||"",line:l||0,column:c||0,length:s||0,lineText:g||"",suggestion:y||""}}function le(e,t,r,i){let a=[],l=0;for(let c of e){let s={},g=n(c,s,"id",b),y=n(c,s,"pluginName",b),R=n(c,s,"text",b),C=n(c,s,"location",Pe),B=n(c,s,"notes",W),$=n(c,s,"detail",pe),T=`in element ${l} of "${t}"`;z(c,s,T);let q=[];if(B)for(let L of B){let Y={},x=n(L,Y,"text",b),d=n(L,Y,"location",Pe);z(L,Y,T),q.push({text:x||"",location:Te(d,T)})}a.push({id:g||"",pluginName:y||i,text:R||"",location:Te(C,T),notes:q,detail:r?r.store($):-1}),l++}return a}function de(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(i)}return r}function ot({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){let i=this.contents;return(r===null||i!==t)&&(t=i,r=ne(i)),r}}}var at="0.16.1",ut=e=>ye().build(e),ft=()=>{throw new Error('The "serve" API only works in node')},ct=(e,t)=>ye().transform(e,t),dt=(e,t)=>ye().formatMessages(e,t),pt=(e,t)=>ye().analyzeMetafile(e,t),gt=()=>{throw new Error('The "buildSync" API only works in node')},mt=()=>{throw new Error('The "transformSync" API only works in node')},yt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},ht=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},ae,Se,ye=()=>{if(Se)return Se;throw ae?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')},bt=e=>{e=Fe(e||{});let t=e.wasmURL,r=e.wasmModule,i=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ae)throw new Error('Cannot call "initialize" more than once');return ae=wt(t||"",r,i),ae.catch(()=>{ae=void 0}),ae},wt=(e,t,r)=>ee(void 0,null,function*(){let i;if(r){let y=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.\nvar y=(r,f,m)=>new Promise((c,n)=>{var s=h=>{try{l(m.next(h))}catch(u){n(u)}},i=h=>{try{l(m.throw(h))}catch(u){n(u)}},l=h=>h.done?c(h.value):Promise.resolve(h.value).then(s,i);l((m=m.apply(r,f)).next())});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]});(()=>{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+=m.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,l,h,u){if(i!==0||l!==s.length||h!==null){u(r());return}const g=this.writeSync(n,s);u(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,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,l){l(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"),m=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 a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let d=0;switch(typeof t){case"object":t!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(e+4,2146959360|d,!0),this.mem.setUint32(e,a,!0)},l=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),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(t+d*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return m.decode(new DataView(this._inst.exports.mem.buffer,t,o))},g=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),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(g+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(l(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)),a=h(e+32),d=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,d),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),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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);l(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=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(c){return y(this,null,function*(){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,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const g=4096+8192;if(n>=g)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield 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,m=globalThis.fs,c="";m.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let g=c.split(`\n`);g.length>1&&console.log(g.slice(0,-1).join(`\n`)),c=g[g.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())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.1"],tryToInstantiateModule(r,l).then(h=>{postMessage(null),l.run(h)},h=>{postMessage(h)})};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(y))}else{let y=(postMessage=>{
10
15
  // Copyright 2018 The Go Authors. All rights reserved.
11
16
  // Use of this source code is governed by a BSD-style
12
17
  // license that can be found in the LICENSE file.
13
- var y=(r,g,f)=>new Promise((h,n)=>{var s=c=>{try{l(f.next(c))}catch(u){n(u)}},i=c=>{try{l(f.throw(c))}catch(u){n(u)}},l=c=>c.done?h(c.value):Promise.resolve(c.value).then(s,i);l((f=f.apply(r,g)).next())});let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let g of Object.getOwnPropertyNames(r))g in globalThis||Object.defineProperty(globalThis,g,{get:()=>self[g]});return(()=>{const r=()=>{const h=new Error("not implemented");return h.code="ENOSYS",h};if(!globalThis.fs){let h="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){h+=f.decode(s);const i=h.lastIndexOf(`
14
- `);return i!=-1&&(console.log(h.substr(0,i)),h=h.substr(i+1)),s.length},write(n,s,i,l,c,u){if(i!==0||l!==s.length||c!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,c,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,l){l(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 g=new TextEncoder("utf-8"),f=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 h=(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 a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;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,a,!0)},l=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},c=e=>{const t=n(e+0),o=n(e+8),a=new Array(o);for(let m=0;m<o;m++)a[m]=s(t+m*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return f.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),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,h(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();h(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(l(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)),a=c(e+32),m=Reflect.apply(o,t,a);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=c(e+16),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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=c(e+16),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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,h(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=g.encode(String(s(e+8)));i(e+16,t),h(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);l(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=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),h(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(h){return y(this,null,function*(){if(!(h instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=h,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=g.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,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.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(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(h){const n=this;return function(){const s={id:h,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let g=new TextDecoder,f=globalThis.fs,h="";f.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){h+=g.decode(u);let d=h.split(`
15
- `);d.length>1&&console.log(d.slice(0,-1).join(`
16
- `)),h=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:c})=>{c.length>0&&(n.push(c),s&&s())},f.read=(c,u,d,e,t,o)=>{if(c!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>f.read(c,u,d,e,t,o);return}let a=n[0],m=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+m),d),i+=m,i===a.length&&(n.shift(),i=0),o(null,m)};let l=new globalThis.Go;l.argv=["","--service=0.15.15"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,l.importObject).then(c=>l.run(c)):WebAssembly.instantiate(r,l.importObject).then(({instance:c})=>l.run(c))},r=>onmessage(r);})(d=>a.onmessage({data:d}));a={onmessage:null,postMessage:d=>setTimeout(()=>l({data:d})),terminate(){}}}a.postMessage(s),a.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:u}=Fe({writeToStdin(l){a.postMessage(l)},isSync:!1,isWriteUnavailable:!0,esbuild:me});Re={build:l=>new Promise((d,R)=>u.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(E,k)=>E?R(E):d(k)})),transform:(l,d)=>new Promise((R,E)=>u.transform({callName:"transform",refs:null,input:l,options:d||{},isTTY:!1,fs:{readFile(k,B){B(new Error("Internal error"),null)},writeFile(k,B){B(null)}},callback:(k,B)=>k?E(k):R(B)})),formatMessages:(l,d)=>new Promise((R,E)=>u.formatMessages({callName:"formatMessages",refs:null,messages:l,options:d,callback:(k,B)=>k?E(k):R(B)})),analyzeMetafile:(l,d)=>new Promise((R,E)=>u.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:d,callback:(k,B)=>k?E(k):R(B)}))}}),mt=me;
18
+ var y=(r,f,m)=>new Promise((c,n)=>{var s=h=>{try{l(m.next(h))}catch(u){n(u)}},i=h=>{try{l(m.throw(h))}catch(u){n(u)}},l=h=>h.done?c(h.value):Promise.resolve(h.value).then(s,i);l((m=m.apply(r,f)).next())});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]});(()=>{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+=m.decode(s);const i=c.lastIndexOf(`
19
+ `);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,l,h,u){if(i!==0||l!==s.length||h!==null){u(r());return}const g=this.writeSync(n,s);u(null,g)},chmod(n,s,i){i(r())},chown(n,s,i,l){l(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,l){l(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,l){l(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,l){l(r())},read(n,s,i,l,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,l){l(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"),m=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 a=this._ids.get(t);a===void 0&&(a=this._idPool.pop(),a===void 0&&(a=this._values.length),this._values[a]=t,this._goRefCounts[a]=0,this._ids.set(t,a)),this._goRefCounts[a]++;let d=0;switch(typeof t){case"object":t!==null&&(d=1);break;case"string":d=2;break;case"symbol":d=3;break;case"function":d=4;break}this.mem.setUint32(e+4,2146959360|d,!0),this.mem.setUint32(e,a,!0)},l=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),a=new Array(o);for(let d=0;d<o;d++)a[d]=s(t+d*8);return a},u=e=>{const t=n(e+0),o=n(e+8);return m.decode(new DataView(this._inst.exports.mem.buffer,t,o))},g=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),a=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,a))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(g+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(l(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)),a=h(e+32),d=Reflect.apply(o,t,a);e=this._inst.exports.getsp()>>>0,i(e+56,d),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),a=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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),a=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,a),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);l(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=l(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=l(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const a=o.subarray(0,t.length);t.set(a),c(e+40,a.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}run(c){return y(this,null,function*(){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,l=[];this.argv.forEach(e=>{l.push(s(e))}),l.push(0),Object.keys(this.env).sort().forEach(e=>{l.push(s(`${e}=${this.env[e]}`))}),l.push(0);const u=n;l.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const g=4096+8192;if(n>=g)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),yield 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,m=globalThis.fs,c="";m.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let g=c.split(`
20
+ `);g.length>1&&console.log(g.slice(0,-1).join(`
21
+ `)),c=g[g.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())},m.read=(h,u,g,e,t,o)=>{if(h!==0||g!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>m.read(h,u,g,e,t,o);return}let a=n[0],d=Math.max(0,Math.min(e,a.length-i));u.set(a.subarray(i,i+d),g),i+=d,i===a.length&&(n.shift(),i=0),o(null,d)};let l=new globalThis.Go;l.argv=["","--service=0.16.1"],tryToInstantiateModule(r,l).then(h=>{postMessage(null),l.run(h)},h=>{postMessage(h)})};function tryToInstantiateModule(r,f){return y(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const m=yield fetch(r);if(!m.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(m.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(m,f.importObject)).instance;const c=yield m.arrayBuffer();return(yield WebAssembly.instantiate(c,f.importObject)).instance})}return r=>onmessage(r);})(R=>i.onmessage({data:R}));i={onmessage:null,postMessage:R=>setTimeout(()=>y({data:R})),terminate(){}}}let a,l,c=new Promise((y,R)=>{a=y,l=R});i.onmessage=({data:y})=>{i.onmessage=({data:R})=>s(R),y?l(y):a()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:s,service:g}=Le({writeToStdin(y){i.postMessage(y)},isSync:!1,isWriteUnavailable:!0,esbuild:he});yield c,Se={build:y=>new Promise((R,C)=>g.buildOrServe({callName:"build",refs:null,serveOptions:null,options:y,isTTY:!1,defaultWD:"/",callback:(B,$)=>B?C(B):R($)})),transform:(y,R)=>new Promise((C,B)=>g.transform({callName:"transform",refs:null,input:y,options:R||{},isTTY:!1,fs:{readFile($,T){T(new Error("Internal error"),null)},writeFile($,T){T(null)}},callback:($,T)=>$?B($):C(T)})),formatMessages:(y,R)=>new Promise((C,B)=>g.formatMessages({callName:"formatMessages",refs:null,messages:y,options:R,callback:($,T)=>$?B($):C(T)})),analyzeMetafile:(y,R)=>new Promise((C,B)=>g.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof y=="string"?y:JSON.stringify(y),options:R,callback:($,T)=>$?B($):C(T)}))}}),vt=he;
17
22
  })(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
@@ -98,6 +98,8 @@ export interface BuildOptions extends CommonOptions {
98
98
  outbase?: string;
99
99
  /** Documentation: https://esbuild.github.io/api/#external */
100
100
  external?: string[];
101
+ /** Documentation: https://esbuild.github.io/api/#alias */
102
+ alias?: Record<string, string>;
101
103
  /** Documentation: https://esbuild.github.io/api/#loader */
102
104
  loader?: { [ext: string]: Loader };
103
105
  /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
@@ -191,8 +193,8 @@ export interface OutputFile {
191
193
  path: string;
192
194
  /** "text" as bytes */
193
195
  contents: Uint8Array;
194
- /** "contents" as text */
195
- text: string;
196
+ /** "contents" as text (changes automatically with "contents") */
197
+ get text(): string;
196
198
  }
197
199
 
198
200
  export interface BuildInvalidate {
@@ -586,7 +588,7 @@ export interface InitializeOptions {
586
588
  * The URL of the "esbuild.wasm" file. This must be provided when running
587
589
  * esbuild in the browser.
588
590
  */
589
- wasmURL?: string
591
+ wasmURL?: string | URL
590
592
 
591
593
  /**
592
594
  * The result of calling "new WebAssembly.Module(buffer)" where "buffer"