You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
50 KiB

(module=>{
"use strict";var $e=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var Xe=(e,t)=>{for(var n in t)$e(e,n,{get:t[n],enumerable:!0})},Ze=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Qe(t))!He.call(e,a)&&a!==n&&$e(e,a,{get:()=>t[a],enumerable:!(i=Ge(t,a))||i.enumerable});return e};var et=e=>Ze($e({},"__esModule",{value:!0}),e);var te=(e,t,n)=>new Promise((i,a)=>{var l=d=>{try{s(n.next(d))}catch(P){a(P)}},g=d=>{try{s(n.throw(d))}catch(P){a(P)}},s=d=>d.done?i(d.value):Promise.resolve(d.value).then(l,g);s((n=n.apply(e,t)).next())});var ke={};Xe(ke,{analyzeMetafile:()=>wt,analyzeMetafileSync:()=>Ot,build:()=>mt,buildSync:()=>vt,context:()=>yt,default:()=>$t,formatMessages:()=>bt,formatMessagesSync:()=>xt,initialize:()=>St,stop:()=>Et,transform:()=>ht,transformSync:()=>Rt,version:()=>pt});module.exports=et(ke);function Ae(e){let t=i=>{if(i===null)n.write8(0);else if(typeof i=="boolean")n.write8(1),n.write8(+i);else if(typeof i=="number")n.write8(2),n.write32(i|0);else if(typeof i=="string")n.write8(3),n.write(Z(i));else if(i instanceof Uint8Array)n.write8(4),n.write(i);else if(i instanceof Array){n.write8(5),n.write32(i.length);for(let a of i)t(a)}else{let a=Object.keys(i);n.write8(6),n.write32(a.length);for(let l of a)n.write(Z(l)),t(i[l])}},n=new he;return n.write32(0),n.write32(e.id<<1|+!e.isRequest),t(e.value),Ce(n.buf,n.len-4,0),n.buf.subarray(0,n.len)}function Pe(e){let t=()=>{switch(n.read8()){case 0:return null;case 1:return!!n.read8();case 2:return n.read32();case 3:return oe(n.read());case 4:return n.read();case 5:{let g=n.read32(),s=[];for(let d=0;d<g;d++)s.push(t());return s}case 6:{let g=n.read32(),s={};for(let d=0;d<g;d++)s[oe(n.read())]=t();return s}default:throw new Error("Invalid packet")}},n=new he(e),i=n.read32(),a=(i&1)===0;i>>>=1;let l=t();if(n.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:a,value:l}}var he=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 n=new Uint8Array((this.len+t)*2);n.set(this.buf),this.buf=n}return this.len+=t,this.len-t}write8(t){let n=this._write(1);this.buf[n]=t}write32(t){let n=this._write(4);Ce(this.buf,t,n)}write(t){let n=this._write(4+t.length);Ce(this.buf,t.length,n),this.buf.set(t,n+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 Fe(this.buf,this._read(4))}read(){let t=this.read32(),n=new Uint8Array(t),i=this._read(n.length);return n.set(this.buf.subarray(i,i+t)),n}},Z,oe,Me;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;Z=n=>e.encode(n),oe=n=>t.decode(n),Me='new TextEncoder().encode("")'}else if(typeof Buffer!="undefined")Z=e=>Buffer.from(e),oe=e=>{let{buffer:t,byteOffset:n,byteLength:i}=e;return Buffer.from(t,n,i).toString()},Me='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Me} instanceof Uint8Array" is incorrectly false
This indicates that your JavaScript environment is broken. You cannot use
esbuild in this environment because esbuild relies on this invariant. This
is not a problem with esbuild. You need to fix your environment instead.
`);function Fe(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ce(e,t,n){e[n++]=t,e[n++]=t>>8,e[n++]=t>>16,e[n++]=t>>24}var _=JSON.stringify,Te="warning",De="silent";function de(e,t){let n=[];for(let i of e){if(Y(i,t),i.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${i}`);n.push(i)}return n.join(",")}var ve=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",Re=e=>e instanceof RegExp?null:"a RegExp object",ue=e=>typeof e=="number"&&e===(e|0)?null:"an integer",nt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",je=e=>typeof e=="function"?null:"a function",le=e=>Array.isArray(e)?null:"an array",G=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",rt=e=>typeof e=="object"&&e!==null?null:"an array or an object",it=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Be=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Le=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",lt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ne=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",qe=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",st=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function r(e,t,n,i){let a=e[n];if(t[n+""]=!0,a===void 0)return;let l=i(a);if(l!==null)throw new Error(`${_(n)} must be ${l}`);return a}function K(e,t,n){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${n}: ${_(i)}`)}function Ie(e){let t=Object.create(null),n=r(e,t,"wasmURL",st),i=r(e,t,"wasmModule",it),a=r(e,t,"worker",I);return K(e,t,"in initialize() call"),{wasmURL:n,wasmModule:i,worker:a}}function We(e){let t;if(e!==void 0){t=Object.create(null);for(let n in e){let i=e[n];if(typeof i=="string"||i===!1)t[n]=i;else throw new Error(`Expected ${_(n)} in mangle cache to map to either a string or false`)}}return t}function Oe(e,t,n,i,a){let l=r(t,n,"color",I),g=r(t,n,"logLevel",y),s=r(t,n,"logLimit",ue);l!==void 0?e.push(`--color=${l}`):i&&e.push("--color=true"),e.push(`--log-level=${g||a}`),e.push(`--log-limit=${s||0}`)}function Y(e,t,n){if(typeof e!="string")throw new Error(`Expected value for ${t}${n!==void 0?" "+_(n):""} to be a string, got ${typeof e} instead`);return e}function ze(e,t,n){let i=r(t,n,"legalComments",y),a=r(t,n,"sourceRoot",y),l=r(t,n,"sourcesContent",I),g=r(t,n,"target",Ne),s=r(t,n,"format",y),d=r(t,n,"globalName",y),P=r(t,n,"mangleProps",Re),A=r(t,n,"reserveProps",Re),w=r(t,n,"mangleQuoted",I),U=r(t,n,"minify",I),T=r(t,n,"minifySyntax",I),j=r(t,n,"minifyWhitespace",I),L=r(t,n,"minifyIdentifiers",I),E=r(t,n,"lineLimit",ue),z=r(t,n,"drop",G),V=r(t,n,"dropLabels",G),v=r(t,n,"charset",y),p=r(t,n,"treeShaking",I),f=r(t,n,"ignoreAnnotations",I),o=r(t,n,"jsx",y),R=r(t,n,"jsxFactory",y),O=r(t,n,"jsxFragment",y),$=r(t,n,"jsxImportSource",y),B=r(t,n,"jsxDev",I),u=r(t,n,"jsxSideEffects",I),c=r(t,n,"define",Q),b=r(t,n,"logOverride",Q),S=r(t,n,"supported",Q),F=r(t,n,"pure",G),k=r(t,n,"keepNames",I),x=r(t,n,"platform",y),M=r(t,n,"tsconfigRaw",lt),q=r(t,n,"absPaths",G);if(i&&e.push(`--legal-comments=${i}`),a!==void 0&&e.push(`--source-root=${a}`),l!==void 0&&e.push(`--sources-content=${l}`),g&&e.push(`--target=${de(Array.isArray(g)?g:[g],"target")}`),s&&e.push(`--format=${s}`),d&&e.push(`--global-name=${d}`),x&&e.push(`--platform=${x}`),M&&e.push(`--tsconfig-raw=${typeof M=="string"?M:JSON.stringify(M)}`),U&&e.push("--minify"),T&&e.push("--minify-syntax"),j&&e.push("--minify-whitespace"),L&&e.push("--minify-identifiers"),E&&e.push(`--line-limit=${E}`),v&&e.push(`--charset=${v}`),p!==void 0&&e.push(`--tree-shaking=${p}`),f&&e.push("--ignore-annotations"),z)for(let m of z)e.push(`--drop:${Y(m,"drop")}`);if(V&&e.push(`--drop-labels=${de(V,"drop label")}`),q&&e.push(`--abs-paths=${de(q,"abs paths")}`),P&&e.push(`--mangle-props=${xe(P)}`),A&&e.push(`--reserve-props=${xe(A)}`),w!==void 0&&e.push(`--mangle-quoted=${w}`),o&&e.push(`--jsx=${o}`),R&&e.push(`--jsx-factory=${R}`),O&&e.push(`--jsx-fragment=${O}`),$&&e.push(`--jsx-import-source=${$}`),B&&e.push("--jsx-dev"),u&&e.push("--jsx-side-effects"),c)for(let m in c){if(m.indexOf("=")>=0)throw new Error(`Invalid define: ${m}`);e.push(`--define:${m}=${Y(c[m],"define",m)}`)}if(b)for(let m in b){if(m.indexOf("=")>=0)throw new Error(`Invalid log override: ${m}`);e.push(`--log-override:${m}=${Y(b[m],"log override",m)}`)}if(S)for(let m in S){if(m.indexOf("=")>=0)throw new Error(`Invalid supported: ${m}`);let C=S[m];if(typeof C!="boolean")throw new Error(`Expected value for supported ${_(m)} to be a boolean, got ${typeof C} instead`);e.push(`--supported:${m}=${C}`)}if(F)for(let m of F)e.push(`--pure:${Y(m,"pure")}`);k&&e.push("--keep-names")}function ot(e,t,n,i,a){var ne;let l=[],g=[],s=Object.create(null),d=null,P=null;Oe(l,t,s,n,i),ze(l,t,s);let A=r(t,s,"sourcemap",Le),w=r(t,s,"bundle",I),U=r(t,s,"splitting",I),T=r(t,s,"preserveSymlinks",I),j=r(t,s,"metafile",I),L=r(t,s,"outfile",y),E=r(t,s,"outdir",y),z=r(t,s,"outbase",y),V=r(t,s,"tsconfig",y),v=r(t,s,"resolveExtensions",G),p=r(t,s,"nodePaths",G),f=r(t,s,"mainFields",G),o=r(t,s,"conditions",G),R=r(t,s,"external",G),O=r(t,s,"packages",y),$=r(t,s,"alias",Q),B=r(t,s,"loader",Q),u=r(t,s,"outExtension",Q),c=r(t,s,"publicPath",y),b=r(t,s,"entryNames",y),S=r(t,s,"chunkNames",y),F=r(t,s,"assetNames",y),k=r(t,s,"inject",G),x=r(t,s,"banner",Q),M=r(t,s,"footer",Q),q=r(t,s,"entryPoints",rt),m=r(t,s,"absWorkingDir",y),C=r(t,s,"stdin",Q),N=(ne=r(t,s,"write",I))!=null?ne:a,D=r(t,s,"allowOverwrite",I),J=r(t,s,"mangleCache",Q);if(s.plugins=!0,K(t,s,`in ${e}() call`),A&&l.push(`--sourcemap${A===!0?"":`=${A}`}`),w&&l.push("--bundle"),D&&l.push("--allow-overwrite"),U&&l.push("--splitting"),T&&l.push("--preserve-symlinks"),j&&l.push("--metafile"),L&&l.push(`--outfile=${L}`),E&&l.push(`--outdir=${E}`),z&&l.push(`--outbase=${z}`),V&&l.push(`--tsconfig=${V}`),O&&l.push(`--packages=${O}`),v&&l.push(`--resolve-extensions=${de(v,"resolve extension")}`),c&&l.push(`--public-path=${c}`),b&&l.push(`--entry-names=${b}`),S&&l.push(`--chunk-names=${S}`),F&&l.push(`--asset-names=${F}`),f&&l.push(`--main-fields=${de(f,"main field")}`),o&&l.push(`--conditions=${de(o,"condition")}`),R)for(let h of R)l.push(`--external:${Y(h,"external")}`);if($)for(let h in $){if(h.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${h}`);l.push(`--alias:${h}=${Y($[h],"alias",h)}`)}if(x)for(let h in x){if(h.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${h}`);l.push(`--banner:${h}=${Y(x[h],"banner",h)}`)}if(M)for(let h in M){if(h.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${h}`);l.push(`--footer:${h}=${Y(M[h],"footer",h)}`)}if(k)for(let h of k)l.push(`--inject:${Y(h,"inject")}`);if(B)for(let h in B){if(h.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${h}`);l.push(`--loader:${h}=${Y(B[h],"loader",h)}`)}if(u)for(let h in u){if(h.indexOf("=")>=0)throw new Error(`Invalid out extension: ${h}`);l.push(`--out-extension:${h}=${Y(u[h],"out extension",h)}`)}if(q)if(Array.isArray(q))for(let h=0,re=q.length;h<re;h++){let H=q[h];if(typeof H=="object"&&H!==null){let ee=Object.create(null),ie=r(H,ee,"in",y),X=r(H,ee,"out",y);if(K(H,ee,"in entry point at index "+h),ie===void 0)throw new Error('Missing property "in" for entry point at index '+h);if(X===void 0)throw new Error('Missing property "out" for entry point at index '+h);g.push([X,ie])}else g.push(["",Y(H,"entry point at index "+h)])}else for(let h in q)g.push([h,Y(q[h],"entry point",h)]);if(C){let h=Object.create(null),re=r(C,h,"contents",qe),H=r(C,h,"resolveDir",y),ee=r(C,h,"sourcefile",y),ie=r(C,h,"loader",y);K(C,h,'in "stdin" object'),ee&&l.push(`--sourcefile=${ee}`),ie&&l.push(`--loader=${ie}`),H&&(P=H),typeof re=="string"?d=Z(re):re instanceof Uint8Array&&(d=re)}let W=[];if(p)for(let h of p)h+="",W.push(h);return{entries:g,flags:l,write:N,stdinContents:d,stdinResolveDir:P,absWorkingDir:m,nodePaths:W,mangleCache:We(J)}}function at(e,t,n,i){let a=[],l=Object.create(null);Oe(a,t,l,n,i),ze(a,t,l);let g=r(t,l,"sourcemap",Le),s=r(t,l,"sourcefile",y),d=r(t,l,"loader",y),P=r(t,l,"banner",y),A=r(t,l,"footer",y),w=r(t,l,"mangleCache",Q);return K(t,l,`in ${e}() call`),g&&a.push(`--sourcemap=${g===!0?"external":g}`),s&&a.push(`--sourcefile=${s}`),d&&a.push(`--loader=${d}`),P&&a.push(`--banner=${P}`),A&&a.push(`--footer=${A}`),{flags:a,mangleCache:We(w)}}function Ke(e){let t={},n={didClose:!1,reason:""},i={},a=0,l=0,g=new Uint8Array(16*1024),s=0,d=v=>{let p=s+v.length;if(p>g.length){let o=new Uint8Array(p*2);o.set(g),g=o}g.set(v,s),s+=v.length;let f=0;for(;f+4<=s;){let o=Fe(g,f);if(f+4+o>s)break;f+=4,j(g.subarray(f,f+o)),f+=o}f>0&&(g.copyWithin(0,f,s),s-=f)},P=v=>{n.didClose=!0,v&&(n.reason=": "+(v.message||v));let p="The service was stopped"+n.reason;for(let f in i)i[f](p,null);i={}},A=(v,p,f)=>{if(n.didClose)return f("The service is no longer running"+n.reason,null);let o=a++;i[o]=(R,O)=>{try{f(R,O)}finally{v&&v.unref()}},v&&v.ref(),e.writeToStdin(Ae({id:o,isRequest:!0,value:p}))},w=(v,p)=>{if(n.didClose)throw new Error("The service is no longer running"+n.reason);e.writeToStdin(Ae({id:v,isRequest:!1,value:p}))},U=(v,p)=>te(null,null,function*(){try{if(p.command==="ping"){w(v,{});return}if(typeof p.key=="number"){let f=t[p.key];if(!f)return;let o=f[p.command];if(o){yield o(v,p);return}}throw new Error("Invalid command: "+p.command)}catch(f){let o=[ae(f,e,null,void 0,"")];try{w(v,{errors:o})}catch(R){}}}),T=!0,j=v=>{if(T){T=!1;let f=String.fromCharCode(...v);if(f!=="0.27.2")throw new Error(`Cannot start service: Host version "0.27.2" does not match binary version ${_(f)}`);return}let p=Pe(v);if(p.isRequest)U(p.id,p.value);else{let f=i[p.id];delete i[p.id],p.value.error?f(p.value.error,{}):f(null,p.value)}};return{readFromStdout:d,afterClose:P,service:{buildOrContext:({callName:v,refs:p,options:f,isTTY:o,defaultWD:R,callback:O})=>{let $=0,B=l++,u={},c={ref(){++$===1&&p&&p.ref()},unref(){--$===0&&(delete t[B],p&&p.unref())}};t[B]=u,c.ref(),ut(v,B,A,w,c,e,u,f,o,R,(b,S)=>{try{O(b,S)}finally{c.unref()}})},transform:({callName:v,refs:p,input:f,options:o,isTTY:R,fs:O,callback:$})=>{let B=_e(),u=c=>{try{if(typeof f!="string"&&!(f instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:b,mangleCache:S}=at(v,o,R,De),F={command:"transform",flags:b,inputFS:c!==null,input:c!==null?Z(c):typeof f=="string"?Z(f):f};S&&(F.mangleCache=S),A(p,F,(k,x)=>{if(k)return $(new Error(k),null);let M=ge(x.errors,B),q=ge(x.warnings,B),m=1,C=()=>{if(--m===0){let N={warnings:q,code:x.code,map:x.map,mangleCache:void 0,legalComments:void 0};"legalComments"in x&&(N.legalComments=x==null?void 0:x.legalComments),x.mangleCache&&(N.mangleCache=x==null?void 0:x.mangleCache),$(null,N)}};if(M.length>0)return $(me("Transform failed",M,q),null);x.codeFS&&(m++,O.readFile(x.code,(N,D)=>{N!==null?$(N,null):(x.code=D,C())})),x.mapFS&&(m++,O.readFile(x.map,(N,D)=>{N!==null?$(N,null):(x.map=D,C())})),C()})}catch(b){let S=[];try{Oe(S,o,{},R,De)}catch(k){}let F=ae(b,e,B,void 0,"");A(p,{command:"error",flags:S,error:F},()=>{F.detail=B.load(F.detail),$(me("Transform failed",[F],[]),null)})}};if((typeof f=="string"||f instanceof Uint8Array)&&f.length>1024*1024){let c=u;u=()=>O.writeFile(f,c)}u(null)},formatMessages:({callName:v,refs:p,messages:f,options:o,callback:R})=>{if(!o)throw new Error(`Missing second argument in ${v}() call`);let O={},$=r(o,O,"kind",y),B=r(o,O,"color",I),u=r(o,O,"terminalWidth",ue);if(K(o,O,`in ${v}() call`),$===void 0)throw new Error(`Missing "kind" in ${v}() call`);if($!=="error"&&$!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${v}() call`);let c={command:"format-msgs",messages:se(f,"messages",null,"",u),isWarning:$==="warning"};B!==void 0&&(c.color=B),u!==void 0&&(c.terminalWidth=u),A(p,c,(b,S)=>{if(b)return R(new Error(b),null);R(null,S.messages)})},analyzeMetafile:({callName:v,refs:p,metafile:f,options:o,callback:R})=>{o===void 0&&(o={});let O={},$=r(o,O,"color",I),B=r(o,O,"verbose",I);K(o,O,`in ${v}() call`);let u={command:"analyze-metafile",metafile:f};$!==void 0&&(u.color=$),B!==void 0&&(u.verbose=B),A(p,u,(c,b)=>{if(c)return R(new Error(c),null);R(null,b.result)})}}}}function ut(e,t,n,i,a,l,g,s,d,P,A){let w=_e(),U=e==="context",T=(E,z)=>{let V=[];try{Oe(V,s,{},d,Te)}catch(p){}let v=ae(E,l,w,void 0,z);n(a,{command:"error",flags:V,error:v},()=>{v.detail=w.load(v.detail),A(me(U?"Context failed":"Build failed",[v],[]),null)})},j;if(typeof s=="object"){let E=s.plugins;if(E!==void 0){if(!Array.isArray(E))return T(new Error('"plugins" must be an array'),"");j=E}}if(j&&j.length>0){if(l.isSync)return T(new Error("Cannot use plugins in synchronous API calls"),"");ct(t,n,i,a,l,g,s,j,w).then(E=>{if(!E.ok)return T(E.error,E.pluginName);try{L(E.requestPlugins,E.runOnEndCallbacks,E.scheduleOnDisposeCallbacks)}catch(z){T(z,"")}},E=>T(E,""));return}try{L(null,(E,z)=>z([],[]),()=>{})}catch(E){T(E,"")}function L(E,z,V){let v=l.hasFS,{entries:p,flags:f,write:o,stdinContents:R,stdinResolveDir:O,absWorkingDir:$,nodePaths:B,mangleCache:u}=ot(e,s,d,Te,v);if(o&&!l.hasFS)throw new Error('The "write" option is unavailable in this environment');let c={command:"build",key:t,entries:p,flags:f,write:o,stdinContents:R,stdinResolveDir:O,absWorkingDir:$||P,nodePaths:B,context:U};E&&(c.plugins=E),u&&(c.mangleCache=u);let b=(k,x)=>{let M={errors:ge(k.errors,w),warnings:ge(k.warnings,w),outputFiles:void 0,metafile:void 0,mangleCache:void 0},q=M.errors.slice(),m=M.warnings.slice();k.outputFiles&&(M.outputFiles=k.outputFiles.map(dt)),k.metafile&&(M.metafile=JSON.parse(k.metafile)),k.mangleCache&&(M.mangleCache=k.mangleCache),k.writeToStdout!==void 0&&console.log(oe(k.writeToStdout).replace(/\n$/,"")),z(M,(C,N)=>{if(q.length>0||C.length>0){let D=me("Build failed",q.concat(C),m.concat(N));return x(D,null,C,N)}x(null,M,C,N)})},S,F;U&&(g["on-end"]=(k,x)=>new Promise(M=>{b(x,(q,m,C,N)=>{let D={errors:C,warnings:N};F&&F(q,m),S=void 0,F=void 0,i(k,D),M()})})),n(a,c,(k,x)=>{if(k)return A(new Error(k),null);if(!U)return b(x,(m,C)=>(V(),A(m,C)));if(x.errors.length>0)return A(me("Context failed",x.errors,x.warnings),null);let M=!1,q={rebuild:()=>(S||(S=new Promise((m,C)=>{let N;F=(J,W)=>{N||(N=()=>J?C(J):m(W))};let D=()=>{n(a,{command:"rebuild",key:t},(W,ne)=>{W?C(new Error(W)):N?N():D()})};D()})),S),watch:(m={})=>new Promise((C,N)=>{if(!l.hasFS)throw new Error('Cannot use the "watch" API in this environment');let D={},J=r(m,D,"delay",ue);K(m,D,"in watch() call");let W={command:"watch",key:t};J&&(W.delay=J),n(a,W,ne=>{ne?N(new Error(ne)):C(void 0)})}),serve:(m={})=>new Promise((C,N)=>{if(!l.hasFS)throw new Error('Cannot use the "serve" API in this environment');let D={},J=r(m,D,"port",nt),W=r(m,D,"host",y),ne=r(m,D,"servedir",y),h=r(m,D,"keyfile",y),re=r(m,D,"certfile",y),H=r(m,D,"fallback",y),ee=r(m,D,"cors",Q),ie=r(m,D,"onRequest",je);K(m,D,"in serve() call");let X={command:"serve",key:t,onRequest:!!ie};if(J!==void 0&&(X.port=J),W!==void 0&&(X.host=W),ne!==void 0&&(X.servedir=ne),h!==void 0&&(X.keyfile=h),re!==void 0&&(X.certfile=re),H!==void 0&&(X.fallback=H),ee){let pe={},fe=r(ee,pe,"origin",Ne);K(ee,pe,'on "cors" object'),Array.isArray(fe)?X.corsOrigin=fe:fe!==void 0&&(X.corsOrigin=[fe])}n(a,X,(pe,fe)=>{if(pe)return N(new Error(pe));ie&&(g["serve-request"]=(Je,Ye)=>{ie(Ye.args),i(Je,{})}),C(fe)})}),cancel:()=>new Promise(m=>{if(M)return m();n(a,{command:"cancel",key:t},()=>{m()})}),dispose:()=>new Promise(m=>{if(M)return m();M=!0,n(a,{command:"dispose",key:t},()=>{m(),V(),a.unref()})})};a.ref(),A(null,q)})}}var ct=(e,t,n,i,a,l,g,s,d)=>te(null,null,function*(){let P=[],A=[],w={},U={},T=[],j=0,L=0,E=[],z=!1;s=[...s];for(let p of s){let f={};if(typeof p!="object")throw new Error(`Plugin at index ${L} must be an object`);let o=r(p,f,"name",y);if(typeof o!="string"||o==="")throw new Error(`Plugin at index ${L} is missing a name`);try{let R=r(p,f,"setup",je);if(typeof R!="function")throw new Error("Plugin is missing a setup function");K(p,f,`on plugin ${_(o)}`);let O={name:o,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};L++;let B=R({initialOptions:g,resolve:(u,c={})=>{if(!z)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 b=Object.create(null),S=r(c,b,"pluginName",y),F=r(c,b,"importer",y),k=r(c,b,"namespace",y),x=r(c,b,"resolveDir",y),M=r(c,b,"kind",y),q=r(c,b,"pluginData",ve),m=r(c,b,"with",Q);return K(c,b,"in resolve() call"),new Promise((C,N)=>{let D={command:"resolve",path:u,key:e,pluginName:o};if(S!=null&&(D.pluginName=S),F!=null&&(D.importer=F),k!=null&&(D.namespace=k),x!=null&&(D.resolveDir=x),M!=null)D.kind=M;else throw new Error('Must specify "kind" when calling "resolve"');q!=null&&(D.pluginData=d.store(q)),m!=null&&(D.with=ft(m,"with")),t(i,D,(J,W)=>{J!==null?N(new Error(J)):C({errors:ge(W.errors,d),warnings:ge(W.warnings,d),path:W.path,external:W.external,sideEffects:W.sideEffects,namespace:W.namespace,suffix:W.suffix,pluginData:d.load(W.pluginData)})})})},onStart(u){let c='This error came from the "onStart" callback registered here:',b=be(new Error(c),a,"onStart");P.push({name:o,callback:u,note:b}),O.onStart=!0},onEnd(u){let c='This error came from the "onEnd" callback registered here:',b=be(new Error(c),a,"onEnd");A.push({name:o,callback:u,note:b}),O.onEnd=!0},onResolve(u,c){let b='This error came from the "onResolve" callback registered here:',S=be(new Error(b),a,"onResolve"),F={},k=r(u,F,"filter",Re),x=r(u,F,"namespace",y);if(K(u,F,`in onResolve() call for plugin ${_(o)}`),k==null)throw new Error("onResolve() call is missing a filter");let M=j++;w[M]={name:o,callback:c,note:S},O.onResolve.push({id:M,filter:xe(k),namespace:x||""})},onLoad(u,c){let b='This error came from the "onLoad" callback registered here:',S=be(new Error(b),a,"onLoad"),F={},k=r(u,F,"filter",Re),x=r(u,F,"namespace",y);if(K(u,F,`in onLoad() call for plugin ${_(o)}`),k==null)throw new Error("onLoad() call is missing a filter");let M=j++;U[M]={name:o,callback:c,note:S},O.onLoad.push({id:M,filter:xe(k),namespace:x||""})},onDispose(u){T.push(u)},esbuild:a.esbuild});B&&(yield B),E.push(O)}catch(R){return{ok:!1,error:R,pluginName:o}}}l["on-start"]=(p,f)=>te(null,null,function*(){d.clear();let o={errors:[],warnings:[]};yield Promise.all(P.map(B=>te(null,[B],function*({name:R,callback:O,note:$}){try{let u=yield O();if(u!=null){if(typeof u!="object")throw new Error(`Expected onStart() callback in plugin ${_(R)} to return an object`);let c={},b=r(u,c,"errors",le),S=r(u,c,"warnings",le);K(u,c,`from onStart() callback in plugin ${_(R)}`),b!=null&&o.errors.push(...se(b,"errors",d,R,void 0)),S!=null&&o.warnings.push(...se(S,"warnings",d,R,void 0))}}catch(u){o.errors.push(ae(u,a,d,$&&$(),R))}}))),n(p,o)}),l["on-resolve"]=(p,f)=>te(null,null,function*(){let o={},R="",O,$;for(let B of f.ids)try{({name:R,callback:O,note:$}=w[B]);let u=yield O({path:f.path,importer:f.importer,namespace:f.namespace,resolveDir:f.resolveDir,kind:f.kind,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onResolve() callback in plugin ${_(R)} to return an object`);let c={},b=r(u,c,"pluginName",y),S=r(u,c,"path",y),F=r(u,c,"namespace",y),k=r(u,c,"suffix",y),x=r(u,c,"external",I),M=r(u,c,"sideEffects",I),q=r(u,c,"pluginData",ve),m=r(u,c,"errors",le),C=r(u,c,"warnings",le),N=r(u,c,"watchFiles",G),D=r(u,c,"watchDirs",G);K(u,c,`from onResolve() callback in plugin ${_(R)}`),o.id=B,b!=null&&(o.pluginName=b),S!=null&&(o.path=S),F!=null&&(o.namespace=F),k!=null&&(o.suffix=k),x!=null&&(o.external=x),M!=null&&(o.sideEffects=M),q!=null&&(o.pluginData=d.store(q)),m!=null&&(o.errors=se(m,"errors",d,R,void 0)),C!=null&&(o.warnings=se(C,"warnings",d,R,void 0)),N!=null&&(o.watchFiles=we(N,"watchFiles")),D!=null&&(o.watchDirs=we(D,"watchDirs"));break}}catch(u){o={id:B,errors:[ae(u,a,d,$&&$(),R)]};break}n(p,o)}),l["on-load"]=(p,f)=>te(null,null,function*(){let o={},R="",O,$;for(let B of f.ids)try{({name:R,callback:O,note:$}=U[B]);let u=yield O({path:f.path,namespace:f.namespace,suffix:f.suffix,pluginData:d.load(f.pluginData),with:f.with});if(u!=null){if(typeof u!="object")throw new Error(`Expected onLoad() callback in plugin ${_(R)} to return an object`);let c={},b=r(u,c,"pluginName",y),S=r(u,c,"contents",qe),F=r(u,c,"resolveDir",y),k=r(u,c,"pluginData",ve),x=r(u,c,"loader",y),M=r(u,c,"errors",le),q=r(u,c,"warnings",le),m=r(u,c,"watchFiles",G),C=r(u,c,"watchDirs",G);K(u,c,`from onLoad() callback in plugin ${_(R)}`),o.id=B,b!=null&&(o.pluginName=b),S instanceof Uint8Array?o.contents=S:S!=null&&(o.contents=Z(S)),F!=null&&(o.resolveDir=F),k!=null&&(o.pluginData=d.store(k)),x!=null&&(o.loader=x),M!=null&&(o.errors=se(M,"errors",d,R,void 0)),q!=null&&(o.warnings=se(q,"warnings",d,R,void 0)),m!=null&&(o.watchFiles=we(m,"watchFiles")),C!=null&&(o.watchDirs=we(C,"watchDirs"));break}}catch(u){o={id:B,errors:[ae(u,a,d,$&&$(),R)]};break}n(p,o)});let V=(p,f)=>f([],[]);A.length>0&&(V=(p,f)=>{te(null,null,function*(){let o=[],R=[];for(let{name:O,callback:$,note:B}of A){let u,c;try{let b=yield $(p);if(b!=null){if(typeof b!="object")throw new Error(`Expected onEnd() callback in plugin ${_(O)} to return an object`);let S={},F=r(b,S,"errors",le),k=r(b,S,"warnings",le);K(b,S,`from onEnd() callback in plugin ${_(O)}`),F!=null&&(u=se(F,"errors",d,O,void 0)),k!=null&&(c=se(k,"warnings",d,O,void 0))}}catch(b){u=[ae(b,a,d,B&&B(),O)]}if(u){o.push(...u);try{p.errors.push(...u)}catch(b){}}if(c){R.push(...c);try{p.warnings.push(...c)}catch(b){}}}f(o,R)})});let v=()=>{for(let p of T)setTimeout(()=>p(),0)};return z=!0,{ok:!0,requestPlugins:E,runOnEndCallbacks:V,scheduleOnDisposeCallbacks:v}});function _e(){let e=new Map,t=0;return{clear(){e.clear()},load(n){return e.get(n)},store(n){if(n===void 0)return-1;let i=t++;return e.set(i,n),i}}}function be(e,t,n){let i,a=!1;return()=>{if(a)return i;a=!0;try{let l=(e.stack+"").split(`
`);l.splice(1,1);let g=Ve(t,l,n);if(g)return i={text:e.message,location:g},i}catch(l){}}}function ae(e,t,n,i,a){let l="Internal error",g=null;try{l=(e&&e.message||e)+""}catch(s){}try{g=Ve(t,(e.stack+"").split(`
`),"")}catch(s){}return{id:"",pluginName:a,text:l,location:g,notes:i?[i]:[],detail:n?n.store(e):-1}}function Ve(e,t,n){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 g=/^(?:new |async )?\S+ \((.*)\)$/.exec(l);if(g){l=g[1];continue}if(g=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(l),g){l=g[1];continue}if(g=/^(\S+):(\d+):(\d+)$/.exec(l),g){let s;try{s=e.readFileSync(g[1],"utf8")}catch(w){break}let d=s.split(/\r\n|\r|\n|\u2028|\u2029/)[+g[2]-1]||"",P=+g[3]-1,A=d.slice(P,P+n.length)===n?n.length:0;return{file:g[1],namespace:"file",line:+g[2],column:Z(d.slice(0,P)).length,length:Z(d.slice(P,P+A)).length,lineText:d+`
`+t.slice(1).join(`
`),suggestion:""}}break}}return null}function me(e,t,n){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((l,g)=>{if(g===i)return`
...`;if(!l.location)return`
error: ${l.text}`;let{file:s,line:d,column:P}=l.location,A=l.pluginName?`[plugin: ${l.pluginName}] `:"";return`
${s}:${d}:${P}: ERROR: ${A}${l.text}`}).join("");let a=new Error(e);for(let[l,g]of[["errors",t],["warnings",n]])Object.defineProperty(a,l,{configurable:!0,enumerable:!0,get:()=>g,set:s=>Object.defineProperty(a,l,{configurable:!0,enumerable:!0,value:s})});return a}function ge(e,t){for(let n of e)n.detail=t.load(n.detail);return e}function Ue(e,t,n){if(e==null)return null;let i={},a=r(e,i,"file",y),l=r(e,i,"namespace",y),g=r(e,i,"line",ue),s=r(e,i,"column",ue),d=r(e,i,"length",ue),P=r(e,i,"lineText",y),A=r(e,i,"suggestion",y);if(K(e,i,t),P){let w=P.slice(0,(s&&s>0?s:0)+(d&&d>0?d:0)+(n&&n>0?n:80));!/[\x7F-\uFFFF]/.test(w)&&!/\n/.test(P)&&(P=w)}return{file:a||"",namespace:l||"",line:g||0,column:s||0,length:d||0,lineText:P||"",suggestion:A||""}}function se(e,t,n,i,a){let l=[],g=0;for(let s of e){let d={},P=r(s,d,"id",y),A=r(s,d,"pluginName",y),w=r(s,d,"text",y),U=r(s,d,"location",Be),T=r(s,d,"notes",le),j=r(s,d,"detail",ve),L=`in element ${g} of "${t}"`;K(s,d,L);let E=[];if(T)for(let z of T){let V={},v=r(z,V,"text",y),p=r(z,V,"location",Be);K(z,V,L),E.push({text:v||"",location:Ue(p,L,a)})}l.push({id:P||"",pluginName:A||i,text:w||"",location:Ue(U,L,a),notes:E,detail:n?n.store(j):-1}),g++}return l}function we(e,t){let n=[];for(let i of e){if(typeof i!="string")throw new Error(`${_(t)} must be an array of strings`);n.push(i)}return n}function ft(e,t){let n=Object.create(null);for(let i in e){let a=e[i];if(typeof a!="string")throw new Error(`key ${_(i)} in object ${_(t)} must be a string`);n[i]=a}return n}function dt({path:e,contents:t,hash:n}){let i=null;return{path:e,contents:t,hash:n,get text(){let a=this.contents;return(i===null||a!==t)&&(t=a,i=oe(a)),i}}}function xe(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}var pt="0.27.2",mt=e=>ye().build(e),yt=e=>ye().context(e),ht=(e,t)=>ye().transform(e,t),bt=(e,t)=>ye().formatMessages(e,t),wt=(e,t)=>ye().analyzeMetafile(e,t),vt=()=>{throw new Error('The "buildSync" API only works in node')},Rt=()=>{throw new Error('The "transformSync" API only works in node')},xt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Ot=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Et=()=>(Ee&&Ee(),Promise.resolve()),ce,Ee,Se,ye=()=>{if(Se)return Se;throw ce?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},St=e=>{e=Ie(e||{});let t=e.wasmURL,n=e.wasmModule,i=e.worker!==!1;if(!t&&!n)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(ce)throw new Error('Cannot call "initialize" more than once');return ce=kt(t||"",n,i),ce.catch(()=>{ce=void 0}),ce},kt=(e,t,n)=>te(null,null,function*(){let i,a,l=new Promise(w=>a=w);if(n){let w=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 _=(r,f,d)=>new Promise((a,i)=>{var s=c=>{try{o(d.next(c))}catch(u){i(u)}},n=c=>{try{o(d.throw(c))}catch(u){i(u)}},o=c=>c.done?a(c.value):Promise.resolve(c.value).then(s,n);o((d=d.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 a=new Error("not implemented");return a.code="ENOSYS",a};if(!globalThis.fs){let a="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(i,s){a+=d.decode(s);const n=a.lastIndexOf(`\n`);return n!=-1&&(console.log(a.substring(0,n)),a=a.substring(n+1)),s.length},write(i,s,n,o,c,u){if(n!==0||o!==s.length||c!==null){u(r());return}const m=this.writeSync(i,s);u(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,u){u(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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.path||(globalThis.path={resolve(...a){return a.join("/")}}),!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"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const a=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let h=this._ids.get(e);h===void 0&&(h=this._idPool.pop(),h===void 0&&(h=this._values.length),this._values[h]=e,this._goRefCounts[h]=0,this._ids.set(e,h)),this._goRefCounts[h]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,h,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},u=t=>{const e=s(t+0),l=s(t+8),h=new Array(l);for(let y=0;y<l;y++)h[y]=n(e+y*8);return h},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=(t,e)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(t,e)),w=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e,callExport:g},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),h=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,h))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,a(t+8,(w+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();a(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),h=u(t+32),y=Reflect.apply(l,e,h);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,a(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),a(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(a){return _(this,null,function*(){if(!(a instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=a,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 i=4096;const s=g=>{const w=i,t=f.encode(g+"\\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,i%8!==0&&(i+=8-i%8),w},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const u=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,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(a){const i=this;return function(){const s={id:a,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,a="";d.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){a+=f.decode(u);let m=a.split(`\n`);m.length>1&&console.log(m.slice(0,-1).join(`\n`)),a=m[m.length-1]}else throw new Error("Bad write");return u.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,u,m,g,w,t)=>{if(c!==0||m!==0||g!==u.length||w!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,u,m,g,w,t);return}let e=i[0],l=Math.max(0,Math.min(g,e.length-n));u.set(e.subarray(n,n+l),m),n+=l,n===e.length&&(i.shift(),n=0),t(null,l)};let o=new globalThis.Go;return o.argv=["","--service=0.27.2"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return _(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const a=yield d.arrayBuffer();return(yield WebAssembly.instantiate(a,f.importObject)).instance})}return r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});i=new Worker(URL.createObjectURL(w))}else{let w=(postMessage=>{
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
var _=(r,f,d)=>new Promise((a,i)=>{var s=c=>{try{o(d.next(c))}catch(u){i(u)}},n=c=>{try{o(d.throw(c))}catch(u){i(u)}},o=c=>c.done?a(c.value):Promise.resolve(c.value).then(s,n);o((d=d.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 a=new Error("not implemented");return a.code="ENOSYS",a};if(!globalThis.fs){let a="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(i,s){a+=d.decode(s);const n=a.lastIndexOf(`
`);return n!=-1&&(console.log(a.substring(0,n)),a=a.substring(n+1)),s.length},write(i,s,n,o,c,u){if(n!==0||o!==s.length||c!==null){u(r());return}const m=this.writeSync(i,s);u(null,m)},chmod(i,s,n){n(r())},chown(i,s,n,o){o(r())},close(i,s){s(r())},fchmod(i,s,n){n(r())},fchown(i,s,n,o){o(r())},fstat(i,s){s(r())},fsync(i,s){s(null)},ftruncate(i,s,n){n(r())},lchown(i,s,n,o){o(r())},link(i,s,n){n(r())},lstat(i,s){s(r())},mkdir(i,s,n){n(r())},open(i,s,n,o){o(r())},read(i,s,n,o,c,u){u(r())},readdir(i,s){s(r())},readlink(i,s){s(r())},rename(i,s,n){n(r())},rmdir(i,s){s(r())},stat(i,s){s(r())},symlink(i,s,n){n(r())},truncate(i,s,n){n(r())},unlink(i,s){s(r())},utimes(i,s,n,o){o(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.path||(globalThis.path={resolve(...a){return a.join("/")}}),!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"),d=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=t=>{t!==0&&console.warn("exit code:",t)},this._exitPromise=new Promise(t=>{this._resolveExitPromise=t}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const a=(t,e)=>{this.mem.setUint32(t+0,e,!0),this.mem.setUint32(t+4,Math.floor(e/4294967296),!0)},i=(t,e)=>{this.mem.setUint32(t+0,e,!0)},s=t=>{const e=this.mem.getUint32(t+0,!0),l=this.mem.getInt32(t+4,!0);return e+l*4294967296},n=t=>{const e=this.mem.getFloat64(t,!0);if(e===0)return;if(!isNaN(e))return e;const l=this.mem.getUint32(t,!0);return this._values[l]},o=(t,e)=>{if(typeof e=="number"&&e!==0){if(isNaN(e)){this.mem.setUint32(t+4,2146959360,!0),this.mem.setUint32(t,0,!0);return}this.mem.setFloat64(t,e,!0);return}if(e===void 0){this.mem.setFloat64(t,0,!0);return}let h=this._ids.get(e);h===void 0&&(h=this._idPool.pop(),h===void 0&&(h=this._values.length),this._values[h]=e,this._goRefCounts[h]=0,this._ids.set(e,h)),this._goRefCounts[h]++;let y=0;switch(typeof e){case"object":e!==null&&(y=1);break;case"string":y=2;break;case"symbol":y=3;break;case"function":y=4;break}this.mem.setUint32(t+4,2146959360|y,!0),this.mem.setUint32(t,h,!0)},c=t=>{const e=s(t+0),l=s(t+8);return new Uint8Array(this._inst.exports.mem.buffer,e,l)},u=t=>{const e=s(t+0),l=s(t+8),h=new Array(l);for(let y=0;y<l;y++)h[y]=n(e+y*8);return h},m=t=>{const e=s(t+0),l=s(t+8);return d.decode(new DataView(this._inst.exports.mem.buffer,e,l))},g=(t,e)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(t,e)),w=Date.now()-performance.now();this.importObject={_gotest:{add:(t,e)=>t+e,callExport:g},gojs:{"runtime.wasmExit":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(e)},"runtime.wasmWrite":t=>{t>>>=0;const e=s(t+8),l=s(t+16),h=this.mem.getInt32(t+24,!0);globalThis.fs.writeSync(e,new Uint8Array(this._inst.exports.mem.buffer,l,h))},"runtime.resetMemoryDataView":t=>{t>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":t=>{t>>>=0,a(t+8,(w+performance.now())*1e6)},"runtime.walltime":t=>{t>>>=0;const e=new Date().getTime();a(t+8,e/1e3),this.mem.setInt32(t+16,e%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":t=>{t>>>=0;const e=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(e,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(e);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(t+8))),this.mem.setInt32(t+16,e,!0)},"runtime.clearTimeoutEvent":t=>{t>>>=0;const e=this.mem.getInt32(t+8,!0);clearTimeout(this._scheduledTimeouts.get(e)),this._scheduledTimeouts.delete(e)},"runtime.getRandomData":t=>{t>>>=0,crypto.getRandomValues(c(t+8))},"syscall/js.finalizeRef":t=>{t>>>=0;const e=this.mem.getUint32(t+8,!0);if(this._goRefCounts[e]--,this._goRefCounts[e]===0){const l=this._values[e];this._values[e]=null,this._ids.delete(l),this._idPool.push(e)}},"syscall/js.stringVal":t=>{t>>>=0,o(t+24,m(t+8))},"syscall/js.valueGet":t=>{t>>>=0;const e=Reflect.get(n(t+8),m(t+16));t=this._inst.exports.getsp()>>>0,o(t+32,e)},"syscall/js.valueSet":t=>{t>>>=0,Reflect.set(n(t+8),m(t+16),n(t+32))},"syscall/js.valueDelete":t=>{t>>>=0,Reflect.deleteProperty(n(t+8),m(t+16))},"syscall/js.valueIndex":t=>{t>>>=0,o(t+24,Reflect.get(n(t+8),s(t+16)))},"syscall/js.valueSetIndex":t=>{t>>>=0,Reflect.set(n(t+8),s(t+16),n(t+24))},"syscall/js.valueCall":t=>{t>>>=0;try{const e=n(t+8),l=Reflect.get(e,m(t+16)),h=u(t+32),y=Reflect.apply(l,e,h);t=this._inst.exports.getsp()>>>0,o(t+56,y),this.mem.setUint8(t+64,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+56,e),this.mem.setUint8(t+64,0)}},"syscall/js.valueInvoke":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.apply(e,void 0,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueNew":t=>{t>>>=0;try{const e=n(t+8),l=u(t+16),h=Reflect.construct(e,l);t=this._inst.exports.getsp()>>>0,o(t+40,h),this.mem.setUint8(t+48,1)}catch(e){t=this._inst.exports.getsp()>>>0,o(t+40,e),this.mem.setUint8(t+48,0)}},"syscall/js.valueLength":t=>{t>>>=0,a(t+16,parseInt(n(t+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const e=f.encode(String(n(t+8)));o(t+16,e),a(t+24,e.length)},"syscall/js.valueLoadString":t=>{t>>>=0;const e=n(t+8);c(t+16).set(e)},"syscall/js.valueInstanceOf":t=>{t>>>=0,this.mem.setUint8(t+24,n(t+8)instanceof n(t+16)?1:0)},"syscall/js.copyBytesToGo":t=>{t>>>=0;const e=c(t+8),l=n(t+32);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},"syscall/js.copyBytesToJS":t=>{t>>>=0;const e=n(t+8),l=c(t+16);if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)){this.mem.setUint8(t+48,0);return}const h=l.subarray(0,e.length);e.set(h),a(t+40,h.length),this.mem.setUint8(t+48,1)},debug:t=>{console.log(t)}}}}run(a){return _(this,null,function*(){if(!(a instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=a,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 i=4096;const s=g=>{const w=i,t=f.encode(g+"\0");return new Uint8Array(this.mem.buffer,i,t.length).set(t),i+=t.length,i%8!==0&&(i+=8-i%8),w},n=this.argv.length,o=[];this.argv.forEach(g=>{o.push(s(g))}),o.push(0),Object.keys(this.env).sort().forEach(g=>{o.push(s(`${g}=${this.env[g]}`))}),o.push(0);const u=i;if(o.forEach(g=>{this.mem.setUint32(i,g,!0),this.mem.setUint32(i+4,0,!0),i+=8}),i>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(n,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(a){const i=this;return function(){const s={id:a,this:this,args:arguments};return i._pendingEvent=s,i._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,d=globalThis.fs,a="";d.writeSync=(c,u)=>{if(c===1)postMessage(u);else if(c===2){a+=f.decode(u);let m=a.split(`
`);m.length>1&&console.log(m.slice(0,-1).join(`
`)),a=m[m.length-1]}else throw new Error("Bad write");return u.length};let i=[],s,n=0;onmessage=({data:c})=>(c.length>0&&(i.push(c),s&&s()),o),d.read=(c,u,m,g,w,t)=>{if(c!==0||m!==0||g!==u.length||w!==null)throw new Error("Bad read");if(i.length===0){s=()=>d.read(c,u,m,g,w,t);return}let e=i[0],l=Math.max(0,Math.min(g,e.length-n));u.set(e.subarray(n,n+l),m),n+=l,n===e.length&&(i.shift(),n=0),t(null,l)};let o=new globalThis.Go;return o.argv=["","--service=0.27.2"],tryToInstantiateModule(r,o).then(c=>{postMessage(null),o.run(c)},c=>{postMessage(c)}),o};function tryToInstantiateModule(r,f){return _(this,null,function*(){if(r instanceof WebAssembly.Module)return WebAssembly.instantiate(r,f.importObject);const d=yield fetch(r);if(!d.ok)throw new Error(`Failed to download ${JSON.stringify(r)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(d.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(d,f.importObject)).instance;const a=yield d.arrayBuffer();return(yield WebAssembly.instantiate(a,f.importObject)).instance})}return r=>onmessage(r);})(T=>i.onmessage({data:T})),U;i={onmessage:null,postMessage:T=>setTimeout(()=>{try{U=w({data:T})}catch(j){a(j)}}),terminate(){if(U)for(let T of U._scheduledTimeouts.values())clearTimeout(T)}}}let g,s,d=new Promise((w,U)=>{g=w,s=U});i.onmessage=({data:w})=>{i.onmessage=({data:U})=>P(U),w?s(w):g()},i.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:P,service:A}=Ke({writeToStdin(w){i.postMessage(w)},isSync:!1,hasFS:!1,esbuild:ke});yield d,Ee=()=>{i.terminate(),ce=void 0,Ee=void 0,Se=void 0},Se={build:w=>new Promise((U,T)=>{l.then(T),A.buildOrContext({callName:"build",refs:null,options:w,isTTY:!1,defaultWD:"/",callback:(j,L)=>j?T(j):U(L)})}),context:w=>new Promise((U,T)=>{l.then(T),A.buildOrContext({callName:"context",refs:null,options:w,isTTY:!1,defaultWD:"/",callback:(j,L)=>j?T(j):U(L)})}),transform:(w,U)=>new Promise((T,j)=>{l.then(j),A.transform({callName:"transform",refs:null,input:w,options:U||{},isTTY:!1,fs:{readFile(L,E){E(new Error("Internal error"),null)},writeFile(L,E){E(null)}},callback:(L,E)=>L?j(L):T(E)})}),formatMessages:(w,U)=>new Promise((T,j)=>{l.then(j),A.formatMessages({callName:"formatMessages",refs:null,messages:w,options:U,callback:(L,E)=>L?j(L):T(E)})}),analyzeMetafile:(w,U)=>new Promise((T,j)=>{l.then(j),A.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof w=="string"?w:JSON.stringify(w),options:U,callback:(L,E)=>L?j(L):T(E)})})}}),$t=ke;
})(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});