isomorfeus-asset-manager 0.14.23 → 0.14.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ab80d28496c725e2249d30e487c547a5bafc86e395260c64b18206138b1baae
4
- data.tar.gz: 8491dff2119a4c51203aaa694370ac359b5d9a4ec4eed8501132749a95a0f4c2
3
+ metadata.gz: f586e23dc01984bc63ef61bf778358cd86c29aca7e267dba653980ff375d060d
4
+ data.tar.gz: 1f94c309bc6afa788e21f49d98112bc0b112c8d8f98f15d1a9d4f09c9ed898c0
5
5
  SHA512:
6
- metadata.gz: 1d545a7d8d51d2102cb766b143b1599eb3d9a063086ce9e312baa89e490f73b919a9438447b974783ad5dea5e1054723a1a88297c83832602a478674ed6b9ba6
7
- data.tar.gz: 9eb408047f5dce8efb398bef3da0d55802c10028a5dbd1a05e333718054a1be64a192c226db8a06aed8b9c9697fe0e6714ae9b95000153fba45718c9569df775
6
+ metadata.gz: 7e71f723e77390090e380c4bbab129383e370e85062eac29522fd70847ea04365bf98171d61a0b4ea1cb2e58687eddcc70cbff40e81abbd0a524918770fa05b4
7
+ data.tar.gz: b08b9e83032b7cd606161adf451e4a914817b982382913ec43033baeb1e0f5968a8e8078f1dce5cb928c734e4d33a35148d21119e5de4a661f0e97d29926d219
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.14.23'
3
+ VERSION = '0.14.24'
4
4
  end
5
5
  end
@@ -4,9 +4,9 @@
4
4
  "requires": true,
5
5
  "packages": {
6
6
  "node_modules/esbuild-wasm": {
7
- "version": "0.14.39",
8
- "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.39.tgz",
9
- "integrity": "sha512-ERthbXykeACyL8gmE1FE2njn/kyBrnj4tuoImtcpry8uNb/McUNtv08TdWA0pGHYxfD76XoaIwKEOMSv25IkFQ==",
7
+ "version": "0.14.42",
8
+ "resolved": "https://registry.npmjs.org/esbuild-wasm/-/esbuild-wasm-0.14.42.tgz",
9
+ "integrity": "sha512-gaR16gg58YxDyIXjS/8zVKxnC0IqbPAqMCVv4Yu6PmrJFoFzhverHINiM24MXuhnngHYCTIn4p3t3JjkfkMPdg==",
10
10
  "bin": {
11
11
  "esbuild": "bin/esbuild"
12
12
  },
Binary file
@@ -67,6 +67,8 @@ interface CommonOptions {
67
67
  logLevel?: LogLevel;
68
68
  /** Documentation: https://esbuild.github.io/api/#log-limit */
69
69
  logLimit?: number;
70
+ /** Documentation: https://esbuild.github.io/api/#log-override */
71
+ logOverride?: Record<string, LogLevel>;
70
72
  }
71
73
 
72
74
  export interface BuildOptions extends CommonOptions {
@@ -303,6 +303,7 @@ function pushCommonFlags(flags, options, keys) {
303
303
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
304
304
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
305
305
  let define = getFlag(options, keys, "define", mustBeObject);
306
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
306
307
  let pure = getFlag(options, keys, "pure", mustBeArray);
307
308
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
308
309
  if (legalComments)
@@ -357,6 +358,13 @@ function pushCommonFlags(flags, options, keys) {
357
358
  flags.push(`--define:${key}=${define[key]}`);
358
359
  }
359
360
  }
361
+ if (logOverride) {
362
+ for (let key in logOverride) {
363
+ if (key.indexOf("=") >= 0)
364
+ throw new Error(`Invalid log override: ${key}`);
365
+ flags.push(`--log-override:${key}=${logOverride[key]}`);
366
+ }
367
+ }
360
368
  if (pure)
361
369
  for (let fn of pure)
362
370
  flags.push(`--pure:${fn}`);
@@ -731,8 +739,8 @@ function createChannel(streamIn) {
731
739
  if (isFirstPacket) {
732
740
  isFirstPacket = false;
733
741
  let binaryVersion = String.fromCharCode(...bytes);
734
- if (binaryVersion !== "0.14.39") {
735
- throw new Error(`Cannot start service: Host version "${"0.14.39"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
742
+ if (binaryVersion !== "0.14.42") {
743
+ throw new Error(`Cannot start service: Host version "${"0.14.42"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
736
744
  }
737
745
  return;
738
746
  }
@@ -1677,7 +1685,7 @@ function convertOutputFiles({ path, contents }) {
1677
1685
  }
1678
1686
 
1679
1687
  // lib/npm/browser.ts
1680
- var version = "0.14.39";
1688
+ var version = "0.14.42";
1681
1689
  var build = (options) => ensureServiceIsRunning().build(options);
1682
1690
  var serve = () => {
1683
1691
  throw new Error(`The "serve" API only works in node`);
@@ -1733,7 +1741,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
1733
1741
  }
1734
1742
  let worker;
1735
1743
  if (useWorker) {
1736
- let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.39"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1744
+ let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n async run(instance) {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n await this._exitPromise;\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.42"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1737
1745
  worker = new Worker(URL.createObjectURL(blob));
1738
1746
  } else {
1739
1747
  let onmessage = ((postMessage) => {
@@ -2312,7 +2320,7 @@ var startRunningService = async (wasmURL, wasmModule, useWorker) => {
2312
2320
  callback(null, count);
2313
2321
  };
2314
2322
  let go = new globalThis.Go();
2315
- go.argv = ["", `--service=${"0.14.39"}`];
2323
+ go.argv = ["", `--service=${"0.14.42"}`];
2316
2324
  if (wasm instanceof WebAssembly.Module) {
2317
2325
  WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));
2318
2326
  } else {
@@ -1,15 +1,15 @@
1
- var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&qe(e,r,t[r]);if(We)for(var r of We(t))it.call(t,r)&&qe(e,r,t[r]);return e},De=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ae={};st(Ae,{analyzeMetafile:()=>St,analyzeMetafileSync:()=>Mt,build:()=>wt,buildSync:()=>xt,default:()=>Pt,formatMessages:()=>Ot,formatMessagesSync:()=>kt,initialize:()=>$t,serve:()=>vt,transform:()=>Rt,transformSync:()=>Et,version:()=>bt});function Fe(e){let t=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(fe(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 p of s)t(p)}else{let p=Object.keys(s);r.write8(6),r.write32(p.length);for(let i of p)r.write(fe(i)),t(s[i])}},r=new xe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return ye(r.read());case 4:return r.read();case 5:{let f=r.read32(),l=[];for(let h=0;h<f;h++)l.push(t());return l}case 6:{let f=r.read32(),l={};for(let h=0;h<f;h++)l[ye(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new xe(e),s=r.read32(),p=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:p,value:i}}var xe=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);Ne(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ne(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 je(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},fe,ye;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;fe=r=>e.encode(r),ye=r=>t.decode(r)}else if(typeof Buffer!="undefined")fe=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},ye=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function je(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Me=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",$e=e=>e instanceof RegExp?null:"a RegExp object",Re=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Le=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",de=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",ft=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ye=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ct=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",dt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",pt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let p=e[r];if(t[r+""]=!0,p===void 0)return;let i=s(p);if(i!==null)throw new Error(`"${r}" must be ${i}`);return p}function Y(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),s=n(e,t,"wasmModule",ut),p=n(e,t,"worker",I);return Y(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:p}}function He(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ce(e,t,r,s,p){let i=n(t,r,"color",I),f=n(t,r,"logLevel",m),l=n(t,r,"logLimit",Re);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${f||p}`),e.push(`--log-limit=${l||0}`)}function Ge(e,t,r){let s=n(t,r,"legalComments",m),p=n(t,r,"sourceRoot",m),i=n(t,r,"sourcesContent",I),f=n(t,r,"target",dt),l=n(t,r,"format",m),h=n(t,r,"globalName",m),O=n(t,r,"mangleProps",$e),N=n(t,r,"reserveProps",$e),k=n(t,r,"mangleQuoted",I),C=n(t,r,"minify",I),q=n(t,r,"minifySyntax",I),oe=n(t,r,"minifyWhitespace",I),re=n(t,r,"minifyIdentifiers",I),ne=n(t,r,"drop",V),le=n(t,r,"charset",m),ie=n(t,r,"treeShaking",I),pe=n(t,r,"ignoreAnnotations",I),ae=n(t,r,"jsx",m),ge=n(t,r,"jsxFactory",m),ue=n(t,r,"jsxFragment",m),me=n(t,r,"define",de),be=n(t,r,"pure",V),Se=n(t,r,"keepNames",I);if(s&&e.push(`--legal-comments=${s}`),p!==void 0&&e.push(`--source-root=${p}`),i!==void 0&&e.push(`--sources-content=${i}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ke).join(",")}`):e.push(`--target=${Ke(f)}`)),l&&e.push(`--format=${l}`),h&&e.push(`--global-name=${h}`),C&&e.push("--minify"),q&&e.push("--minify-syntax"),oe&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),pe&&e.push("--ignore-annotations"),ne)for(let c of ne)e.push(`--drop:${c}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),k!==void 0&&e.push(`--mangle-quoted=${k}`),ae&&e.push(`--jsx=${ae}`),ge&&e.push(`--jsx-factory=${ge}`),ue&&e.push(`--jsx-fragment=${ue}`),me)for(let c in me){if(c.indexOf("=")>=0)throw new Error(`Invalid define: ${c}`);e.push(`--define:${c}=${me[c]}`)}if(be)for(let c of be)e.push(`--pure:${c}`);Se&&e.push("--keep-names")}function gt(e,t,r,s,p){var b;let i=[],f=[],l=Object.create(null),h=null,O=null,N=null;Ce(i,t,l,r,s),Ge(i,t,l);let k=n(t,l,"sourcemap",Ye),C=n(t,l,"bundle",I),q=n(t,l,"watch",at),oe=n(t,l,"splitting",I),re=n(t,l,"preserveSymlinks",I),ne=n(t,l,"metafile",I),le=n(t,l,"outfile",m),ie=n(t,l,"outdir",m),pe=n(t,l,"outbase",m),ae=n(t,l,"platform",m),ge=n(t,l,"tsconfig",m),ue=n(t,l,"resolveExtensions",V),me=n(t,l,"nodePaths",V),be=n(t,l,"mainFields",V),Se=n(t,l,"conditions",V),c=n(t,l,"external",V),u=n(t,l,"loader",de),o=n(t,l,"outExtension",de),d=n(t,l,"publicPath",m),F=n(t,l,"entryNames",m),B=n(t,l,"chunkNames",m),M=n(t,l,"assetNames",m),x=n(t,l,"inject",V),P=n(t,l,"banner",de),$=n(t,l,"footer",de),R=n(t,l,"entryPoints",ft),L=n(t,l,"absWorkingDir",m),S=n(t,l,"stdin",de),T=(b=n(t,l,"write",I))!=null?b:p,W=n(t,l,"allowOverwrite",I),ee=n(t,l,"incremental",I)===!0,E=n(t,l,"mangleCache",de);if(l.plugins=!0,Y(t,l,`in ${e}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),C&&i.push("--bundle"),W&&i.push("--allow-overwrite"),q)if(i.push("--watch"),typeof q=="boolean")N={};else{let a=Object.create(null),v=n(q,a,"onRebuild",Le);Y(q,a,`on "watch" in ${e}() call`),N={onRebuild:v}}if(oe&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),pe&&i.push(`--outbase=${pe}`),ae&&i.push(`--platform=${ae}`),ge&&i.push(`--tsconfig=${ge}`),ue){let a=[];for(let v of ue){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);a.push(v)}i.push(`--resolve-extensions=${a.join(",")}`)}if(d&&i.push(`--public-path=${d}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),M&&i.push(`--asset-names=${M}`),be){let a=[];for(let v of be){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);a.push(v)}i.push(`--main-fields=${a.join(",")}`)}if(Se){let a=[];for(let v of Se){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);a.push(v)}i.push(`--conditions=${a.join(",")}`)}if(c)for(let a of c)i.push(`--external:${a}`);if(P)for(let a in P){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);i.push(`--banner:${a}=${P[a]}`)}if($)for(let a in $){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);i.push(`--footer:${a}=${$[a]}`)}if(x)for(let a of x)i.push(`--inject:${a}`);if(u)for(let a in u){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);i.push(`--loader:${a}=${u[a]}`)}if(o)for(let a in o){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);i.push(`--out-extension:${a}=${o[a]}`)}if(R)if(Array.isArray(R))for(let a of R)f.push(["",a+""]);else for(let[a,v]of Object.entries(R))f.push([a+"",v+""]);if(S){let a=Object.create(null),v=n(S,a,"contents",m),U=n(S,a,"resolveDir",m),w=n(S,a,"sourcefile",m),g=n(S,a,"loader",m);Y(S,a,'in "stdin" object'),w&&i.push(`--sourcefile=${w}`),g&&i.push(`--loader=${g}`),U&&(O=U+""),h=v?v+"":""}let y=[];if(me)for(let a of me)a+="",y.push(a);return{entries:f,flags:i,write:T,stdinContents:h,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:y,watch:N,mangleCache:He(E)}}function mt(e,t,r,s){let p=[],i=Object.create(null);Ce(p,t,i,r,s),Ge(p,t,i);let f=n(t,i,"sourcemap",Ye),l=n(t,i,"tsconfigRaw",ct),h=n(t,i,"sourcefile",m),O=n(t,i,"loader",m),N=n(t,i,"banner",m),k=n(t,i,"footer",m),C=n(t,i,"mangleCache",de);return Y(t,i,`in ${e}() call`),f&&p.push(`--sourcemap=${f===!0?"external":f}`),l&&p.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),h&&p.push(`--sourcefile=${h}`),O&&p.push(`--loader=${O}`),N&&p.push(`--banner=${N}`),k&&p.push(`--footer=${k}`),{flags:p,mangleCache:He(C)}}function Xe(e){let t=new Map,r=new Map,s=new Map,p=new Map,i=null,f=0,l=0,h=new Uint8Array(16*1024),O=0,N=c=>{let u=O+c.length;if(u>h.length){let d=new Uint8Array(u*2);d.set(h),h=d}h.set(c,O),O+=c.length;let o=0;for(;o+4<=O;){let d=je(h,o);if(o+4+d>O)break;o+=4,ne(h.subarray(o,o+d)),o+=d}o>0&&(h.copyWithin(0,o,O),O-=o)},k=c=>{i={reason:c?": "+(c.message||c):""};let u="The service was stopped"+i.reason;for(let o of t.values())o(u,null);t.clear();for(let o of p.values())o.onWait(u);p.clear();for(let o of s.values())try{o(new Error(u),null)}catch(d){console.error(d)}s.clear()},C=(c,u,o)=>{if(i)return o("The service is no longer running"+i.reason,null);let d=f++;t.set(d,(F,B)=>{try{o(F,B)}finally{c&&c.unref()}}),c&&c.ref(),e.writeToStdin(Fe({id:d,isRequest:!0,value:u}))},q=(c,u)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Fe({id:c,isRequest:!1,value:u}))},oe=async(c,u)=>{try{switch(u.command){case"ping":{q(c,{});break}case"on-start":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"on-resolve":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"on-load":{let o=r.get(u.key);o?q(c,await o(u)):q(c,{});break}case"serve-request":{let o=p.get(u.key);o&&o.onRequest&&o.onRequest(u.args),q(c,{});break}case"serve-wait":{let o=p.get(u.key);o&&o.onWait(u.error),q(c,{});break}case"watch-rebuild":{let o=s.get(u.key);try{o&&o(null,u.args)}catch(d){console.error(d)}q(c,{});break}default:throw new Error("Invalid command: "+u.command)}}catch(o){q(c,{errors:[we(o,e,null,void 0,"")]})}},re=!0,ne=c=>{if(re){re=!1;let o=String.fromCharCode(...c);if(o!=="0.14.39")throw new Error(`Cannot start service: Host version "0.14.39" does not match binary version ${JSON.stringify(o)}`);return}let u=ze(c);if(u.isRequest)oe(u.id,u.value);else{let o=t.get(u.id);t.delete(u.id),u.value.error?o(u.value.error,{}):o(null,u.value)}},le=async(c,u,o,d,F)=>{let B=[],M=[],x={},P={},$=0,R=0,L=[],S=!1;u=[...u];for(let E of u){let y={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n(E,y,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let a=n(E,y,"setup",Le);if(typeof a!="function")throw new Error("Plugin is missing a setup function");Y(E,y,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=a({initialOptions:c,resolve:(g,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof g!="string")throw new Error("The path to resolve must be a string");let A=Object.create(null),Q=n(D,A,"pluginName",m),z=n(D,A,"importer",m),_=n(D,A,"namespace",m),X=n(D,A,"resolveDir",m),H=n(D,A,"kind",m),j=n(D,A,"pluginData",Me);return Y(D,A,"in resolve() call"),new Promise((J,G)=>{let K={command:"resolve",path:g,key:o,pluginName:b};Q!=null&&(K.pluginName=Q),z!=null&&(K.importer=z),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),H!=null&&(K.kind=H),j!=null&&(K.pluginData=d.store(j)),C(F,K,(se,Z)=>{se!==null?G(new Error(se)):J({errors:ce(Z.errors,d),warnings:ce(Z.warnings,d),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:d.load(Z.pluginData)})})})},onStart(g){let D='This error came from the "onStart" callback registered here:',A=Ee(new Error(D),e,"onStart");B.push({name:b,callback:g,note:A})},onEnd(g){let D='This error came from the "onEnd" callback registered here:',A=Ee(new Error(D),e,"onEnd");M.push({name:b,callback:g,note:A})},onResolve(g,D){let A='This error came from the "onResolve" callback registered here:',Q=Ee(new Error(A),e,"onResolve"),z={},_=n(g,z,"filter",$e),X=n(g,z,"namespace",m);if(Y(g,z,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let H=$++;x[H]={name:b,callback:D,note:Q},v.onResolve.push({id:H,filter:_.source,namespace:X||""})},onLoad(g,D){let A='This error came from the "onLoad" callback registered here:',Q=Ee(new Error(A),e,"onLoad"),z={},_=n(g,z,"filter",$e),X=n(g,z,"namespace",m);if(Y(g,z,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let H=$++;P[H]={name:b,callback:D,note:Q},v.onLoad.push({id:H,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,L.push(v)}catch(a){return{ok:!1,error:a,pluginName:b}}}let T=async E=>{switch(E.command){case"on-start":{let y={errors:[],warnings:[]};return await Promise.all(B.map(async({name:b,callback:a,note:v})=>{try{let U=await a();if(U!=null){if(typeof U!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},g=n(U,w,"errors",V),D=n(U,w,"warnings",V);Y(U,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),g!=null&&y.errors.push(...he(g,"errors",d,b)),D!=null&&y.warnings.push(...he(D,"warnings",d,b))}}catch(U){y.errors.push(we(U,e,d,v&&v(),b))}})),y}case"on-resolve":{let y={},b="",a,v;for(let U of E.ids)try{({name:b,callback:a,note:v}=x[U]);let w=await a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:d.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let g={},D=n(w,g,"pluginName",m),A=n(w,g,"path",m),Q=n(w,g,"namespace",m),z=n(w,g,"suffix",m),_=n(w,g,"external",I),X=n(w,g,"sideEffects",I),H=n(w,g,"pluginData",Me),j=n(w,g,"errors",V),J=n(w,g,"warnings",V),G=n(w,g,"watchFiles",V),K=n(w,g,"watchDirs",V);Y(w,g,`from onResolve() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A!=null&&(y.path=A),Q!=null&&(y.namespace=Q),z!=null&&(y.suffix=z),_!=null&&(y.external=_),X!=null&&(y.sideEffects=X),H!=null&&(y.pluginData=d.store(H)),j!=null&&(y.errors=he(j,"errors",d,b)),J!=null&&(y.warnings=he(J,"warnings",d,b)),G!=null&&(y.watchFiles=ke(G,"watchFiles")),K!=null&&(y.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:U,errors:[we(w,e,d,v&&v(),b)]}}return y}case"on-load":{let y={},b="",a,v;for(let U of E.ids)try{({name:b,callback:a,note:v}=P[U]);let w=await a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:d.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let g={},D=n(w,g,"pluginName",m),A=n(w,g,"contents",pt),Q=n(w,g,"resolveDir",m),z=n(w,g,"pluginData",Me),_=n(w,g,"loader",m),X=n(w,g,"errors",V),H=n(w,g,"warnings",V),j=n(w,g,"watchFiles",V),J=n(w,g,"watchDirs",V);Y(w,g,`from onLoad() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A instanceof Uint8Array?y.contents=A:A!=null&&(y.contents=fe(A)),Q!=null&&(y.resolveDir=Q),z!=null&&(y.pluginData=d.store(z)),_!=null&&(y.loader=_),X!=null&&(y.errors=he(X,"errors",d,b)),H!=null&&(y.warnings=he(H,"warnings",d,b)),j!=null&&(y.watchFiles=ke(j,"watchFiles")),J!=null&&(y.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:U,errors:[we(w,e,d,v&&v(),b)]}}return y}default:throw new Error("Invalid command: "+E.command)}},W=(E,y,b)=>b();M.length>0&&(W=(E,y,b)=>{(async()=>{for(let{name:a,callback:v,note:U}of M)try{await v(E)}catch(w){E.errors.push(await new Promise(g=>y(w,a,U&&U(),g)))}})().then(b)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(o,T)},unref(){--ee===0&&r.delete(o)}}}},ie=(c,u,o,d)=>{let F={},B=n(u,F,"port",Re),M=n(u,F,"host",m),x=n(u,F,"servedir",m),P=n(u,F,"onRequest",Le),$,R=new Promise((L,S)=>{$=T=>{p.delete(d),T!==null?S(new Error(T)):L()}});return o.serve={},Y(u,F,"in serve() call"),B!==void 0&&(o.serve.port=B),M!==void 0&&(o.serve.host=M),x!==void 0&&(o.serve.servedir=x),p.set(d,{onRequest:P,onWait:$}),{wait:R,stop(){C(c,{command:"serve-stop",key:d},()=>{})}}},pe="warning",ae="silent",ge=c=>{let u=l++,o=Ve(),d,{refs:F,options:B,isTTY:M,callback:x}=c;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');d=R}}let P=(R,L,S,T)=>{let W=[];try{Ce(W,B,{},M,pe)}catch(E){}let ee=we(R,e,o,S,L);C(F,{command:"error",flags:W,error:ee},()=>{ee.detail=o.load(ee.detail),T(ee)})},$=(R,L)=>{P(R,L,void 0,S=>{x(ve("Build failed",[S],[]),null)})};if(d&&d.length>0){if(e.isSync)return $(new Error("Cannot use plugins in synchronous API calls"),"");le(B,d,u,o,F).then(R=>{if(!R.ok)$(R.error,R.pluginName);else try{ue(De(Te({},c),{key:u,details:o,logPluginError:P,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){$(L,"")}},R=>$(R,""))}else try{ue(De(Te({},c),{key:u,details:o,logPluginError:P,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){$(R,"")}},ue=({callName:c,refs:u,serveOptions:o,options:d,isTTY:F,defaultWD:B,callback:M,key:x,details:P,logPluginError:$,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),u&&u.ref()},unref(){S&&S.unref(),u&&u.unref()}},W=!e.isBrowser,{entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v,incremental:U,nodePaths:w,watch:g,mangleCache:D}=gt(c,d,F,pe,W),A={command:"build",key:x,entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:a,absWorkingDir:v||B,incremental:U,nodePaths:w};R&&(A.plugins=R),D&&(A.mangleCache=D);let Q=o&&ie(T,o,A,x),z,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(yt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(ye(j.writeToStdout).replace(/\n$/,""))},H=(j,J)=>{let G={errors:ce(j.errors,P),warnings:ce(j.warnings,P)};X(j,G),L(G,$,()=>{if(G.errors.length>0)return J(ve("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!z){let K=!1;z=()=>new Promise((se,Z)=>{if(K||i)throw new Error("Cannot rebuild");C(T,{command:"rebuild",key:x},(te,et)=>{if(te)return J(ve("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(et,(Be,tt)=>{Be?Z(Be):se(tt)})})}),T.ref(),z.dispose=()=>{K||(K=!0,C(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=z}if(j.watch){if(!_){let K=!1;T.ref(),_=()=>{K||(K=!0,s.delete(x),C(T,{command:"watch-stop",key:x},()=>{}),T.unref())},g&&s.set(x,(se,Z)=>{if(se){g.onRebuild&&g.onRebuild(se,null);return}let te={errors:ce(Z.errors,P),warnings:ce(Z.warnings,P)};X(Z,te),L(te,$,()=>{if(te.errors.length>0){g.onRebuild&&g.onRebuild(ve("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=z),te.stop=_,g.onRebuild&&g.onRebuild(null,te)})})}G.stop=_}J(null,G)})};if(y&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(U&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(g&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');C(T,A,(j,J)=>{if(j)return M(new Error(j),null);if(Q){let G=J,K=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){K||(K=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),M(null,se)}return H(J,M)})};return{readFromStdout:N,afterClose:k,service:{buildOrServe:ge,transform:({callName:c,refs:u,input:o,options:d,isTTY:F,fs:B,callback:M})=>{let x=Ve(),P=$=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=mt(c,d,F,ae),S={command:"transform",flags:R,inputFS:$!==null,input:$!==null?$:o};L&&(S.mangleCache=L),C(u,S,(T,W)=>{if(T)return M(new Error(T),null);let ee=ce(W.errors,x),E=ce(W.warnings,x),y=1,b=()=>{if(--y===0){let a={warnings:E,code:W.code,map:W.map};W.mangleCache&&(a.mangleCache=W==null?void 0:W.mangleCache),M(null,a)}};if(ee.length>0)return M(ve("Transform failed",ee,E),null);W.codeFS&&(y++,B.readFile(W.code,(a,v)=>{a!==null?M(a,null):(W.code=v,b())})),W.mapFS&&(y++,B.readFile(W.map,(a,v)=>{a!==null?M(a,null):(W.map=v,b())})),b()})}catch(R){let L=[];try{Ce(L,d,{},F,ae)}catch(T){}let S=we(R,e,x,void 0,"");C(u,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),M(ve("Transform failed",[S],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let $=P;P=()=>B.writeFile(o,$)}P(null)},formatMessages:({callName:c,refs:u,messages:o,options:d,callback:F})=>{let B=he(o,"messages",null,"");if(!d)throw new Error(`Missing second argument in ${c}() call`);let M={},x=n(d,M,"kind",m),P=n(d,M,"color",I),$=n(d,M,"terminalWidth",Re);if(Y(d,M,`in ${c}() call`),x===void 0)throw new Error(`Missing "kind" in ${c}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${c}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};P!==void 0&&(R.color=P),$!==void 0&&(R.terminalWidth=$),C(u,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:c,refs:u,metafile:o,options:d,callback:F})=>{d===void 0&&(d={});let B={},M=n(d,B,"color",I),x=n(d,B,"verbose",I);Y(d,B,`in ${c}() call`);let P={command:"analyze-metafile",metafile:o};M!==void 0&&(P.color=M),x!==void 0&&(P.verbose=x),C(u,P,($,R)=>{if($)return F(new Error($),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Ee(e,t,r){let s,p=!1;return()=>{if(p)return s;p=!0;try{let i=(e.stack+"").split(`
2
- `);i.splice(1,1);let f=Ze(t,i,r);if(f)return s={text:e.message,location:f},s}catch(i){}}}function we(e,t,r,s,p){let i="Internal error",f=null;try{i=(e&&e.message||e)+""}catch(l){}try{f=Ze(t,(e.stack+"").split(`
3
- `),"")}catch(l){}return{pluginName:p,text:i,location:f,notes:s?[s]:[],detail:r?r.store(e):-1}}function Ze(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let p=1;p<t.length;p++){let i=t[p];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(f){i=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),f){i=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(i),f){let l;try{l=e.readFileSync(f[1],"utf8")}catch(k){break}let h=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",O=+f[3]-1,N=h.slice(O,O+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:fe(h.slice(0,O)).length,length:fe(h.slice(O,O+N)).length,lineText:h+`
1
+ var Ie=Object.defineProperty,rt=Object.defineProperties;var nt=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))lt.call(t,r)&&qe(e,r,t[r]);if(We)for(var r of We(t))it.call(t,r)&&qe(e,r,t[r]);return e},De=(e,t)=>rt(e,nt(t));var st=(e,t)=>{for(var r in t)Ie(e,r,{get:t[r],enumerable:!0})};var Ae={};st(Ae,{analyzeMetafile:()=>St,analyzeMetafileSync:()=>$t,build:()=>wt,buildSync:()=>xt,default:()=>Pt,formatMessages:()=>Ot,formatMessagesSync:()=>kt,initialize:()=>Mt,serve:()=>vt,transform:()=>Rt,transformSync:()=>Et,version:()=>bt});function Fe(e){let t=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(ce(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 d of s)t(d)}else{let d=Object.keys(s);r.write8(6),r.write32(d.length);for(let i of d)r.write(ce(i)),t(s[i])}},r=new xe;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function ze(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let f=r.read32(),l=[];for(let h=0;h<f;h++)l.push(t());return l}case 6:{let f=r.read32(),l={};for(let h=0;h<f;h++)l[he(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new xe(e),s=r.read32(),d=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:d,value:i}}var xe=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);Ne(this.buf,t,r)}write(t){let r=this._write(4+t.length);Ne(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 je(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ce,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ce=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")ce=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function je(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ke(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var $e=()=>null,I=e=>typeof e=="boolean"?null:"a boolean",at=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",m=e=>typeof e=="string"?null:"a string",Me=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Le=e=>typeof e=="function"?null:"a function",V=e=>Array.isArray(e)?null:"an array",oe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",ut=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",ft=e=>typeof e=="object"&&e!==null?null:"an array or an object",_e=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Ye=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",ct=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",dt=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",pt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let d=e[r];if(t[r+""]=!0,d===void 0)return;let i=s(d);if(i!==null)throw new Error(`"${r}" must be ${i}`);return d}function Y(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Qe(e){let t=Object.create(null),r=n(e,t,"wasmURL",m),s=n(e,t,"wasmModule",ut),d=n(e,t,"worker",I);return Y(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:d}}function He(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ce(e,t,r,s,d){let i=n(t,r,"color",I),f=n(t,r,"logLevel",m),l=n(t,r,"logLimit",Oe);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${f||d}`),e.push(`--log-limit=${l||0}`)}function Ge(e,t,r){let s=n(t,r,"legalComments",m),d=n(t,r,"sourceRoot",m),i=n(t,r,"sourcesContent",I),f=n(t,r,"target",dt),l=n(t,r,"format",m),h=n(t,r,"globalName",m),O=n(t,r,"mangleProps",Me),N=n(t,r,"reserveProps",Me),k=n(t,r,"mangleQuoted",I),C=n(t,r,"minify",I),q=n(t,r,"minifySyntax",I),ae=n(t,r,"minifyWhitespace",I),re=n(t,r,"minifyIdentifiers",I),ne=n(t,r,"drop",V),le=n(t,r,"charset",m),ie=n(t,r,"treeShaking",I),pe=n(t,r,"ignoreAnnotations",I),ue=n(t,r,"jsx",m),ge=n(t,r,"jsxFactory",m),fe=n(t,r,"jsxFragment",m),me=n(t,r,"define",oe),ye=n(t,r,"logOverride",oe),we=n(t,r,"pure",V),g=n(t,r,"keepNames",I);if(s&&e.push(`--legal-comments=${s}`),d!==void 0&&e.push(`--source-root=${d}`),i!==void 0&&e.push(`--sources-content=${i}`),f&&(Array.isArray(f)?e.push(`--target=${Array.from(f).map(Ke).join(",")}`):e.push(`--target=${Ke(f)}`)),l&&e.push(`--format=${l}`),h&&e.push(`--global-name=${h}`),C&&e.push("--minify"),q&&e.push("--minify-syntax"),ae&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),pe&&e.push("--ignore-annotations"),ne)for(let o of ne)e.push(`--drop:${o}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),k!==void 0&&e.push(`--mangle-quoted=${k}`),ue&&e.push(`--jsx=${ue}`),ge&&e.push(`--jsx-factory=${ge}`),fe&&e.push(`--jsx-fragment=${fe}`),me)for(let o in me){if(o.indexOf("=")>=0)throw new Error(`Invalid define: ${o}`);e.push(`--define:${o}=${me[o]}`)}if(ye)for(let o in ye){if(o.indexOf("=")>=0)throw new Error(`Invalid log override: ${o}`);e.push(`--log-override:${o}=${ye[o]}`)}if(we)for(let o of we)e.push(`--pure:${o}`);g&&e.push("--keep-names")}function gt(e,t,r,s,d){var b;let i=[],f=[],l=Object.create(null),h=null,O=null,N=null;Ce(i,t,l,r,s),Ge(i,t,l);let k=n(t,l,"sourcemap",Ye),C=n(t,l,"bundle",I),q=n(t,l,"watch",at),ae=n(t,l,"splitting",I),re=n(t,l,"preserveSymlinks",I),ne=n(t,l,"metafile",I),le=n(t,l,"outfile",m),ie=n(t,l,"outdir",m),pe=n(t,l,"outbase",m),ue=n(t,l,"platform",m),ge=n(t,l,"tsconfig",m),fe=n(t,l,"resolveExtensions",V),me=n(t,l,"nodePaths",V),ye=n(t,l,"mainFields",V),we=n(t,l,"conditions",V),g=n(t,l,"external",V),o=n(t,l,"loader",oe),a=n(t,l,"outExtension",oe),c=n(t,l,"publicPath",m),F=n(t,l,"entryNames",m),B=n(t,l,"chunkNames",m),$=n(t,l,"assetNames",m),x=n(t,l,"inject",V),P=n(t,l,"banner",oe),M=n(t,l,"footer",oe),R=n(t,l,"entryPoints",ft),L=n(t,l,"absWorkingDir",m),S=n(t,l,"stdin",oe),T=(b=n(t,l,"write",I))!=null?b:d,W=n(t,l,"allowOverwrite",I),ee=n(t,l,"incremental",I)===!0,E=n(t,l,"mangleCache",oe);if(l.plugins=!0,Y(t,l,`in ${e}() call`),k&&i.push(`--sourcemap${k===!0?"":`=${k}`}`),C&&i.push("--bundle"),W&&i.push("--allow-overwrite"),q)if(i.push("--watch"),typeof q=="boolean")N={};else{let u=Object.create(null),v=n(q,u,"onRebuild",Le);Y(q,u,`on "watch" in ${e}() call`),N={onRebuild:v}}if(ae&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),pe&&i.push(`--outbase=${pe}`),ue&&i.push(`--platform=${ue}`),ge&&i.push(`--tsconfig=${ge}`),fe){let u=[];for(let v of fe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);u.push(v)}i.push(`--resolve-extensions=${u.join(",")}`)}if(c&&i.push(`--public-path=${c}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),$&&i.push(`--asset-names=${$}`),ye){let u=[];for(let v of ye){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);u.push(v)}i.push(`--main-fields=${u.join(",")}`)}if(we){let u=[];for(let v of we){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);u.push(v)}i.push(`--conditions=${u.join(",")}`)}if(g)for(let u of g)i.push(`--external:${u}`);if(P)for(let u in P){if(u.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${u}`);i.push(`--banner:${u}=${P[u]}`)}if(M)for(let u in M){if(u.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${u}`);i.push(`--footer:${u}=${M[u]}`)}if(x)for(let u of x)i.push(`--inject:${u}`);if(o)for(let u in o){if(u.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${u}`);i.push(`--loader:${u}=${o[u]}`)}if(a)for(let u in a){if(u.indexOf("=")>=0)throw new Error(`Invalid out extension: ${u}`);i.push(`--out-extension:${u}=${a[u]}`)}if(R)if(Array.isArray(R))for(let u of R)f.push(["",u+""]);else for(let[u,v]of Object.entries(R))f.push([u+"",v+""]);if(S){let u=Object.create(null),v=n(S,u,"contents",m),U=n(S,u,"resolveDir",m),w=n(S,u,"sourcefile",m),p=n(S,u,"loader",m);Y(S,u,'in "stdin" object'),w&&i.push(`--sourcefile=${w}`),p&&i.push(`--loader=${p}`),U&&(O=U+""),h=v?v+"":""}let y=[];if(me)for(let u of me)u+="",y.push(u);return{entries:f,flags:i,write:T,stdinContents:h,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:y,watch:N,mangleCache:He(E)}}function mt(e,t,r,s){let d=[],i=Object.create(null);Ce(d,t,i,r,s),Ge(d,t,i);let f=n(t,i,"sourcemap",Ye),l=n(t,i,"tsconfigRaw",ct),h=n(t,i,"sourcefile",m),O=n(t,i,"loader",m),N=n(t,i,"banner",m),k=n(t,i,"footer",m),C=n(t,i,"mangleCache",oe);return Y(t,i,`in ${e}() call`),f&&d.push(`--sourcemap=${f===!0?"external":f}`),l&&d.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),h&&d.push(`--sourcefile=${h}`),O&&d.push(`--loader=${O}`),N&&d.push(`--banner=${N}`),k&&d.push(`--footer=${k}`),{flags:d,mangleCache:He(C)}}function Xe(e){let t=new Map,r=new Map,s=new Map,d=new Map,i=null,f=0,l=0,h=new Uint8Array(16*1024),O=0,N=g=>{let o=O+g.length;if(o>h.length){let c=new Uint8Array(o*2);c.set(h),h=c}h.set(g,O),O+=g.length;let a=0;for(;a+4<=O;){let c=je(h,a);if(a+4+c>O)break;a+=4,ne(h.subarray(a,a+c)),a+=c}a>0&&(h.copyWithin(0,a,O),O-=a)},k=g=>{i={reason:g?": "+(g.message||g):""};let o="The service was stopped"+i.reason;for(let a of t.values())a(o,null);t.clear();for(let a of d.values())a.onWait(o);d.clear();for(let a of s.values())try{a(new Error(o),null)}catch(c){console.error(c)}s.clear()},C=(g,o,a)=>{if(i)return a("The service is no longer running"+i.reason,null);let c=f++;t.set(c,(F,B)=>{try{a(F,B)}finally{g&&g.unref()}}),g&&g.ref(),e.writeToStdin(Fe({id:c,isRequest:!0,value:o}))},q=(g,o)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Fe({id:g,isRequest:!1,value:o}))},ae=async(g,o)=>{try{switch(o.command){case"ping":{q(g,{});break}case"on-start":{let a=r.get(o.key);a?q(g,await a(o)):q(g,{});break}case"on-resolve":{let a=r.get(o.key);a?q(g,await a(o)):q(g,{});break}case"on-load":{let a=r.get(o.key);a?q(g,await a(o)):q(g,{});break}case"serve-request":{let a=d.get(o.key);a&&a.onRequest&&a.onRequest(o.args),q(g,{});break}case"serve-wait":{let a=d.get(o.key);a&&a.onWait(o.error),q(g,{});break}case"watch-rebuild":{let a=s.get(o.key);try{a&&a(null,o.args)}catch(c){console.error(c)}q(g,{});break}default:throw new Error("Invalid command: "+o.command)}}catch(a){q(g,{errors:[ve(a,e,null,void 0,"")]})}},re=!0,ne=g=>{if(re){re=!1;let a=String.fromCharCode(...g);if(a!=="0.14.42")throw new Error(`Cannot start service: Host version "0.14.42" does not match binary version ${JSON.stringify(a)}`);return}let o=ze(g);if(o.isRequest)ae(o.id,o.value);else{let a=t.get(o.id);t.delete(o.id),o.value.error?a(o.value.error,{}):a(null,o.value)}},le=async(g,o,a,c,F)=>{let B=[],$=[],x={},P={},M=0,R=0,L=[],S=!1;o=[...o];for(let E of o){let y={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let b=n(E,y,"name",m);if(typeof b!="string"||b==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let u=n(E,y,"setup",Le);if(typeof u!="function")throw new Error("Plugin is missing a setup function");Y(E,y,`on plugin ${JSON.stringify(b)}`);let v={name:b,onResolve:[],onLoad:[]};R++;let w=u({initialOptions:g,resolve:(p,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof p!="string")throw new Error("The path to resolve must be a string");let A=Object.create(null),Q=n(D,A,"pluginName",m),z=n(D,A,"importer",m),_=n(D,A,"namespace",m),X=n(D,A,"resolveDir",m),H=n(D,A,"kind",m),j=n(D,A,"pluginData",$e);return Y(D,A,"in resolve() call"),new Promise((J,G)=>{let K={command:"resolve",path:p,key:a,pluginName:b};Q!=null&&(K.pluginName=Q),z!=null&&(K.importer=z),_!=null&&(K.namespace=_),X!=null&&(K.resolveDir=X),H!=null&&(K.kind=H),j!=null&&(K.pluginData=c.store(j)),C(F,K,(se,Z)=>{se!==null?G(new Error(se)):J({errors:de(Z.errors,c),warnings:de(Z.warnings,c),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:c.load(Z.pluginData)})})})},onStart(p){let D='This error came from the "onStart" callback registered here:',A=Ee(new Error(D),e,"onStart");B.push({name:b,callback:p,note:A})},onEnd(p){let D='This error came from the "onEnd" callback registered here:',A=Ee(new Error(D),e,"onEnd");$.push({name:b,callback:p,note:A})},onResolve(p,D){let A='This error came from the "onResolve" callback registered here:',Q=Ee(new Error(A),e,"onResolve"),z={},_=n(p,z,"filter",Me),X=n(p,z,"namespace",m);if(Y(p,z,`in onResolve() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onResolve() call is missing a filter");let H=M++;x[H]={name:b,callback:D,note:Q},v.onResolve.push({id:H,filter:_.source,namespace:X||""})},onLoad(p,D){let A='This error came from the "onLoad" callback registered here:',Q=Ee(new Error(A),e,"onLoad"),z={},_=n(p,z,"filter",Me),X=n(p,z,"namespace",m);if(Y(p,z,`in onLoad() call for plugin ${JSON.stringify(b)}`),_==null)throw new Error("onLoad() call is missing a filter");let H=M++;P[H]={name:b,callback:D,note:Q},v.onLoad.push({id:H,filter:_.source,namespace:X||""})},esbuild:e.esbuild});w&&await w,L.push(v)}catch(u){return{ok:!1,error:u,pluginName:b}}}let T=async E=>{switch(E.command){case"on-start":{let y={errors:[],warnings:[]};return await Promise.all(B.map(async({name:b,callback:u,note:v})=>{try{let U=await u();if(U!=null){if(typeof U!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(b)} to return an object`);let w={},p=n(U,w,"errors",V),D=n(U,w,"warnings",V);Y(U,w,`from onStart() callback in plugin ${JSON.stringify(b)}`),p!=null&&y.errors.push(...be(p,"errors",c,b)),D!=null&&y.warnings.push(...be(D,"warnings",c,b))}}catch(U){y.errors.push(ve(U,e,c,v&&v(),b))}})),y}case"on-resolve":{let y={},b="",u,v;for(let U of E.ids)try{({name:b,callback:u,note:v}=x[U]);let w=await u({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:c.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(b)} to return an object`);let p={},D=n(w,p,"pluginName",m),A=n(w,p,"path",m),Q=n(w,p,"namespace",m),z=n(w,p,"suffix",m),_=n(w,p,"external",I),X=n(w,p,"sideEffects",I),H=n(w,p,"pluginData",$e),j=n(w,p,"errors",V),J=n(w,p,"warnings",V),G=n(w,p,"watchFiles",V),K=n(w,p,"watchDirs",V);Y(w,p,`from onResolve() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A!=null&&(y.path=A),Q!=null&&(y.namespace=Q),z!=null&&(y.suffix=z),_!=null&&(y.external=_),X!=null&&(y.sideEffects=X),H!=null&&(y.pluginData=c.store(H)),j!=null&&(y.errors=be(j,"errors",c,b)),J!=null&&(y.warnings=be(J,"warnings",c,b)),G!=null&&(y.watchFiles=ke(G,"watchFiles")),K!=null&&(y.watchDirs=ke(K,"watchDirs"));break}}catch(w){return{id:U,errors:[ve(w,e,c,v&&v(),b)]}}return y}case"on-load":{let y={},b="",u,v;for(let U of E.ids)try{({name:b,callback:u,note:v}=P[U]);let w=await u({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:c.load(E.pluginData)});if(w!=null){if(typeof w!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(b)} to return an object`);let p={},D=n(w,p,"pluginName",m),A=n(w,p,"contents",pt),Q=n(w,p,"resolveDir",m),z=n(w,p,"pluginData",$e),_=n(w,p,"loader",m),X=n(w,p,"errors",V),H=n(w,p,"warnings",V),j=n(w,p,"watchFiles",V),J=n(w,p,"watchDirs",V);Y(w,p,`from onLoad() callback in plugin ${JSON.stringify(b)}`),y.id=U,D!=null&&(y.pluginName=D),A instanceof Uint8Array?y.contents=A:A!=null&&(y.contents=ce(A)),Q!=null&&(y.resolveDir=Q),z!=null&&(y.pluginData=c.store(z)),_!=null&&(y.loader=_),X!=null&&(y.errors=be(X,"errors",c,b)),H!=null&&(y.warnings=be(H,"warnings",c,b)),j!=null&&(y.watchFiles=ke(j,"watchFiles")),J!=null&&(y.watchDirs=ke(J,"watchDirs"));break}}catch(w){return{id:U,errors:[ve(w,e,c,v&&v(),b)]}}return y}default:throw new Error("Invalid command: "+E.command)}},W=(E,y,b)=>b();$.length>0&&(W=(E,y,b)=>{(async()=>{for(let{name:u,callback:v,note:U}of $)try{await v(E)}catch(w){E.errors.push(await new Promise(p=>y(w,u,U&&U(),p)))}})().then(b)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:W,pluginRefs:{ref(){++ee===1&&r.set(a,T)},unref(){--ee===0&&r.delete(a)}}}},ie=(g,o,a,c)=>{let F={},B=n(o,F,"port",Oe),$=n(o,F,"host",m),x=n(o,F,"servedir",m),P=n(o,F,"onRequest",Le),M,R=new Promise((L,S)=>{M=T=>{d.delete(c),T!==null?S(new Error(T)):L()}});return a.serve={},Y(o,F,"in serve() call"),B!==void 0&&(a.serve.port=B),$!==void 0&&(a.serve.host=$),x!==void 0&&(a.serve.servedir=x),d.set(c,{onRequest:P,onWait:M}),{wait:R,stop(){C(g,{command:"serve-stop",key:c},()=>{})}}},pe="warning",ue="silent",ge=g=>{let o=l++,a=Ve(),c,{refs:F,options:B,isTTY:$,callback:x}=g;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');c=R}}let P=(R,L,S,T)=>{let W=[];try{Ce(W,B,{},$,pe)}catch(E){}let ee=ve(R,e,a,S,L);C(F,{command:"error",flags:W,error:ee},()=>{ee.detail=a.load(ee.detail),T(ee)})},M=(R,L)=>{P(R,L,void 0,S=>{x(Re("Build failed",[S],[]),null)})};if(c&&c.length>0){if(e.isSync)return M(new Error("Cannot use plugins in synchronous API calls"),"");le(B,c,o,a,F).then(R=>{if(!R.ok)M(R.error,R.pluginName);else try{fe(De(Te({},g),{key:o,details:a,logPluginError:P,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){M(L,"")}},R=>M(R,""))}else try{fe(De(Te({},g),{key:o,details:a,logPluginError:P,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){M(R,"")}},fe=({callName:g,refs:o,serveOptions:a,options:c,isTTY:F,defaultWD:B,callback:$,key:x,details:P,logPluginError:M,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),o&&o.ref()},unref(){S&&S.unref(),o&&o.unref()}},W=!e.isBrowser,{entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:u,absWorkingDir:v,incremental:U,nodePaths:w,watch:p,mangleCache:D}=gt(g,c,F,pe,W),A={command:"build",key:x,entries:ee,flags:E,write:y,stdinContents:b,stdinResolveDir:u,absWorkingDir:v||B,incremental:U,nodePaths:w};R&&(A.plugins=R),D&&(A.mangleCache=D);let Q=a&&ie(T,a,A,x),z,_,X=(j,J)=>{j.outputFiles&&(J.outputFiles=j.outputFiles.map(yt)),j.metafile&&(J.metafile=JSON.parse(j.metafile)),j.mangleCache&&(J.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(he(j.writeToStdout).replace(/\n$/,""))},H=(j,J)=>{let G={errors:de(j.errors,P),warnings:de(j.warnings,P)};X(j,G),L(G,M,()=>{if(G.errors.length>0)return J(Re("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!z){let K=!1;z=()=>new Promise((se,Z)=>{if(K||i)throw new Error("Cannot rebuild");C(T,{command:"rebuild",key:x},(te,et)=>{if(te)return J(Re("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(et,(Be,tt)=>{Be?Z(Be):se(tt)})})}),T.ref(),z.dispose=()=>{K||(K=!0,C(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=z}if(j.watch){if(!_){let K=!1;T.ref(),_=()=>{K||(K=!0,s.delete(x),C(T,{command:"watch-stop",key:x},()=>{}),T.unref())},p&&s.set(x,(se,Z)=>{if(se){p.onRebuild&&p.onRebuild(se,null);return}let te={errors:de(Z.errors,P),warnings:de(Z.warnings,P)};X(Z,te),L(te,M,()=>{if(te.errors.length>0){p.onRebuild&&p.onRebuild(Re("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=z),te.stop=_,p.onRebuild&&p.onRebuild(null,te)})})}G.stop=_}J(null,G)})};if(y&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(U&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(p&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');C(T,A,(j,J)=>{if(j)return $(new Error(j),null);if(Q){let G=J,K=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){K||(K=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),$(null,se)}return H(J,$)})};return{readFromStdout:N,afterClose:k,service:{buildOrServe:ge,transform:({callName:g,refs:o,input:a,options:c,isTTY:F,fs:B,callback:$})=>{let x=Ve(),P=M=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=mt(g,c,F,ue),S={command:"transform",flags:R,inputFS:M!==null,input:M!==null?M:a};L&&(S.mangleCache=L),C(o,S,(T,W)=>{if(T)return $(new Error(T),null);let ee=de(W.errors,x),E=de(W.warnings,x),y=1,b=()=>{if(--y===0){let u={warnings:E,code:W.code,map:W.map};W.mangleCache&&(u.mangleCache=W==null?void 0:W.mangleCache),$(null,u)}};if(ee.length>0)return $(Re("Transform failed",ee,E),null);W.codeFS&&(y++,B.readFile(W.code,(u,v)=>{u!==null?$(u,null):(W.code=v,b())})),W.mapFS&&(y++,B.readFile(W.map,(u,v)=>{u!==null?$(u,null):(W.map=v,b())})),b()})}catch(R){let L=[];try{Ce(L,c,{},F,ue)}catch(T){}let S=ve(R,e,x,void 0,"");C(o,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),$(Re("Transform failed",[S],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let M=P;P=()=>B.writeFile(a,M)}P(null)},formatMessages:({callName:g,refs:o,messages:a,options:c,callback:F})=>{let B=be(a,"messages",null,"");if(!c)throw new Error(`Missing second argument in ${g}() call`);let $={},x=n(c,$,"kind",m),P=n(c,$,"color",I),M=n(c,$,"terminalWidth",Oe);if(Y(c,$,`in ${g}() call`),x===void 0)throw new Error(`Missing "kind" in ${g}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${g}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};P!==void 0&&(R.color=P),M!==void 0&&(R.terminalWidth=M),C(o,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:g,refs:o,metafile:a,options:c,callback:F})=>{c===void 0&&(c={});let B={},$=n(c,B,"color",I),x=n(c,B,"verbose",I);Y(c,B,`in ${g}() call`);let P={command:"analyze-metafile",metafile:a};$!==void 0&&(P.color=$),x!==void 0&&(P.verbose=x),C(o,P,(M,R)=>{if(M)return F(new Error(M),null);F(null,R.result)})}}}}function Ve(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Ee(e,t,r){let s,d=!1;return()=>{if(d)return s;d=!0;try{let i=(e.stack+"").split(`
2
+ `);i.splice(1,1);let f=Ze(t,i,r);if(f)return s={text:e.message,location:f},s}catch(i){}}}function ve(e,t,r,s,d){let i="Internal error",f=null;try{i=(e&&e.message||e)+""}catch(l){}try{f=Ze(t,(e.stack+"").split(`
3
+ `),"")}catch(l){}return{pluginName:d,text:i,location:f,notes:s?[s]:[],detail:r?r.store(e):-1}}function Ze(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let d=1;d<t.length;d++){let i=t[d];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let f=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(f){i=f[1];continue}if(f=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),f){i=f[1];continue}if(f=/^(\S+):(\d+):(\d+)$/.exec(i),f){let l;try{l=e.readFileSync(f[1],"utf8")}catch(k){break}let h=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+f[2]-1]||"",O=+f[3]-1,N=h.slice(O,O+r.length)===r?r.length:0;return{file:f[1],namespace:"file",line:+f[2],column:ce(h.slice(0,O)).length,length:ce(h.slice(O,O+N)).length,lineText:h+`
4
4
  `+t.slice(1).join(`
5
- `),suggestion:""}}break}}return null}function ve(e,t,r){let s=5,p=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((f,l)=>{if(l===s)return`
5
+ `),suggestion:""}}break}}return null}function Re(e,t,r){let s=5,d=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((f,l)=>{if(l===s)return`
6
6
  ...`;if(!f.location)return`
7
7
  error: ${f.text}`;let{file:h,line:O,column:N}=f.location,k=f.pluginName?`[plugin: ${f.pluginName}] `:"";return`
8
- ${h}:${O}:${N}: ERROR: ${k}${f.text}`}).join(""),i=new Error(`${e}${p}`);return i.errors=t,i.warnings=r,i}function ce(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},s=n(e,r,"file",m),p=n(e,r,"namespace",m),i=n(e,r,"line",Re),f=n(e,r,"column",Re),l=n(e,r,"length",Re),h=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:s||"",namespace:p||"",line:i||0,column:f||0,length:l||0,lineText:h||"",suggestion:O||""}}function he(e,t,r,s){let p=[],i=0;for(let f of e){let l={},h=n(f,l,"pluginName",m),O=n(f,l,"text",m),N=n(f,l,"location",_e),k=n(f,l,"notes",V),C=n(f,l,"detail",Me),q=`in element ${i} of "${t}"`;Y(f,l,q);let oe=[];if(k)for(let re of k){let ne={},le=n(re,ne,"text",m),ie=n(re,ne,"location",_e);Y(re,ne,q),oe.push({text:le||"",location:Je(ie,q)})}p.push({pluginName:h||s,text:O||"",location:Je(N,q),notes:oe,detail:r?r.store(C):-1}),i++}return p}function ke(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function yt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=ye(t)),r}}}var bt="0.14.39",wt=e=>Pe().build(e),vt=()=>{throw new Error('The "serve" API only works in node')},Rt=(e,t)=>Pe().transform(e,t),Ot=(e,t)=>Pe().formatMessages(e,t),St=(e,t)=>Pe().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},Et=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Mt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Oe,Ue,Pe=()=>{if(Ue)return Ue;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')},$t=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!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=Ct(t||"",r,s),Oe.catch(()=>{Oe=void 0}),Oe},Ct=async(e,t,r)=>{let s;if(t)s=t;else{let l=await fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=await l.arrayBuffer()}let p;if(r){let l=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.39"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});p=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
8
+ ${h}:${O}:${N}: ERROR: ${k}${f.text}`}).join(""),i=new Error(`${e}${d}`);return i.errors=t,i.warnings=r,i}function de(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Je(e,t){if(e==null)return null;let r={},s=n(e,r,"file",m),d=n(e,r,"namespace",m),i=n(e,r,"line",Oe),f=n(e,r,"column",Oe),l=n(e,r,"length",Oe),h=n(e,r,"lineText",m),O=n(e,r,"suggestion",m);return Y(e,r,t),{file:s||"",namespace:d||"",line:i||0,column:f||0,length:l||0,lineText:h||"",suggestion:O||""}}function be(e,t,r,s){let d=[],i=0;for(let f of e){let l={},h=n(f,l,"pluginName",m),O=n(f,l,"text",m),N=n(f,l,"location",_e),k=n(f,l,"notes",V),C=n(f,l,"detail",$e),q=`in element ${i} of "${t}"`;Y(f,l,q);let ae=[];if(k)for(let re of k){let ne={},le=n(re,ne,"text",m),ie=n(re,ne,"location",_e);Y(re,ne,q),ae.push({text:le||"",location:Je(ie,q)})}d.push({pluginName:h||s,text:O||"",location:Je(N,q),notes:ae,detail:r?r.store(C):-1}),i++}return d}function ke(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function yt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=he(t)),r}}}var bt="0.14.42",wt=e=>Pe().build(e),vt=()=>{throw new Error('The "serve" API only works in node')},Rt=(e,t)=>Pe().transform(e,t),Ot=(e,t)=>Pe().formatMessages(e,t),St=(e,t)=>Pe().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},Et=()=>{throw new Error('The "transformSync" API only works in node')},kt=()=>{throw new Error('The "formatMessagesSync" API only works in node')},$t=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,Ue,Pe=()=>{if(Ue)return Ue;throw Se?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')},Mt=e=>{e=Qe(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Se)throw new Error('Cannot call "initialize" more than once');return Se=Ct(t||"",r,s),Se.catch(()=>{Se=void 0}),Se},Ct=async(e,t,r)=>{let s;if(t)s=t;else{let l=await fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=await l.arrayBuffer()}let d;if(r){let l=new Blob(['onmessage=(postMessage=>{\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\nlet onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`\n`);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`\n`);d.length>1&&console.log(d.slice(0,-1).join(`\n`)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.42"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(postMessage)'],{type:"text/javascript"});d=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
9
9
  // Copyright 2018 The Go Authors. All rights reserved.
10
10
  // Use of this source code is governed by a BSD-style
11
11
  // license that can be found in the LICENSE file.
12
12
  let onmessage,globalThis={};for(let r=self;r;r=Object.getPrototypeOf(r))for(let f of Object.getOwnPropertyNames(r))f in globalThis||Object.defineProperty(globalThis,f,{get:()=>self[f]});return(()=>{const r=()=>{const c=new Error("not implemented");return c.code="ENOSYS",c};if(!globalThis.fs){let c="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(n,s){c+=g.decode(s);const i=c.lastIndexOf(`
13
13
  `);return i!=-1&&(console.log(c.substr(0,i)),c=c.substr(i+1)),s.length},write(n,s,i,a,h,u){if(i!==0||a!==s.length||h!==null){u(r());return}const d=this.writeSync(n,s);u(null,d)},chmod(n,s,i){i(r())},chown(n,s,i,a){a(r())},close(n,s){s(r())},fchmod(n,s,i){i(r())},fchown(n,s,i,a){a(r())},fstat(n,s){s(r())},fsync(n,s){s(null)},ftruncate(n,s,i){i(r())},lchown(n,s,i,a){a(r())},link(n,s,i){i(r())},lstat(n,s){s(r())},mkdir(n,s,i){i(r())},open(n,s,i,a){a(r())},read(n,s,i,a,h,u){u(r())},readdir(n,s){s(r())},readlink(n,s){s(r())},rename(n,s,i){i(r())},rmdir(n,s){s(r())},stat(n,s){s(r())},symlink(n,s,i){i(r())},truncate(n,s,i){i(r())},unlink(n,s){s(r())},utimes(n,s,i,a){a(r())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw r()},pid:-1,ppid:-1,umask(){throw r()},cwd(){throw r()},chdir(){throw r()}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const f=new TextEncoder("utf-8"),g=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{e!==0&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const c=(e,t)=>{this.mem.setUint32(e+0,t,!0),this.mem.setUint32(e+4,Math.floor(t/4294967296),!0)},n=e=>{const t=this.mem.getUint32(e+0,!0),o=this.mem.getInt32(e+4,!0);return t+o*4294967296},s=e=>{const t=this.mem.getFloat64(e,!0);if(t===0)return;if(!isNaN(t))return t;const o=this.mem.getUint32(e,!0);return this._values[o]},i=(e,t)=>{if(typeof t=="number"&&t!==0){if(isNaN(t)){this.mem.setUint32(e+4,2146959360,!0),this.mem.setUint32(e,0,!0);return}this.mem.setFloat64(e,t,!0);return}if(t===void 0){this.mem.setFloat64(e,0,!0);return}let l=this._ids.get(t);l===void 0&&(l=this._idPool.pop(),l===void 0&&(l=this._values.length),this._values[l]=t,this._goRefCounts[l]=0,this._ids.set(t,l)),this._goRefCounts[l]++;let m=0;switch(typeof t){case"object":t!==null&&(m=1);break;case"string":m=2;break;case"symbol":m=3;break;case"function":m=4;break}this.mem.setUint32(e+4,2146959360|m,!0),this.mem.setUint32(e,l,!0)},a=e=>{const t=n(e+0),o=n(e+8);return new Uint8Array(this._inst.exports.mem.buffer,t,o)},h=e=>{const t=n(e+0),o=n(e+8),l=new Array(o);for(let m=0;m<o;m++)l[m]=s(t+m*8);return l},u=e=>{const t=n(e+0),o=n(e+8);return g.decode(new DataView(this._inst.exports.mem.buffer,t,o))},d=Date.now()-performance.now();this.importObject={go:{"runtime.wasmExit":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(t)},"runtime.wasmWrite":e=>{e>>>=0;const t=n(e+8),o=n(e+16),l=this.mem.getInt32(e+24,!0);globalThis.fs.writeSync(t,new Uint8Array(this._inst.exports.mem.buffer,o,l))},"runtime.resetMemoryDataView":e=>{e>>>=0,this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":e=>{e>>>=0,c(e+8,(d+performance.now())*1e6)},"runtime.walltime":e=>{e>>>=0;const t=new Date().getTime();c(e+8,t/1e3),this.mem.setInt32(e+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const t=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(t,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(t);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},n(e+8)+1)),this.mem.setInt32(e+16,t,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const t=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(t)),this._scheduledTimeouts.delete(t)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(a(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const t=this.mem.getUint32(e+8,!0);if(this._goRefCounts[t]--,this._goRefCounts[t]===0){const o=this._values[t];this._values[t]=null,this._ids.delete(o),this._idPool.push(t)}},"syscall/js.stringVal":e=>{e>>>=0,i(e+24,u(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const t=Reflect.get(s(e+8),u(e+16));e=this._inst.exports.getsp()>>>0,i(e+32,t)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(s(e+8),u(e+16),s(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(s(e+8),u(e+16))},"syscall/js.valueIndex":e=>{e>>>=0,i(e+24,Reflect.get(s(e+8),n(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(s(e+8),n(e+16),s(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const t=s(e+8),o=Reflect.get(t,u(e+16)),l=h(e+32),m=Reflect.apply(o,t,l);e=this._inst.exports.getsp()>>>0,i(e+56,m),this.mem.setUint8(e+64,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+56,t),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.apply(t,void 0,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const t=s(e+8),o=h(e+16),l=Reflect.construct(t,o);e=this._inst.exports.getsp()>>>0,i(e+40,l),this.mem.setUint8(e+48,1)}catch(t){e=this._inst.exports.getsp()>>>0,i(e+40,t),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":e=>{e>>>=0,c(e+16,parseInt(s(e+8).length))},"syscall/js.valuePrepareString":e=>{e>>>=0;const t=f.encode(String(s(e+8)));i(e+16,t),c(e+24,t.length)},"syscall/js.valueLoadString":e=>{e>>>=0;const t=s(e+8);a(e+16).set(t)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,s(e+8)instanceof s(e+16)?1:0)},"syscall/js.copyBytesToGo":e=>{e>>>=0;const t=a(e+8),o=s(e+32);if(!(o instanceof Uint8Array||o instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},"syscall/js.copyBytesToJS":e=>{e>>>=0;const t=s(e+8),o=a(e+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray)){this.mem.setUint8(e+48,0);return}const l=o.subarray(0,t.length);t.set(l),c(e+40,l.length),this.mem.setUint8(e+48,1)},debug:e=>{console.log(e)}}}}async run(c){if(!(c instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=c,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let n=4096;const s=e=>{const t=n,o=f.encode(e+"\0");return new Uint8Array(this.mem.buffer,n,o.length).set(o),n+=o.length,n%8!==0&&(n+=8-n%8),t},i=this.argv.length,a=[];this.argv.forEach(e=>{a.push(s(e))}),a.push(0),Object.keys(this.env).sort().forEach(e=>{a.push(s(`${e}=${this.env[e]}`))}),a.push(0);const u=n;a.forEach(e=>{this.mem.setUint32(n,e,!0),this.mem.setUint32(n+4,0,!0),n+=8});const d=4096+8192;if(n>=d)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,u),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(c){const n=this;return function(){const s={id:c,this:this,args:arguments};return n._pendingEvent=s,n._resume(),s.result}}}})(),onmessage=({data:r})=>{let f=new TextDecoder,g=globalThis.fs,c="";g.writeSync=(h,u)=>{if(h===1)postMessage(u);else if(h===2){c+=f.decode(u);let d=c.split(`
14
14
  `);d.length>1&&console.log(d.slice(0,-1).join(`
15
- `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.39"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(h=>p.onmessage({data:h}));p={onmessage:null,postMessage:h=>setTimeout(()=>l({data:h})),terminate(){}}}p.postMessage(s),p.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:f}=Xe({writeToStdin(l){p.postMessage(l)},isSync:!1,isBrowser:!0,esbuild:Ae});Ue={build:l=>new Promise((h,O)=>f.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,k)=>N?O(N):h(k)})),transform:(l,h)=>new Promise((O,N)=>f.transform({callName:"transform",refs:null,input:l,options:h||{},isTTY:!1,fs:{readFile(k,C){C(new Error("Internal error"),null)},writeFile(k,C){C(null)}},callback:(k,C)=>k?N(k):O(C)})),formatMessages:(l,h)=>new Promise((O,N)=>f.formatMessages({callName:"formatMessages",refs:null,messages:l,options:h,callback:(k,C)=>k?N(k):O(C)})),analyzeMetafile:(l,h)=>new Promise((O,N)=>f.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:h,callback:(k,C)=>k?N(k):O(C)}))}},Pt=Ae;export{St as analyzeMetafile,Mt as analyzeMetafileSync,wt as build,xt as buildSync,Pt as default,Ot as formatMessages,kt as formatMessagesSync,$t as initialize,vt as serve,Rt as transform,Et as transformSync,bt as version};
15
+ `)),c=d[d.length-1]}else throw new Error("Bad write");return u.length};let n=[],s,i=0;onmessage=({data:h})=>{h.length>0&&(n.push(h),s&&s())},g.read=(h,u,d,e,t,o)=>{if(h!==0||d!==0||e!==u.length||t!==null)throw new Error("Bad read");if(n.length===0){s=()=>g.read(h,u,d,e,t,o);return}let l=n[0],m=Math.max(0,Math.min(e,l.length-i));u.set(l.subarray(i,i+m),d),i+=m,i===l.length&&(n.shift(),i=0),o(null,m)};let a=new globalThis.Go;a.argv=["","--service=0.14.42"],r instanceof WebAssembly.Module?WebAssembly.instantiate(r,a.importObject).then(h=>a.run(h)):WebAssembly.instantiate(r,a.importObject).then(({instance:h})=>a.run(h))},r=>onmessage(r);})(h=>d.onmessage({data:h}));d={onmessage:null,postMessage:h=>setTimeout(()=>l({data:h})),terminate(){}}}d.postMessage(s),d.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:f}=Xe({writeToStdin(l){d.postMessage(l)},isSync:!1,isBrowser:!0,esbuild:Ae});Ue={build:l=>new Promise((h,O)=>f.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,k)=>N?O(N):h(k)})),transform:(l,h)=>new Promise((O,N)=>f.transform({callName:"transform",refs:null,input:l,options:h||{},isTTY:!1,fs:{readFile(k,C){C(new Error("Internal error"),null)},writeFile(k,C){C(null)}},callback:(k,C)=>k?N(k):O(C)})),formatMessages:(l,h)=>new Promise((O,N)=>f.formatMessages({callName:"formatMessages",refs:null,messages:l,options:h,callback:(k,C)=>k?N(k):O(C)})),analyzeMetafile:(l,h)=>new Promise((O,N)=>f.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:h,callback:(k,C)=>k?N(k):O(C)}))}},Pt=Ae;export{St as analyzeMetafile,$t as analyzeMetafileSync,wt as build,xt as buildSync,Pt as default,Ot as formatMessages,kt as formatMessagesSync,Mt as initialize,vt as serve,Rt as transform,Et as transformSync,bt as version};
@@ -67,6 +67,8 @@ interface CommonOptions {
67
67
  logLevel?: LogLevel;
68
68
  /** Documentation: https://esbuild.github.io/api/#log-limit */
69
69
  logLimit?: number;
70
+ /** Documentation: https://esbuild.github.io/api/#log-override */
71
+ logOverride?: Record<string, LogLevel>;
70
72
  }
71
73
 
72
74
  export interface BuildOptions extends CommonOptions {
@@ -336,6 +336,7 @@ function pushCommonFlags(flags, options, keys) {
336
336
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
337
337
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
338
338
  let define = getFlag(options, keys, "define", mustBeObject);
339
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
339
340
  let pure = getFlag(options, keys, "pure", mustBeArray);
340
341
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
341
342
  if (legalComments)
@@ -390,6 +391,13 @@ function pushCommonFlags(flags, options, keys) {
390
391
  flags.push(`--define:${key}=${define[key]}`);
391
392
  }
392
393
  }
394
+ if (logOverride) {
395
+ for (let key in logOverride) {
396
+ if (key.indexOf("=") >= 0)
397
+ throw new Error(`Invalid log override: ${key}`);
398
+ flags.push(`--log-override:${key}=${logOverride[key]}`);
399
+ }
400
+ }
393
401
  if (pure)
394
402
  for (let fn of pure)
395
403
  flags.push(`--pure:${fn}`);
@@ -764,8 +772,8 @@ function createChannel(streamIn) {
764
772
  if (isFirstPacket) {
765
773
  isFirstPacket = false;
766
774
  let binaryVersion = String.fromCharCode(...bytes);
767
- if (binaryVersion !== "0.14.39") {
768
- throw new Error(`Cannot start service: Host version "${"0.14.39"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
775
+ if (binaryVersion !== "0.14.42") {
776
+ throw new Error(`Cannot start service: Host version "${"0.14.42"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
769
777
  }
770
778
  return;
771
779
  }
@@ -1710,7 +1718,7 @@ function convertOutputFiles({ path, contents }) {
1710
1718
  }
1711
1719
 
1712
1720
  // lib/npm/browser.ts
1713
- var version = "0.14.39";
1721
+ var version = "0.14.42";
1714
1722
  var build = (options) => ensureServiceIsRunning().build(options);
1715
1723
  var serve = () => {
1716
1724
  throw new Error(`The "serve" API only works in node`);
@@ -1766,7 +1774,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
1766
1774
  }
1767
1775
  let worker;
1768
1776
  if (useWorker) {
1769
- let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.39"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1777
+ let blob = new Blob([`onmessage=${'((postMessage) => {\n // Copyright 2018 The Go Authors. All rights reserved.\n // Use of this source code is governed by a BSD-style\n // license that can be found in the LICENSE file.\n var __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n };\n let onmessage;\n let globalThis = {};\n for (let o = self; o; o = Object.getPrototypeOf(o))\n for (let k of Object.getOwnPropertyNames(o))\n if (!(k in globalThis))\n Object.defineProperty(globalThis, k, { get: () => self[k] });\n "use strict";\n (() => {\n const enosys = () => {\n const err = new Error("not implemented");\n err.code = "ENOSYS";\n return err;\n };\n if (!globalThis.fs) {\n let outputBuf = "";\n globalThis.fs = {\n constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 },\n writeSync(fd, buf) {\n outputBuf += decoder.decode(buf);\n const nl = outputBuf.lastIndexOf("\\n");\n if (nl != -1) {\n console.log(outputBuf.substr(0, nl));\n outputBuf = outputBuf.substr(nl + 1);\n }\n return buf.length;\n },\n write(fd, buf, offset, length, position, callback) {\n if (offset !== 0 || length !== buf.length || position !== null) {\n callback(enosys());\n return;\n }\n const n = this.writeSync(fd, buf);\n callback(null, n);\n },\n chmod(path, mode, callback) {\n callback(enosys());\n },\n chown(path, uid, gid, callback) {\n callback(enosys());\n },\n close(fd, callback) {\n callback(enosys());\n },\n fchmod(fd, mode, callback) {\n callback(enosys());\n },\n fchown(fd, uid, gid, callback) {\n callback(enosys());\n },\n fstat(fd, callback) {\n callback(enosys());\n },\n fsync(fd, callback) {\n callback(null);\n },\n ftruncate(fd, length, callback) {\n callback(enosys());\n },\n lchown(path, uid, gid, callback) {\n callback(enosys());\n },\n link(path, link, callback) {\n callback(enosys());\n },\n lstat(path, callback) {\n callback(enosys());\n },\n mkdir(path, perm, callback) {\n callback(enosys());\n },\n open(path, flags, mode, callback) {\n callback(enosys());\n },\n read(fd, buffer, offset, length, position, callback) {\n callback(enosys());\n },\n readdir(path, callback) {\n callback(enosys());\n },\n readlink(path, callback) {\n callback(enosys());\n },\n rename(from, to, callback) {\n callback(enosys());\n },\n rmdir(path, callback) {\n callback(enosys());\n },\n stat(path, callback) {\n callback(enosys());\n },\n symlink(path, link, callback) {\n callback(enosys());\n },\n truncate(path, length, callback) {\n callback(enosys());\n },\n unlink(path, callback) {\n callback(enosys());\n },\n utimes(path, atime, mtime, callback) {\n callback(enosys());\n }\n };\n }\n if (!globalThis.process) {\n globalThis.process = {\n getuid() {\n return -1;\n },\n getgid() {\n return -1;\n },\n geteuid() {\n return -1;\n },\n getegid() {\n return -1;\n },\n getgroups() {\n throw enosys();\n },\n pid: -1,\n ppid: -1,\n umask() {\n throw enosys();\n },\n cwd() {\n throw enosys();\n },\n chdir() {\n throw enosys();\n }\n };\n }\n if (!globalThis.crypto) {\n throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");\n }\n if (!globalThis.performance) {\n throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");\n }\n if (!globalThis.TextEncoder) {\n throw new Error("globalThis.TextEncoder is not available, polyfill required");\n }\n if (!globalThis.TextDecoder) {\n throw new Error("globalThis.TextDecoder is not available, polyfill required");\n }\n const encoder = new TextEncoder("utf-8");\n const decoder = new TextDecoder("utf-8");\n globalThis.Go = class {\n constructor() {\n this.argv = ["js"];\n this.env = {};\n this.exit = (code) => {\n if (code !== 0) {\n console.warn("exit code:", code);\n }\n };\n this._exitPromise = new Promise((resolve) => {\n this._resolveExitPromise = resolve;\n });\n this._pendingEvent = null;\n this._scheduledTimeouts = /* @__PURE__ */ new Map();\n this._nextCallbackTimeoutID = 1;\n const setInt64 = (addr, v) => {\n this.mem.setUint32(addr + 0, v, true);\n this.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n };\n const getInt64 = (addr) => {\n const low = this.mem.getUint32(addr + 0, true);\n const high = this.mem.getInt32(addr + 4, true);\n return low + high * 4294967296;\n };\n const loadValue = (addr) => {\n const f = this.mem.getFloat64(addr, true);\n if (f === 0) {\n return void 0;\n }\n if (!isNaN(f)) {\n return f;\n }\n const id = this.mem.getUint32(addr, true);\n return this._values[id];\n };\n const storeValue = (addr, v) => {\n const nanHead = 2146959360;\n if (typeof v === "number" && v !== 0) {\n if (isNaN(v)) {\n this.mem.setUint32(addr + 4, nanHead, true);\n this.mem.setUint32(addr, 0, true);\n return;\n }\n this.mem.setFloat64(addr, v, true);\n return;\n }\n if (v === void 0) {\n this.mem.setFloat64(addr, 0, true);\n return;\n }\n let id = this._ids.get(v);\n if (id === void 0) {\n id = this._idPool.pop();\n if (id === void 0) {\n id = this._values.length;\n }\n this._values[id] = v;\n this._goRefCounts[id] = 0;\n this._ids.set(v, id);\n }\n this._goRefCounts[id]++;\n let typeFlag = 0;\n switch (typeof v) {\n case "object":\n if (v !== null) {\n typeFlag = 1;\n }\n break;\n case "string":\n typeFlag = 2;\n break;\n case "symbol":\n typeFlag = 3;\n break;\n case "function":\n typeFlag = 4;\n break;\n }\n this.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n this.mem.setUint32(addr, id, true);\n };\n const loadSlice = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return new Uint8Array(this._inst.exports.mem.buffer, array, len);\n };\n const loadSliceOfValues = (addr) => {\n const array = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n const a = new Array(len);\n for (let i = 0; i < len; i++) {\n a[i] = loadValue(array + i * 8);\n }\n return a;\n };\n const loadString = (addr) => {\n const saddr = getInt64(addr + 0);\n const len = getInt64(addr + 8);\n return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n };\n const timeOrigin = Date.now() - performance.now();\n this.importObject = {\n go: {\n "runtime.wasmExit": (sp) => {\n sp >>>= 0;\n const code = this.mem.getInt32(sp + 8, true);\n this.exited = true;\n delete this._inst;\n delete this._values;\n delete this._goRefCounts;\n delete this._ids;\n delete this._idPool;\n this.exit(code);\n },\n "runtime.wasmWrite": (sp) => {\n sp >>>= 0;\n const fd = getInt64(sp + 8);\n const p = getInt64(sp + 16);\n const n = this.mem.getInt32(sp + 24, true);\n globalThis.fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n },\n "runtime.resetMemoryDataView": (sp) => {\n sp >>>= 0;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n },\n "runtime.nanotime1": (sp) => {\n sp >>>= 0;\n setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6);\n },\n "runtime.walltime": (sp) => {\n sp >>>= 0;\n const msec = new Date().getTime();\n setInt64(sp + 8, msec / 1e3);\n this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true);\n },\n "runtime.scheduleTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this._nextCallbackTimeoutID;\n this._nextCallbackTimeoutID++;\n this._scheduledTimeouts.set(id, setTimeout(() => {\n this._resume();\n while (this._scheduledTimeouts.has(id)) {\n console.warn("scheduleTimeoutEvent: missed timeout event");\n this._resume();\n }\n }, getInt64(sp + 8) + 1));\n this.mem.setInt32(sp + 16, id, true);\n },\n "runtime.clearTimeoutEvent": (sp) => {\n sp >>>= 0;\n const id = this.mem.getInt32(sp + 8, true);\n clearTimeout(this._scheduledTimeouts.get(id));\n this._scheduledTimeouts.delete(id);\n },\n "runtime.getRandomData": (sp) => {\n sp >>>= 0;\n crypto.getRandomValues(loadSlice(sp + 8));\n },\n "syscall/js.finalizeRef": (sp) => {\n sp >>>= 0;\n const id = this.mem.getUint32(sp + 8, true);\n this._goRefCounts[id]--;\n if (this._goRefCounts[id] === 0) {\n const v = this._values[id];\n this._values[id] = null;\n this._ids.delete(v);\n this._idPool.push(id);\n }\n },\n "syscall/js.stringVal": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, loadString(sp + 8));\n },\n "syscall/js.valueGet": (sp) => {\n sp >>>= 0;\n const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 32, result);\n },\n "syscall/js.valueSet": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n },\n "syscall/js.valueDelete": (sp) => {\n sp >>>= 0;\n Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n },\n "syscall/js.valueIndex": (sp) => {\n sp >>>= 0;\n storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n },\n "syscall/js.valueSetIndex": (sp) => {\n sp >>>= 0;\n Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n },\n "syscall/js.valueCall": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const m = Reflect.get(v, loadString(sp + 16));\n const args = loadSliceOfValues(sp + 32);\n const result = Reflect.apply(m, v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, result);\n this.mem.setUint8(sp + 64, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 56, err);\n this.mem.setUint8(sp + 64, 0);\n }\n },\n "syscall/js.valueInvoke": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.apply(v, void 0, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueNew": (sp) => {\n sp >>>= 0;\n try {\n const v = loadValue(sp + 8);\n const args = loadSliceOfValues(sp + 16);\n const result = Reflect.construct(v, args);\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, result);\n this.mem.setUint8(sp + 48, 1);\n } catch (err) {\n sp = this._inst.exports.getsp() >>> 0;\n storeValue(sp + 40, err);\n this.mem.setUint8(sp + 48, 0);\n }\n },\n "syscall/js.valueLength": (sp) => {\n sp >>>= 0;\n setInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n },\n "syscall/js.valuePrepareString": (sp) => {\n sp >>>= 0;\n const str = encoder.encode(String(loadValue(sp + 8)));\n storeValue(sp + 16, str);\n setInt64(sp + 24, str.length);\n },\n "syscall/js.valueLoadString": (sp) => {\n sp >>>= 0;\n const str = loadValue(sp + 8);\n loadSlice(sp + 16).set(str);\n },\n "syscall/js.valueInstanceOf": (sp) => {\n sp >>>= 0;\n this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0);\n },\n "syscall/js.copyBytesToGo": (sp) => {\n sp >>>= 0;\n const dst = loadSlice(sp + 8);\n const src = loadValue(sp + 32);\n if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "syscall/js.copyBytesToJS": (sp) => {\n sp >>>= 0;\n const dst = loadValue(sp + 8);\n const src = loadSlice(sp + 16);\n if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n this.mem.setUint8(sp + 48, 0);\n return;\n }\n const toCopy = src.subarray(0, dst.length);\n dst.set(toCopy);\n setInt64(sp + 40, toCopy.length);\n this.mem.setUint8(sp + 48, 1);\n },\n "debug": (value) => {\n console.log(value);\n }\n }\n };\n }\n run(instance) {\n return __async(this, null, function* () {\n if (!(instance instanceof WebAssembly.Instance)) {\n throw new Error("Go.run: WebAssembly.Instance expected");\n }\n this._inst = instance;\n this.mem = new DataView(this._inst.exports.mem.buffer);\n this._values = [\n NaN,\n 0,\n null,\n true,\n false,\n globalThis,\n this\n ];\n this._goRefCounts = new Array(this._values.length).fill(Infinity);\n this._ids = /* @__PURE__ */ new Map([\n [0, 1],\n [null, 2],\n [true, 3],\n [false, 4],\n [globalThis, 5],\n [this, 6]\n ]);\n this._idPool = [];\n this.exited = false;\n let offset = 4096;\n const strPtr = (str) => {\n const ptr = offset;\n const bytes = encoder.encode(str + "\\0");\n new Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n offset += bytes.length;\n if (offset % 8 !== 0) {\n offset += 8 - offset % 8;\n }\n return ptr;\n };\n const argc = this.argv.length;\n const argvPtrs = [];\n this.argv.forEach((arg) => {\n argvPtrs.push(strPtr(arg));\n });\n argvPtrs.push(0);\n const keys = Object.keys(this.env).sort();\n keys.forEach((key) => {\n argvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n });\n argvPtrs.push(0);\n const argv = offset;\n argvPtrs.forEach((ptr) => {\n this.mem.setUint32(offset, ptr, true);\n this.mem.setUint32(offset + 4, 0, true);\n offset += 8;\n });\n const wasmMinDataAddr = 4096 + 8192;\n if (offset >= wasmMinDataAddr) {\n throw new Error("total length of command line and environment variables exceeds limit");\n }\n this._inst.exports.run(argc, argv);\n if (this.exited) {\n this._resolveExitPromise();\n }\n yield this._exitPromise;\n });\n }\n _resume() {\n if (this.exited) {\n throw new Error("Go program has already exited");\n }\n this._inst.exports.resume();\n if (this.exited) {\n this._resolveExitPromise();\n }\n }\n _makeFuncWrapper(id) {\n const go = this;\n return function() {\n const event = { id, this: this, args: arguments };\n go._pendingEvent = event;\n go._resume();\n return event.result;\n };\n }\n };\n })();\n onmessage = ({ data: wasm }) => {\n let decoder = new TextDecoder();\n let fs = globalThis.fs;\n let stderr = "";\n fs.writeSync = (fd, buffer) => {\n if (fd === 1) {\n postMessage(buffer);\n } else if (fd === 2) {\n stderr += decoder.decode(buffer);\n let parts = stderr.split("\\n");\n if (parts.length > 1)\n console.log(parts.slice(0, -1).join("\\n"));\n stderr = parts[parts.length - 1];\n } else {\n throw new Error("Bad write");\n }\n return buffer.length;\n };\n let stdin = [];\n let resumeStdin;\n let stdinPos = 0;\n onmessage = ({ data }) => {\n if (data.length > 0) {\n stdin.push(data);\n if (resumeStdin)\n resumeStdin();\n }\n };\n fs.read = (fd, buffer, offset, length, position, callback) => {\n if (fd !== 0 || offset !== 0 || length !== buffer.length || position !== null) {\n throw new Error("Bad read");\n }\n if (stdin.length === 0) {\n resumeStdin = () => fs.read(fd, buffer, offset, length, position, callback);\n return;\n }\n let first = stdin[0];\n let count = Math.max(0, Math.min(length, first.length - stdinPos));\n buffer.set(first.subarray(stdinPos, stdinPos + count), offset);\n stdinPos += count;\n if (stdinPos === first.length) {\n stdin.shift();\n stdinPos = 0;\n }\n callback(null, count);\n };\n let go = new globalThis.Go();\n go.argv = ["", `--service=${"0.14.42"}`];\n if (wasm instanceof WebAssembly.Module) {\n WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));\n } else {\n WebAssembly.instantiate(wasm, go.importObject).then(({ instance }) => go.run(instance));\n }\n };\n return (m) => onmessage(m);\n })'}(postMessage)`], { type: "text/javascript" });
1770
1778
  worker = new Worker(URL.createObjectURL(blob));
1771
1779
  } else {
1772
1780
  let onmessage = ((postMessage) => {
@@ -2367,7 +2375,7 @@ var startRunningService = (wasmURL, wasmModule, useWorker) => __async(void 0, nu
2367
2375
  callback(null, count);
2368
2376
  };
2369
2377
  let go = new globalThis.Go();
2370
- go.argv = ["", `--service=${"0.14.39"}`];
2378
+ go.argv = ["", `--service=${"0.14.42"}`];
2371
2379
  if (wasm instanceof WebAssembly.Module) {
2372
2380
  WebAssembly.instantiate(wasm, go.importObject).then((instance) => go.run(instance));
2373
2381
  } else {
@@ -1,17 +1,17 @@
1
1
  (module=>{
2
- var Ee=Object.defineProperty,lt=Object.defineProperties,it=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable;var ze=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ne=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&ze(e,r,t[r]);if(Ie)for(var r of Ie(t))at.call(t,r)&&ze(e,r,t[r]);return e},Fe=(e,t)=>lt(e,st(t));var ut=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},ft=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ot(t))!Ke.call(e,u)&&u!==r&&Ee(e,u,{get:()=>t[u],enumerable:!(s=it(t,u))||s.enumerable});return e};var ct=e=>ft(Ee({},"__esModule",{value:!0}),e);var fe=(e,t,r)=>new Promise((s,u)=>{var i=m=>{try{l(r.next(m))}catch(O){u(O)}},c=m=>{try{l(r.throw(m))}catch(O){u(O)}},l=m=>m.done?s(m.value):Promise.resolve(m.value).then(i,c);l((r=r.apply(e,t)).next())});var Te={};ut(Te,{analyzeMetafile:()=>$t,analyzeMetafileSync:()=>Bt,build:()=>xt,buildSync:()=>Ct,default:()=>Nt,formatMessages:()=>Mt,formatMessagesSync:()=>At,initialize:()=>Tt,serve:()=>Et,transform:()=>kt,transformSync:()=>Pt,version:()=>St});module.exports=ct(Te);function Le(e){let t=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(ce(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 u of s)t(u)}else{let u=Object.keys(s);r.write8(6),r.write32(u.length);for(let i of u)r.write(ce(i)),t(s[i])}},r=new ke;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),je(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function _e(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let c=r.read32(),l=[];for(let m=0;m<c;m++)l.push(t());return l}case 6:{let c=r.read32(),l={};for(let m=0;m<c;m++)l[he(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new ke(e),s=r.read32(),u=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:u,value:i}}var ke=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);je(this.buf,t,r)}write(t){let r=this._write(4+t.length);je(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 Ue(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},ce,he;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;ce=r=>e.encode(r),he=r=>t.decode(r)}else if(typeof Buffer!="undefined")ce=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},he=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ue(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function je(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ve(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ce=()=>null,q=e=>typeof e=="boolean"?null:"a boolean",pt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Pe=e=>e instanceof RegExp?null:"a RegExp object",Oe=e=>typeof e=="number"&&e===(e|0)?null:"an integer",We=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",pe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",gt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",mt=e=>typeof e=="object"&&e!==null?null:"an array or an object",Je=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",He=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",yt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ht=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",bt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let u=e[r];if(t[r+""]=!0,u===void 0)return;let i=s(u);if(i!==null)throw new Error(`"${r}" must be ${i}`);return u}function J(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Ge(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),s=n(e,t,"wasmModule",gt),u=n(e,t,"worker",q);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:u}}function Xe(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ae(e,t,r,s,u){let i=n(t,r,"color",q),c=n(t,r,"logLevel",y),l=n(t,r,"logLimit",Oe);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${c||u}`),e.push(`--log-limit=${l||0}`)}function Ze(e,t,r){let s=n(t,r,"legalComments",y),u=n(t,r,"sourceRoot",y),i=n(t,r,"sourcesContent",q),c=n(t,r,"target",ht),l=n(t,r,"format",y),m=n(t,r,"globalName",y),O=n(t,r,"mangleProps",Pe),N=n(t,r,"reserveProps",Pe),M=n(t,r,"mangleQuoted",q),P=n(t,r,"minify",q),W=n(t,r,"minifySyntax",q),oe=n(t,r,"minifyWhitespace",q),re=n(t,r,"minifyIdentifiers",q),ne=n(t,r,"drop",_),le=n(t,r,"charset",y),ie=n(t,r,"treeShaking",q),ge=n(t,r,"ignoreAnnotations",q),ae=n(t,r,"jsx",y),me=n(t,r,"jsxFactory",y),ue=n(t,r,"jsxFragment",y),ye=n(t,r,"define",pe),we=n(t,r,"pure",_),xe=n(t,r,"keepNames",q);if(s&&e.push(`--legal-comments=${s}`),u!==void 0&&e.push(`--source-root=${u}`),i!==void 0&&e.push(`--sources-content=${i}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),l&&e.push(`--format=${l}`),m&&e.push(`--global-name=${m}`),P&&e.push("--minify"),W&&e.push("--minify-syntax"),oe&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ge&&e.push("--ignore-annotations"),ne)for(let d of ne)e.push(`--drop:${d}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),M!==void 0&&e.push(`--mangle-quoted=${M}`),ae&&e.push(`--jsx=${ae}`),me&&e.push(`--jsx-factory=${me}`),ue&&e.push(`--jsx-fragment=${ue}`),ye)for(let d in ye){if(d.indexOf("=")>=0)throw new Error(`Invalid define: ${d}`);e.push(`--define:${d}=${ye[d]}`)}if(we)for(let d of we)e.push(`--pure:${d}`);xe&&e.push("--keep-names")}function wt(e,t,r,s,u){var w;let i=[],c=[],l=Object.create(null),m=null,O=null,N=null;Ae(i,t,l,r,s),Ze(i,t,l);let M=n(t,l,"sourcemap",He),P=n(t,l,"bundle",q),W=n(t,l,"watch",pt),oe=n(t,l,"splitting",q),re=n(t,l,"preserveSymlinks",q),ne=n(t,l,"metafile",q),le=n(t,l,"outfile",y),ie=n(t,l,"outdir",y),ge=n(t,l,"outbase",y),ae=n(t,l,"platform",y),me=n(t,l,"tsconfig",y),ue=n(t,l,"resolveExtensions",_),ye=n(t,l,"nodePaths",_),we=n(t,l,"mainFields",_),xe=n(t,l,"conditions",_),d=n(t,l,"external",_),f=n(t,l,"loader",pe),o=n(t,l,"outExtension",pe),p=n(t,l,"publicPath",y),F=n(t,l,"entryNames",y),B=n(t,l,"chunkNames",y),$=n(t,l,"assetNames",y),x=n(t,l,"inject",_),A=n(t,l,"banner",pe),C=n(t,l,"footer",pe),R=n(t,l,"entryPoints",mt),L=n(t,l,"absWorkingDir",y),S=n(t,l,"stdin",pe),T=(w=n(t,l,"write",q))!=null?w:u,U=n(t,l,"allowOverwrite",q),ee=n(t,l,"incremental",q)===!0,E=n(t,l,"mangleCache",pe);if(l.plugins=!0,J(t,l,`in ${e}() call`),M&&i.push(`--sourcemap${M===!0?"":`=${M}`}`),P&&i.push("--bundle"),U&&i.push("--allow-overwrite"),W)if(i.push("--watch"),typeof W=="boolean")N={};else{let a=Object.create(null),v=n(W,a,"onRebuild",We);J(W,a,`on "watch" in ${e}() call`),N={onRebuild:v}}if(oe&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),ge&&i.push(`--outbase=${ge}`),ae&&i.push(`--platform=${ae}`),me&&i.push(`--tsconfig=${me}`),ue){let a=[];for(let v of ue){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);a.push(v)}i.push(`--resolve-extensions=${a.join(",")}`)}if(p&&i.push(`--public-path=${p}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),$&&i.push(`--asset-names=${$}`),we){let a=[];for(let v of we){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);a.push(v)}i.push(`--main-fields=${a.join(",")}`)}if(xe){let a=[];for(let v of xe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);a.push(v)}i.push(`--conditions=${a.join(",")}`)}if(d)for(let a of d)i.push(`--external:${a}`);if(A)for(let a in A){if(a.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${a}`);i.push(`--banner:${a}=${A[a]}`)}if(C)for(let a in C){if(a.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${a}`);i.push(`--footer:${a}=${C[a]}`)}if(x)for(let a of x)i.push(`--inject:${a}`);if(f)for(let a in f){if(a.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${a}`);i.push(`--loader:${a}=${f[a]}`)}if(o)for(let a in o){if(a.indexOf("=")>=0)throw new Error(`Invalid out extension: ${a}`);i.push(`--out-extension:${a}=${o[a]}`)}if(R)if(Array.isArray(R))for(let a of R)c.push(["",a+""]);else for(let[a,v]of Object.entries(R))c.push([a+"",v+""]);if(S){let a=Object.create(null),v=n(S,a,"contents",y),Y=n(S,a,"resolveDir",y),h=n(S,a,"sourcefile",y),g=n(S,a,"loader",y);J(S,a,'in "stdin" object'),h&&i.push(`--sourcefile=${h}`),g&&i.push(`--loader=${g}`),Y&&(O=Y+""),m=v?v+"":""}let b=[];if(ye)for(let a of ye)a+="",b.push(a);return{entries:c,flags:i,write:T,stdinContents:m,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:b,watch:N,mangleCache:Xe(E)}}function vt(e,t,r,s){let u=[],i=Object.create(null);Ae(u,t,i,r,s),Ze(u,t,i);let c=n(t,i,"sourcemap",He),l=n(t,i,"tsconfigRaw",yt),m=n(t,i,"sourcefile",y),O=n(t,i,"loader",y),N=n(t,i,"banner",y),M=n(t,i,"footer",y),P=n(t,i,"mangleCache",pe);return J(t,i,`in ${e}() call`),c&&u.push(`--sourcemap=${c===!0?"external":c}`),l&&u.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),m&&u.push(`--sourcefile=${m}`),O&&u.push(`--loader=${O}`),N&&u.push(`--banner=${N}`),M&&u.push(`--footer=${M}`),{flags:u,mangleCache:Xe(P)}}function et(e){let t=new Map,r=new Map,s=new Map,u=new Map,i=null,c=0,l=0,m=new Uint8Array(16*1024),O=0,N=d=>{let f=O+d.length;if(f>m.length){let p=new Uint8Array(f*2);p.set(m),m=p}m.set(d,O),O+=d.length;let o=0;for(;o+4<=O;){let p=Ue(m,o);if(o+4+p>O)break;o+=4,ne(m.subarray(o,o+p)),o+=p}o>0&&(m.copyWithin(0,o,O),O-=o)},M=d=>{i={reason:d?": "+(d.message||d):""};let f="The service was stopped"+i.reason;for(let o of t.values())o(f,null);t.clear();for(let o of u.values())o.onWait(f);u.clear();for(let o of s.values())try{o(new Error(f),null)}catch(p){console.error(p)}s.clear()},P=(d,f,o)=>{if(i)return o("The service is no longer running"+i.reason,null);let p=c++;t.set(p,(F,B)=>{try{o(F,B)}finally{d&&d.unref()}}),d&&d.ref(),e.writeToStdin(Le({id:p,isRequest:!0,value:f}))},W=(d,f)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Le({id:d,isRequest:!1,value:f}))},oe=(d,f)=>fe(this,null,function*(){try{switch(f.command){case"ping":{W(d,{});break}case"on-start":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"on-resolve":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"on-load":{let o=r.get(f.key);o?W(d,yield o(f)):W(d,{});break}case"serve-request":{let o=u.get(f.key);o&&o.onRequest&&o.onRequest(f.args),W(d,{});break}case"serve-wait":{let o=u.get(f.key);o&&o.onWait(f.error),W(d,{});break}case"watch-rebuild":{let o=s.get(f.key);try{o&&o(null,f.args)}catch(p){console.error(p)}W(d,{});break}default:throw new Error("Invalid command: "+f.command)}}catch(o){W(d,{errors:[ve(o,e,null,void 0,"")]})}}),re=!0,ne=d=>{if(re){re=!1;let o=String.fromCharCode(...d);if(o!=="0.14.39")throw new Error(`Cannot start service: Host version "0.14.39" does not match binary version ${JSON.stringify(o)}`);return}let f=_e(d);if(f.isRequest)oe(f.id,f.value);else{let o=t.get(f.id);t.delete(f.id),f.value.error?o(f.value.error,{}):o(null,f.value)}},le=(d,f,o,p,F)=>fe(this,null,function*(){let B=[],$=[],x={},A={},C=0,R=0,L=[],S=!1;f=[...f];for(let E of f){let b={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let w=n(E,b,"name",y);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let a=n(E,b,"setup",We);if(typeof a!="function")throw new Error("Plugin is missing a setup function");J(E,b,`on plugin ${JSON.stringify(w)}`);let v={name:w,onResolve:[],onLoad:[]};R++;let h=a({initialOptions:d,resolve:(g,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof g!="string")throw new Error("The path to resolve must be a string");let k=Object.create(null),Q=n(D,k,"pluginName",y),I=n(D,k,"importer",y),K=n(D,k,"namespace",y),X=n(D,k,"resolveDir",y),H=n(D,k,"kind",y),j=n(D,k,"pluginData",Ce);return J(D,k,"in resolve() call"),new Promise((V,G)=>{let z={command:"resolve",path:g,key:o,pluginName:w};Q!=null&&(z.pluginName=Q),I!=null&&(z.importer=I),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),H!=null&&(z.kind=H),j!=null&&(z.pluginData=p.store(j)),P(F,z,(se,Z)=>{se!==null?G(new Error(se)):V({errors:de(Z.errors,p),warnings:de(Z.warnings,p),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:p.load(Z.pluginData)})})})},onStart(g){let D='This error came from the "onStart" callback registered here:',k=Me(new Error(D),e,"onStart");B.push({name:w,callback:g,note:k})},onEnd(g){let D='This error came from the "onEnd" callback registered here:',k=Me(new Error(D),e,"onEnd");$.push({name:w,callback:g,note:k})},onResolve(g,D){let k='This error came from the "onResolve" callback registered here:',Q=Me(new Error(k),e,"onResolve"),I={},K=n(g,I,"filter",Pe),X=n(g,I,"namespace",y);if(J(g,I,`in onResolve() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onResolve() call is missing a filter");let H=C++;x[H]={name:w,callback:D,note:Q},v.onResolve.push({id:H,filter:K.source,namespace:X||""})},onLoad(g,D){let k='This error came from the "onLoad" callback registered here:',Q=Me(new Error(k),e,"onLoad"),I={},K=n(g,I,"filter",Pe),X=n(g,I,"namespace",y);if(J(g,I,`in onLoad() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onLoad() call is missing a filter");let H=C++;A[H]={name:w,callback:D,note:Q},v.onLoad.push({id:H,filter:K.source,namespace:X||""})},esbuild:e.esbuild});h&&(yield h),L.push(v)}catch(a){return{ok:!1,error:a,pluginName:w}}}let T=E=>fe(this,null,function*(){switch(E.command){case"on-start":{let b={errors:[],warnings:[]};return yield Promise.all(B.map(Y=>fe(this,[Y],function*({name:w,callback:a,note:v}){try{let h=yield a();if(h!=null){if(typeof h!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},D=n(h,g,"errors",_),k=n(h,g,"warnings",_);J(h,g,`from onStart() callback in plugin ${JSON.stringify(w)}`),D!=null&&b.errors.push(...be(D,"errors",p,w)),k!=null&&b.warnings.push(...be(k,"warnings",p,w))}}catch(h){b.errors.push(ve(h,e,p,v&&v(),w))}}))),b}case"on-resolve":{let b={},w="",a,v;for(let Y of E.ids)try{({name:w,callback:a,note:v}=x[Y]);let h=yield a({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:p.load(E.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},D=n(h,g,"pluginName",y),k=n(h,g,"path",y),Q=n(h,g,"namespace",y),I=n(h,g,"suffix",y),K=n(h,g,"external",q),X=n(h,g,"sideEffects",q),H=n(h,g,"pluginData",Ce),j=n(h,g,"errors",_),V=n(h,g,"warnings",_),G=n(h,g,"watchFiles",_),z=n(h,g,"watchDirs",_);J(h,g,`from onResolve() callback in plugin ${JSON.stringify(w)}`),b.id=Y,D!=null&&(b.pluginName=D),k!=null&&(b.path=k),Q!=null&&(b.namespace=Q),I!=null&&(b.suffix=I),K!=null&&(b.external=K),X!=null&&(b.sideEffects=X),H!=null&&(b.pluginData=p.store(H)),j!=null&&(b.errors=be(j,"errors",p,w)),V!=null&&(b.warnings=be(V,"warnings",p,w)),G!=null&&(b.watchFiles=$e(G,"watchFiles")),z!=null&&(b.watchDirs=$e(z,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}case"on-load":{let b={},w="",a,v;for(let Y of E.ids)try{({name:w,callback:a,note:v}=A[Y]);let h=yield a({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:p.load(E.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let g={},D=n(h,g,"pluginName",y),k=n(h,g,"contents",bt),Q=n(h,g,"resolveDir",y),I=n(h,g,"pluginData",Ce),K=n(h,g,"loader",y),X=n(h,g,"errors",_),H=n(h,g,"warnings",_),j=n(h,g,"watchFiles",_),V=n(h,g,"watchDirs",_);J(h,g,`from onLoad() callback in plugin ${JSON.stringify(w)}`),b.id=Y,D!=null&&(b.pluginName=D),k instanceof Uint8Array?b.contents=k:k!=null&&(b.contents=ce(k)),Q!=null&&(b.resolveDir=Q),I!=null&&(b.pluginData=p.store(I)),K!=null&&(b.loader=K),X!=null&&(b.errors=be(X,"errors",p,w)),H!=null&&(b.warnings=be(H,"warnings",p,w)),j!=null&&(b.watchFiles=$e(j,"watchFiles")),V!=null&&(b.watchDirs=$e(V,"watchDirs"));break}}catch(h){return{id:Y,errors:[ve(h,e,p,v&&v(),w)]}}return b}default:throw new Error("Invalid command: "+E.command)}}),U=(E,b,w)=>w();$.length>0&&(U=(E,b,w)=>{(()=>fe(this,null,function*(){for(let{name:a,callback:v,note:Y}of $)try{yield v(E)}catch(h){E.errors.push(yield new Promise(g=>b(h,a,Y&&Y(),g)))}}))().then(w)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:U,pluginRefs:{ref(){++ee===1&&r.set(o,T)},unref(){--ee===0&&r.delete(o)}}}}),ie=(d,f,o,p)=>{let F={},B=n(f,F,"port",Oe),$=n(f,F,"host",y),x=n(f,F,"servedir",y),A=n(f,F,"onRequest",We),C,R=new Promise((L,S)=>{C=T=>{u.delete(p),T!==null?S(new Error(T)):L()}});return o.serve={},J(f,F,"in serve() call"),B!==void 0&&(o.serve.port=B),$!==void 0&&(o.serve.host=$),x!==void 0&&(o.serve.servedir=x),u.set(p,{onRequest:A,onWait:C}),{wait:R,stop(){P(d,{command:"serve-stop",key:p},()=>{})}}},ge="warning",ae="silent",me=d=>{let f=l++,o=Ye(),p,{refs:F,options:B,isTTY:$,callback:x}=d;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');p=R}}let A=(R,L,S,T)=>{let U=[];try{Ae(U,B,{},$,ge)}catch(E){}let ee=ve(R,e,o,S,L);P(F,{command:"error",flags:U,error:ee},()=>{ee.detail=o.load(ee.detail),T(ee)})},C=(R,L)=>{A(R,L,void 0,S=>{x(Re("Build failed",[S],[]),null)})};if(p&&p.length>0){if(e.isSync)return C(new Error("Cannot use plugins in synchronous API calls"),"");le(B,p,f,o,F).then(R=>{if(!R.ok)C(R.error,R.pluginName);else try{ue(Fe(Ne({},d),{key:f,details:o,logPluginError:A,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){C(L,"")}},R=>C(R,""))}else try{ue(Fe(Ne({},d),{key:f,details:o,logPluginError:A,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){C(R,"")}},ue=({callName:d,refs:f,serveOptions:o,options:p,isTTY:F,defaultWD:B,callback:$,key:x,details:A,logPluginError:C,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),f&&f.ref()},unref(){S&&S.unref(),f&&f.unref()}},U=!e.isBrowser,{entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:a,absWorkingDir:v,incremental:Y,nodePaths:h,watch:g,mangleCache:D}=wt(d,p,F,ge,U),k={command:"build",key:x,entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:a,absWorkingDir:v||B,incremental:Y,nodePaths:h};R&&(k.plugins=R),D&&(k.mangleCache=D);let Q=o&&ie(T,o,k,x),I,K,X=(j,V)=>{j.outputFiles&&(V.outputFiles=j.outputFiles.map(Rt)),j.metafile&&(V.metafile=JSON.parse(j.metafile)),j.mangleCache&&(V.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(he(j.writeToStdout).replace(/\n$/,""))},H=(j,V)=>{let G={errors:de(j.errors,A),warnings:de(j.warnings,A)};X(j,G),L(G,C,()=>{if(G.errors.length>0)return V(Re("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!I){let z=!1;I=()=>new Promise((se,Z)=>{if(z||i)throw new Error("Cannot rebuild");P(T,{command:"rebuild",key:x},(te,rt)=>{if(te)return V(Re("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(rt,(De,nt)=>{De?Z(De):se(nt)})})}),T.ref(),I.dispose=()=>{z||(z=!0,P(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=I}if(j.watch){if(!K){let z=!1;T.ref(),K=()=>{z||(z=!0,s.delete(x),P(T,{command:"watch-stop",key:x},()=>{}),T.unref())},g&&s.set(x,(se,Z)=>{if(se){g.onRebuild&&g.onRebuild(se,null);return}let te={errors:de(Z.errors,A),warnings:de(Z.warnings,A)};X(Z,te),L(te,C,()=>{if(te.errors.length>0){g.onRebuild&&g.onRebuild(Re("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=I),te.stop=K,g.onRebuild&&g.onRebuild(null,te)})})}G.stop=K}V(null,G)})};if(b&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(Y&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(g&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');P(T,k,(j,V)=>{if(j)return $(new Error(j),null);if(Q){let G=V,z=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){z||(z=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),$(null,se)}return H(V,$)})};return{readFromStdout:N,afterClose:M,service:{buildOrServe:me,transform:({callName:d,refs:f,input:o,options:p,isTTY:F,fs:B,callback:$})=>{let x=Ye(),A=C=>{try{if(typeof o!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=vt(d,p,F,ae),S={command:"transform",flags:R,inputFS:C!==null,input:C!==null?C:o};L&&(S.mangleCache=L),P(f,S,(T,U)=>{if(T)return $(new Error(T),null);let ee=de(U.errors,x),E=de(U.warnings,x),b=1,w=()=>{if(--b===0){let a={warnings:E,code:U.code,map:U.map};U.mangleCache&&(a.mangleCache=U==null?void 0:U.mangleCache),$(null,a)}};if(ee.length>0)return $(Re("Transform failed",ee,E),null);U.codeFS&&(b++,B.readFile(U.code,(a,v)=>{a!==null?$(a,null):(U.code=v,w())})),U.mapFS&&(b++,B.readFile(U.map,(a,v)=>{a!==null?$(a,null):(U.map=v,w())})),w()})}catch(R){let L=[];try{Ae(L,p,{},F,ae)}catch(T){}let S=ve(R,e,x,void 0,"");P(f,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),$(Re("Transform failed",[S],[]),null)})}};if(typeof o=="string"&&o.length>1024*1024){let C=A;A=()=>B.writeFile(o,C)}A(null)},formatMessages:({callName:d,refs:f,messages:o,options:p,callback:F})=>{let B=be(o,"messages",null,"");if(!p)throw new Error(`Missing second argument in ${d}() call`);let $={},x=n(p,$,"kind",y),A=n(p,$,"color",q),C=n(p,$,"terminalWidth",Oe);if(J(p,$,`in ${d}() call`),x===void 0)throw new Error(`Missing "kind" in ${d}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${d}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};A!==void 0&&(R.color=A),C!==void 0&&(R.terminalWidth=C),P(f,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:d,refs:f,metafile:o,options:p,callback:F})=>{p===void 0&&(p={});let B={},$=n(p,B,"color",q),x=n(p,B,"verbose",q);J(p,B,`in ${d}() call`);let A={command:"analyze-metafile",metafile:o};$!==void 0&&(A.color=$),x!==void 0&&(A.verbose=x),P(f,A,(C,R)=>{if(C)return F(new Error(C),null);F(null,R.result)})}}}}function Ye(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function Me(e,t,r){let s,u=!1;return()=>{if(u)return s;u=!0;try{let i=(e.stack+"").split(`
3
- `);i.splice(1,1);let c=tt(t,i,r);if(c)return s={text:e.message,location:c},s}catch(i){}}}function ve(e,t,r,s,u){let i="Internal error",c=null;try{i=(e&&e.message||e)+""}catch(l){}try{c=tt(t,(e.stack+"").split(`
4
- `),"")}catch(l){}return{pluginName:u,text:i,location:c,notes:s?[s]:[],detail:r?r.store(e):-1}}function tt(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let u=1;u<t.length;u++){let i=t[u];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(c){i=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),c){i=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(i),c){let l;try{l=e.readFileSync(c[1],"utf8")}catch(M){break}let m=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",O=+c[3]-1,N=m.slice(O,O+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:ce(m.slice(0,O)).length,length:ce(m.slice(O,O+N)).length,lineText:m+`
2
+ var Ee=Object.defineProperty,lt=Object.defineProperties,it=Object.getOwnPropertyDescriptor,st=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertyNames,Ie=Object.getOwnPropertySymbols;var Ke=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable;var ze=(e,t,r)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ne=(e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&ze(e,r,t[r]);if(Ie)for(var r of Ie(t))at.call(t,r)&&ze(e,r,t[r]);return e},Fe=(e,t)=>lt(e,st(t));var ut=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},ft=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of ot(t))!Ke.call(e,f)&&f!==r&&Ee(e,f,{get:()=>t[f],enumerable:!(s=it(t,f))||s.enumerable});return e};var ct=e=>ft(Ee({},"__esModule",{value:!0}),e);var ce=(e,t,r)=>new Promise((s,f)=>{var i=g=>{try{l(r.next(g))}catch(O){f(O)}},c=g=>{try{l(r.throw(g))}catch(O){f(O)}},l=g=>g.done?s(g.value):Promise.resolve(g.value).then(i,c);l((r=r.apply(e,t)).next())});var Te={};ut(Te,{analyzeMetafile:()=>Mt,analyzeMetafileSync:()=>Bt,build:()=>xt,buildSync:()=>Ct,default:()=>Nt,formatMessages:()=>$t,formatMessagesSync:()=>At,initialize:()=>Tt,serve:()=>Et,transform:()=>kt,transformSync:()=>Pt,version:()=>St});module.exports=ct(Te);function Le(e){let t=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(de(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 f of s)t(f)}else{let f=Object.keys(s);r.write8(6),r.write32(f.length);for(let i of f)r.write(de(i)),t(s[i])}},r=new ke;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),je(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function _e(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return be(r.read());case 4:return r.read();case 5:{let c=r.read32(),l=[];for(let g=0;g<c;g++)l.push(t());return l}case 6:{let c=r.read32(),l={};for(let g=0;g<c;g++)l[be(r.read())]=t();return l}default:throw new Error("Invalid packet")}},r=new ke(e),s=r.read32(),f=(s&1)===0;s>>>=1;let i=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:s,isRequest:f,value:i}}var ke=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);je(this.buf,t,r)}write(t){let r=this._write(4+t.length);je(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 Ue(this.buf,this._read(4))}read(){let t=this.read32(),r=new Uint8Array(t),s=this._read(r.length);return r.set(this.buf.subarray(s,s+t)),r}},de,be;if(typeof TextEncoder!="undefined"&&typeof TextDecoder!="undefined"){let e=new TextEncoder,t=new TextDecoder;de=r=>e.encode(r),be=r=>t.decode(r)}else if(typeof Buffer!="undefined")de=e=>{let t=Buffer.from(e);return t instanceof Uint8Array||(t=new Uint8Array(t)),t},be=e=>{let{buffer:t,byteOffset:r,byteLength:s}=e;return Buffer.from(t,r,s).toString()};else throw new Error("No UTF-8 codec found");function Ue(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function je(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}function Ve(e){if(e+="",e.indexOf(",")>=0)throw new Error(`Invalid target: ${e}`);return e}var Ce=()=>null,q=e=>typeof e=="boolean"?null:"a boolean",pt=e=>typeof e=="boolean"||typeof e=="object"&&!Array.isArray(e)?null:"a boolean or an object",y=e=>typeof e=="string"?null:"a string",Pe=e=>e instanceof RegExp?null:"a RegExp object",Se=e=>typeof e=="number"&&e===(e|0)?null:"an integer",We=e=>typeof e=="function"?null:"a function",_=e=>Array.isArray(e)?null:"an array",oe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",gt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",mt=e=>typeof e=="object"&&e!==null?null:"an array or an object",Je=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",He=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",yt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",ht=e=>typeof e=="string"||Array.isArray(e)?null:"a string or an array",bt=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array";function n(e,t,r,s){let f=e[r];if(t[r+""]=!0,f===void 0)return;let i=s(f);if(i!==null)throw new Error(`"${r}" must be ${i}`);return f}function J(e,t,r){for(let s in e)if(!(s in t))throw new Error(`Invalid option ${r}: "${s}"`)}function Ge(e){let t=Object.create(null),r=n(e,t,"wasmURL",y),s=n(e,t,"wasmModule",gt),f=n(e,t,"worker",q);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:s,worker:f}}function Xe(e){let t;if(e!==void 0){t=Object.create(null);for(let r of Object.keys(e)){let s=e[r];if(typeof s=="string"||s===!1)t[r]=s;else throw new Error(`Expected ${JSON.stringify(r)} in mangle cache to map to either a string or false`)}}return t}function Ae(e,t,r,s,f){let i=n(t,r,"color",q),c=n(t,r,"logLevel",y),l=n(t,r,"logLimit",Se);i!==void 0?e.push(`--color=${i}`):s&&e.push("--color=true"),e.push(`--log-level=${c||f}`),e.push(`--log-limit=${l||0}`)}function Ze(e,t,r){let s=n(t,r,"legalComments",y),f=n(t,r,"sourceRoot",y),i=n(t,r,"sourcesContent",q),c=n(t,r,"target",ht),l=n(t,r,"format",y),g=n(t,r,"globalName",y),O=n(t,r,"mangleProps",Pe),N=n(t,r,"reserveProps",Pe),$=n(t,r,"mangleQuoted",q),P=n(t,r,"minify",q),W=n(t,r,"minifySyntax",q),ae=n(t,r,"minifyWhitespace",q),re=n(t,r,"minifyIdentifiers",q),ne=n(t,r,"drop",_),le=n(t,r,"charset",y),ie=n(t,r,"treeShaking",q),ge=n(t,r,"ignoreAnnotations",q),ue=n(t,r,"jsx",y),me=n(t,r,"jsxFactory",y),fe=n(t,r,"jsxFragment",y),ye=n(t,r,"define",oe),he=n(t,r,"logOverride",oe),ve=n(t,r,"pure",_),m=n(t,r,"keepNames",q);if(s&&e.push(`--legal-comments=${s}`),f!==void 0&&e.push(`--source-root=${f}`),i!==void 0&&e.push(`--sources-content=${i}`),c&&(Array.isArray(c)?e.push(`--target=${Array.from(c).map(Ve).join(",")}`):e.push(`--target=${Ve(c)}`)),l&&e.push(`--format=${l}`),g&&e.push(`--global-name=${g}`),P&&e.push("--minify"),W&&e.push("--minify-syntax"),ae&&e.push("--minify-whitespace"),re&&e.push("--minify-identifiers"),le&&e.push(`--charset=${le}`),ie!==void 0&&e.push(`--tree-shaking=${ie}`),ge&&e.push("--ignore-annotations"),ne)for(let o of ne)e.push(`--drop:${o}`);if(O&&e.push(`--mangle-props=${O.source}`),N&&e.push(`--reserve-props=${N.source}`),$!==void 0&&e.push(`--mangle-quoted=${$}`),ue&&e.push(`--jsx=${ue}`),me&&e.push(`--jsx-factory=${me}`),fe&&e.push(`--jsx-fragment=${fe}`),ye)for(let o in ye){if(o.indexOf("=")>=0)throw new Error(`Invalid define: ${o}`);e.push(`--define:${o}=${ye[o]}`)}if(he)for(let o in he){if(o.indexOf("=")>=0)throw new Error(`Invalid log override: ${o}`);e.push(`--log-override:${o}=${he[o]}`)}if(ve)for(let o of ve)e.push(`--pure:${o}`);m&&e.push("--keep-names")}function wt(e,t,r,s,f){var w;let i=[],c=[],l=Object.create(null),g=null,O=null,N=null;Ae(i,t,l,r,s),Ze(i,t,l);let $=n(t,l,"sourcemap",He),P=n(t,l,"bundle",q),W=n(t,l,"watch",pt),ae=n(t,l,"splitting",q),re=n(t,l,"preserveSymlinks",q),ne=n(t,l,"metafile",q),le=n(t,l,"outfile",y),ie=n(t,l,"outdir",y),ge=n(t,l,"outbase",y),ue=n(t,l,"platform",y),me=n(t,l,"tsconfig",y),fe=n(t,l,"resolveExtensions",_),ye=n(t,l,"nodePaths",_),he=n(t,l,"mainFields",_),ve=n(t,l,"conditions",_),m=n(t,l,"external",_),o=n(t,l,"loader",oe),a=n(t,l,"outExtension",oe),d=n(t,l,"publicPath",y),F=n(t,l,"entryNames",y),B=n(t,l,"chunkNames",y),M=n(t,l,"assetNames",y),x=n(t,l,"inject",_),A=n(t,l,"banner",oe),C=n(t,l,"footer",oe),R=n(t,l,"entryPoints",mt),L=n(t,l,"absWorkingDir",y),S=n(t,l,"stdin",oe),T=(w=n(t,l,"write",q))!=null?w:f,U=n(t,l,"allowOverwrite",q),ee=n(t,l,"incremental",q)===!0,E=n(t,l,"mangleCache",oe);if(l.plugins=!0,J(t,l,`in ${e}() call`),$&&i.push(`--sourcemap${$===!0?"":`=${$}`}`),P&&i.push("--bundle"),U&&i.push("--allow-overwrite"),W)if(i.push("--watch"),typeof W=="boolean")N={};else{let u=Object.create(null),v=n(W,u,"onRebuild",We);J(W,u,`on "watch" in ${e}() call`),N={onRebuild:v}}if(ae&&i.push("--splitting"),re&&i.push("--preserve-symlinks"),ne&&i.push("--metafile"),le&&i.push(`--outfile=${le}`),ie&&i.push(`--outdir=${ie}`),ge&&i.push(`--outbase=${ge}`),ue&&i.push(`--platform=${ue}`),me&&i.push(`--tsconfig=${me}`),fe){let u=[];for(let v of fe){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid resolve extension: ${v}`);u.push(v)}i.push(`--resolve-extensions=${u.join(",")}`)}if(d&&i.push(`--public-path=${d}`),F&&i.push(`--entry-names=${F}`),B&&i.push(`--chunk-names=${B}`),M&&i.push(`--asset-names=${M}`),he){let u=[];for(let v of he){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid main field: ${v}`);u.push(v)}i.push(`--main-fields=${u.join(",")}`)}if(ve){let u=[];for(let v of ve){if(v+="",v.indexOf(",")>=0)throw new Error(`Invalid condition: ${v}`);u.push(v)}i.push(`--conditions=${u.join(",")}`)}if(m)for(let u of m)i.push(`--external:${u}`);if(A)for(let u in A){if(u.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${u}`);i.push(`--banner:${u}=${A[u]}`)}if(C)for(let u in C){if(u.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${u}`);i.push(`--footer:${u}=${C[u]}`)}if(x)for(let u of x)i.push(`--inject:${u}`);if(o)for(let u in o){if(u.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${u}`);i.push(`--loader:${u}=${o[u]}`)}if(a)for(let u in a){if(u.indexOf("=")>=0)throw new Error(`Invalid out extension: ${u}`);i.push(`--out-extension:${u}=${a[u]}`)}if(R)if(Array.isArray(R))for(let u of R)c.push(["",u+""]);else for(let[u,v]of Object.entries(R))c.push([u+"",v+""]);if(S){let u=Object.create(null),v=n(S,u,"contents",y),Y=n(S,u,"resolveDir",y),h=n(S,u,"sourcefile",y),p=n(S,u,"loader",y);J(S,u,'in "stdin" object'),h&&i.push(`--sourcefile=${h}`),p&&i.push(`--loader=${p}`),Y&&(O=Y+""),g=v?v+"":""}let b=[];if(ye)for(let u of ye)u+="",b.push(u);return{entries:c,flags:i,write:T,stdinContents:g,stdinResolveDir:O,absWorkingDir:L,incremental:ee,nodePaths:b,watch:N,mangleCache:Xe(E)}}function vt(e,t,r,s){let f=[],i=Object.create(null);Ae(f,t,i,r,s),Ze(f,t,i);let c=n(t,i,"sourcemap",He),l=n(t,i,"tsconfigRaw",yt),g=n(t,i,"sourcefile",y),O=n(t,i,"loader",y),N=n(t,i,"banner",y),$=n(t,i,"footer",y),P=n(t,i,"mangleCache",oe);return J(t,i,`in ${e}() call`),c&&f.push(`--sourcemap=${c===!0?"external":c}`),l&&f.push(`--tsconfig-raw=${typeof l=="string"?l:JSON.stringify(l)}`),g&&f.push(`--sourcefile=${g}`),O&&f.push(`--loader=${O}`),N&&f.push(`--banner=${N}`),$&&f.push(`--footer=${$}`),{flags:f,mangleCache:Xe(P)}}function et(e){let t=new Map,r=new Map,s=new Map,f=new Map,i=null,c=0,l=0,g=new Uint8Array(16*1024),O=0,N=m=>{let o=O+m.length;if(o>g.length){let d=new Uint8Array(o*2);d.set(g),g=d}g.set(m,O),O+=m.length;let a=0;for(;a+4<=O;){let d=Ue(g,a);if(a+4+d>O)break;a+=4,ne(g.subarray(a,a+d)),a+=d}a>0&&(g.copyWithin(0,a,O),O-=a)},$=m=>{i={reason:m?": "+(m.message||m):""};let o="The service was stopped"+i.reason;for(let a of t.values())a(o,null);t.clear();for(let a of f.values())a.onWait(o);f.clear();for(let a of s.values())try{a(new Error(o),null)}catch(d){console.error(d)}s.clear()},P=(m,o,a)=>{if(i)return a("The service is no longer running"+i.reason,null);let d=c++;t.set(d,(F,B)=>{try{a(F,B)}finally{m&&m.unref()}}),m&&m.ref(),e.writeToStdin(Le({id:d,isRequest:!0,value:o}))},W=(m,o)=>{if(i)throw new Error("The service is no longer running"+i.reason);e.writeToStdin(Le({id:m,isRequest:!1,value:o}))},ae=(m,o)=>ce(this,null,function*(){try{switch(o.command){case"ping":{W(m,{});break}case"on-start":{let a=r.get(o.key);a?W(m,yield a(o)):W(m,{});break}case"on-resolve":{let a=r.get(o.key);a?W(m,yield a(o)):W(m,{});break}case"on-load":{let a=r.get(o.key);a?W(m,yield a(o)):W(m,{});break}case"serve-request":{let a=f.get(o.key);a&&a.onRequest&&a.onRequest(o.args),W(m,{});break}case"serve-wait":{let a=f.get(o.key);a&&a.onWait(o.error),W(m,{});break}case"watch-rebuild":{let a=s.get(o.key);try{a&&a(null,o.args)}catch(d){console.error(d)}W(m,{});break}default:throw new Error("Invalid command: "+o.command)}}catch(a){W(m,{errors:[Re(a,e,null,void 0,"")]})}}),re=!0,ne=m=>{if(re){re=!1;let a=String.fromCharCode(...m);if(a!=="0.14.42")throw new Error(`Cannot start service: Host version "0.14.42" does not match binary version ${JSON.stringify(a)}`);return}let o=_e(m);if(o.isRequest)ae(o.id,o.value);else{let a=t.get(o.id);t.delete(o.id),o.value.error?a(o.value.error,{}):a(null,o.value)}},le=(m,o,a,d,F)=>ce(this,null,function*(){let B=[],M=[],x={},A={},C=0,R=0,L=[],S=!1;o=[...o];for(let E of o){let b={};if(typeof E!="object")throw new Error(`Plugin at index ${R} must be an object`);let w=n(E,b,"name",y);if(typeof w!="string"||w==="")throw new Error(`Plugin at index ${R} is missing a name`);try{let u=n(E,b,"setup",We);if(typeof u!="function")throw new Error("Plugin is missing a setup function");J(E,b,`on plugin ${JSON.stringify(w)}`);let v={name:w,onResolve:[],onLoad:[]};R++;let h=u({initialOptions:m,resolve:(p,D={})=>{if(!S)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof p!="string")throw new Error("The path to resolve must be a string");let k=Object.create(null),Q=n(D,k,"pluginName",y),I=n(D,k,"importer",y),K=n(D,k,"namespace",y),X=n(D,k,"resolveDir",y),H=n(D,k,"kind",y),j=n(D,k,"pluginData",Ce);return J(D,k,"in resolve() call"),new Promise((V,G)=>{let z={command:"resolve",path:p,key:a,pluginName:w};Q!=null&&(z.pluginName=Q),I!=null&&(z.importer=I),K!=null&&(z.namespace=K),X!=null&&(z.resolveDir=X),H!=null&&(z.kind=H),j!=null&&(z.pluginData=d.store(j)),P(F,z,(se,Z)=>{se!==null?G(new Error(se)):V({errors:pe(Z.errors,d),warnings:pe(Z.warnings,d),path:Z.path,external:Z.external,sideEffects:Z.sideEffects,namespace:Z.namespace,suffix:Z.suffix,pluginData:d.load(Z.pluginData)})})})},onStart(p){let D='This error came from the "onStart" callback registered here:',k=$e(new Error(D),e,"onStart");B.push({name:w,callback:p,note:k})},onEnd(p){let D='This error came from the "onEnd" callback registered here:',k=$e(new Error(D),e,"onEnd");M.push({name:w,callback:p,note:k})},onResolve(p,D){let k='This error came from the "onResolve" callback registered here:',Q=$e(new Error(k),e,"onResolve"),I={},K=n(p,I,"filter",Pe),X=n(p,I,"namespace",y);if(J(p,I,`in onResolve() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onResolve() call is missing a filter");let H=C++;x[H]={name:w,callback:D,note:Q},v.onResolve.push({id:H,filter:K.source,namespace:X||""})},onLoad(p,D){let k='This error came from the "onLoad" callback registered here:',Q=$e(new Error(k),e,"onLoad"),I={},K=n(p,I,"filter",Pe),X=n(p,I,"namespace",y);if(J(p,I,`in onLoad() call for plugin ${JSON.stringify(w)}`),K==null)throw new Error("onLoad() call is missing a filter");let H=C++;A[H]={name:w,callback:D,note:Q},v.onLoad.push({id:H,filter:K.source,namespace:X||""})},esbuild:e.esbuild});h&&(yield h),L.push(v)}catch(u){return{ok:!1,error:u,pluginName:w}}}let T=E=>ce(this,null,function*(){switch(E.command){case"on-start":{let b={errors:[],warnings:[]};return yield Promise.all(B.map(Y=>ce(this,[Y],function*({name:w,callback:u,note:v}){try{let h=yield u();if(h!=null){if(typeof h!="object")throw new Error(`Expected onStart() callback in plugin ${JSON.stringify(w)} to return an object`);let p={},D=n(h,p,"errors",_),k=n(h,p,"warnings",_);J(h,p,`from onStart() callback in plugin ${JSON.stringify(w)}`),D!=null&&b.errors.push(...we(D,"errors",d,w)),k!=null&&b.warnings.push(...we(k,"warnings",d,w))}}catch(h){b.errors.push(Re(h,e,d,v&&v(),w))}}))),b}case"on-resolve":{let b={},w="",u,v;for(let Y of E.ids)try{({name:w,callback:u,note:v}=x[Y]);let h=yield u({path:E.path,importer:E.importer,namespace:E.namespace,resolveDir:E.resolveDir,kind:E.kind,pluginData:d.load(E.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onResolve() callback in plugin ${JSON.stringify(w)} to return an object`);let p={},D=n(h,p,"pluginName",y),k=n(h,p,"path",y),Q=n(h,p,"namespace",y),I=n(h,p,"suffix",y),K=n(h,p,"external",q),X=n(h,p,"sideEffects",q),H=n(h,p,"pluginData",Ce),j=n(h,p,"errors",_),V=n(h,p,"warnings",_),G=n(h,p,"watchFiles",_),z=n(h,p,"watchDirs",_);J(h,p,`from onResolve() callback in plugin ${JSON.stringify(w)}`),b.id=Y,D!=null&&(b.pluginName=D),k!=null&&(b.path=k),Q!=null&&(b.namespace=Q),I!=null&&(b.suffix=I),K!=null&&(b.external=K),X!=null&&(b.sideEffects=X),H!=null&&(b.pluginData=d.store(H)),j!=null&&(b.errors=we(j,"errors",d,w)),V!=null&&(b.warnings=we(V,"warnings",d,w)),G!=null&&(b.watchFiles=Me(G,"watchFiles")),z!=null&&(b.watchDirs=Me(z,"watchDirs"));break}}catch(h){return{id:Y,errors:[Re(h,e,d,v&&v(),w)]}}return b}case"on-load":{let b={},w="",u,v;for(let Y of E.ids)try{({name:w,callback:u,note:v}=A[Y]);let h=yield u({path:E.path,namespace:E.namespace,suffix:E.suffix,pluginData:d.load(E.pluginData)});if(h!=null){if(typeof h!="object")throw new Error(`Expected onLoad() callback in plugin ${JSON.stringify(w)} to return an object`);let p={},D=n(h,p,"pluginName",y),k=n(h,p,"contents",bt),Q=n(h,p,"resolveDir",y),I=n(h,p,"pluginData",Ce),K=n(h,p,"loader",y),X=n(h,p,"errors",_),H=n(h,p,"warnings",_),j=n(h,p,"watchFiles",_),V=n(h,p,"watchDirs",_);J(h,p,`from onLoad() callback in plugin ${JSON.stringify(w)}`),b.id=Y,D!=null&&(b.pluginName=D),k instanceof Uint8Array?b.contents=k:k!=null&&(b.contents=de(k)),Q!=null&&(b.resolveDir=Q),I!=null&&(b.pluginData=d.store(I)),K!=null&&(b.loader=K),X!=null&&(b.errors=we(X,"errors",d,w)),H!=null&&(b.warnings=we(H,"warnings",d,w)),j!=null&&(b.watchFiles=Me(j,"watchFiles")),V!=null&&(b.watchDirs=Me(V,"watchDirs"));break}}catch(h){return{id:Y,errors:[Re(h,e,d,v&&v(),w)]}}return b}default:throw new Error("Invalid command: "+E.command)}}),U=(E,b,w)=>w();M.length>0&&(U=(E,b,w)=>{(()=>ce(this,null,function*(){for(let{name:u,callback:v,note:Y}of M)try{yield v(E)}catch(h){E.errors.push(yield new Promise(p=>b(h,u,Y&&Y(),p)))}}))().then(w)}),S=!0;let ee=0;return{ok:!0,requestPlugins:L,runOnEndCallbacks:U,pluginRefs:{ref(){++ee===1&&r.set(a,T)},unref(){--ee===0&&r.delete(a)}}}}),ie=(m,o,a,d)=>{let F={},B=n(o,F,"port",Se),M=n(o,F,"host",y),x=n(o,F,"servedir",y),A=n(o,F,"onRequest",We),C,R=new Promise((L,S)=>{C=T=>{f.delete(d),T!==null?S(new Error(T)):L()}});return a.serve={},J(o,F,"in serve() call"),B!==void 0&&(a.serve.port=B),M!==void 0&&(a.serve.host=M),x!==void 0&&(a.serve.servedir=x),f.set(d,{onRequest:A,onWait:C}),{wait:R,stop(){P(m,{command:"serve-stop",key:d},()=>{})}}},ge="warning",ue="silent",me=m=>{let o=l++,a=Ye(),d,{refs:F,options:B,isTTY:M,callback:x}=m;if(typeof B=="object"){let R=B.plugins;if(R!==void 0){if(!Array.isArray(R))throw new Error('"plugins" must be an array');d=R}}let A=(R,L,S,T)=>{let U=[];try{Ae(U,B,{},M,ge)}catch(E){}let ee=Re(R,e,a,S,L);P(F,{command:"error",flags:U,error:ee},()=>{ee.detail=a.load(ee.detail),T(ee)})},C=(R,L)=>{A(R,L,void 0,S=>{x(Oe("Build failed",[S],[]),null)})};if(d&&d.length>0){if(e.isSync)return C(new Error("Cannot use plugins in synchronous API calls"),"");le(B,d,o,a,F).then(R=>{if(!R.ok)C(R.error,R.pluginName);else try{fe(Fe(Ne({},m),{key:o,details:a,logPluginError:A,requestPlugins:R.requestPlugins,runOnEndCallbacks:R.runOnEndCallbacks,pluginRefs:R.pluginRefs}))}catch(L){C(L,"")}},R=>C(R,""))}else try{fe(Fe(Ne({},m),{key:o,details:a,logPluginError:A,requestPlugins:null,runOnEndCallbacks:(R,L,S)=>S(),pluginRefs:null}))}catch(R){C(R,"")}},fe=({callName:m,refs:o,serveOptions:a,options:d,isTTY:F,defaultWD:B,callback:M,key:x,details:A,logPluginError:C,requestPlugins:R,runOnEndCallbacks:L,pluginRefs:S})=>{let T={ref(){S&&S.ref(),o&&o.ref()},unref(){S&&S.unref(),o&&o.unref()}},U=!e.isBrowser,{entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:u,absWorkingDir:v,incremental:Y,nodePaths:h,watch:p,mangleCache:D}=wt(m,d,F,ge,U),k={command:"build",key:x,entries:ee,flags:E,write:b,stdinContents:w,stdinResolveDir:u,absWorkingDir:v||B,incremental:Y,nodePaths:h};R&&(k.plugins=R),D&&(k.mangleCache=D);let Q=a&&ie(T,a,k,x),I,K,X=(j,V)=>{j.outputFiles&&(V.outputFiles=j.outputFiles.map(Rt)),j.metafile&&(V.metafile=JSON.parse(j.metafile)),j.mangleCache&&(V.mangleCache=j.mangleCache),j.writeToStdout!==void 0&&console.log(be(j.writeToStdout).replace(/\n$/,""))},H=(j,V)=>{let G={errors:pe(j.errors,A),warnings:pe(j.warnings,A)};X(j,G),L(G,C,()=>{if(G.errors.length>0)return V(Oe("Build failed",G.errors,G.warnings),null);if(j.rebuild){if(!I){let z=!1;I=()=>new Promise((se,Z)=>{if(z||i)throw new Error("Cannot rebuild");P(T,{command:"rebuild",key:x},(te,rt)=>{if(te)return V(Oe("Build failed",[{pluginName:"",text:te,location:null,notes:[],detail:void 0}],[]),null);H(rt,(De,nt)=>{De?Z(De):se(nt)})})}),T.ref(),I.dispose=()=>{z||(z=!0,P(T,{command:"rebuild-dispose",key:x},()=>{}),T.unref())}}G.rebuild=I}if(j.watch){if(!K){let z=!1;T.ref(),K=()=>{z||(z=!0,s.delete(x),P(T,{command:"watch-stop",key:x},()=>{}),T.unref())},p&&s.set(x,(se,Z)=>{if(se){p.onRebuild&&p.onRebuild(se,null);return}let te={errors:pe(Z.errors,A),warnings:pe(Z.warnings,A)};X(Z,te),L(te,C,()=>{if(te.errors.length>0){p.onRebuild&&p.onRebuild(Oe("Build failed",te.errors,te.warnings),null);return}Z.rebuildID!==void 0&&(te.rebuild=I),te.stop=K,p.onRebuild&&p.onRebuild(null,te)})})}G.stop=K}V(null,G)})};if(b&&e.isBrowser)throw new Error('Cannot enable "write" in the browser');if(Y&&e.isSync)throw new Error('Cannot use "incremental" with a synchronous build');if(p&&e.isSync)throw new Error('Cannot use "watch" with a synchronous build');P(T,k,(j,V)=>{if(j)return M(new Error(j),null);if(Q){let G=V,z=!1;T.ref();let se={port:G.port,host:G.host,wait:Q.wait,stop(){z||(z=!0,Q.stop(),T.unref())}};return T.ref(),Q.wait.then(T.unref,T.unref),M(null,se)}return H(V,M)})};return{readFromStdout:N,afterClose:$,service:{buildOrServe:me,transform:({callName:m,refs:o,input:a,options:d,isTTY:F,fs:B,callback:M})=>{let x=Ye(),A=C=>{try{if(typeof a!="string")throw new Error('The input to "transform" must be a string');let{flags:R,mangleCache:L}=vt(m,d,F,ue),S={command:"transform",flags:R,inputFS:C!==null,input:C!==null?C:a};L&&(S.mangleCache=L),P(o,S,(T,U)=>{if(T)return M(new Error(T),null);let ee=pe(U.errors,x),E=pe(U.warnings,x),b=1,w=()=>{if(--b===0){let u={warnings:E,code:U.code,map:U.map};U.mangleCache&&(u.mangleCache=U==null?void 0:U.mangleCache),M(null,u)}};if(ee.length>0)return M(Oe("Transform failed",ee,E),null);U.codeFS&&(b++,B.readFile(U.code,(u,v)=>{u!==null?M(u,null):(U.code=v,w())})),U.mapFS&&(b++,B.readFile(U.map,(u,v)=>{u!==null?M(u,null):(U.map=v,w())})),w()})}catch(R){let L=[];try{Ae(L,d,{},F,ue)}catch(T){}let S=Re(R,e,x,void 0,"");P(o,{command:"error",flags:L,error:S},()=>{S.detail=x.load(S.detail),M(Oe("Transform failed",[S],[]),null)})}};if(typeof a=="string"&&a.length>1024*1024){let C=A;A=()=>B.writeFile(a,C)}A(null)},formatMessages:({callName:m,refs:o,messages:a,options:d,callback:F})=>{let B=we(a,"messages",null,"");if(!d)throw new Error(`Missing second argument in ${m}() call`);let M={},x=n(d,M,"kind",y),A=n(d,M,"color",q),C=n(d,M,"terminalWidth",Se);if(J(d,M,`in ${m}() call`),x===void 0)throw new Error(`Missing "kind" in ${m}() call`);if(x!=="error"&&x!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${m}() call`);let R={command:"format-msgs",messages:B,isWarning:x==="warning"};A!==void 0&&(R.color=A),C!==void 0&&(R.terminalWidth=C),P(o,R,(L,S)=>{if(L)return F(new Error(L),null);F(null,S.messages)})},analyzeMetafile:({callName:m,refs:o,metafile:a,options:d,callback:F})=>{d===void 0&&(d={});let B={},M=n(d,B,"color",q),x=n(d,B,"verbose",q);J(d,B,`in ${m}() call`);let A={command:"analyze-metafile",metafile:a};M!==void 0&&(A.color=M),x!==void 0&&(A.verbose=x),P(o,A,(C,R)=>{if(C)return F(new Error(C),null);F(null,R.result)})}}}}function Ye(){let e=new Map,t=0;return{load(r){return e.get(r)},store(r){if(r===void 0)return-1;let s=t++;return e.set(s,r),s}}}function $e(e,t,r){let s,f=!1;return()=>{if(f)return s;f=!0;try{let i=(e.stack+"").split(`
3
+ `);i.splice(1,1);let c=tt(t,i,r);if(c)return s={text:e.message,location:c},s}catch(i){}}}function Re(e,t,r,s,f){let i="Internal error",c=null;try{i=(e&&e.message||e)+""}catch(l){}try{c=tt(t,(e.stack+"").split(`
4
+ `),"")}catch(l){}return{pluginName:f,text:i,location:c,notes:s?[s]:[],detail:r?r.store(e):-1}}function tt(e,t,r){let s=" at ";if(e.readFileSync&&!t[0].startsWith(s)&&t[1].startsWith(s))for(let f=1;f<t.length;f++){let i=t[f];if(!!i.startsWith(s))for(i=i.slice(s.length);;){let c=/^(?:new |async )?\S+ \((.*)\)$/.exec(i);if(c){i=c[1];continue}if(c=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(i),c){i=c[1];continue}if(c=/^(\S+):(\d+):(\d+)$/.exec(i),c){let l;try{l=e.readFileSync(c[1],"utf8")}catch($){break}let g=l.split(/\r\n|\r|\n|\u2028|\u2029/)[+c[2]-1]||"",O=+c[3]-1,N=g.slice(O,O+r.length)===r?r.length:0;return{file:c[1],namespace:"file",line:+c[2],column:de(g.slice(0,O)).length,length:de(g.slice(O,O+N)).length,lineText:g+`
5
5
  `+t.slice(1).join(`
6
- `),suggestion:""}}break}}return null}function Re(e,t,r){let s=5,u=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((c,l)=>{if(l===s)return`
6
+ `),suggestion:""}}break}}return null}function Oe(e,t,r){let s=5,f=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,s+1).map((c,l)=>{if(l===s)return`
7
7
  ...`;if(!c.location)return`
8
- error: ${c.text}`;let{file:m,line:O,column:N}=c.location,M=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
9
- ${m}:${O}:${N}: ERROR: ${M}${c.text}`}).join(""),i=new Error(`${e}${u}`);return i.errors=t,i.warnings=r,i}function de(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",y),u=n(e,r,"namespace",y),i=n(e,r,"line",Oe),c=n(e,r,"column",Oe),l=n(e,r,"length",Oe),m=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return J(e,r,t),{file:s||"",namespace:u||"",line:i||0,column:c||0,length:l||0,lineText:m||"",suggestion:O||""}}function be(e,t,r,s){let u=[],i=0;for(let c of e){let l={},m=n(c,l,"pluginName",y),O=n(c,l,"text",y),N=n(c,l,"location",Je),M=n(c,l,"notes",_),P=n(c,l,"detail",Ce),W=`in element ${i} of "${t}"`;J(c,l,W);let oe=[];if(M)for(let re of M){let ne={},le=n(re,ne,"text",y),ie=n(re,ne,"location",Je);J(re,ne,W),oe.push({text:le||"",location:Qe(ie,W)})}u.push({pluginName:m||s,text:O||"",location:Qe(N,W),notes:oe,detail:r?r.store(P):-1}),i++}return u}function $e(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function Rt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=he(t)),r}}}var St="0.14.39",xt=e=>Be().build(e),Et=()=>{throw new Error('The "serve" API only works in node')},kt=(e,t)=>Be().transform(e,t),Mt=(e,t)=>Be().formatMessages(e,t),$t=(e,t)=>Be().analyzeMetafile(e,t),Ct=()=>{throw new Error('The "buildSync" API only works in node')},Pt=()=>{throw new Error('The "transformSync" API only works in node')},At=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},Se,qe,Be=()=>{if(qe)return qe;throw Se?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')},Tt=e=>{e=Ge(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(Se)throw new Error('Cannot call "initialize" more than once');return Se=Dt(t||"",r,s),Se.catch(()=>{Se=void 0}),Se},Dt=(e,t,r)=>fe(void 0,null,function*(){let s;if(t)s=t;else{let l=yield fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=yield l.arrayBuffer()}let u;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.14.39"],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"});u=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
8
+ error: ${c.text}`;let{file:g,line:O,column:N}=c.location,$=c.pluginName?`[plugin: ${c.pluginName}] `:"";return`
9
+ ${g}:${O}:${N}: ERROR: ${$}${c.text}`}).join(""),i=new Error(`${e}${f}`);return i.errors=t,i.warnings=r,i}function pe(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Qe(e,t){if(e==null)return null;let r={},s=n(e,r,"file",y),f=n(e,r,"namespace",y),i=n(e,r,"line",Se),c=n(e,r,"column",Se),l=n(e,r,"length",Se),g=n(e,r,"lineText",y),O=n(e,r,"suggestion",y);return J(e,r,t),{file:s||"",namespace:f||"",line:i||0,column:c||0,length:l||0,lineText:g||"",suggestion:O||""}}function we(e,t,r,s){let f=[],i=0;for(let c of e){let l={},g=n(c,l,"pluginName",y),O=n(c,l,"text",y),N=n(c,l,"location",Je),$=n(c,l,"notes",_),P=n(c,l,"detail",Ce),W=`in element ${i} of "${t}"`;J(c,l,W);let ae=[];if($)for(let re of $){let ne={},le=n(re,ne,"text",y),ie=n(re,ne,"location",Je);J(re,ne,W),ae.push({text:le||"",location:Qe(ie,W)})}f.push({pluginName:g||s,text:O||"",location:Qe(N,W),notes:ae,detail:r?r.store(P):-1}),i++}return f}function Me(e,t){let r=[];for(let s of e){if(typeof s!="string")throw new Error(`${JSON.stringify(t)} must be an array of strings`);r.push(s)}return r}function Rt({path:e,contents:t}){let r=null;return{path:e,contents:t,get text(){return r===null&&(r=be(t)),r}}}var St="0.14.42",xt=e=>Be().build(e),Et=()=>{throw new Error('The "serve" API only works in node')},kt=(e,t)=>Be().transform(e,t),$t=(e,t)=>Be().formatMessages(e,t),Mt=(e,t)=>Be().analyzeMetafile(e,t),Ct=()=>{throw new Error('The "buildSync" API only works in node')},Pt=()=>{throw new Error('The "transformSync" API only works in node')},At=()=>{throw new Error('The "formatMessagesSync" API only works in node')},Bt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},xe,qe,Be=()=>{if(qe)return qe;throw xe?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')},Tt=e=>{e=Ge(e||{});let t=e.wasmURL,r=e.wasmModule,s=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(xe)throw new Error('Cannot call "initialize" more than once');return xe=Dt(t||"",r,s),xe.catch(()=>{xe=void 0}),xe},Dt=(e,t,r)=>ce(void 0,null,function*(){let s;if(t)s=t;else{let l=yield fetch(e);if(!l.ok)throw new Error(`Failed to download ${JSON.stringify(e)}`);s=yield l.arrayBuffer()}let f;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.14.42"],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"});f=new Worker(URL.createObjectURL(l))}else{let l=(postMessage=>{
10
10
  // Copyright 2018 The Go Authors. All rights reserved.
11
11
  // Use of this source code is governed by a BSD-style
12
12
  // license that can be found in the LICENSE file.
13
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
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
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.14.39"],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);})(m=>u.onmessage({data:m}));u={onmessage:null,postMessage:m=>setTimeout(()=>l({data:m})),terminate(){}}}u.postMessage(s),u.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:c}=et({writeToStdin(l){u.postMessage(l)},isSync:!1,isBrowser:!0,esbuild:Te});qe={build:l=>new Promise((m,O)=>c.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,M)=>N?O(N):m(M)})),transform:(l,m)=>new Promise((O,N)=>c.transform({callName:"transform",refs:null,input:l,options:m||{},isTTY:!1,fs:{readFile(M,P){P(new Error("Internal error"),null)},writeFile(M,P){P(null)}},callback:(M,P)=>M?N(M):O(P)})),formatMessages:(l,m)=>new Promise((O,N)=>c.formatMessages({callName:"formatMessages",refs:null,messages:l,options:m,callback:(M,P)=>M?N(M):O(P)})),analyzeMetafile:(l,m)=>new Promise((O,N)=>c.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:m,callback:(M,P)=>M?N(M):O(P)}))}}),Nt=Te;
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.14.42"],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);})(g=>f.onmessage({data:g}));f={onmessage:null,postMessage:g=>setTimeout(()=>l({data:g})),terminate(){}}}f.postMessage(s),f.onmessage=({data:l})=>i(l);let{readFromStdout:i,service:c}=et({writeToStdin(l){f.postMessage(l)},isSync:!1,isBrowser:!0,esbuild:Te});qe={build:l=>new Promise((g,O)=>c.buildOrServe({callName:"build",refs:null,serveOptions:null,options:l,isTTY:!1,defaultWD:"/",callback:(N,$)=>N?O(N):g($)})),transform:(l,g)=>new Promise((O,N)=>c.transform({callName:"transform",refs:null,input:l,options:g||{},isTTY:!1,fs:{readFile($,P){P(new Error("Internal error"),null)},writeFile($,P){P(null)}},callback:($,P)=>$?N($):O(P)})),formatMessages:(l,g)=>new Promise((O,N)=>c.formatMessages({callName:"formatMessages",refs:null,messages:l,options:g,callback:($,P)=>$?N($):O(P)})),analyzeMetafile:(l,g)=>new Promise((O,N)=>c.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof l=="string"?l:JSON.stringify(l),options:g,callback:($,P)=>$?N($):O(P)}))}}),Nt=Te;
17
17
  })(typeof module==="object"?module:{set exports(x){(typeof self!=="undefined"?self:this).esbuild=x}});
@@ -67,6 +67,8 @@ interface CommonOptions {
67
67
  logLevel?: LogLevel;
68
68
  /** Documentation: https://esbuild.github.io/api/#log-limit */
69
69
  logLimit?: number;
70
+ /** Documentation: https://esbuild.github.io/api/#log-override */
71
+ logOverride?: Record<string, LogLevel>;
70
72
  }
71
73
 
72
74
  export interface BuildOptions extends CommonOptions {
@@ -318,6 +318,7 @@ function pushCommonFlags(flags, options, keys) {
318
318
  let jsxFactory = getFlag(options, keys, "jsxFactory", mustBeString);
319
319
  let jsxFragment = getFlag(options, keys, "jsxFragment", mustBeString);
320
320
  let define = getFlag(options, keys, "define", mustBeObject);
321
+ let logOverride = getFlag(options, keys, "logOverride", mustBeObject);
321
322
  let pure = getFlag(options, keys, "pure", mustBeArray);
322
323
  let keepNames = getFlag(options, keys, "keepNames", mustBeBoolean);
323
324
  if (legalComments)
@@ -372,6 +373,13 @@ function pushCommonFlags(flags, options, keys) {
372
373
  flags.push(`--define:${key}=${define[key]}`);
373
374
  }
374
375
  }
376
+ if (logOverride) {
377
+ for (let key in logOverride) {
378
+ if (key.indexOf("=") >= 0)
379
+ throw new Error(`Invalid log override: ${key}`);
380
+ flags.push(`--log-override:${key}=${logOverride[key]}`);
381
+ }
382
+ }
375
383
  if (pure)
376
384
  for (let fn of pure)
377
385
  flags.push(`--pure:${fn}`);
@@ -746,8 +754,8 @@ function createChannel(streamIn) {
746
754
  if (isFirstPacket) {
747
755
  isFirstPacket = false;
748
756
  let binaryVersion = String.fromCharCode(...bytes);
749
- if (binaryVersion !== "0.14.39") {
750
- throw new Error(`Cannot start service: Host version "${"0.14.39"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
757
+ if (binaryVersion !== "0.14.42") {
758
+ throw new Error(`Cannot start service: Host version "${"0.14.42"}" does not match binary version ${JSON.stringify(binaryVersion)}`);
751
759
  }
752
760
  return;
753
761
  }
@@ -1859,7 +1867,7 @@ if (process.env.ESBUILD_WORKER_THREADS !== "0") {
1859
1867
  }
1860
1868
  }
1861
1869
  var _a;
1862
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.39";
1870
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.14.42";
1863
1871
  var esbuildCommandAndArgs = () => {
1864
1872
  if ((!ESBUILD_BINARY_PATH || true) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
1865
1873
  throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
@@ -1923,7 +1931,7 @@ var fsAsync = {
1923
1931
  }
1924
1932
  }
1925
1933
  };
1926
- var version = "0.14.39";
1934
+ var version = "0.14.42";
1927
1935
  var build = (options) => ensureServiceIsRunning().build(options);
1928
1936
  var serve = (serveOptions, buildOptions) => ensureServiceIsRunning().serve(serveOptions, buildOptions);
1929
1937
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2032,7 +2040,7 @@ var ensureServiceIsRunning = () => {
2032
2040
  if (longLivedService)
2033
2041
  return longLivedService;
2034
2042
  let [command, args] = esbuildCommandAndArgs();
2035
- let child = child_process.spawn(command, args.concat(`--service=${"0.14.39"}`, "--ping"), {
2043
+ let child = child_process.spawn(command, args.concat(`--service=${"0.14.42"}`, "--ping"), {
2036
2044
  windowsHide: true,
2037
2045
  stdio: ["pipe", "pipe", "inherit"],
2038
2046
  cwd: defaultWD
@@ -2146,7 +2154,7 @@ var runServiceSync = (callback) => {
2146
2154
  esbuild: node_exports
2147
2155
  });
2148
2156
  callback(service);
2149
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.39"}`), {
2157
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.14.42"}`), {
2150
2158
  cwd: defaultWD,
2151
2159
  windowsHide: true,
2152
2160
  input: stdin,
@@ -2162,7 +2170,7 @@ var workerThreadService = null;
2162
2170
  var startWorkerThreadService = (worker_threads2) => {
2163
2171
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2164
2172
  let worker = new worker_threads2.Worker(__filename, {
2165
- workerData: { workerPort, defaultWD, esbuildVersion: "0.14.39" },
2173
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.14.42" },
2166
2174
  transferList: [workerPort],
2167
2175
  execArgv: []
2168
2176
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esbuild-wasm",
3
- "version": "0.14.39",
3
+ "version": "0.14.42",
4
4
  "description": "The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.",
5
5
  "repository": "https://github.com/evanw/esbuild",
6
6
  "license": "MIT",
data/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/isomorfeus/isomorfeus-asset-manager",
6
6
  "dependencies": {
7
- "esbuild-wasm": "0.14.39"
7
+ "esbuild-wasm": "0.14.42"
8
8
  }
9
9
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.23
4
+ version: 0.14.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.49
33
+ version: 0.7.50
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.7.49
40
+ version: 0.7.50
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isomorfeus-speednode
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.13.11
75
+ version: 3.13.13
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.13.11
82
+ version: 3.13.13
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: opal
85
85
  requirement: !ruby/object:Gem::Requirement