var re = Object.defineProperty;
var ne = (s, e, A) => e in s ? re(s, e, { enumerable: !0, configurable: !0, writable: !0, value: A }) : s[e] = A;
var fA = (s, e, A) => ne(s, typeof e != "symbol" ? e + "" : e, A);
import * as vscode from "vscode";
import { EventEmitter } from "vscode";
import require$$2 from "path";
import { MetricReporter, Feature, getMachineId, updateResolvedIDESetting, authProvider, addPrivacyHeadersMiddleware, addAgentModeHeadersMiddleware, addExternalIdpTokenTypeMiddleware, addRedirectForInternalMiddleware, AccessDeniedError } from "@kiro/shared";
import { TelemetryNamespace } from "@kiro/shared-types";
import "node:fs";
import * as path from "node:path";
import { CodeWhispererRuntime, GenerateCompletionsCommand, AccessDeniedException, ThrottlingException, ValidationException } from "@amzn/codewhisperer-runtime";
import * as https from "https";
import https__default from "https";
import require$$0$1 from "os";
import require$$1$1 from "fs";
import require$$1 from "child_process";
import require$$4 from "util";
import require$$6 from "http";
import require$$0$2 from "net";
var byteToHex = [];
for (var i = 0; i < 256; ++i)
  byteToHex.push((i + 256).toString(16).slice(1));
function unsafeStringify(s, e = 0) {
  return (byteToHex[s[e + 0]] + byteToHex[s[e + 1]] + byteToHex[s[e + 2]] + byteToHex[s[e + 3]] + "-" + byteToHex[s[e + 4]] + byteToHex[s[e + 5]] + "-" + byteToHex[s[e + 6]] + byteToHex[s[e + 7]] + "-" + byteToHex[s[e + 8]] + byteToHex[s[e + 9]] + "-" + byteToHex[s[e + 10]] + byteToHex[s[e + 11]] + byteToHex[s[e + 12]] + byteToHex[s[e + 13]] + byteToHex[s[e + 14]] + byteToHex[s[e + 15]]).toLowerCase();
}
var getRandomValues, rnds8 = new Uint8Array(16);
function rng() {
  if (!getRandomValues && (getRandomValues = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !getRandomValues))
    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
  return getRandomValues(rnds8);
}
var randomUUID = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
const native = {
  randomUUID
};
function v4(s, e, A) {
  if (native.randomUUID && !s)
    return native.randomUUID();
  s = s || {};
  var g = s.random || (s.rng || rng)();
  return g[6] = g[6] & 15 | 64, g[8] = g[8] & 63 | 128, unsafeStringify(g);
}
const Typescript = {
  name: "TypeScript",
  topLevelKeywords: ["function", "class", "module", "export", "import"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Python = {
  name: "Python",
  // """"#" is for .ipynb files, where we add '"""' surrounding markdown blocks.
  // This stops the model from trying to complete the start of a new markdown block
  topLevelKeywords: ["def", "class", '"""#'],
  singleLineComment: "#",
  endOfLine: []
}, Java = {
  name: "Java",
  topLevelKeywords: ["class", "function"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Cpp = {
  name: "C++",
  topLevelKeywords: ["class", "namespace", "template"],
  singleLineComment: "//",
  endOfLine: [";"]
}, CSharp = {
  name: "C#",
  topLevelKeywords: ["class", "namespace", "void"],
  singleLineComment: "//",
  endOfLine: [";"]
}, C$1 = {
  name: "C",
  topLevelKeywords: ["if", "else", "while", "for", "switch", "case"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Scala = {
  name: "Scala",
  topLevelKeywords: ["def", "val", "var", "class", "object", "trait"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Go = {
  name: "Go",
  topLevelKeywords: ["func", "package", "import", "type"],
  singleLineComment: "//",
  endOfLine: []
}, Rust = {
  name: "Rust",
  topLevelKeywords: ["fn", "mod", "pub", "struct", "enum", "trait"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Haskell = {
  name: "Haskell",
  topLevelKeywords: ["data", "type", "newtype", "class", "instance", "let", "in", "where"],
  singleLineComment: "--",
  endOfLine: []
}, PHP = {
  name: "PHP",
  topLevelKeywords: ["function", "class", "namespace", "use"],
  singleLineComment: "//",
  endOfLine: [";"]
}, RubyOnRails = {
  name: "Ruby on Rails",
  topLevelKeywords: ["def", "class", "module"],
  singleLineComment: "#",
  endOfLine: []
}, Swift = {
  name: "Swift",
  topLevelKeywords: ["func", "class", "struct", "import"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Kotlin = {
  name: "Kotlin",
  topLevelKeywords: ["fun", "class", "package", "import"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Ruby = {
  name: "Ruby",
  topLevelKeywords: ["class", "module", "def"],
  singleLineComment: "#",
  endOfLine: []
}, Clojure = {
  name: "Clojure",
  topLevelKeywords: ["def", "fn", "let", "do", "if", "defn", "ns", "defmacro"],
  singleLineComment: ";",
  endOfLine: []
}, Julia = {
  name: "Julia",
  topLevelKeywords: ["function", "macro", "if", "else", "elseif", "while", "for", "begin", "end", "module"],
  singleLineComment: "#",
  endOfLine: [";"]
}, FSharp = {
  name: "F#",
  topLevelKeywords: ["let", "type", "module", "namespace", "open", "if", "then", "else", "match", "with"],
  singleLineComment: "//",
  endOfLine: []
}, R = {
  name: "R",
  topLevelKeywords: ["function", "if", "else", "for", "while", "repeat", "library", "require"],
  singleLineComment: "#",
  endOfLine: []
}, Dart = {
  name: "Dart",
  topLevelKeywords: ["class", "import", "void", "enum"],
  singleLineComment: "//",
  endOfLine: [";"]
}, Solidity = {
  name: "Solidity",
  topLevelKeywords: [
    "contract",
    "event",
    "modifier",
    "function",
    "constructor",
    "for",
    "require",
    "emit",
    "interface",
    "error",
    "library",
    "struct",
    "enum",
    "type"
  ],
  singleLineComment: "//",
  endOfLine: [";"]
}, YAML = {
  name: "YAML",
  topLevelKeywords: [],
  singleLineComment: "#",
  endOfLine: [],
  lineFilters: [
    // Only display one list item at a time
    async function* ({ lines: s, fullStop: e }) {
      let A = !1;
      for await (const g of s)
        if (g.trim().startsWith("- ")) {
          if (A) {
            e();
            break;
          } else
            A = !0;
          yield g;
        } else
          yield g;
    },
    // Don't allow consecutive lines of same key
    async function* ({ lines: s }) {
      let e;
      for await (const A of s)
        if (A.includes(":")) {
          const g = A.split(":")[0];
          if (g !== e)
            yield A, e = g;
          else
            break;
        }
    }
  ]
}, Markdown = {
  name: "Markdown",
  topLevelKeywords: [],
  singleLineComment: "",
  endOfLine: [],
  useMultiline: ({ prefix: s, suffix: e }) => {
    const A = ["- ", "* ", /^\d+\. /, "> ", "```", /^#{1,6} /];
    let g = s.split(`
`).pop();
    if (g) {
      g = g.trim();
      for (const o of A)
        if (typeof o == "string" ? g.startsWith(o) : o.test(g))
          return !1;
    }
  }
}, LANGUAGES = {
  ts: Typescript,
  js: Typescript,
  tsx: Typescript,
  jsx: Typescript,
  ipynb: Python,
  py: Python,
  pyi: Python,
  java: Java,
  cpp: Cpp,
  cxx: Cpp,
  h: Cpp,
  hpp: Cpp,
  cs: CSharp,
  c: C$1,
  scala: Scala,
  sc: Scala,
  go: Go,
  rs: Rust,
  hs: Haskell,
  php: PHP,
  rb: Ruby,
  rails: RubyOnRails,
  swift: Swift,
  kt: Kotlin,
  clj: Clojure,
  cljs: Clojure,
  cljc: Clojure,
  jl: Julia,
  fs: FSharp,
  fsi: FSharp,
  fsx: FSharp,
  fsscript: FSharp,
  r: R,
  R,
  dart: Dart,
  sol: Solidity,
  yaml: YAML,
  yml: YAML,
  md: Markdown
}, RTS_LANGUAGES = {
  // JavaScript/TypeScript related
  js: "javascript",
  jsx: "javascript",
  mjs: "javascript",
  cjs: "javascript",
  ts: "typescript",
  tsx: "typescript",
  // Python related
  py: "python",
  pyi: "python",
  pyx: "python",
  ipynb: "python",
  // C/C++ related
  c: "cpp",
  cpp: "cpp",
  cxx: "cpp",
  cc: "cpp",
  h: "cpp",
  hpp: "cpp",
  hh: "cpp",
  // Java/JVM languages
  java: "java",
  kt: "kotlin",
  kts: "kotlin",
  scala: "scala",
  sc: "scala",
  sbt: "scala",
  // Shell/scripting languages
  sh: "shell",
  bash: "shell",
  zsh: "shell",
  ksh: "shell",
  csh: "shell",
  fish: "shell",
  ps1: "powershell",
  psm1: "powershell",
  psd1: "powershell",
  // Web technologies
  php: "php",
  phtml: "php",
  rb: "ruby",
  vue: "vue",
  // Data formats
  json: "json",
  jsonl: "json",
  geojson: "json",
  jsonc: "json",
  yaml: "yaml",
  yml: "yaml",
  // SQL related
  sql: "sql",
  mysql: "sql",
  psql: "sql",
  tsql: "sql",
  // Other languages
  go: "go",
  rs: "rust",
  dart: "dart",
  lua: "lua",
  r: "r",
  R: "r",
  rmd: "r",
  swift: "swift",
  tf: "tf",
  tfvars: "tf",
  cs: "csharp",
  // Hardware description languages
  sv: "systemverilog",
  svh: "systemverilog",
  v: "systemverilog"
};
function languageForFilepath(s) {
  const e = s.split(".").pop() ?? "";
  return LANGUAGES[e] ?? Typescript;
}
function rtsLanguageForFilepath(s) {
  const e = s.split(".").pop() ?? "";
  return RTS_LANGUAGES[e];
}
const Metrics$1 = new MetricReporter(TelemetryNamespace.Continue, "Autocomplete"), ERRORS_TO_IGNORE = ["unexpected server status"], DEFAULT_AUTOCOMPLETE_OPTS = {
  disable: !1,
  useCopyBuffer: !1,
  useFileSuffix: !0,
  maxPromptTokens: 1024,
  debounceDelay: 350,
  maxSuffixPercentage: 0.25,
  prefixPercentage: 0.75,
  multilineCompletions: "auto",
  slidingWindowPrefixPercentage: 0.75,
  slidingWindowSize: 500,
  maxSnippetPercentage: 0.6,
  recentlyEditedSimilarityThreshold: 0.3,
  useCache: !0,
  onlyMyCode: !0,
  useOtherFiles: !0,
  useRecentlyEdited: !0,
  recentLinePrefixMatchMinLength: 7
}, COUNT_COMPLETION_REJECTED_AFTER = 1e4, MAX_FILE_CONTENT_LENGTH = 10240, MAX_FILE_NAME_LENGTH = 1024;
function getBasename(s) {
  return require$$2.basename(s);
}
function getRangeInString(s, e) {
  var F, x, b;
  const A = s.split(`
`), g = Math.max(0, e.start.line), o = Math.min(A.length - 1, e.end.line);
  if (g === o)
    return ((F = A[g]) == null ? void 0 : F.substring(e.start.character, e.end.character)) ?? "";
  const B = [];
  for (let X = g; X <= o; X++)
    X === g ? B.push(((x = A[X]) == null ? void 0 : x.substring(e.start.character)) ?? "") : X === o ? B.push(((b = A[X]) == null ? void 0 : b.substring(0, e.end.character)) ?? "") : B.push(A[X] ?? "");
  return B.join(`
`);
}
async function readFile$1(s) {
  const e = vscode.Uri.file(s), A = await vscode.workspace.fs.readFile(e);
  return new TextDecoder().decode(A);
}
function getWorkspaceDirs() {
  var s;
  return ((s = vscode.workspace.workspaceFolders) == null ? void 0 : s.map((e) => e.uri.fsPath)) ?? [];
}
async function getRepoName(s) {
  var e;
  try {
    const A = vscode.extensions.getExtension("vscode.git");
    if (!A)
      return;
    const B = (A.isActive ? A.exports : await A.activate()).getAPI(1).getRepository(vscode.Uri.file(s));
    if ((e = B == null ? void 0 : B.state.HEAD) != null && e.upstream) {
      const F = B.state.remotes;
      if (F && F.length > 0) {
        const x = F[0].fetchUrl ?? F[0].pushUrl;
        if (x) {
          const b = x.match(/[/:]([^/:]+\/[^/.]+)(\.git)?$/);
          return b ? b[1] : void 0;
        }
      }
    }
    return;
  } catch {
    return;
  }
}
function getUniqueId() {
  return getMachineId();
}
const JA = class JA {
  constructor(e, A, g) {
    fA(this, "errorsShown", /* @__PURE__ */ new Set());
    fA(this, "_abortControllers", /* @__PURE__ */ new Map());
    fA(this, "_logRejectionTimeouts", /* @__PURE__ */ new Map());
    fA(this, "_outcomes", /* @__PURE__ */ new Map());
    fA(this, "_lastDisplayedCompletion");
    this.rtsClient = e, this._onError = A, this.getDefinitionsFromLsp = g;
  }
  onError(e) {
    const A = e instanceof Error ? e : new Error(String(e));
    ERRORS_TO_IGNORE.some((g) => A.message.includes(g)) || this.errorsShown.has(A.message) || (this.errorsShown.add(A.message), this._onError(A));
  }
  /**
   * Cancel all pending completions
   */
  cancel() {
    this._abortControllers.forEach((e) => {
      e.abort();
    }), this._abortControllers.clear(), Metrics$1.reportCountMetrics({ completionCanceled: !0 });
  }
  /**
   * Accept a completion by ID
   */
  accept(e) {
    this._logRejectionTimeouts.has(e) && (clearTimeout(this._logRejectionTimeouts.get(e)), this._logRejectionTimeouts.delete(e));
    const A = this._outcomes.get(e);
    A && (A.accepted = !0, Feature.reportUsage("AutocompleteAccepted"), Metrics$1.reportCountMetrics({
      completionAccepted: !0
    }), Metrics$1.reportHistogramMetrics({
      completionAcceptanceTime: A.time,
      completionAcceptedLength: A.completion.length
    }), this._outcomes.delete(e));
  }
  /**
   * Cancel the rejection timeout for a completion
   */
  cancelRejectionTimeout(e) {
    this._logRejectionTimeouts.has(e) && (clearTimeout(this._logRejectionTimeouts.get(e)), this._logRejectionTimeouts.delete(e)), this._outcomes.has(e) && this._outcomes.delete(e), Metrics$1.reportCountMetrics({ completionRejectionTimeout: !0 });
  }
  /**
   * Provide inline completion items for the given input
   */
  async provideInlineCompletionItems(e, A, g) {
    var o;
    try {
      const B = v4();
      JA.lastUUID = B;
      const F = DEFAULT_AUTOCOMPLETE_OPTS;
      if (!g) {
        const b = new AbortController();
        g = b.signal, this._abortControllers.set(A.completionId, b);
      }
      if (JA.debouncing) {
        (o = JA.debounceTimeout) == null || o.refresh();
        const b = await new Promise(
          (X) => setTimeout(() => X(JA.lastUUID), F.debounceDelay)
        );
        if (B !== b)
          return;
      } else
        JA.debouncing = !0, JA.debounceTimeout = setTimeout(() => {
          JA.debouncing = !1;
        }, F.debounceDelay);
      const x = await Metrics$1.callWithTrace(
        "TabCompletionInvoke",
        () => this.getTabCompletion(e, F, A)
      );
      return Metrics$1.reportCountMetrics({ completionOutcomeRecieved: !!x }), Metrics$1.reportHistogramMetrics({ completionProvidedLength: x == null ? void 0 : x.completion.length }), e == null || e.appendLine(`[Autocomplete model] result: [${x == null ? void 0 : x.completion}]`), !(x != null && x.completion) || isOnlyPunctuationAndWhitespace(x.completion) ? void 0 : x;
    } catch (B) {
      this.onError(B);
    } finally {
      this._abortControllers.delete(A.completionId);
    }
  }
  /**
   * Mark a completion as displayed and set up rejection timeout
   */
  markDisplayed(e, A) {
    const g = setTimeout(() => {
      A.accepted = !1, Metrics$1.reportCountMetrics({ completionRejected: !0 }), this._logRejectionTimeouts.delete(e);
    }, COUNT_COMPLETION_REJECTED_AFTER);
    this._outcomes.set(e, A), this._logRejectionTimeouts.set(e, g);
    const o = this._lastDisplayedCompletion, B = Date.now();
    if (o && this._logRejectionTimeouts.has(o.id)) {
      const F = this._outcomes.get(o.id), x = (F == null ? void 0 : F.completion.split(`
`)[0]) ?? "", b = A.completion.split(`
`)[0];
      F && (x.endsWith(b) || b.endsWith(x) || x.startsWith(b) || b.startsWith(x)) ? this.cancelRejectionTimeout(o.id) : B - o.displayedAt < 500 && this.cancelRejectionTimeout(o.id);
    }
    this._lastDisplayedCompletion = { id: e, displayedAt: B };
  }
  /**
   * Get tab completion for the given input
   */
  async getTabCompletion(e, A, g) {
    var r, Q;
    const o = Date.now(), { filepath: B, pos: F, manuallyPassFileContents: x } = g, b = x ?? await readFile$1(B), X = b.split(`
`), W = languageForFilepath(B), eA = X[F.line] ?? "";
    for (const d of W.endOfLine)
      if (eA.endsWith(d) && F.character >= eA.length)
        return;
    let IA = getRangeInString(b, {
      start: { line: 0, character: 0 },
      end: ((r = g.selectedCompletionInfo) == null ? void 0 : r.range.start) ?? F
    }) + (((Q = g.selectedCompletionInfo) == null ? void 0 : Q.text) ?? "");
    if (g.injectDetails) {
      const d = IA.split(`
`);
      IA = `${d.slice(0, -1).join(`
`)}
${W.singleLineComment} ${g.injectDetails.split(`
`).join(`
${W.singleLineComment} `)}
${d[d.length - 1]}`;
    }
    const z = getRangeInString(b, {
      start: F,
      end: { line: X.length - 1, character: Number.MAX_SAFE_INTEGER }
    }), N = performance.now();
    let J = [];
    A.useOtherFiles && (J = await Promise.race([
      this.getDefinitionsFromLsp(B, IA + z, IA.length, W),
      new Promise((d) => setTimeout(() => d([]), 100))
    ]));
    const $ = getWorkspaceDirs();
    A.onlyMyCode && (J = J.filter(
      (d) => $.some((c) => d.filepath.startsWith(c))
    ));
    const H = getBasename(g.filepath), y = rtsLanguageForFilepath(g.filepath);
    if (!y)
      return;
    let p = IA, h = z, E = H;
    p.length > MAX_FILE_CONTENT_LENGTH && (p = p.slice(-MAX_FILE_CONTENT_LENGTH)), H.length > MAX_FILE_NAME_LENGTH && (E = B.slice(-MAX_FILE_NAME_LENGTH)), h.length > MAX_FILE_CONTENT_LENGTH && (h = h.slice(0, MAX_FILE_CONTENT_LENGTH)), Metrics$1.reportHistogramMetrics({
      buildContextDuration: performance.now() - N,
      completionContextPrefix: p.length,
      completionContextSuffix: h.length
    });
    const u = await this.rtsClient.tabComplete({
      logger: e,
      leftFileContent: p,
      rightFileContent: h,
      languageName: y,
      filename: E,
      lineNumber: g.pos.line + 1,
      snippets: J
    });
    if (u)
      return {
        time: Date.now() - o,
        completion: u,
        prefix: p,
        suffix: h,
        prompt: "unknown",
        modelProvider: "qdev",
        modelName: "qdev",
        completionOptions: {},
        cacheHit: !1,
        filepath: g.filepath,
        completionId: g.completionId,
        gitRepo: await getRepoName(g.filepath),
        uniqueId: getUniqueId(),
        ...A
      };
  }
};
fA(JA, "debounceTimeout"), fA(JA, "debouncing", !1), fA(JA, "lastUUID");
let CompletionProvider = JA;
function isOnlyPunctuationAndWhitespace(s) {
  return /^[^\w\d})\]]+$/.test(s);
}
var __defProp = Object.defineProperty, __name = (s, e) => __defProp(s, "name", { value: e, configurable: !0 }), SIZE_OF_SHORT = 2, SIZE_OF_INT = 4, SIZE_OF_CURSOR = 4 * SIZE_OF_INT, SIZE_OF_NODE = 5 * SIZE_OF_INT, SIZE_OF_POINT = 2 * SIZE_OF_INT, SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT, ZERO_POINT = { row: 0, column: 0 }, INTERNAL = Symbol("INTERNAL");
function assertInternal(s) {
  if (s !== INTERNAL) throw new Error("Illegal constructor");
}
__name(assertInternal, "assertInternal");
function isPoint(s) {
  return !!s && typeof s.row == "number" && typeof s.column == "number";
}
__name(isPoint, "isPoint");
function setModule(s) {
  C = s;
}
__name(setModule, "setModule");
var C, ge, LookaheadIterator = (ge = class {
  /** @internal */
  constructor(e, A, g) {
    /** @internal */
    fA(this, 0, 0);
    // Internal handle for WASM
    /** @internal */
    fA(this, "language");
    assertInternal(e), this[0] = A, this.language = g;
  }
  /** Get the current symbol of the lookahead iterator. */
  get currentTypeId() {
    return C._ts_lookahead_iterator_current_symbol(this[0]);
  }
  /** Get the current symbol name of the lookahead iterator. */
  get currentType() {
    return this.language.types[this.currentTypeId] || "ERROR";
  }
  /** Delete the lookahead iterator, freeing its resources. */
  delete() {
    C._ts_lookahead_iterator_delete(this[0]), this[0] = 0;
  }
  /**
   * Reset the lookahead iterator.
   *
   * This returns `true` if the language was set successfully and `false`
   * otherwise.
   */
  reset(e, A) {
    return C._ts_lookahead_iterator_reset(this[0], e[0], A) ? (this.language = e, !0) : !1;
  }
  /**
   * Reset the lookahead iterator to another state.
   *
   * This returns `true` if the iterator was reset to the given state and
   * `false` otherwise.
   */
  resetState(e) {
    return !!C._ts_lookahead_iterator_reset_state(this[0], e);
  }
  /**
   * Returns an iterator that iterates over the symbols of the lookahead iterator.
   *
   * The iterator will yield the current symbol name as a string for each step
   * until there are no more symbols to iterate over.
   */
  [Symbol.iterator]() {
    return {
      next: /* @__PURE__ */ __name(() => C._ts_lookahead_iterator_next(this[0]) ? { done: !1, value: this.currentType } : { done: !0, value: "" }, "next")
    };
  }
}, __name(ge, "LookaheadIterator"), ge);
function getText(s, e, A, g) {
  const o = A - e;
  let B = s.textCallback(e, g);
  if (B) {
    for (e += B.length; e < A; ) {
      const F = s.textCallback(e, g);
      if (F && F.length > 0)
        e += F.length, B += F;
      else
        break;
    }
    e > A && (B = B.slice(0, o));
  }
  return B ?? "";
}
__name(getText, "getText");
var qA, Tree = (qA = class {
  /** @internal */
  constructor(e, A, g, o) {
    /** @internal */
    fA(this, 0, 0);
    // Internal handle for WASM
    /** @internal */
    fA(this, "textCallback");
    /** The language that was used to parse the syntax tree. */
    fA(this, "language");
    assertInternal(e), this[0] = A, this.language = g, this.textCallback = o;
  }
  /** Create a shallow copy of the syntax tree. This is very fast. */
  copy() {
    const e = C._ts_tree_copy(this[0]);
    return new qA(INTERNAL, e, this.language, this.textCallback);
  }
  /** Delete the syntax tree, freeing its resources. */
  delete() {
    C._ts_tree_delete(this[0]), this[0] = 0;
  }
  /** Get the root node of the syntax tree. */
  get rootNode() {
    return C._ts_tree_root_node_wasm(this[0]), unmarshalNode(this);
  }
  /**
   * Get the root node of the syntax tree, but with its position shifted
   * forward by the given offset.
   */
  rootNodeWithOffset(e, A) {
    const g = TRANSFER_BUFFER + SIZE_OF_NODE;
    return C.setValue(g, e, "i32"), marshalPoint(g + SIZE_OF_INT, A), C._ts_tree_root_node_with_offset_wasm(this[0]), unmarshalNode(this);
  }
  /**
   * Edit the syntax tree to keep it in sync with source code that has been
   * edited.
   *
   * You must describe the edit both in terms of byte offsets and in terms of
   * row/column coordinates.
   */
  edit(e) {
    marshalEdit(e), C._ts_tree_edit_wasm(this[0]);
  }
  /** Create a new {@link TreeCursor} starting from the root of the tree. */
  walk() {
    return this.rootNode.walk();
  }
  /**
   * Compare this old edited syntax tree to a new syntax tree representing
   * the same document, returning a sequence of ranges whose syntactic
   * structure has changed.
   *
   * For this to work correctly, this syntax tree must have been edited such
   * that its ranges match up to the new tree. Generally, you'll want to
   * call this method right after calling one of the [`Parser::parse`]
   * functions. Call it on the old tree that was passed to parse, and
   * pass the new tree that was returned from `parse`.
   */
  getChangedRanges(e) {
    if (!(e instanceof qA))
      throw new TypeError("Argument must be a Tree");
    C._ts_tree_get_changed_ranges_wasm(this[0], e[0]);
    const A = C.getValue(TRANSFER_BUFFER, "i32"), g = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = new Array(A);
    if (A > 0) {
      let B = g;
      for (let F = 0; F < A; F++)
        o[F] = unmarshalRange(B), B += SIZE_OF_RANGE;
      C._free(g);
    }
    return o;
  }
  /** Get the included ranges that were used to parse the syntax tree. */
  getIncludedRanges() {
    C._ts_tree_included_ranges_wasm(this[0]);
    const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), g = new Array(e);
    if (e > 0) {
      let o = A;
      for (let B = 0; B < e; B++)
        g[B] = unmarshalRange(o), o += SIZE_OF_RANGE;
      C._free(A);
    }
    return g;
  }
}, __name(qA, "Tree"), qA), $A, TreeCursor = ($A = class {
  /** @internal */
  constructor(e, A) {
    /** @internal */
    // @ts-expect-error: never read
    fA(this, 0, 0);
    // Internal handle for Wasm
    /** @internal */
    // @ts-expect-error: never read
    fA(this, 1, 0);
    // Internal handle for Wasm
    /** @internal */
    // @ts-expect-error: never read
    fA(this, 2, 0);
    // Internal handle for Wasm
    /** @internal */
    // @ts-expect-error: never read
    fA(this, 3, 0);
    // Internal handle for Wasm
    /** @internal */
    fA(this, "tree");
    assertInternal(e), this.tree = A, unmarshalTreeCursor(this);
  }
  /** Creates a deep copy of the tree cursor. This allocates new memory. */
  copy() {
    const e = new $A(INTERNAL, this.tree);
    return C._ts_tree_cursor_copy_wasm(this.tree[0]), unmarshalTreeCursor(e), e;
  }
  /** Delete the tree cursor, freeing its resources. */
  delete() {
    marshalTreeCursor(this), C._ts_tree_cursor_delete_wasm(this.tree[0]), this[0] = this[1] = this[2] = 0;
  }
  /** Get the tree cursor's current {@link Node}. */
  get currentNode() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /**
   * Get the numerical field id of this tree cursor's current node.
   *
   * See also {@link TreeCursor#currentFieldName}.
   */
  get currentFieldId() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);
  }
  /** Get the field name of this tree cursor's current node. */
  get currentFieldName() {
    return this.tree.language.fields[this.currentFieldId];
  }
  /**
   * Get the depth of the cursor's current node relative to the original
   * node that the cursor was constructed with.
   */
  get currentDepth() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_depth_wasm(this.tree[0]);
  }
  /**
   * Get the index of the cursor's current node out of all of the
   * descendants of the original node that the cursor was constructed with.
   */
  get currentDescendantIndex() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0]);
  }
  /** Get the type of the cursor's current node. */
  get nodeType() {
    return this.tree.language.types[this.nodeTypeId] || "ERROR";
  }
  /** Get the type id of the cursor's current node. */
  get nodeTypeId() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);
  }
  /** Get the state id of the cursor's current node. */
  get nodeStateId() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0]);
  }
  /** Get the id of the cursor's current node. */
  get nodeId() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);
  }
  /**
   * Check if the cursor's current node is *named*.
   *
   * Named nodes correspond to named rules in the grammar, whereas
   * *anonymous* nodes correspond to string literals in the grammar.
   */
  get nodeIsNamed() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;
  }
  /**
   * Check if the cursor's current node is *missing*.
   *
   * Missing nodes are inserted by the parser in order to recover from
   * certain kinds of syntax errors.
   */
  get nodeIsMissing() {
    return marshalTreeCursor(this), C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;
  }
  /** Get the string content of the cursor's current node. */
  get nodeText() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_start_index_wasm(this.tree[0]), A = C._ts_tree_cursor_end_index_wasm(this.tree[0]);
    C._ts_tree_cursor_start_position_wasm(this.tree[0]);
    const g = unmarshalPoint(TRANSFER_BUFFER);
    return getText(this.tree, e, A, g);
  }
  /** Get the start position of the cursor's current node. */
  get startPosition() {
    return marshalTreeCursor(this), C._ts_tree_cursor_start_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
  }
  /** Get the end position of the cursor's current node. */
  get endPosition() {
    return marshalTreeCursor(this), C._ts_tree_cursor_end_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
  }
  /** Get the start index of the cursor's current node. */
  get startIndex() {
    return marshalTreeCursor(this), C._ts_tree_cursor_start_index_wasm(this.tree[0]);
  }
  /** Get the end index of the cursor's current node. */
  get endIndex() {
    return marshalTreeCursor(this), C._ts_tree_cursor_end_index_wasm(this.tree[0]);
  }
  /**
   * Move this cursor to the first child of its current node.
   *
   * This returns `true` if the cursor successfully moved, and returns
   * `false` if there were no children.
   */
  gotoFirstChild() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), e === 1;
  }
  /**
   * Move this cursor to the last child of its current node.
   *
   * This returns `true` if the cursor successfully moved, and returns
   * `false` if there were no children.
   *
   * Note that this function may be slower than
   * {@link TreeCursor#gotoFirstChild} because it needs to
   * iterate through all the children to compute the child's position.
   */
  gotoLastChild() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), e === 1;
  }
  /**
   * Move this cursor to the parent of its current node.
   *
   * This returns `true` if the cursor successfully moved, and returns
   * `false` if there was no parent node (the cursor was already on the
   * root node).
   *
   * Note that the node the cursor was constructed with is considered the root
   * of the cursor, and the cursor cannot walk outside this node.
   */
  gotoParent() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), e === 1;
  }
  /**
   * Move this cursor to the next sibling of its current node.
   *
   * This returns `true` if the cursor successfully moved, and returns
   * `false` if there was no next sibling node.
   *
   * Note that the node the cursor was constructed with is considered the root
   * of the cursor, and the cursor cannot walk outside this node.
   */
  gotoNextSibling() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), e === 1;
  }
  /**
   * Move this cursor to the previous sibling of its current node.
   *
   * This returns `true` if the cursor successfully moved, and returns
   * `false` if there was no previous sibling node.
   *
   * Note that this function may be slower than
   * {@link TreeCursor#gotoNextSibling} due to how node
   * positions are stored. In the worst case, this will need to iterate
   * through all the children up to the previous sibling node to recalculate
   * its position. Also note that the node the cursor was constructed with is
   * considered the root of the cursor, and the cursor cannot walk outside this node.
   */
  gotoPreviousSibling() {
    marshalTreeCursor(this);
    const e = C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), e === 1;
  }
  /**
   * Move the cursor to the node that is the nth descendant of
   * the original node that the cursor was constructed with, where
   * zero represents the original node itself.
   */
  gotoDescendant(e) {
    marshalTreeCursor(this), C._ts_tree_cursor_goto_descendant_wasm(this.tree[0], e), unmarshalTreeCursor(this);
  }
  /**
   * Move this cursor to the first child of its current node that contains or
   * starts after the given byte offset.
   *
   * This returns `true` if the cursor successfully moved to a child node, and returns
   * `false` if no such child was found.
   */
  gotoFirstChildForIndex(e) {
    marshalTreeCursor(this), C.setValue(TRANSFER_BUFFER + SIZE_OF_CURSOR, e, "i32");
    const A = C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), A === 1;
  }
  /**
   * Move this cursor to the first child of its current node that contains or
   * starts after the given byte offset.
   *
   * This returns the index of the child node if one was found, and returns
   * `null` if no such child was found.
   */
  gotoFirstChildForPosition(e) {
    marshalTreeCursor(this), marshalPoint(TRANSFER_BUFFER + SIZE_OF_CURSOR, e);
    const A = C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);
    return unmarshalTreeCursor(this), A === 1;
  }
  /**
   * Re-initialize this tree cursor to start at the original node that the
   * cursor was constructed with.
   */
  reset(e) {
    marshalNode(e), marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE), C._ts_tree_cursor_reset_wasm(this.tree[0]), unmarshalTreeCursor(this);
  }
  /**
   * Re-initialize a tree cursor to the same position as another cursor.
   *
   * Unlike {@link TreeCursor#reset}, this will not lose parent
   * information and allows reusing already created cursors.
   */
  resetTo(e) {
    marshalTreeCursor(this, TRANSFER_BUFFER), marshalTreeCursor(e, TRANSFER_BUFFER + SIZE_OF_CURSOR), C._ts_tree_cursor_reset_to_wasm(this.tree[0], e.tree[0]), unmarshalTreeCursor(this);
  }
}, __name($A, "TreeCursor"), $A), ie, Node = (ie = class {
  /** @internal */
  constructor(e, {
    id: A,
    tree: g,
    startIndex: o,
    startPosition: B,
    other: F
  }) {
    /** @internal */
    // @ts-expect-error: never read
    fA(this, 0, 0);
    // Internal handle for Wasm
    /** @internal */
    fA(this, "_children");
    /** @internal */
    fA(this, "_namedChildren");
    /**
     * The numeric id for this node that is unique.
     *
     * Within a given syntax tree, no two nodes have the same id. However:
     *
     * * If a new tree is created based on an older tree, and a node from the old tree is reused in
     *   the process, then that node will have the same id in both trees.
     *
     * * A node not marked as having changes does not guarantee it was reused.
     *
     * * If a node is marked as having changed in the old tree, it will not be reused.
     */
    fA(this, "id");
    /** The byte index where this node starts. */
    fA(this, "startIndex");
    /** The position where this node starts. */
    fA(this, "startPosition");
    /** The tree that this node belongs to. */
    fA(this, "tree");
    assertInternal(e), this[0] = F, this.id = A, this.tree = g, this.startIndex = o, this.startPosition = B;
  }
  /** Get this node's type as a numerical id. */
  get typeId() {
    return marshalNode(this), C._ts_node_symbol_wasm(this.tree[0]);
  }
  /**
   * Get the node's type as a numerical id as it appears in the grammar,
   * ignoring aliases.
   */
  get grammarId() {
    return marshalNode(this), C._ts_node_grammar_symbol_wasm(this.tree[0]);
  }
  /** Get this node's type as a string. */
  get type() {
    return this.tree.language.types[this.typeId] || "ERROR";
  }
  /**
   * Get this node's symbol name as it appears in the grammar, ignoring
   * aliases as a string.
   */
  get grammarType() {
    return this.tree.language.types[this.grammarId] || "ERROR";
  }
  /**
   * Check if this node is *named*.
   *
   * Named nodes correspond to named rules in the grammar, whereas
   * *anonymous* nodes correspond to string literals in the grammar.
   */
  get isNamed() {
    return marshalNode(this), C._ts_node_is_named_wasm(this.tree[0]) === 1;
  }
  /**
   * Check if this node is *extra*.
   *
   * Extra nodes represent things like comments, which are not required
   * by the grammar, but can appear anywhere.
   */
  get isExtra() {
    return marshalNode(this), C._ts_node_is_extra_wasm(this.tree[0]) === 1;
  }
  /**
   * Check if this node represents a syntax error.
   *
   * Syntax errors represent parts of the code that could not be incorporated
   * into a valid syntax tree.
   */
  get isError() {
    return marshalNode(this), C._ts_node_is_error_wasm(this.tree[0]) === 1;
  }
  /**
   * Check if this node is *missing*.
   *
   * Missing nodes are inserted by the parser in order to recover from
   * certain kinds of syntax errors.
   */
  get isMissing() {
    return marshalNode(this), C._ts_node_is_missing_wasm(this.tree[0]) === 1;
  }
  /** Check if this node has been edited. */
  get hasChanges() {
    return marshalNode(this), C._ts_node_has_changes_wasm(this.tree[0]) === 1;
  }
  /**
   * Check if this node represents a syntax error or contains any syntax
   * errors anywhere within it.
   */
  get hasError() {
    return marshalNode(this), C._ts_node_has_error_wasm(this.tree[0]) === 1;
  }
  /** Get the byte index where this node ends. */
  get endIndex() {
    return marshalNode(this), C._ts_node_end_index_wasm(this.tree[0]);
  }
  /** Get the position where this node ends. */
  get endPosition() {
    return marshalNode(this), C._ts_node_end_point_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
  }
  /** Get the string content of this node. */
  get text() {
    return getText(this.tree, this.startIndex, this.endIndex, this.startPosition);
  }
  /** Get this node's parse state. */
  get parseState() {
    return marshalNode(this), C._ts_node_parse_state_wasm(this.tree[0]);
  }
  /** Get the parse state after this node. */
  get nextParseState() {
    return marshalNode(this), C._ts_node_next_parse_state_wasm(this.tree[0]);
  }
  /** Check if this node is equal to another node. */
  equals(e) {
    return this.tree === e.tree && this.id === e.id;
  }
  /**
   * Get the node's child at the given index, where zero represents the first child.
   *
   * This method is fairly fast, but its cost is technically log(n), so if
   * you might be iterating over a long list of children, you should use
   * {@link Node#children} instead.
   */
  child(e) {
    return marshalNode(this), C._ts_node_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
  }
  /**
   * Get this node's *named* child at the given index.
   *
   * See also {@link Node#isNamed}.
   * This method is fairly fast, but its cost is technically log(n), so if
   * you might be iterating over a long list of children, you should use
   * {@link Node#namedChildren} instead.
   */
  namedChild(e) {
    return marshalNode(this), C._ts_node_named_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
  }
  /**
   * Get this node's child with the given numerical field id.
   *
   * See also {@link Node#childForFieldName}. You can
   * convert a field name to an id using {@link Language#fieldIdForName}.
   */
  childForFieldId(e) {
    return marshalNode(this), C._ts_node_child_by_field_id_wasm(this.tree[0], e), unmarshalNode(this.tree);
  }
  /**
   * Get the first child with the given field name.
   *
   * If multiple children may have the same field name, access them using
   * {@link Node#childrenForFieldName}.
   */
  childForFieldName(e) {
    const A = this.tree.language.fields.indexOf(e);
    return A !== -1 ? this.childForFieldId(A) : null;
  }
  /** Get the field name of this node's child at the given index. */
  fieldNameForChild(e) {
    marshalNode(this);
    const A = C._ts_node_field_name_for_child_wasm(this.tree[0], e);
    return A ? C.AsciiToString(A) : null;
  }
  /** Get the field name of this node's named child at the given index. */
  fieldNameForNamedChild(e) {
    marshalNode(this);
    const A = C._ts_node_field_name_for_named_child_wasm(this.tree[0], e);
    return A ? C.AsciiToString(A) : null;
  }
  /**
   * Get an array of this node's children with a given field name.
   *
   * See also {@link Node#children}.
   */
  childrenForFieldName(e) {
    const A = this.tree.language.fields.indexOf(e);
    return A !== -1 && A !== 0 ? this.childrenForFieldId(A) : [];
  }
  /**
    * Get an array of this node's children with a given field id.
    *
    * See also {@link Node#childrenForFieldName}.
    */
  childrenForFieldId(e) {
    marshalNode(this), C._ts_node_children_by_field_id_wasm(this.tree[0], e);
    const A = C.getValue(TRANSFER_BUFFER, "i32"), g = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = new Array(A);
    if (A > 0) {
      let B = g;
      for (let F = 0; F < A; F++)
        o[F] = unmarshalNode(this.tree, B), B += SIZE_OF_NODE;
      C._free(g);
    }
    return o;
  }
  /** Get the node's first child that contains or starts after the given byte offset. */
  firstChildForIndex(e) {
    marshalNode(this);
    const A = TRANSFER_BUFFER + SIZE_OF_NODE;
    return C.setValue(A, e, "i32"), C._ts_node_first_child_for_byte_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the node's first named child that contains or starts after the given byte offset. */
  firstNamedChildForIndex(e) {
    marshalNode(this);
    const A = TRANSFER_BUFFER + SIZE_OF_NODE;
    return C.setValue(A, e, "i32"), C._ts_node_first_named_child_for_byte_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get this node's number of children. */
  get childCount() {
    return marshalNode(this), C._ts_node_child_count_wasm(this.tree[0]);
  }
  /**
   * Get this node's number of *named* children.
   *
   * See also {@link Node#isNamed}.
   */
  get namedChildCount() {
    return marshalNode(this), C._ts_node_named_child_count_wasm(this.tree[0]);
  }
  /** Get this node's first child. */
  get firstChild() {
    return this.child(0);
  }
  /**
   * Get this node's first named child.
   *
   * See also {@link Node#isNamed}.
   */
  get firstNamedChild() {
    return this.namedChild(0);
  }
  /** Get this node's last child. */
  get lastChild() {
    return this.child(this.childCount - 1);
  }
  /**
   * Get this node's last named child.
   *
   * See also {@link Node#isNamed}.
   */
  get lastNamedChild() {
    return this.namedChild(this.namedChildCount - 1);
  }
  /**
   * Iterate over this node's children.
   *
   * If you're walking the tree recursively, you may want to use the
   * {@link TreeCursor} APIs directly instead.
   */
  get children() {
    if (!this._children) {
      marshalNode(this), C._ts_node_children_wasm(this.tree[0]);
      const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
      if (this._children = new Array(e), e > 0) {
        let g = A;
        for (let o = 0; o < e; o++)
          this._children[o] = unmarshalNode(this.tree, g), g += SIZE_OF_NODE;
        C._free(A);
      }
    }
    return this._children;
  }
  /**
   * Iterate over this node's named children.
   *
   * See also {@link Node#children}.
   */
  get namedChildren() {
    if (!this._namedChildren) {
      marshalNode(this), C._ts_node_named_children_wasm(this.tree[0]);
      const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
      if (this._namedChildren = new Array(e), e > 0) {
        let g = A;
        for (let o = 0; o < e; o++)
          this._namedChildren[o] = unmarshalNode(this.tree, g), g += SIZE_OF_NODE;
        C._free(A);
      }
    }
    return this._namedChildren;
  }
  /**
   * Get the descendants of this node that are the given type, or in the given types array.
   *
   * The types array should contain node type strings, which can be retrieved from {@link Language#types}.
   *
   * Additionally, a `startPosition` and `endPosition` can be passed in to restrict the search to a byte range.
   */
  descendantsOfType(e, A = ZERO_POINT, g = ZERO_POINT) {
    Array.isArray(e) || (e = [e]);
    const o = [], B = this.tree.language.types;
    for (const W of e)
      W == "ERROR" && o.push(65535);
    for (let W = 0, eA = B.length; W < eA; W++)
      e.includes(B[W]) && o.push(W);
    const F = C._malloc(SIZE_OF_INT * o.length);
    for (let W = 0, eA = o.length; W < eA; W++)
      C.setValue(F + W * SIZE_OF_INT, o[W], "i32");
    marshalNode(this), C._ts_node_descendants_of_type_wasm(
      this.tree[0],
      F,
      o.length,
      A.row,
      A.column,
      g.row,
      g.column
    );
    const x = C.getValue(TRANSFER_BUFFER, "i32"), b = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), X = new Array(x);
    if (x > 0) {
      let W = b;
      for (let eA = 0; eA < x; eA++)
        X[eA] = unmarshalNode(this.tree, W), W += SIZE_OF_NODE;
    }
    return C._free(b), C._free(F), X;
  }
  /** Get this node's next sibling. */
  get nextSibling() {
    return marshalNode(this), C._ts_node_next_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get this node's previous sibling. */
  get previousSibling() {
    return marshalNode(this), C._ts_node_prev_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /**
   * Get this node's next *named* sibling.
   *
   * See also {@link Node#isNamed}.
   */
  get nextNamedSibling() {
    return marshalNode(this), C._ts_node_next_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /**
   * Get this node's previous *named* sibling.
   *
   * See also {@link Node#isNamed}.
   */
  get previousNamedSibling() {
    return marshalNode(this), C._ts_node_prev_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the node's number of descendants, including one for the node itself. */
  get descendantCount() {
    return marshalNode(this), C._ts_node_descendant_count_wasm(this.tree[0]);
  }
  /**
   * Get this node's immediate parent.
   * Prefer {@link Node#childWithDescendant} for iterating over this node's ancestors.
   */
  get parent() {
    return marshalNode(this), C._ts_node_parent_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /**
   * Get the node that contains `descendant`.
   *
   * Note that this can return `descendant` itself.
   */
  childWithDescendant(e) {
    return marshalNode(this), marshalNode(e, 1), C._ts_node_child_with_descendant_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the smallest node within this node that spans the given byte range. */
  descendantForIndex(e, A = e) {
    if (typeof e != "number" || typeof A != "number")
      throw new Error("Arguments must be numbers");
    marshalNode(this);
    const g = TRANSFER_BUFFER + SIZE_OF_NODE;
    return C.setValue(g, e, "i32"), C.setValue(g + SIZE_OF_INT, A, "i32"), C._ts_node_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the smallest named node within this node that spans the given byte range. */
  namedDescendantForIndex(e, A = e) {
    if (typeof e != "number" || typeof A != "number")
      throw new Error("Arguments must be numbers");
    marshalNode(this);
    const g = TRANSFER_BUFFER + SIZE_OF_NODE;
    return C.setValue(g, e, "i32"), C.setValue(g + SIZE_OF_INT, A, "i32"), C._ts_node_named_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the smallest node within this node that spans the given point range. */
  descendantForPosition(e, A = e) {
    if (!isPoint(e) || !isPoint(A))
      throw new Error("Arguments must be {row, column} objects");
    marshalNode(this);
    const g = TRANSFER_BUFFER + SIZE_OF_NODE;
    return marshalPoint(g, e), marshalPoint(g + SIZE_OF_POINT, A), C._ts_node_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /** Get the smallest named node within this node that spans the given point range. */
  namedDescendantForPosition(e, A = e) {
    if (!isPoint(e) || !isPoint(A))
      throw new Error("Arguments must be {row, column} objects");
    marshalNode(this);
    const g = TRANSFER_BUFFER + SIZE_OF_NODE;
    return marshalPoint(g, e), marshalPoint(g + SIZE_OF_POINT, A), C._ts_node_named_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
  }
  /**
   * Create a new {@link TreeCursor} starting from this node.
   *
   * Note that the given node is considered the root of the cursor,
   * and the cursor cannot walk outside this node.
   */
  walk() {
    return marshalNode(this), C._ts_tree_cursor_new_wasm(this.tree[0]), new TreeCursor(INTERNAL, this.tree);
  }
  /**
   * Edit this node to keep it in-sync with source code that has been edited.
   *
   * This function is only rarely needed. When you edit a syntax tree with
   * the {@link Tree#edit} method, all of the nodes that you retrieve from
   * the tree afterward will already reflect the edit. You only need to
   * use {@link Node#edit} when you have a specific {@link Node} instance that
   * you want to keep and continue to use after an edit.
   */
  edit(e) {
    if (this.startIndex >= e.oldEndIndex) {
      this.startIndex = e.newEndIndex + (this.startIndex - e.oldEndIndex);
      let A, g;
      this.startPosition.row > e.oldEndPosition.row ? (A = this.startPosition.row - e.oldEndPosition.row, g = this.startPosition.column) : (A = 0, g = this.startPosition.column, this.startPosition.column >= e.oldEndPosition.column && (g = this.startPosition.column - e.oldEndPosition.column)), A > 0 ? (this.startPosition.row += A, this.startPosition.column = g) : this.startPosition.column += g;
    } else this.startIndex > e.startIndex && (this.startIndex = e.newEndIndex, this.startPosition.row = e.newEndPosition.row, this.startPosition.column = e.newEndPosition.column);
  }
  /** Get the S-expression representation of this node. */
  toString() {
    marshalNode(this);
    const e = C._ts_node_to_string_wasm(this.tree[0]), A = C.AsciiToString(e);
    return C._free(e), A;
  }
}, __name(ie, "Node"), ie);
function unmarshalCaptures(s, e, A, g, o) {
  for (let B = 0, F = o.length; B < F; B++) {
    const x = C.getValue(A, "i32");
    A += SIZE_OF_INT;
    const b = unmarshalNode(e, A);
    A += SIZE_OF_NODE, o[B] = { patternIndex: g, name: s.captureNames[x], node: b };
  }
  return A;
}
__name(unmarshalCaptures, "unmarshalCaptures");
function marshalNode(s, e = 0) {
  let A = TRANSFER_BUFFER + e * SIZE_OF_NODE;
  C.setValue(A, s.id, "i32"), A += SIZE_OF_INT, C.setValue(A, s.startIndex, "i32"), A += SIZE_OF_INT, C.setValue(A, s.startPosition.row, "i32"), A += SIZE_OF_INT, C.setValue(A, s.startPosition.column, "i32"), A += SIZE_OF_INT, C.setValue(A, s[0], "i32");
}
__name(marshalNode, "marshalNode");
function unmarshalNode(s, e = TRANSFER_BUFFER) {
  const A = C.getValue(e, "i32");
  if (e += SIZE_OF_INT, A === 0) return null;
  const g = C.getValue(e, "i32");
  e += SIZE_OF_INT;
  const o = C.getValue(e, "i32");
  e += SIZE_OF_INT;
  const B = C.getValue(e, "i32");
  e += SIZE_OF_INT;
  const F = C.getValue(e, "i32");
  return new Node(INTERNAL, {
    id: A,
    tree: s,
    startIndex: g,
    startPosition: { row: o, column: B },
    other: F
  });
}
__name(unmarshalNode, "unmarshalNode");
function marshalTreeCursor(s, e = TRANSFER_BUFFER) {
  C.setValue(e + 0 * SIZE_OF_INT, s[0], "i32"), C.setValue(e + 1 * SIZE_OF_INT, s[1], "i32"), C.setValue(e + 2 * SIZE_OF_INT, s[2], "i32"), C.setValue(e + 3 * SIZE_OF_INT, s[3], "i32");
}
__name(marshalTreeCursor, "marshalTreeCursor");
function unmarshalTreeCursor(s) {
  s[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32"), s[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32"), s[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), s[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, "i32");
}
__name(unmarshalTreeCursor, "unmarshalTreeCursor");
function marshalPoint(s, e) {
  C.setValue(s, e.row, "i32"), C.setValue(s + SIZE_OF_INT, e.column, "i32");
}
__name(marshalPoint, "marshalPoint");
function unmarshalPoint(s) {
  return {
    row: C.getValue(s, "i32") >>> 0,
    column: C.getValue(s + SIZE_OF_INT, "i32") >>> 0
  };
}
__name(unmarshalPoint, "unmarshalPoint");
function marshalRange(s, e) {
  marshalPoint(s, e.startPosition), s += SIZE_OF_POINT, marshalPoint(s, e.endPosition), s += SIZE_OF_POINT, C.setValue(s, e.startIndex, "i32"), s += SIZE_OF_INT, C.setValue(s, e.endIndex, "i32"), s += SIZE_OF_INT;
}
__name(marshalRange, "marshalRange");
function unmarshalRange(s) {
  const e = {};
  return e.startPosition = unmarshalPoint(s), s += SIZE_OF_POINT, e.endPosition = unmarshalPoint(s), s += SIZE_OF_POINT, e.startIndex = C.getValue(s, "i32") >>> 0, s += SIZE_OF_INT, e.endIndex = C.getValue(s, "i32") >>> 0, e;
}
__name(unmarshalRange, "unmarshalRange");
function marshalEdit(s, e = TRANSFER_BUFFER) {
  marshalPoint(e, s.startPosition), e += SIZE_OF_POINT, marshalPoint(e, s.oldEndPosition), e += SIZE_OF_POINT, marshalPoint(e, s.newEndPosition), e += SIZE_OF_POINT, C.setValue(e, s.startIndex, "i32"), e += SIZE_OF_INT, C.setValue(e, s.oldEndIndex, "i32"), e += SIZE_OF_INT, C.setValue(e, s.newEndIndex, "i32"), e += SIZE_OF_INT;
}
__name(marshalEdit, "marshalEdit");
function unmarshalLanguageMetadata(s) {
  const e = C.getValue(s, "i32"), A = C.getValue(s += SIZE_OF_INT, "i32"), g = C.getValue(s += SIZE_OF_INT, "i32");
  return { major_version: e, minor_version: A, patch_version: g };
}
__name(unmarshalLanguageMetadata, "unmarshalLanguageMetadata");
var PREDICATE_STEP_TYPE_CAPTURE = 1, PREDICATE_STEP_TYPE_STRING = 2, QUERY_WORD_REGEX = /[\w-]+/g, isCaptureStep = /* @__PURE__ */ __name((s) => s.type === "capture", "isCaptureStep"), isStringStep = /* @__PURE__ */ __name((s) => s.type === "string", "isStringStep"), QueryErrorKind = {
  Syntax: 1,
  NodeName: 2,
  FieldName: 3,
  CaptureName: 4,
  PatternStructure: 5
}, Ae, QueryError = (Ae = class extends Error {
  constructor(e, A, g, o) {
    super(Ae.formatMessage(e, A)), this.kind = e, this.info = A, this.index = g, this.length = o, this.name = "QueryError";
  }
  /** Formats an error message based on the error kind and info */
  static formatMessage(e, A) {
    switch (e) {
      case QueryErrorKind.NodeName:
        return `Bad node name '${A.word}'`;
      case QueryErrorKind.FieldName:
        return `Bad field name '${A.word}'`;
      case QueryErrorKind.CaptureName:
        return `Bad capture name @${A.word}`;
      case QueryErrorKind.PatternStructure:
        return `Bad pattern structure at offset ${A.suffix}`;
      case QueryErrorKind.Syntax:
        return `Bad syntax at offset ${A.suffix}`;
    }
  }
}, __name(Ae, "QueryError"), Ae);
function parseAnyPredicate(s, e, A, g) {
  if (s.length !== 3)
    throw new Error(
      `Wrong number of arguments to \`#${A}\` predicate. Expected 2, got ${s.length - 1}`
    );
  if (!isCaptureStep(s[1]))
    throw new Error(
      `First argument of \`#${A}\` predicate must be a capture. Got "${s[1].value}"`
    );
  const o = A === "eq?" || A === "any-eq?", B = !A.startsWith("any-");
  if (isCaptureStep(s[2])) {
    const F = s[1].name, x = s[2].name;
    g[e].push((b) => {
      const X = [], W = [];
      for (const IA of b)
        IA.name === F && X.push(IA.node), IA.name === x && W.push(IA.node);
      const eA = /* @__PURE__ */ __name((IA, z, N) => N ? IA.text === z.text : IA.text !== z.text, "compare");
      return B ? X.every((IA) => W.some((z) => eA(IA, z, o))) : X.some((IA) => W.some((z) => eA(IA, z, o)));
    });
  } else {
    const F = s[1].name, x = s[2].value, b = /* @__PURE__ */ __name((W) => W.text === x, "matches"), X = /* @__PURE__ */ __name((W) => W.text !== x, "doesNotMatch");
    g[e].push((W) => {
      const eA = [];
      for (const z of W)
        z.name === F && eA.push(z.node);
      const IA = o ? b : X;
      return B ? eA.every(IA) : eA.some(IA);
    });
  }
}
__name(parseAnyPredicate, "parseAnyPredicate");
function parseMatchPredicate(s, e, A, g) {
  if (s.length !== 3)
    throw new Error(
      `Wrong number of arguments to \`#${A}\` predicate. Expected 2, got ${s.length - 1}.`
    );
  if (s[1].type !== "capture")
    throw new Error(
      `First argument of \`#${A}\` predicate must be a capture. Got "${s[1].value}".`
    );
  if (s[2].type !== "string")
    throw new Error(
      `Second argument of \`#${A}\` predicate must be a string. Got @${s[2].name}.`
    );
  const o = A === "match?" || A === "any-match?", B = !A.startsWith("any-"), F = s[1].name, x = new RegExp(s[2].value);
  g[e].push((b) => {
    const X = [];
    for (const eA of b)
      eA.name === F && X.push(eA.node.text);
    const W = /* @__PURE__ */ __name((eA, IA) => IA ? x.test(eA) : !x.test(eA), "test");
    return X.length === 0 ? !o : B ? X.every((eA) => W(eA, o)) : X.some((eA) => W(eA, o));
  });
}
__name(parseMatchPredicate, "parseMatchPredicate");
function parseAnyOfPredicate(s, e, A, g) {
  if (s.length < 2)
    throw new Error(
      `Wrong number of arguments to \`#${A}\` predicate. Expected at least 1. Got ${s.length - 1}.`
    );
  if (s[1].type !== "capture")
    throw new Error(
      `First argument of \`#${A}\` predicate must be a capture. Got "${s[1].value}".`
    );
  const o = A === "any-of?", B = s[1].name, F = s.slice(2);
  if (!F.every(isStringStep))
    throw new Error(
      `Arguments to \`#${A}\` predicate must be strings.".`
    );
  const x = F.map((b) => b.value);
  g[e].push((b) => {
    const X = [];
    for (const W of b)
      W.name === B && X.push(W.node.text);
    return X.length === 0 ? !o : X.every((W) => x.includes(W)) === o;
  });
}
__name(parseAnyOfPredicate, "parseAnyOfPredicate");
function parseIsPredicate(s, e, A, g, o) {
  var F;
  if (s.length < 2 || s.length > 3)
    throw new Error(
      `Wrong number of arguments to \`#${A}\` predicate. Expected 1 or 2. Got ${s.length - 1}.`
    );
  if (!s.every(isStringStep))
    throw new Error(
      `Arguments to \`#${A}\` predicate must be strings.".`
    );
  const B = A === "is?" ? g : o;
  B[e] || (B[e] = {}), B[e][s[1].value] = ((F = s[2]) == null ? void 0 : F.value) ?? null;
}
__name(parseIsPredicate, "parseIsPredicate");
function parseSetDirective(s, e, A) {
  var g;
  if (s.length < 2 || s.length > 3)
    throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${s.length - 1}.`);
  if (!s.every(isStringStep))
    throw new Error('Arguments to `#set!` predicate must be strings.".');
  A[e] || (A[e] = {}), A[e][s[1].value] = ((g = s[2]) == null ? void 0 : g.value) ?? null;
}
__name(parseSetDirective, "parseSetDirective");
function parsePattern(s, e, A, g, o, B, F, x, b, X, W) {
  if (e === PREDICATE_STEP_TYPE_CAPTURE) {
    const eA = g[A];
    B.push({ type: "capture", name: eA });
  } else if (e === PREDICATE_STEP_TYPE_STRING)
    B.push({ type: "string", value: o[A] });
  else if (B.length > 0) {
    if (B[0].type !== "string")
      throw new Error("Predicates must begin with a literal value");
    const eA = B[0].value;
    switch (eA) {
      case "any-not-eq?":
      case "not-eq?":
      case "any-eq?":
      case "eq?":
        parseAnyPredicate(B, s, eA, F);
        break;
      case "any-not-match?":
      case "not-match?":
      case "any-match?":
      case "match?":
        parseMatchPredicate(B, s, eA, F);
        break;
      case "not-any-of?":
      case "any-of?":
        parseAnyOfPredicate(B, s, eA, F);
        break;
      case "is?":
      case "is-not?":
        parseIsPredicate(B, s, eA, X, W);
        break;
      case "set!":
        parseSetDirective(B, s, b);
        break;
      default:
        x[s].push({ operator: eA, operands: B.slice(1) });
    }
    B.length = 0;
  }
}
__name(parsePattern, "parsePattern");
var Ie, Query = (Ie = class {
  /**
   * Create a new query from a string containing one or more S-expression
   * patterns.
   *
   * The query is associated with a particular language, and can only be run
   * on syntax nodes parsed with that language. References to Queries can be
   * shared between multiple threads.
   *
   * @link {@see https://tree-sitter.github.io/tree-sitter/using-parsers/queries}
   */
  constructor(e, A) {
    /** @internal */
    fA(this, 0, 0);
    // Internal handle for WASM
    /** @internal */
    fA(this, "exceededMatchLimit");
    /** @internal */
    fA(this, "textPredicates");
    /** The names of the captures used in the query. */
    fA(this, "captureNames");
    /** The quantifiers of the captures used in the query. */
    fA(this, "captureQuantifiers");
    /**
     * The other user-defined predicates associated with the given index.
     *
     * This includes predicates with operators other than:
     * - `match?`
     * - `eq?` and `not-eq?`
     * - `any-of?` and `not-any-of?`
     * - `is?` and `is-not?`
     * - `set!`
     */
    fA(this, "predicates");
    /** The properties for predicates with the operator `set!`. */
    fA(this, "setProperties");
    /** The properties for predicates with the operator `is?`. */
    fA(this, "assertedProperties");
    /** The properties for predicates with the operator `is-not?`. */
    fA(this, "refutedProperties");
    /** The maximum number of in-progress matches for this cursor. */
    fA(this, "matchLimit");
    var H;
    const g = C.lengthBytesUTF8(A), o = C._malloc(g + 1);
    C.stringToUTF8(A, o, g + 1);
    const B = C._ts_query_new(
      e[0],
      o,
      g,
      TRANSFER_BUFFER,
      TRANSFER_BUFFER + SIZE_OF_INT
    );
    if (!B) {
      const y = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), p = C.getValue(TRANSFER_BUFFER, "i32"), h = C.UTF8ToString(o, p).length, E = A.slice(h, h + 100).split(`
`)[0], u = ((H = E.match(QUERY_WORD_REGEX)) == null ? void 0 : H[0]) ?? "";
      switch (C._free(o), y) {
        case QueryErrorKind.Syntax:
          throw new QueryError(QueryErrorKind.Syntax, { suffix: `${h}: '${E}'...` }, h, 0);
        case QueryErrorKind.NodeName:
          throw new QueryError(y, { word: u }, h, u.length);
        case QueryErrorKind.FieldName:
          throw new QueryError(y, { word: u }, h, u.length);
        case QueryErrorKind.CaptureName:
          throw new QueryError(y, { word: u }, h, u.length);
        case QueryErrorKind.PatternStructure:
          throw new QueryError(y, { suffix: `${h}: '${E}'...` }, h, 0);
      }
    }
    const F = C._ts_query_string_count(B), x = C._ts_query_capture_count(B), b = C._ts_query_pattern_count(B), X = new Array(x), W = new Array(b), eA = new Array(F);
    for (let y = 0; y < x; y++) {
      const p = C._ts_query_capture_name_for_id(
        B,
        y,
        TRANSFER_BUFFER
      ), h = C.getValue(TRANSFER_BUFFER, "i32");
      X[y] = C.UTF8ToString(p, h);
    }
    for (let y = 0; y < b; y++) {
      const p = new Array(x);
      for (let h = 0; h < x; h++) {
        const E = C._ts_query_capture_quantifier_for_id(B, y, h);
        p[h] = E;
      }
      W[y] = p;
    }
    for (let y = 0; y < F; y++) {
      const p = C._ts_query_string_value_for_id(
        B,
        y,
        TRANSFER_BUFFER
      ), h = C.getValue(TRANSFER_BUFFER, "i32");
      eA[y] = C.UTF8ToString(p, h);
    }
    const IA = new Array(b), z = new Array(b), N = new Array(b), J = new Array(b), $ = new Array(b);
    for (let y = 0; y < b; y++) {
      const p = C._ts_query_predicates_for_pattern(B, y, TRANSFER_BUFFER), h = C.getValue(TRANSFER_BUFFER, "i32");
      J[y] = [], $[y] = [];
      const E = new Array();
      let u = p;
      for (let r = 0; r < h; r++) {
        const Q = C.getValue(u, "i32");
        u += SIZE_OF_INT;
        const d = C.getValue(u, "i32");
        u += SIZE_OF_INT, parsePattern(
          y,
          Q,
          d,
          X,
          eA,
          E,
          $,
          J,
          IA,
          z,
          N
        );
      }
      Object.freeze($[y]), Object.freeze(J[y]), Object.freeze(IA[y]), Object.freeze(z[y]), Object.freeze(N[y]);
    }
    C._free(o), this[0] = B, this.captureNames = X, this.captureQuantifiers = W, this.textPredicates = $, this.predicates = J, this.setProperties = IA, this.assertedProperties = z, this.refutedProperties = N, this.exceededMatchLimit = !1;
  }
  /** Delete the query, freeing its resources. */
  delete() {
    C._ts_query_delete(this[0]), this[0] = 0;
  }
  /**
   * Iterate over all of the matches in the order that they were found.
   *
   * Each match contains the index of the pattern that matched, and a list of
   * captures. Because multiple patterns can match the same set of nodes,
   * one match may contain captures that appear *before* some of the
   * captures from a previous match.
   *
   * @param {Node} node - The node to execute the query on.
   *
   * @param {QueryOptions} options - Options for query execution.
   */
  matches(e, A = {}) {
    const g = A.startPosition ?? ZERO_POINT, o = A.endPosition ?? ZERO_POINT, B = A.startIndex ?? 0, F = A.endIndex ?? 0, x = A.matchLimit ?? 4294967295, b = A.maxStartDepth ?? 4294967295, X = A.timeoutMicros ?? 0, W = A.progressCallback;
    if (typeof x != "number")
      throw new Error("Arguments must be numbers");
    if (this.matchLimit = x, F !== 0 && B > F)
      throw new Error("`startIndex` cannot be greater than `endIndex`");
    if (o !== ZERO_POINT && (g.row > o.row || g.row === o.row && g.column > o.column))
      throw new Error("`startPosition` cannot be greater than `endPosition`");
    W && (C.currentQueryProgressCallback = W), marshalNode(e), C._ts_query_matches_wasm(
      this[0],
      e.tree[0],
      g.row,
      g.column,
      o.row,
      o.column,
      B,
      F,
      x,
      b,
      X
    );
    const eA = C.getValue(TRANSFER_BUFFER, "i32"), IA = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), z = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), N = new Array(eA);
    this.exceededMatchLimit = !!z;
    let J = 0, $ = IA;
    for (let H = 0; H < eA; H++) {
      const y = C.getValue($, "i32");
      $ += SIZE_OF_INT;
      const p = C.getValue($, "i32");
      $ += SIZE_OF_INT;
      const h = new Array(p);
      if ($ = unmarshalCaptures(this, e.tree, $, y, h), this.textPredicates[y].every((E) => E(h))) {
        N[J] = { pattern: y, patternIndex: y, captures: h };
        const E = this.setProperties[y];
        N[J].setProperties = E;
        const u = this.assertedProperties[y];
        N[J].assertedProperties = u;
        const r = this.refutedProperties[y];
        N[J].refutedProperties = r, J++;
      }
    }
    return N.length = J, C._free(IA), C.currentQueryProgressCallback = null, N;
  }
  /**
   * Iterate over all of the individual captures in the order that they
   * appear.
   *
   * This is useful if you don't care about which pattern matched, and just
   * want a single, ordered sequence of captures.
   *
   * @param {Node} node - The node to execute the query on.
   *
   * @param {QueryOptions} options - Options for query execution.
   */
  captures(e, A = {}) {
    const g = A.startPosition ?? ZERO_POINT, o = A.endPosition ?? ZERO_POINT, B = A.startIndex ?? 0, F = A.endIndex ?? 0, x = A.matchLimit ?? 4294967295, b = A.maxStartDepth ?? 4294967295, X = A.timeoutMicros ?? 0, W = A.progressCallback;
    if (typeof x != "number")
      throw new Error("Arguments must be numbers");
    if (this.matchLimit = x, F !== 0 && B > F)
      throw new Error("`startIndex` cannot be greater than `endIndex`");
    if (o !== ZERO_POINT && (g.row > o.row || g.row === o.row && g.column > o.column))
      throw new Error("`startPosition` cannot be greater than `endPosition`");
    W && (C.currentQueryProgressCallback = W), marshalNode(e), C._ts_query_captures_wasm(
      this[0],
      e.tree[0],
      g.row,
      g.column,
      o.row,
      o.column,
      B,
      F,
      x,
      b,
      X
    );
    const eA = C.getValue(TRANSFER_BUFFER, "i32"), IA = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), z = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), N = new Array();
    this.exceededMatchLimit = !!z;
    const J = new Array();
    let $ = IA;
    for (let H = 0; H < eA; H++) {
      const y = C.getValue($, "i32");
      $ += SIZE_OF_INT;
      const p = C.getValue($, "i32");
      $ += SIZE_OF_INT;
      const h = C.getValue($, "i32");
      if ($ += SIZE_OF_INT, J.length = p, $ = unmarshalCaptures(this, e.tree, $, y, J), this.textPredicates[y].every((E) => E(J))) {
        const E = J[h], u = this.setProperties[y];
        E.setProperties = u;
        const r = this.assertedProperties[y];
        E.assertedProperties = r;
        const Q = this.refutedProperties[y];
        E.refutedProperties = Q, N.push(E);
      }
    }
    return C._free(IA), C.currentQueryProgressCallback = null, N;
  }
  /** Get the predicates for a given pattern. */
  predicatesForPattern(e) {
    return this.predicates[e];
  }
  /**
   * Disable a certain capture within a query.
   *
   * This prevents the capture from being returned in matches, and also
   * avoids any resource usage associated with recording the capture.
   */
  disableCapture(e) {
    const A = C.lengthBytesUTF8(e), g = C._malloc(A + 1);
    C.stringToUTF8(e, g, A + 1), C._ts_query_disable_capture(this[0], g, A), C._free(g);
  }
  /**
   * Disable a certain pattern within a query.
   *
   * This prevents the pattern from matching, and also avoids any resource
   * usage associated with the pattern. This throws an error if the pattern
   * index is out of bounds.
   */
  disablePattern(e) {
    if (e >= this.predicates.length)
      throw new Error(
        `Pattern index is ${e} but the pattern count is ${this.predicates.length}`
      );
    C._ts_query_disable_pattern(this[0], e);
  }
  /**
   * Check if, on its last execution, this cursor exceeded its maximum number
   * of in-progress matches.
   */
  didExceedMatchLimit() {
    return this.exceededMatchLimit;
  }
  /** Get the byte offset where the given pattern starts in the query's source. */
  startIndexForPattern(e) {
    if (e >= this.predicates.length)
      throw new Error(
        `Pattern index is ${e} but the pattern count is ${this.predicates.length}`
      );
    return C._ts_query_start_byte_for_pattern(this[0], e);
  }
  /** Get the byte offset where the given pattern ends in the query's source. */
  endIndexForPattern(e) {
    if (e >= this.predicates.length)
      throw new Error(
        `Pattern index is ${e} but the pattern count is ${this.predicates.length}`
      );
    return C._ts_query_end_byte_for_pattern(this[0], e);
  }
  /** Get the number of patterns in the query. */
  patternCount() {
    return C._ts_query_pattern_count(this[0]);
  }
  /** Get the index for a given capture name. */
  captureIndexForName(e) {
    return this.captureNames.indexOf(e);
  }
  /** Check if a given pattern within a query has a single root node. */
  isPatternRooted(e) {
    return C._ts_query_is_pattern_rooted(this[0], e) === 1;
  }
  /** Check if a given pattern within a query has a single root node. */
  isPatternNonLocal(e) {
    return C._ts_query_is_pattern_non_local(this[0], e) === 1;
  }
  /**
   * Check if a given step in a query is 'definite'.
   *
   * A query step is 'definite' if its parent pattern will be guaranteed to
   * match successfully once it reaches the step.
   */
  isPatternGuaranteedAtStep(e) {
    return C._ts_query_is_pattern_guaranteed_at_step(this[0], e) === 1;
  }
}, __name(Ie, "Query"), Ie), LANGUAGE_FUNCTION_REGEX = /^tree_sitter_\w+$/, ee, Language = (ee = class {
  /** @internal */
  constructor(e, A) {
    /** @internal */
    fA(this, 0, 0);
    // Internal handle for WASM
    /**
     * A list of all node types in the language. The index of each type in this
     * array is its node type id.
     */
    fA(this, "types");
    /**
     * A list of all field names in the language. The index of each field name in
     * this array is its field id.
     */
    fA(this, "fields");
    assertInternal(e), this[0] = A, this.types = new Array(C._ts_language_symbol_count(this[0]));
    for (let g = 0, o = this.types.length; g < o; g++)
      C._ts_language_symbol_type(this[0], g) < 2 && (this.types[g] = C.UTF8ToString(C._ts_language_symbol_name(this[0], g)));
    this.fields = new Array(C._ts_language_field_count(this[0]) + 1);
    for (let g = 0, o = this.fields.length; g < o; g++) {
      const B = C._ts_language_field_name_for_id(this[0], g);
      B !== 0 ? this.fields[g] = C.UTF8ToString(B) : this.fields[g] = null;
    }
  }
  /**
   * Gets the name of the language.
   */
  get name() {
    const e = C._ts_language_name(this[0]);
    return e === 0 ? null : C.UTF8ToString(e);
  }
  /**
   * @deprecated since version 0.25.0, use {@link Language#abiVersion} instead
   * Gets the version of the language.
   */
  get version() {
    return C._ts_language_version(this[0]);
  }
  /**
   * Gets the ABI version of the language.
   */
  get abiVersion() {
    return C._ts_language_abi_version(this[0]);
  }
  /**
  * Get the metadata for this language. This information is generated by the
  * CLI, and relies on the language author providing the correct metadata in
  * the language's `tree-sitter.json` file.
  */
  get metadata() {
    C._ts_language_metadata(this[0]);
    const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
    return e === 0 ? null : unmarshalLanguageMetadata(A);
  }
  /**
   * Gets the number of fields in the language.
   */
  get fieldCount() {
    return this.fields.length - 1;
  }
  /**
   * Gets the number of states in the language.
   */
  get stateCount() {
    return C._ts_language_state_count(this[0]);
  }
  /**
   * Get the field id for a field name.
   */
  fieldIdForName(e) {
    const A = this.fields.indexOf(e);
    return A !== -1 ? A : null;
  }
  /**
   * Get the field name for a field id.
   */
  fieldNameForId(e) {
    return this.fields[e] ?? null;
  }
  /**
   * Get the node type id for a node type name.
   */
  idForNodeType(e, A) {
    const g = C.lengthBytesUTF8(e), o = C._malloc(g + 1);
    C.stringToUTF8(e, o, g + 1);
    const B = C._ts_language_symbol_for_name(this[0], o, g, A ? 1 : 0);
    return C._free(o), B || null;
  }
  /**
   * Gets the number of node types in the language.
   */
  get nodeTypeCount() {
    return C._ts_language_symbol_count(this[0]);
  }
  /**
   * Get the node type name for a node type id.
   */
  nodeTypeForId(e) {
    const A = C._ts_language_symbol_name(this[0], e);
    return A ? C.UTF8ToString(A) : null;
  }
  /**
   * Check if a node type is named.
   *
   * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/2-basic-parsing.html#named-vs-anonymous-nodes}
   */
  nodeTypeIsNamed(e) {
    return !!C._ts_language_type_is_named_wasm(this[0], e);
  }
  /**
   * Check if a node type is visible.
   */
  nodeTypeIsVisible(e) {
    return !!C._ts_language_type_is_visible_wasm(this[0], e);
  }
  /**
   * Get the supertypes ids of this language.
   *
   * @see {@link https://tree-sitter.github.io/tree-sitter/using-parsers/6-static-node-types.html?highlight=supertype#supertype-nodes}
   */
  get supertypes() {
    C._ts_language_supertypes_wasm(this[0]);
    const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), g = new Array(e);
    if (e > 0) {
      let o = A;
      for (let B = 0; B < e; B++)
        g[B] = C.getValue(o, "i16"), o += SIZE_OF_SHORT;
    }
    return g;
  }
  /**
   * Get the subtype ids for a given supertype node id.
   */
  subtypes(e) {
    C._ts_language_subtypes_wasm(this[0], e);
    const A = C.getValue(TRANSFER_BUFFER, "i32"), g = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), o = new Array(A);
    if (A > 0) {
      let B = g;
      for (let F = 0; F < A; F++)
        o[F] = C.getValue(B, "i16"), B += SIZE_OF_SHORT;
    }
    return o;
  }
  /**
   * Get the next state id for a given state id and node type id.
   */
  nextState(e, A) {
    return C._ts_language_next_state(this[0], e, A);
  }
  /**
   * Create a new lookahead iterator for this language and parse state.
   *
   * This returns `null` if state is invalid for this language.
   *
   * Iterating {@link LookaheadIterator} will yield valid symbols in the given
   * parse state. Newly created lookahead iterators will return the `ERROR`
   * symbol from {@link LookaheadIterator#currentType}.
   *
   * Lookahead iterators can be useful for generating suggestions and improving
   * syntax error diagnostics. To get symbols valid in an `ERROR` node, use the
   * lookahead iterator on its first leaf node state. For `MISSING` nodes, a
   * lookahead iterator created on the previous non-extra leaf node may be
   * appropriate.
   */
  lookaheadIterator(e) {
    const A = C._ts_lookahead_iterator_new(this[0], e);
    return A ? new LookaheadIterator(INTERNAL, A, this) : null;
  }
  /**
   * @deprecated since version 0.25.0, call `new` on a {@link Query} instead
   *
   * Create a new query from a string containing one or more S-expression
   * patterns.
   *
   * The query is associated with a particular language, and can only be run
   * on syntax nodes parsed with that language. References to Queries can be
   * shared between multiple threads.
   *
   * @link {@see https://tree-sitter.github.io/tree-sitter/using-parsers/queries}
   */
  query(e) {
    return console.warn("Language.query is deprecated. Use new Query(language, source) instead."), new Query(this, e);
  }
  /**
   * Load a language from a WebAssembly module.
   * The module can be provided as a path to a file or as a buffer.
   */
  static async load(e) {
    var x;
    let A;
    e instanceof Uint8Array ? A = Promise.resolve(e) : (x = globalThis.process) != null && x.versions.node ? A = (await import("fs/promises")).readFile(e) : A = fetch(e).then((b) => b.arrayBuffer().then((X) => {
      if (b.ok)
        return new Uint8Array(X);
      {
        const W = new TextDecoder("utf-8").decode(X);
        throw new Error(`Language.load failed with status ${b.status}.

${W}`);
      }
    }));
    const g = await C.loadWebAssemblyModule(await A, { loadAsync: !0 }), o = Object.keys(g), B = o.find((b) => LANGUAGE_FUNCTION_REGEX.test(b) && !b.includes("external_scanner_"));
    if (!B)
      throw console.log(`Couldn't find language function in WASM file. Symbols:
${JSON.stringify(o, null, 2)}`), new Error("Language.load failed: no language function found in WASM file");
    const F = g[B]();
    return new ee(INTERNAL, F);
  }
}, __name(ee, "Language"), ee), Module2 = (() => {
  var _scriptName = import.meta.url;
  return async function(moduleArg = {}) {
    var moduleRtn, Module = moduleArg, readyPromiseResolve, readyPromiseReject, readyPromise = new Promise((e, A) => {
      readyPromiseResolve = e, readyPromiseReject = A;
    }), ENVIRONMENT_IS_WEB = typeof window == "object", ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope < "u", ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && process.type != "renderer";
    if (ENVIRONMENT_IS_NODE) {
      const { createRequire: e } = await import("module");
      var require = e(import.meta.url);
    }
    Module.currentQueryProgressCallback = null, Module.currentProgressCallback = null, Module.currentLogCallback = null, Module.currentParseCallback = null;
    var moduleOverrides = Object.assign({}, Module), arguments_ = [], thisProgram = "./this.program", quit_ = /* @__PURE__ */ __name((e, A) => {
      throw A;
    }, "quit_"), scriptDirectory = "";
    function locateFile(e) {
      return Module.locateFile ? Module.locateFile(e, scriptDirectory) : scriptDirectory + e;
    }
    __name(locateFile, "locateFile");
    var readAsync, readBinary;
    if (ENVIRONMENT_IS_NODE) {
      var fs = require("fs"), nodePath = require("path");
      import.meta.url.startsWith("data:") || (scriptDirectory = nodePath.dirname(require("url").fileURLToPath(import.meta.url)) + "/"), readBinary = /* @__PURE__ */ __name((e) => {
        e = isFileURI(e) ? new URL(e) : e;
        var A = fs.readFileSync(e);
        return A;
      }, "readBinary"), readAsync = /* @__PURE__ */ __name(async (e, A = !0) => {
        e = isFileURI(e) ? new URL(e) : e;
        var g = fs.readFileSync(e, A ? void 0 : "utf8");
        return g;
      }, "readAsync"), !Module.thisProgram && process.argv.length > 1 && (thisProgram = process.argv[1].replace(/\\/g, "/")), arguments_ = process.argv.slice(2), quit_ = /* @__PURE__ */ __name((e, A) => {
        throw process.exitCode = e, A;
      }, "quit_");
    } else (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && (ENVIRONMENT_IS_WORKER ? scriptDirectory = self.location.href : typeof document < "u" && document.currentScript && (scriptDirectory = document.currentScript.src), _scriptName && (scriptDirectory = _scriptName), scriptDirectory.startsWith("blob:") ? scriptDirectory = "" : scriptDirectory = scriptDirectory.slice(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1), ENVIRONMENT_IS_WORKER && (readBinary = /* @__PURE__ */ __name((e) => {
      var A = new XMLHttpRequest();
      return A.open("GET", e, !1), A.responseType = "arraybuffer", A.send(null), new Uint8Array(
        /** @type{!ArrayBuffer} */
        A.response
      );
    }, "readBinary")), readAsync = /* @__PURE__ */ __name(async (e) => {
      if (isFileURI(e))
        return new Promise((g, o) => {
          var B = new XMLHttpRequest();
          B.open("GET", e, !0), B.responseType = "arraybuffer", B.onload = () => {
            if (B.status == 200 || B.status == 0 && B.response) {
              g(B.response);
              return;
            }
            o(B.status);
          }, B.onerror = o, B.send(null);
        });
      var A = await fetch(e, {
        credentials: "same-origin"
      });
      if (A.ok)
        return A.arrayBuffer();
      throw new Error(A.status + " : " + A.url);
    }, "readAsync"));
    var out = Module.print || console.log.bind(console), err = Module.printErr || console.error.bind(console);
    Object.assign(Module, moduleOverrides), moduleOverrides = null, Module.arguments && (arguments_ = Module.arguments), Module.thisProgram && (thisProgram = Module.thisProgram);
    var dynamicLibraries = Module.dynamicLibraries || [], wasmBinary = Module.wasmBinary, wasmMemory, ABORT = !1, EXITSTATUS;
    function assert(e, A) {
      e || abort(A);
    }
    __name(assert, "assert");
    var HEAP8, HEAPU8, HEAP64, HEAP_DATA_VIEW, runtimeInitialized = !1, isFileURI = /* @__PURE__ */ __name((e) => e.startsWith("file://"), "isFileURI");
    function updateMemoryViews() {
      var e = wasmMemory.buffer;
      Module.HEAP_DATA_VIEW = HEAP_DATA_VIEW = new DataView(e), Module.HEAP8 = HEAP8 = new Int8Array(e), Module.HEAP16 = new Int16Array(e), Module.HEAPU8 = HEAPU8 = new Uint8Array(e), Module.HEAPU16 = new Uint16Array(e), Module.HEAP32 = new Int32Array(e), Module.HEAPU32 = new Uint32Array(e), Module.HEAPF32 = new Float32Array(e), Module.HEAPF64 = new Float64Array(e), Module.HEAP64 = HEAP64 = new BigInt64Array(e), Module.HEAPU64 = new BigUint64Array(e);
    }
    if (__name(updateMemoryViews, "updateMemoryViews"), Module.wasmMemory)
      wasmMemory = Module.wasmMemory;
    else {
      var INITIAL_MEMORY = Module.INITIAL_MEMORY || 33554432;
      wasmMemory = new WebAssembly.Memory({
        initial: INITIAL_MEMORY / 65536,
        // In theory we should not need to emit the maximum if we want "unlimited"
        // or 4GB of memory, but VMs error on that atm, see
        // https://github.com/emscripten-core/emscripten/issues/14130
        // And in the pthreads case we definitely need to emit a maximum. So
        // always emit one.
        maximum: 32768
      });
    }
    updateMemoryViews();
    var __RELOC_FUNCS__ = [];
    function preRun() {
      if (Module.preRun)
        for (typeof Module.preRun == "function" && (Module.preRun = [Module.preRun]); Module.preRun.length; )
          addOnPreRun(Module.preRun.shift());
      callRuntimeCallbacks(onPreRuns);
    }
    __name(preRun, "preRun");
    function initRuntime() {
      runtimeInitialized = !0, callRuntimeCallbacks(__RELOC_FUNCS__), wasmExports.__wasm_call_ctors(), callRuntimeCallbacks(onPostCtors);
    }
    __name(initRuntime, "initRuntime");
    function preMain() {
    }
    __name(preMain, "preMain");
    function postRun() {
      if (Module.postRun)
        for (typeof Module.postRun == "function" && (Module.postRun = [Module.postRun]); Module.postRun.length; )
          addOnPostRun(Module.postRun.shift());
      callRuntimeCallbacks(onPostRuns);
    }
    __name(postRun, "postRun");
    var runDependencies = 0, dependenciesFulfilled = null;
    function getUniqueRunDependency(e) {
      return e;
    }
    __name(getUniqueRunDependency, "getUniqueRunDependency");
    function addRunDependency(e) {
      var A;
      runDependencies++, (A = Module.monitorRunDependencies) == null || A.call(Module, runDependencies);
    }
    __name(addRunDependency, "addRunDependency");
    function removeRunDependency(e) {
      var g;
      if (runDependencies--, (g = Module.monitorRunDependencies) == null || g.call(Module, runDependencies), runDependencies == 0 && dependenciesFulfilled) {
        var A = dependenciesFulfilled;
        dependenciesFulfilled = null, A();
      }
    }
    __name(removeRunDependency, "removeRunDependency");
    function abort(e) {
      var g;
      (g = Module.onAbort) == null || g.call(Module, e), e = "Aborted(" + e + ")", err(e), ABORT = !0, e += ". Build with -sASSERTIONS for more info.";
      var A = new WebAssembly.RuntimeError(e);
      throw readyPromiseReject(A), A;
    }
    __name(abort, "abort");
    var wasmBinaryFile;
    function findWasmBinary() {
      return Module.locateFile ? locateFile("tree-sitter.wasm") : new URL("data:application/wasm;base64, ", import.meta.url).href;
    }
    __name(findWasmBinary, "findWasmBinary");
    function getBinarySync(e) {
      if (e == wasmBinaryFile && wasmBinary)
        return new Uint8Array(wasmBinary);
      if (readBinary)
        return readBinary(e);
      throw "both async and sync fetching of the wasm failed";
    }
    __name(getBinarySync, "getBinarySync");
    async function getWasmBinary(e) {
      if (!wasmBinary)
        try {
          var A = await readAsync(e);
          return new Uint8Array(A);
        } catch {
        }
      return getBinarySync(e);
    }
    __name(getWasmBinary, "getWasmBinary");
    async function instantiateArrayBuffer(e, A) {
      try {
        var g = await getWasmBinary(e), o = await WebAssembly.instantiate(g, A);
        return o;
      } catch (B) {
        err(`failed to asynchronously prepare wasm: ${B}`), abort(B);
      }
    }
    __name(instantiateArrayBuffer, "instantiateArrayBuffer");
    async function instantiateAsync(e, A, g) {
      if (!e && typeof WebAssembly.instantiateStreaming == "function" && !isFileURI(A) && !ENVIRONMENT_IS_NODE)
        try {
          var o = fetch(A, {
            credentials: "same-origin"
          }), B = await WebAssembly.instantiateStreaming(o, g);
          return B;
        } catch (F) {
          err(`wasm streaming compile failed: ${F}`), err("falling back to ArrayBuffer instantiation");
        }
      return instantiateArrayBuffer(A, g);
    }
    __name(instantiateAsync, "instantiateAsync");
    function getWasmImports() {
      return {
        env: wasmImports,
        wasi_snapshot_preview1: wasmImports,
        "GOT.mem": new Proxy(wasmImports, GOTHandler),
        "GOT.func": new Proxy(wasmImports, GOTHandler)
      };
    }
    __name(getWasmImports, "getWasmImports");
    async function createWasm() {
      function e(F, x) {
        wasmExports = F.exports, wasmExports = relocateExports(wasmExports, 1024);
        var b = getDylinkMetadata(x);
        return b.neededDynlibs && (dynamicLibraries = b.neededDynlibs.concat(dynamicLibraries)), mergeLibSymbols(wasmExports, "main"), LDSO.init(), loadDylibs(), __RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs), removeRunDependency(), wasmExports;
      }
      __name(e, "receiveInstance"), addRunDependency();
      function A(F) {
        return e(F.instance, F.module);
      }
      __name(A, "receiveInstantiationResult");
      var g = getWasmImports();
      if (Module.instantiateWasm)
        return new Promise((F, x) => {
          Module.instantiateWasm(g, (b, X) => {
            e(b, X), F(b.exports);
          });
        });
      wasmBinaryFile ?? (wasmBinaryFile = findWasmBinary());
      try {
        var o = await instantiateAsync(wasmBinary, wasmBinaryFile, g), B = A(o);
        return B;
      } catch (F) {
        return readyPromiseReject(F), Promise.reject(F);
      }
    }
    __name(createWasm, "createWasm");
    const s = class s {
      constructor(A) {
        fA(this, "name", "ExitStatus");
        this.message = `Program terminated with exit(${A})`, this.status = A;
      }
    };
    __name(s, "ExitStatus");
    let ExitStatus = s;
    var GOT = {}, currentModuleWeakSymbols = /* @__PURE__ */ new Set([]), GOTHandler = {
      get(e, A) {
        var g = GOT[A];
        return g || (g = GOT[A] = new WebAssembly.Global({
          value: "i32",
          mutable: !0
        })), currentModuleWeakSymbols.has(A) || (g.required = !0), g;
      }
    }, LE_HEAP_LOAD_F32 = /* @__PURE__ */ __name((e) => HEAP_DATA_VIEW.getFloat32(e, !0), "LE_HEAP_LOAD_F32"), LE_HEAP_LOAD_F64 = /* @__PURE__ */ __name((e) => HEAP_DATA_VIEW.getFloat64(e, !0), "LE_HEAP_LOAD_F64"), LE_HEAP_LOAD_I16 = /* @__PURE__ */ __name((e) => HEAP_DATA_VIEW.getInt16(e, !0), "LE_HEAP_LOAD_I16"), LE_HEAP_LOAD_I32 = /* @__PURE__ */ __name((e) => HEAP_DATA_VIEW.getInt32(e, !0), "LE_HEAP_LOAD_I32"), LE_HEAP_LOAD_U32 = /* @__PURE__ */ __name((e) => HEAP_DATA_VIEW.getUint32(e, !0), "LE_HEAP_LOAD_U32"), LE_HEAP_STORE_F32 = /* @__PURE__ */ __name((e, A) => HEAP_DATA_VIEW.setFloat32(e, A, !0), "LE_HEAP_STORE_F32"), LE_HEAP_STORE_F64 = /* @__PURE__ */ __name((e, A) => HEAP_DATA_VIEW.setFloat64(e, A, !0), "LE_HEAP_STORE_F64"), LE_HEAP_STORE_I16 = /* @__PURE__ */ __name((e, A) => HEAP_DATA_VIEW.setInt16(e, A, !0), "LE_HEAP_STORE_I16"), LE_HEAP_STORE_I32 = /* @__PURE__ */ __name((e, A) => HEAP_DATA_VIEW.setInt32(e, A, !0), "LE_HEAP_STORE_I32"), LE_HEAP_STORE_U32 = /* @__PURE__ */ __name((e, A) => HEAP_DATA_VIEW.setUint32(e, A, !0), "LE_HEAP_STORE_U32"), callRuntimeCallbacks = /* @__PURE__ */ __name((e) => {
      for (; e.length > 0; )
        e.shift()(Module);
    }, "callRuntimeCallbacks"), onPostRuns = [], addOnPostRun = /* @__PURE__ */ __name((e) => onPostRuns.unshift(e), "addOnPostRun"), onPreRuns = [], addOnPreRun = /* @__PURE__ */ __name((e) => onPreRuns.unshift(e), "addOnPreRun"), UTF8Decoder = typeof TextDecoder < "u" ? new TextDecoder() : void 0, UTF8ArrayToString = /* @__PURE__ */ __name((e, A = 0, g = NaN) => {
      for (var o = A + g, B = A; e[B] && !(B >= o); ) ++B;
      if (B - A > 16 && e.buffer && UTF8Decoder)
        return UTF8Decoder.decode(e.subarray(A, B));
      for (var F = ""; A < B; ) {
        var x = e[A++];
        if (!(x & 128)) {
          F += String.fromCharCode(x);
          continue;
        }
        var b = e[A++] & 63;
        if ((x & 224) == 192) {
          F += String.fromCharCode((x & 31) << 6 | b);
          continue;
        }
        var X = e[A++] & 63;
        if ((x & 240) == 224 ? x = (x & 15) << 12 | b << 6 | X : x = (x & 7) << 18 | b << 12 | X << 6 | e[A++] & 63, x < 65536)
          F += String.fromCharCode(x);
        else {
          var W = x - 65536;
          F += String.fromCharCode(55296 | W >> 10, 56320 | W & 1023);
        }
      }
      return F;
    }, "UTF8ArrayToString"), getDylinkMetadata = /* @__PURE__ */ __name((e) => {
      var A = 0, g = 0;
      function o() {
        return e[A++];
      }
      __name(o, "getU8");
      function B() {
        for (var k = 0, K = 1; ; ) {
          var gA = e[A++];
          if (k += (gA & 127) * K, K *= 128, !(gA & 128)) break;
        }
        return k;
      }
      __name(B, "getLEB");
      function F() {
        var k = B();
        return A += k, UTF8ArrayToString(e, A - k, k);
      }
      __name(F, "getString");
      function x(k, K) {
        if (k) throw new Error(K);
      }
      __name(x, "failIf");
      var b = "dylink.0";
      if (e instanceof WebAssembly.Module) {
        var X = WebAssembly.Module.customSections(e, b);
        X.length === 0 && (b = "dylink", X = WebAssembly.Module.customSections(e, b)), x(X.length === 0, "need dylink section"), e = new Uint8Array(X[0]), g = e.length;
      } else {
        var W = new Uint32Array(new Uint8Array(e.subarray(0, 24)).buffer), eA = W[0] == 1836278016 || W[0] == 6386541;
        x(!eA, "need to see wasm magic number"), x(e[8] !== 0, "need the dylink section to be first"), A = 9;
        var IA = B();
        g = A + IA, b = F();
      }
      var z = {
        neededDynlibs: [],
        tlsExports: /* @__PURE__ */ new Set(),
        weakImports: /* @__PURE__ */ new Set()
      };
      if (b == "dylink") {
        z.memorySize = B(), z.memoryAlign = B(), z.tableSize = B(), z.tableAlign = B();
        for (var N = B(), J = 0; J < N; ++J) {
          var $ = F();
          z.neededDynlibs.push($);
        }
      } else {
        x(b !== "dylink.0");
        for (var H = 1, y = 2, p = 3, h = 4, E = 256, u = 3, r = 1; A < g; ) {
          var Q = o(), d = B();
          if (Q === H)
            z.memorySize = B(), z.memoryAlign = B(), z.tableSize = B(), z.tableAlign = B();
          else if (Q === y)
            for (var N = B(), J = 0; J < N; ++J)
              $ = F(), z.neededDynlibs.push($);
          else if (Q === p)
            for (var c = B(); c--; ) {
              var n = F(), L = B();
              L & E && z.tlsExports.add(n);
            }
          else if (Q === h)
            for (var c = B(); c--; ) {
              F();
              var n = F(), L = B();
              (L & u) == r && z.weakImports.add(n);
            }
          else
            A += d;
        }
      }
      return z;
    }, "getDylinkMetadata");
    function getValue(e, A = "i8") {
      switch (A.endsWith("*") && (A = "*"), A) {
        case "i1":
          return HEAP8[e];
        case "i8":
          return HEAP8[e];
        case "i16":
          return LE_HEAP_LOAD_I16((e >> 1) * 2);
        case "i32":
          return LE_HEAP_LOAD_I32((e >> 2) * 4);
        case "i64":
          return HEAP64[e >> 3];
        case "float":
          return LE_HEAP_LOAD_F32((e >> 2) * 4);
        case "double":
          return LE_HEAP_LOAD_F64((e >> 3) * 8);
        case "*":
          return LE_HEAP_LOAD_U32((e >> 2) * 4);
        default:
          abort(`invalid type for getValue: ${A}`);
      }
    }
    __name(getValue, "getValue");
    var newDSO = /* @__PURE__ */ __name((e, A, g) => {
      var o = {
        refcount: 1 / 0,
        name: e,
        exports: g,
        global: !0
      };
      return LDSO.loadedLibsByName[e] = o, A != null && (LDSO.loadedLibsByHandle[A] = o), o;
    }, "newDSO"), LDSO = {
      loadedLibsByName: {},
      loadedLibsByHandle: {},
      init() {
        newDSO("__main__", 0, wasmImports);
      }
    }, ___heap_base = 78224, alignMemory = /* @__PURE__ */ __name((e, A) => Math.ceil(e / A) * A, "alignMemory"), getMemory = /* @__PURE__ */ __name((e) => {
      if (runtimeInitialized)
        return _calloc(e, 1);
      var A = ___heap_base, g = A + alignMemory(e, 16);
      return ___heap_base = g, GOT.__heap_base.value = g, A;
    }, "getMemory"), isInternalSym = /* @__PURE__ */ __name((e) => ["__cpp_exception", "__c_longjmp", "__wasm_apply_data_relocs", "__dso_handle", "__tls_size", "__tls_align", "__set_stack_limits", "_emscripten_tls_init", "__wasm_init_tls", "__wasm_call_ctors", "__start_em_asm", "__stop_em_asm", "__start_em_js", "__stop_em_js"].includes(e) || e.startsWith("__em_js__"), "isInternalSym"), uleb128Encode = /* @__PURE__ */ __name((e, A) => {
      e < 128 ? A.push(e) : A.push(e % 128 | 128, e >> 7);
    }, "uleb128Encode"), sigToWasmTypes = /* @__PURE__ */ __name((e) => {
      for (var A = {
        i: "i32",
        j: "i64",
        f: "f32",
        d: "f64",
        e: "externref",
        p: "i32"
      }, g = {
        parameters: [],
        results: e[0] == "v" ? [] : [A[e[0]]]
      }, o = 1; o < e.length; ++o)
        g.parameters.push(A[e[o]]);
      return g;
    }, "sigToWasmTypes"), generateFuncType = /* @__PURE__ */ __name((e, A) => {
      var g = e.slice(0, 1), o = e.slice(1), B = {
        i: 127,
        // i32
        p: 127,
        // i32
        j: 126,
        // i64
        f: 125,
        // f32
        d: 124,
        // f64
        e: 111
      };
      A.push(96), uleb128Encode(o.length, A);
      for (var F = 0; F < o.length; ++F)
        A.push(B[o[F]]);
      g == "v" ? A.push(0) : A.push(1, B[g]);
    }, "generateFuncType"), convertJsFunctionToWasm = /* @__PURE__ */ __name((e, A) => {
      if (typeof WebAssembly.Function == "function")
        return new WebAssembly.Function(sigToWasmTypes(A), e);
      var g = [1];
      generateFuncType(A, g);
      var o = [
        0,
        97,
        115,
        109,
        // magic ("\0asm")
        1,
        0,
        0,
        0,
        // version: 1
        1
      ];
      uleb128Encode(g.length, o), o.push(...g), o.push(
        2,
        7,
        // import section
        // (import "e" "f" (func 0 (type 0)))
        1,
        1,
        101,
        1,
        102,
        0,
        0,
        7,
        5,
        // export section
        // (export "f" (func 0 (type 0)))
        1,
        1,
        102,
        0,
        0
      );
      var B = new WebAssembly.Module(new Uint8Array(o)), F = new WebAssembly.Instance(B, {
        e: {
          f: e
        }
      }), x = F.exports.f;
      return x;
    }, "convertJsFunctionToWasm"), wasmTableMirror = [], wasmTable = new WebAssembly.Table({
      initial: 31,
      element: "anyfunc"
    }), getWasmTableEntry = /* @__PURE__ */ __name((e) => {
      var A = wasmTableMirror[e];
      return A || (e >= wasmTableMirror.length && (wasmTableMirror.length = e + 1), wasmTableMirror[e] = A = wasmTable.get(e)), A;
    }, "getWasmTableEntry"), updateTableMap = /* @__PURE__ */ __name((e, A) => {
      if (functionsInTableMap)
        for (var g = e; g < e + A; g++) {
          var o = getWasmTableEntry(g);
          o && functionsInTableMap.set(o, g);
        }
    }, "updateTableMap"), functionsInTableMap, getFunctionAddress = /* @__PURE__ */ __name((e) => (functionsInTableMap || (functionsInTableMap = /* @__PURE__ */ new WeakMap(), updateTableMap(0, wasmTable.length)), functionsInTableMap.get(e) || 0), "getFunctionAddress"), freeTableIndexes = [], getEmptyTableSlot = /* @__PURE__ */ __name(() => {
      if (freeTableIndexes.length)
        return freeTableIndexes.pop();
      try {
        wasmTable.grow(1);
      } catch (e) {
        throw e instanceof RangeError ? "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH." : e;
      }
      return wasmTable.length - 1;
    }, "getEmptyTableSlot"), setWasmTableEntry = /* @__PURE__ */ __name((e, A) => {
      wasmTable.set(e, A), wasmTableMirror[e] = wasmTable.get(e);
    }, "setWasmTableEntry"), addFunction = /* @__PURE__ */ __name((e, A) => {
      var g = getFunctionAddress(e);
      if (g)
        return g;
      var o = getEmptyTableSlot();
      try {
        setWasmTableEntry(o, e);
      } catch (F) {
        if (!(F instanceof TypeError))
          throw F;
        var B = convertJsFunctionToWasm(e, A);
        setWasmTableEntry(o, B);
      }
      return functionsInTableMap.set(e, o), o;
    }, "addFunction"), updateGOT = /* @__PURE__ */ __name((e, A) => {
      for (var g in e)
        if (!isInternalSym(g)) {
          var o = e[g];
          GOT[g] || (GOT[g] = new WebAssembly.Global({
            value: "i32",
            mutable: !0
          })), (A || GOT[g].value == 0) && (typeof o == "function" ? GOT[g].value = addFunction(o) : typeof o == "number" ? GOT[g].value = o : err(`unhandled export type for '${g}': ${typeof o}`));
        }
    }, "updateGOT"), relocateExports = /* @__PURE__ */ __name((e, A, g) => {
      var o = {};
      for (var B in e) {
        var F = e[B];
        typeof F == "object" && (F = F.value), typeof F == "number" && (F += A), o[B] = F;
      }
      return updateGOT(o, g), o;
    }, "relocateExports"), isSymbolDefined = /* @__PURE__ */ __name((e) => {
      var A = wasmImports[e];
      return !(!A || A.stub);
    }, "isSymbolDefined"), dynCall = /* @__PURE__ */ __name((e, A, g = []) => {
      var o = getWasmTableEntry(A)(...g);
      return o;
    }, "dynCall"), stackSave = /* @__PURE__ */ __name(() => _emscripten_stack_get_current(), "stackSave"), stackRestore = /* @__PURE__ */ __name((e) => __emscripten_stack_restore(e), "stackRestore"), createInvokeFunction = /* @__PURE__ */ __name((e) => (A, ...g) => {
      var o = stackSave();
      try {
        return dynCall(e, A, g);
      } catch (B) {
        if (stackRestore(o), B !== B + 0) throw B;
        if (_setThrew(1, 0), e[0] == "j") return 0n;
      }
    }, "createInvokeFunction"), resolveGlobalSymbol = /* @__PURE__ */ __name((e, A = !1) => {
      var g;
      return isSymbolDefined(e) ? g = wasmImports[e] : e.startsWith("invoke_") && (g = wasmImports[e] = createInvokeFunction(e.split("_")[1])), {
        sym: g,
        name: e
      };
    }, "resolveGlobalSymbol"), onPostCtors = [], addOnPostCtor = /* @__PURE__ */ __name((e) => onPostCtors.unshift(e), "addOnPostCtor"), UTF8ToString = /* @__PURE__ */ __name((e, A) => e ? UTF8ArrayToString(HEAPU8, e, A) : "", "UTF8ToString"), loadWebAssemblyModule = /* @__PURE__ */ __name((binary, flags, libName, localScope, handle) => {
      var metadata = getDylinkMetadata(binary);
      currentModuleWeakSymbols = metadata.weakImports;
      function loadModule() {
        var memAlign = Math.pow(2, metadata.memoryAlign), memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0, tableBase = metadata.tableSize ? wasmTable.length : 0;
        handle && (HEAP8[handle + 8] = 1, LE_HEAP_STORE_U32((handle + 12 >> 2) * 4, memoryBase), LE_HEAP_STORE_I32((handle + 16 >> 2) * 4, metadata.memorySize), LE_HEAP_STORE_U32((handle + 20 >> 2) * 4, tableBase), LE_HEAP_STORE_I32((handle + 24 >> 2) * 4, metadata.tableSize)), metadata.tableSize && wasmTable.grow(metadata.tableSize);
        var moduleExports;
        function resolveSymbol(e) {
          var A = resolveGlobalSymbol(e).sym;
          return !A && localScope && (A = localScope[e]), A || (A = moduleExports[e]), A;
        }
        __name(resolveSymbol, "resolveSymbol");
        var proxyHandler = {
          get(e, A) {
            switch (A) {
              case "__memory_base":
                return memoryBase;
              case "__table_base":
                return tableBase;
            }
            if (A in wasmImports && !wasmImports[A].stub) {
              var g = wasmImports[A];
              return g;
            }
            if (!(A in e)) {
              var o;
              e[A] = (...B) => (o || (o = resolveSymbol(A)), o(...B));
            }
            return e[A];
          }
        }, proxy = new Proxy({}, proxyHandler), info = {
          "GOT.mem": new Proxy({}, GOTHandler),
          "GOT.func": new Proxy({}, GOTHandler),
          env: proxy,
          wasi_snapshot_preview1: proxy
        };
        function postInstantiation(module, instance) {
          updateTableMap(tableBase, metadata.tableSize), moduleExports = relocateExports(instance.exports, memoryBase), flags.allowUndefined || reportUndefinedSymbols();
          function addEmAsm(addr, body) {
            for (var args = [], arity = 0; arity < 16 && body.indexOf("$" + arity) != -1; arity++)
              args.push("$" + arity);
            args = args.join(",");
            var func = `(${args}) => { ${body} };`;
            eval(func);
          }
          if (__name(addEmAsm, "addEmAsm"), "__start_em_asm" in moduleExports)
            for (var start = moduleExports.__start_em_asm, stop = moduleExports.__stop_em_asm; start < stop; ) {
              var jsString = UTF8ToString(start);
              addEmAsm(start, jsString), start = HEAPU8.indexOf(0, start) + 1;
            }
          function addEmJs(name, cSig, body) {
            var jsArgs = [];
            if (cSig = cSig.slice(1, -1), cSig != "void") {
              cSig = cSig.split(",");
              for (var i in cSig) {
                var jsArg = cSig[i].split(" ").pop();
                jsArgs.push(jsArg.replace("*", ""));
              }
            }
            var func = `(${jsArgs}) => ${body};`;
            moduleExports[name] = eval(func);
          }
          __name(addEmJs, "addEmJs");
          for (var name in moduleExports)
            if (name.startsWith("__em_js__")) {
              var start = moduleExports[name], jsString = UTF8ToString(start), parts = jsString.split("<::>");
              addEmJs(name.replace("__em_js__", ""), parts[0], parts[1]), delete moduleExports[name];
            }
          var applyRelocs = moduleExports.__wasm_apply_data_relocs;
          applyRelocs && (runtimeInitialized ? applyRelocs() : __RELOC_FUNCS__.push(applyRelocs));
          var init = moduleExports.__wasm_call_ctors;
          return init && (runtimeInitialized ? init() : addOnPostCtor(init)), moduleExports;
        }
        if (__name(postInstantiation, "postInstantiation"), flags.loadAsync) {
          if (binary instanceof WebAssembly.Module) {
            var instance = new WebAssembly.Instance(binary, info);
            return Promise.resolve(postInstantiation(binary, instance));
          }
          return WebAssembly.instantiate(binary, info).then((e) => postInstantiation(e.module, e.instance));
        }
        var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary), instance = new WebAssembly.Instance(module, info);
        return postInstantiation(module, instance);
      }
      return __name(loadModule, "loadModule"), flags.loadAsync ? metadata.neededDynlibs.reduce((e, A) => e.then(() => loadDynamicLibrary(A, flags, localScope)), Promise.resolve()).then(loadModule) : (metadata.neededDynlibs.forEach((e) => loadDynamicLibrary(e, flags, localScope)), loadModule());
    }, "loadWebAssemblyModule"), mergeLibSymbols = /* @__PURE__ */ __name((e, A) => {
      for (var [g, o] of Object.entries(e)) {
        const B = /* @__PURE__ */ __name((x) => {
          isSymbolDefined(x) || (wasmImports[x] = o);
        }, "setImport");
        B(g);
        const F = "__main_argc_argv";
        g == "main" && B(F), g == F && B("main");
      }
    }, "mergeLibSymbols"), asyncLoad = /* @__PURE__ */ __name(async (e) => {
      var A = await readAsync(e);
      return new Uint8Array(A);
    }, "asyncLoad");
    function loadDynamicLibrary(e, A = {
      global: !0,
      nodelete: !0
    }, g, o) {
      var B = LDSO.loadedLibsByName[e];
      if (B)
        return A.global ? B.global || (B.global = !0, mergeLibSymbols(B.exports, e)) : g && Object.assign(g, B.exports), A.nodelete && B.refcount !== 1 / 0 && (B.refcount = 1 / 0), B.refcount++, o && (LDSO.loadedLibsByHandle[o] = B), A.loadAsync ? Promise.resolve(!0) : !0;
      B = newDSO(e, o, "loading"), B.refcount = A.nodelete ? 1 / 0 : 1, B.global = A.global;
      function F() {
        if (o) {
          var X = LE_HEAP_LOAD_U32((o + 28 >> 2) * 4), W = LE_HEAP_LOAD_U32((o + 32 >> 2) * 4);
          if (X && W) {
            var eA = HEAP8.slice(X, X + W);
            return A.loadAsync ? Promise.resolve(eA) : eA;
          }
        }
        var IA = locateFile(e);
        if (A.loadAsync)
          return asyncLoad(IA);
        if (!readBinary)
          throw new Error(`${IA}: file not found, and synchronous loading of external files is not available`);
        return readBinary(IA);
      }
      __name(F, "loadLibData");
      function x() {
        return A.loadAsync ? F().then((X) => loadWebAssemblyModule(X, A, e, g, o)) : loadWebAssemblyModule(F(), A, e, g, o);
      }
      __name(x, "getExports");
      function b(X) {
        B.global ? mergeLibSymbols(X, e) : g && Object.assign(g, X), B.exports = X;
      }
      return __name(b, "moduleLoaded"), A.loadAsync ? x().then((X) => (b(X), !0)) : (b(x()), !0);
    }
    __name(loadDynamicLibrary, "loadDynamicLibrary");
    var reportUndefinedSymbols = /* @__PURE__ */ __name(() => {
      for (var [e, A] of Object.entries(GOT))
        if (A.value == 0) {
          var g = resolveGlobalSymbol(e, !0).sym;
          if (!g && !A.required)
            continue;
          if (typeof g == "function")
            A.value = addFunction(g, g.sig);
          else if (typeof g == "number")
            A.value = g;
          else
            throw new Error(`bad export type for '${e}': ${typeof g}`);
        }
    }, "reportUndefinedSymbols"), loadDylibs = /* @__PURE__ */ __name(() => {
      if (!dynamicLibraries.length) {
        reportUndefinedSymbols();
        return;
      }
      addRunDependency(), dynamicLibraries.reduce((e, A) => e.then(() => loadDynamicLibrary(A, {
        loadAsync: !0,
        global: !0,
        nodelete: !0,
        allowUndefined: !0
      })), Promise.resolve()).then(() => {
        reportUndefinedSymbols(), removeRunDependency();
      });
    }, "loadDylibs"), noExitRuntime = Module.noExitRuntime || !0;
    function setValue(e, A, g = "i8") {
      switch (g.endsWith("*") && (g = "*"), g) {
        case "i1":
          HEAP8[e] = A;
          break;
        case "i8":
          HEAP8[e] = A;
          break;
        case "i16":
          LE_HEAP_STORE_I16((e >> 1) * 2, A);
          break;
        case "i32":
          LE_HEAP_STORE_I32((e >> 2) * 4, A);
          break;
        case "i64":
          HEAP64[e >> 3] = BigInt(A);
          break;
        case "float":
          LE_HEAP_STORE_F32((e >> 2) * 4, A);
          break;
        case "double":
          LE_HEAP_STORE_F64((e >> 3) * 8, A);
          break;
        case "*":
          LE_HEAP_STORE_U32((e >> 2) * 4, A);
          break;
        default:
          abort(`invalid type for setValue: ${g}`);
      }
    }
    __name(setValue, "setValue");
    var ___memory_base = new WebAssembly.Global({
      value: "i32",
      mutable: !1
    }, 1024), ___stack_pointer = new WebAssembly.Global({
      value: "i32",
      mutable: !0
    }, 78224), ___table_base = new WebAssembly.Global({
      value: "i32",
      mutable: !1
    }, 1), __abort_js = /* @__PURE__ */ __name(() => abort(""), "__abort_js");
    __abort_js.sig = "v";
    var _emscripten_get_now = /* @__PURE__ */ __name(() => performance.now(), "_emscripten_get_now");
    _emscripten_get_now.sig = "d";
    var _emscripten_date_now = /* @__PURE__ */ __name(() => Date.now(), "_emscripten_date_now");
    _emscripten_date_now.sig = "d";
    var checkWasiClock = /* @__PURE__ */ __name((e) => e >= 0 && e <= 3, "checkWasiClock"), INT53_MAX = 9007199254740992, INT53_MIN = -9007199254740992, bigintToI53Checked = /* @__PURE__ */ __name((e) => e < INT53_MIN || e > INT53_MAX ? NaN : Number(e), "bigintToI53Checked");
    function _clock_time_get(e, A, g) {
      if (A = bigintToI53Checked(A), !checkWasiClock(e))
        return 28;
      var o;
      e === 0 ? o = _emscripten_date_now() : o = _emscripten_get_now();
      var B = Math.round(o * 1e3 * 1e3);
      return HEAP64[g >> 3] = BigInt(B), 0;
    }
    __name(_clock_time_get, "_clock_time_get"), _clock_time_get.sig = "iijp";
    var getHeapMax = /* @__PURE__ */ __name(() => (
      // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
      // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
      // for any code that deals with heap sizes, which would require special
      // casing all heap size related code to treat 0 specially.
      2147483648
    ), "getHeapMax"), growMemory = /* @__PURE__ */ __name((e) => {
      var A = wasmMemory.buffer, g = (e - A.byteLength + 65535) / 65536 | 0;
      try {
        return wasmMemory.grow(g), updateMemoryViews(), 1;
      } catch {
      }
    }, "growMemory"), _emscripten_resize_heap = /* @__PURE__ */ __name((e) => {
      var A = HEAPU8.length;
      e >>>= 0;
      var g = getHeapMax();
      if (e > g)
        return !1;
      for (var o = 1; o <= 4; o *= 2) {
        var B = A * (1 + 0.2 / o);
        B = Math.min(B, e + 100663296);
        var F = Math.min(g, alignMemory(Math.max(e, B), 65536)), x = growMemory(F);
        if (x)
          return !0;
      }
      return !1;
    }, "_emscripten_resize_heap");
    _emscripten_resize_heap.sig = "ip";
    var _fd_close = /* @__PURE__ */ __name((e) => 52, "_fd_close");
    _fd_close.sig = "ii";
    function _fd_seek(e, A, g, o) {
      return A = bigintToI53Checked(A), 70;
    }
    __name(_fd_seek, "_fd_seek"), _fd_seek.sig = "iijip";
    var printCharBuffers = [null, [], []], printChar = /* @__PURE__ */ __name((e, A) => {
      var g = printCharBuffers[e];
      A === 0 || A === 10 ? ((e === 1 ? out : err)(UTF8ArrayToString(g)), g.length = 0) : g.push(A);
    }, "printChar"), _fd_write = /* @__PURE__ */ __name((e, A, g, o) => {
      for (var B = 0, F = 0; F < g; F++) {
        var x = LE_HEAP_LOAD_U32((A >> 2) * 4), b = LE_HEAP_LOAD_U32((A + 4 >> 2) * 4);
        A += 8;
        for (var X = 0; X < b; X++)
          printChar(e, HEAPU8[x + X]);
        B += b;
      }
      return LE_HEAP_STORE_U32((o >> 2) * 4, B), 0;
    }, "_fd_write");
    _fd_write.sig = "iippp";
    function _tree_sitter_log_callback(e, A) {
      if (Module.currentLogCallback) {
        const g = UTF8ToString(A);
        Module.currentLogCallback(g, e !== 0);
      }
    }
    __name(_tree_sitter_log_callback, "_tree_sitter_log_callback");
    function _tree_sitter_parse_callback(e, A, g, o, B) {
      const x = Module.currentParseCallback(A, {
        row: g,
        column: o
      });
      typeof x == "string" ? (setValue(B, x.length, "i32"), stringToUTF16(x, e, 10240)) : setValue(B, 0, "i32");
    }
    __name(_tree_sitter_parse_callback, "_tree_sitter_parse_callback");
    function _tree_sitter_progress_callback(e, A) {
      return Module.currentProgressCallback ? Module.currentProgressCallback({
        currentOffset: e,
        hasError: A
      }) : !1;
    }
    __name(_tree_sitter_progress_callback, "_tree_sitter_progress_callback");
    function _tree_sitter_query_progress_callback(e) {
      return Module.currentQueryProgressCallback ? Module.currentQueryProgressCallback({
        currentOffset: e
      }) : !1;
    }
    __name(_tree_sitter_query_progress_callback, "_tree_sitter_query_progress_callback");
    var keepRuntimeAlive = /* @__PURE__ */ __name(() => noExitRuntime, "keepRuntimeAlive"), _proc_exit = /* @__PURE__ */ __name((e) => {
      var A;
      EXITSTATUS = e, keepRuntimeAlive() || ((A = Module.onExit) == null || A.call(Module, e), ABORT = !0), quit_(e, new ExitStatus(e));
    }, "_proc_exit");
    _proc_exit.sig = "vi";
    var exitJS = /* @__PURE__ */ __name((e, A) => {
      EXITSTATUS = e, _proc_exit(e);
    }, "exitJS"), handleException = /* @__PURE__ */ __name((e) => {
      if (e instanceof ExitStatus || e == "unwind")
        return EXITSTATUS;
      quit_(1, e);
    }, "handleException"), lengthBytesUTF8 = /* @__PURE__ */ __name((e) => {
      for (var A = 0, g = 0; g < e.length; ++g) {
        var o = e.charCodeAt(g);
        o <= 127 ? A++ : o <= 2047 ? A += 2 : o >= 55296 && o <= 57343 ? (A += 4, ++g) : A += 3;
      }
      return A;
    }, "lengthBytesUTF8"), stringToUTF8Array = /* @__PURE__ */ __name((e, A, g, o) => {
      if (!(o > 0)) return 0;
      for (var B = g, F = g + o - 1, x = 0; x < e.length; ++x) {
        var b = e.charCodeAt(x);
        if (b >= 55296 && b <= 57343) {
          var X = e.charCodeAt(++x);
          b = 65536 + ((b & 1023) << 10) | X & 1023;
        }
        if (b <= 127) {
          if (g >= F) break;
          A[g++] = b;
        } else if (b <= 2047) {
          if (g + 1 >= F) break;
          A[g++] = 192 | b >> 6, A[g++] = 128 | b & 63;
        } else if (b <= 65535) {
          if (g + 2 >= F) break;
          A[g++] = 224 | b >> 12, A[g++] = 128 | b >> 6 & 63, A[g++] = 128 | b & 63;
        } else {
          if (g + 3 >= F) break;
          A[g++] = 240 | b >> 18, A[g++] = 128 | b >> 12 & 63, A[g++] = 128 | b >> 6 & 63, A[g++] = 128 | b & 63;
        }
      }
      return A[g] = 0, g - B;
    }, "stringToUTF8Array"), stringToUTF8 = /* @__PURE__ */ __name((e, A, g) => stringToUTF8Array(e, HEAPU8, A, g), "stringToUTF8"), stackAlloc = /* @__PURE__ */ __name((e) => __emscripten_stack_alloc(e), "stackAlloc"), stringToUTF8OnStack = /* @__PURE__ */ __name((e) => {
      var A = lengthBytesUTF8(e) + 1, g = stackAlloc(A);
      return stringToUTF8(e, g, A), g;
    }, "stringToUTF8OnStack"), AsciiToString = /* @__PURE__ */ __name((e) => {
      for (var A = ""; ; ) {
        var g = HEAPU8[e++];
        if (!g) return A;
        A += String.fromCharCode(g);
      }
    }, "AsciiToString"), stringToUTF16 = /* @__PURE__ */ __name((e, A, g) => {
      if (g ?? (g = 2147483647), g < 2) return 0;
      g -= 2;
      for (var o = A, B = g < e.length * 2 ? g / 2 : e.length, F = 0; F < B; ++F) {
        var x = e.charCodeAt(F);
        LE_HEAP_STORE_I16((A >> 1) * 2, x), A += 2;
      }
      return LE_HEAP_STORE_I16((A >> 1) * 2, 0), A - o;
    }, "stringToUTF16"), wasmImports = {
      /** @export */
      __heap_base: ___heap_base,
      /** @export */
      __indirect_function_table: wasmTable,
      /** @export */
      __memory_base: ___memory_base,
      /** @export */
      __stack_pointer: ___stack_pointer,
      /** @export */
      __table_base: ___table_base,
      /** @export */
      _abort_js: __abort_js,
      /** @export */
      clock_time_get: _clock_time_get,
      /** @export */
      emscripten_resize_heap: _emscripten_resize_heap,
      /** @export */
      fd_close: _fd_close,
      /** @export */
      fd_seek: _fd_seek,
      /** @export */
      fd_write: _fd_write,
      /** @export */
      memory: wasmMemory,
      /** @export */
      tree_sitter_log_callback: _tree_sitter_log_callback,
      /** @export */
      tree_sitter_parse_callback: _tree_sitter_parse_callback,
      /** @export */
      tree_sitter_progress_callback: _tree_sitter_progress_callback,
      /** @export */
      tree_sitter_query_progress_callback: _tree_sitter_query_progress_callback
    }, wasmExports = await createWasm();
    wasmExports.__wasm_call_ctors, Module._malloc = wasmExports.malloc;
    var _calloc = Module._calloc = wasmExports.calloc;
    Module._realloc = wasmExports.realloc, Module._free = wasmExports.free, Module._memcmp = wasmExports.memcmp, Module._ts_language_symbol_count = wasmExports.ts_language_symbol_count, Module._ts_language_state_count = wasmExports.ts_language_state_count, Module._ts_language_version = wasmExports.ts_language_version, Module._ts_language_abi_version = wasmExports.ts_language_abi_version, Module._ts_language_metadata = wasmExports.ts_language_metadata, Module._ts_language_name = wasmExports.ts_language_name, Module._ts_language_field_count = wasmExports.ts_language_field_count, Module._ts_language_next_state = wasmExports.ts_language_next_state, Module._ts_language_symbol_name = wasmExports.ts_language_symbol_name, Module._ts_language_symbol_for_name = wasmExports.ts_language_symbol_for_name, Module._strncmp = wasmExports.strncmp, Module._ts_language_symbol_type = wasmExports.ts_language_symbol_type, Module._ts_language_field_name_for_id = wasmExports.ts_language_field_name_for_id, Module._ts_lookahead_iterator_new = wasmExports.ts_lookahead_iterator_new, Module._ts_lookahead_iterator_delete = wasmExports.ts_lookahead_iterator_delete, Module._ts_lookahead_iterator_reset_state = wasmExports.ts_lookahead_iterator_reset_state, Module._ts_lookahead_iterator_reset = wasmExports.ts_lookahead_iterator_reset, Module._ts_lookahead_iterator_next = wasmExports.ts_lookahead_iterator_next, Module._ts_lookahead_iterator_current_symbol = wasmExports.ts_lookahead_iterator_current_symbol, Module._ts_parser_delete = wasmExports.ts_parser_delete, Module._ts_parser_reset = wasmExports.ts_parser_reset, Module._ts_parser_set_language = wasmExports.ts_parser_set_language, Module._ts_parser_timeout_micros = wasmExports.ts_parser_timeout_micros, Module._ts_parser_set_timeout_micros = wasmExports.ts_parser_set_timeout_micros, Module._ts_parser_set_included_ranges = wasmExports.ts_parser_set_included_ranges, Module._ts_query_new = wasmExports.ts_query_new, Module._ts_query_delete = wasmExports.ts_query_delete, Module._iswspace = wasmExports.iswspace, Module._iswalnum = wasmExports.iswalnum, Module._ts_query_pattern_count = wasmExports.ts_query_pattern_count, Module._ts_query_capture_count = wasmExports.ts_query_capture_count, Module._ts_query_string_count = wasmExports.ts_query_string_count, Module._ts_query_capture_name_for_id = wasmExports.ts_query_capture_name_for_id, Module._ts_query_capture_quantifier_for_id = wasmExports.ts_query_capture_quantifier_for_id, Module._ts_query_string_value_for_id = wasmExports.ts_query_string_value_for_id, Module._ts_query_predicates_for_pattern = wasmExports.ts_query_predicates_for_pattern, Module._ts_query_start_byte_for_pattern = wasmExports.ts_query_start_byte_for_pattern, Module._ts_query_end_byte_for_pattern = wasmExports.ts_query_end_byte_for_pattern, Module._ts_query_is_pattern_rooted = wasmExports.ts_query_is_pattern_rooted, Module._ts_query_is_pattern_non_local = wasmExports.ts_query_is_pattern_non_local, Module._ts_query_is_pattern_guaranteed_at_step = wasmExports.ts_query_is_pattern_guaranteed_at_step, Module._ts_query_disable_capture = wasmExports.ts_query_disable_capture, Module._ts_query_disable_pattern = wasmExports.ts_query_disable_pattern, Module._ts_tree_copy = wasmExports.ts_tree_copy, Module._ts_tree_delete = wasmExports.ts_tree_delete, Module._ts_init = wasmExports.ts_init, Module._ts_parser_new_wasm = wasmExports.ts_parser_new_wasm, Module._ts_parser_enable_logger_wasm = wasmExports.ts_parser_enable_logger_wasm, Module._ts_parser_parse_wasm = wasmExports.ts_parser_parse_wasm, Module._ts_parser_included_ranges_wasm = wasmExports.ts_parser_included_ranges_wasm, Module._ts_language_type_is_named_wasm = wasmExports.ts_language_type_is_named_wasm, Module._ts_language_type_is_visible_wasm = wasmExports.ts_language_type_is_visible_wasm, Module._ts_language_supertypes_wasm = wasmExports.ts_language_supertypes_wasm, Module._ts_language_subtypes_wasm = wasmExports.ts_language_subtypes_wasm, Module._ts_tree_root_node_wasm = wasmExports.ts_tree_root_node_wasm, Module._ts_tree_root_node_with_offset_wasm = wasmExports.ts_tree_root_node_with_offset_wasm, Module._ts_tree_edit_wasm = wasmExports.ts_tree_edit_wasm, Module._ts_tree_included_ranges_wasm = wasmExports.ts_tree_included_ranges_wasm, Module._ts_tree_get_changed_ranges_wasm = wasmExports.ts_tree_get_changed_ranges_wasm, Module._ts_tree_cursor_new_wasm = wasmExports.ts_tree_cursor_new_wasm, Module._ts_tree_cursor_copy_wasm = wasmExports.ts_tree_cursor_copy_wasm, Module._ts_tree_cursor_delete_wasm = wasmExports.ts_tree_cursor_delete_wasm, Module._ts_tree_cursor_reset_wasm = wasmExports.ts_tree_cursor_reset_wasm, Module._ts_tree_cursor_reset_to_wasm = wasmExports.ts_tree_cursor_reset_to_wasm, Module._ts_tree_cursor_goto_first_child_wasm = wasmExports.ts_tree_cursor_goto_first_child_wasm, Module._ts_tree_cursor_goto_last_child_wasm = wasmExports.ts_tree_cursor_goto_last_child_wasm, Module._ts_tree_cursor_goto_first_child_for_index_wasm = wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm, Module._ts_tree_cursor_goto_first_child_for_position_wasm = wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm, Module._ts_tree_cursor_goto_next_sibling_wasm = wasmExports.ts_tree_cursor_goto_next_sibling_wasm, Module._ts_tree_cursor_goto_previous_sibling_wasm = wasmExports.ts_tree_cursor_goto_previous_sibling_wasm, Module._ts_tree_cursor_goto_descendant_wasm = wasmExports.ts_tree_cursor_goto_descendant_wasm, Module._ts_tree_cursor_goto_parent_wasm = wasmExports.ts_tree_cursor_goto_parent_wasm, Module._ts_tree_cursor_current_node_type_id_wasm = wasmExports.ts_tree_cursor_current_node_type_id_wasm, Module._ts_tree_cursor_current_node_state_id_wasm = wasmExports.ts_tree_cursor_current_node_state_id_wasm, Module._ts_tree_cursor_current_node_is_named_wasm = wasmExports.ts_tree_cursor_current_node_is_named_wasm, Module._ts_tree_cursor_current_node_is_missing_wasm = wasmExports.ts_tree_cursor_current_node_is_missing_wasm, Module._ts_tree_cursor_current_node_id_wasm = wasmExports.ts_tree_cursor_current_node_id_wasm, Module._ts_tree_cursor_start_position_wasm = wasmExports.ts_tree_cursor_start_position_wasm, Module._ts_tree_cursor_end_position_wasm = wasmExports.ts_tree_cursor_end_position_wasm, Module._ts_tree_cursor_start_index_wasm = wasmExports.ts_tree_cursor_start_index_wasm, Module._ts_tree_cursor_end_index_wasm = wasmExports.ts_tree_cursor_end_index_wasm, Module._ts_tree_cursor_current_field_id_wasm = wasmExports.ts_tree_cursor_current_field_id_wasm, Module._ts_tree_cursor_current_depth_wasm = wasmExports.ts_tree_cursor_current_depth_wasm, Module._ts_tree_cursor_current_descendant_index_wasm = wasmExports.ts_tree_cursor_current_descendant_index_wasm, Module._ts_tree_cursor_current_node_wasm = wasmExports.ts_tree_cursor_current_node_wasm, Module._ts_node_symbol_wasm = wasmExports.ts_node_symbol_wasm, Module._ts_node_field_name_for_child_wasm = wasmExports.ts_node_field_name_for_child_wasm, Module._ts_node_field_name_for_named_child_wasm = wasmExports.ts_node_field_name_for_named_child_wasm, Module._ts_node_children_by_field_id_wasm = wasmExports.ts_node_children_by_field_id_wasm, Module._ts_node_first_child_for_byte_wasm = wasmExports.ts_node_first_child_for_byte_wasm, Module._ts_node_first_named_child_for_byte_wasm = wasmExports.ts_node_first_named_child_for_byte_wasm, Module._ts_node_grammar_symbol_wasm = wasmExports.ts_node_grammar_symbol_wasm, Module._ts_node_child_count_wasm = wasmExports.ts_node_child_count_wasm, Module._ts_node_named_child_count_wasm = wasmExports.ts_node_named_child_count_wasm, Module._ts_node_child_wasm = wasmExports.ts_node_child_wasm, Module._ts_node_named_child_wasm = wasmExports.ts_node_named_child_wasm, Module._ts_node_child_by_field_id_wasm = wasmExports.ts_node_child_by_field_id_wasm, Module._ts_node_next_sibling_wasm = wasmExports.ts_node_next_sibling_wasm, Module._ts_node_prev_sibling_wasm = wasmExports.ts_node_prev_sibling_wasm, Module._ts_node_next_named_sibling_wasm = wasmExports.ts_node_next_named_sibling_wasm, Module._ts_node_prev_named_sibling_wasm = wasmExports.ts_node_prev_named_sibling_wasm, Module._ts_node_descendant_count_wasm = wasmExports.ts_node_descendant_count_wasm, Module._ts_node_parent_wasm = wasmExports.ts_node_parent_wasm, Module._ts_node_child_with_descendant_wasm = wasmExports.ts_node_child_with_descendant_wasm, Module._ts_node_descendant_for_index_wasm = wasmExports.ts_node_descendant_for_index_wasm, Module._ts_node_named_descendant_for_index_wasm = wasmExports.ts_node_named_descendant_for_index_wasm, Module._ts_node_descendant_for_position_wasm = wasmExports.ts_node_descendant_for_position_wasm, Module._ts_node_named_descendant_for_position_wasm = wasmExports.ts_node_named_descendant_for_position_wasm, Module._ts_node_start_point_wasm = wasmExports.ts_node_start_point_wasm, Module._ts_node_end_point_wasm = wasmExports.ts_node_end_point_wasm, Module._ts_node_start_index_wasm = wasmExports.ts_node_start_index_wasm, Module._ts_node_end_index_wasm = wasmExports.ts_node_end_index_wasm, Module._ts_node_to_string_wasm = wasmExports.ts_node_to_string_wasm, Module._ts_node_children_wasm = wasmExports.ts_node_children_wasm, Module._ts_node_named_children_wasm = wasmExports.ts_node_named_children_wasm, Module._ts_node_descendants_of_type_wasm = wasmExports.ts_node_descendants_of_type_wasm, Module._ts_node_is_named_wasm = wasmExports.ts_node_is_named_wasm, Module._ts_node_has_changes_wasm = wasmExports.ts_node_has_changes_wasm, Module._ts_node_has_error_wasm = wasmExports.ts_node_has_error_wasm, Module._ts_node_is_error_wasm = wasmExports.ts_node_is_error_wasm, Module._ts_node_is_missing_wasm = wasmExports.ts_node_is_missing_wasm, Module._ts_node_is_extra_wasm = wasmExports.ts_node_is_extra_wasm, Module._ts_node_parse_state_wasm = wasmExports.ts_node_parse_state_wasm, Module._ts_node_next_parse_state_wasm = wasmExports.ts_node_next_parse_state_wasm, Module._ts_query_matches_wasm = wasmExports.ts_query_matches_wasm, Module._ts_query_captures_wasm = wasmExports.ts_query_captures_wasm, Module._memset = wasmExports.memset, Module._memcpy = wasmExports.memcpy, Module._memmove = wasmExports.memmove, Module._iswalpha = wasmExports.iswalpha, Module._iswblank = wasmExports.iswblank, Module._iswdigit = wasmExports.iswdigit, Module._iswlower = wasmExports.iswlower, Module._iswupper = wasmExports.iswupper, Module._iswxdigit = wasmExports.iswxdigit, Module._memchr = wasmExports.memchr, Module._strlen = wasmExports.strlen, Module._strcmp = wasmExports.strcmp, Module._strncat = wasmExports.strncat, Module._strncpy = wasmExports.strncpy, Module._towlower = wasmExports.towlower, Module._towupper = wasmExports.towupper;
    var _setThrew = wasmExports.setThrew, __emscripten_stack_restore = wasmExports._emscripten_stack_restore, __emscripten_stack_alloc = wasmExports._emscripten_stack_alloc, _emscripten_stack_get_current = wasmExports.emscripten_stack_get_current;
    wasmExports.__wasm_apply_data_relocs, Module.setValue = setValue, Module.getValue = getValue, Module.UTF8ToString = UTF8ToString, Module.stringToUTF8 = stringToUTF8, Module.lengthBytesUTF8 = lengthBytesUTF8, Module.AsciiToString = AsciiToString, Module.stringToUTF16 = stringToUTF16, Module.loadWebAssemblyModule = loadWebAssemblyModule;
    function callMain(e = []) {
      var A = resolveGlobalSymbol("main").sym;
      if (A) {
        e.unshift(thisProgram);
        var g = e.length, o = stackAlloc((g + 1) * 4), B = o;
        e.forEach((x) => {
          LE_HEAP_STORE_U32((B >> 2) * 4, stringToUTF8OnStack(x)), B += 4;
        }), LE_HEAP_STORE_U32((B >> 2) * 4, 0);
        try {
          var F = A(g, o);
          return exitJS(
            F,
            /* implicit = */
            !0
          ), F;
        } catch (x) {
          return handleException(x);
        }
      }
    }
    __name(callMain, "callMain");
    function run(e = arguments_) {
      if (runDependencies > 0) {
        dependenciesFulfilled = run;
        return;
      }
      if (preRun(), runDependencies > 0) {
        dependenciesFulfilled = run;
        return;
      }
      function A() {
        var o;
        if (Module.calledRun = !0, !ABORT) {
          initRuntime(), readyPromiseResolve(Module), (o = Module.onRuntimeInitialized) == null || o.call(Module);
          var g = Module.noInitialRun;
          g || callMain(e), postRun();
        }
      }
      __name(A, "doRun"), Module.setStatus ? (Module.setStatus("Running..."), setTimeout(() => {
        setTimeout(() => Module.setStatus(""), 1), A();
      }, 1)) : A();
    }
    if (__name(run, "run"), Module.preInit)
      for (typeof Module.preInit == "function" && (Module.preInit = [Module.preInit]); Module.preInit.length > 0; )
        Module.preInit.pop()();
    return run(), moduleRtn = readyPromise, moduleRtn;
  };
})(), tree_sitter_default = Module2, Module3 = null;
async function initializeBinding(s) {
  return Module3 || (Module3 = await tree_sitter_default(s)), Module3;
}
__name(initializeBinding, "initializeBinding");
function checkModule() {
  return !!Module3;
}
__name(checkModule, "checkModule");
var TRANSFER_BUFFER, LANGUAGE_VERSION, MIN_COMPATIBLE_VERSION, se, Parser = (se = class {
  /**
   * Create a new parser.
   */
  constructor() {
    /** @internal */
    fA(this, 0, 0);
    // Internal handle for WASM
    /** @internal */
    fA(this, 1, 0);
    // Internal handle for WASM
    /** @internal */
    fA(this, "logCallback", null);
    /** The parser's current language. */
    fA(this, "language", null);
    this.initialize();
  }
  /**
   * This must always be called before creating a Parser.
   *
   * You can optionally pass in options to configure the WASM module, the most common
   * one being `locateFile` to help the module find the `.wasm` file.
   */
  static async init(e) {
    setModule(await initializeBinding(e)), TRANSFER_BUFFER = C._ts_init(), LANGUAGE_VERSION = C.getValue(TRANSFER_BUFFER, "i32"), MIN_COMPATIBLE_VERSION = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
  }
  /** @internal */
  initialize() {
    if (!checkModule())
      throw new Error("cannot construct a Parser before calling `init()`");
    C._ts_parser_new_wasm(), this[0] = C.getValue(TRANSFER_BUFFER, "i32"), this[1] = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
  }
  /** Delete the parser, freeing its resources. */
  delete() {
    C._ts_parser_delete(this[0]), C._free(this[1]), this[0] = 0, this[1] = 0;
  }
  /**
   * Set the language that the parser should use for parsing.
   *
   * If the language was not successfully assigned, an error will be thrown.
   * This happens if the language was generated with an incompatible
   * version of the Tree-sitter CLI. Check the language's version using
   * {@link Language#version} and compare it to this library's
   * {@link LANGUAGE_VERSION} and {@link MIN_COMPATIBLE_VERSION} constants.
   */
  setLanguage(e) {
    let A;
    if (!e)
      A = 0, this.language = null;
    else if (e.constructor === Language) {
      A = e[0];
      const g = C._ts_language_version(A);
      if (g < MIN_COMPATIBLE_VERSION || LANGUAGE_VERSION < g)
        throw new Error(
          `Incompatible language version ${g}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${LANGUAGE_VERSION}.`
        );
      this.language = e;
    } else
      throw new Error("Argument must be a Language");
    return C._ts_parser_set_language(this[0], A), this;
  }
  /**
   * Parse a slice of UTF8 text.
   *
   * @param {string | ParseCallback} callback - The UTF8-encoded text to parse or a callback function.
   *
   * @param {Tree | null} [oldTree] - A previous syntax tree parsed from the same document. If the text of the
   *   document has changed since `oldTree` was created, then you must edit `oldTree` to match
   *   the new text using {@link Tree#edit}.
   *
   * @param {ParseOptions} [options] - Options for parsing the text.
   *  This can be used to set the included ranges, or a progress callback.
   *
   * @returns {Tree | null} A {@link Tree} if parsing succeeded, or `null` if:
   *  - The parser has not yet had a language assigned with {@link Parser#setLanguage}.
   *  - The progress callback returned true.
   */
  parse(e, A, g) {
    if (typeof e == "string")
      C.currentParseCallback = (b) => e.slice(b);
    else if (typeof e == "function")
      C.currentParseCallback = e;
    else
      throw new Error("Argument must be a string or a function");
    g != null && g.progressCallback ? C.currentProgressCallback = g.progressCallback : C.currentProgressCallback = null, this.logCallback ? (C.currentLogCallback = this.logCallback, C._ts_parser_enable_logger_wasm(this[0], 1)) : (C.currentLogCallback = null, C._ts_parser_enable_logger_wasm(this[0], 0));
    let o = 0, B = 0;
    if (g != null && g.includedRanges) {
      o = g.includedRanges.length, B = C._calloc(o, SIZE_OF_RANGE);
      let b = B;
      for (let X = 0; X < o; X++)
        marshalRange(b, g.includedRanges[X]), b += SIZE_OF_RANGE;
    }
    const F = C._ts_parser_parse_wasm(
      this[0],
      this[1],
      A ? A[0] : 0,
      B,
      o
    );
    if (!F)
      return C.currentParseCallback = null, C.currentLogCallback = null, C.currentProgressCallback = null, null;
    if (!this.language)
      throw new Error("Parser must have a language to parse");
    const x = new Tree(INTERNAL, F, this.language, C.currentParseCallback);
    return C.currentParseCallback = null, C.currentLogCallback = null, C.currentProgressCallback = null, x;
  }
  /**
   * Instruct the parser to start the next parse from the beginning.
   *
   * If the parser previously failed because of a timeout, cancellation,
   * or callback, then by default, it will resume where it left off on the
   * next call to {@link Parser#parse} or other parsing functions.
   * If you don't want to resume, and instead intend to use this parser to
   * parse some other document, you must call `reset` first.
   */
  reset() {
    C._ts_parser_reset(this[0]);
  }
  /** Get the ranges of text that the parser will include when parsing. */
  getIncludedRanges() {
    C._ts_parser_included_ranges_wasm(this[0]);
    const e = C.getValue(TRANSFER_BUFFER, "i32"), A = C.getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), g = new Array(e);
    if (e > 0) {
      let o = A;
      for (let B = 0; B < e; B++)
        g[B] = unmarshalRange(o), o += SIZE_OF_RANGE;
      C._free(A);
    }
    return g;
  }
  /**
   * @deprecated since version 0.25.0, prefer passing a progress callback to {@link Parser#parse}
   *
   * Get the duration in microseconds that parsing is allowed to take.
   *
   * This is set via {@link Parser#setTimeoutMicros}.
   */
  getTimeoutMicros() {
    return C._ts_parser_timeout_micros(this[0]);
  }
  /**
   * @deprecated since version 0.25.0, prefer passing a progress callback to {@link Parser#parse}
   *
   * Set the maximum duration in microseconds that parsing should be allowed
   * to take before halting.
   *
   * If parsing takes longer than this, it will halt early, returning `null`.
   * See {@link Parser#parse} for more information.
   */
  setTimeoutMicros(e) {
    C._ts_parser_set_timeout_micros(this[0], 0, e);
  }
  /** Set the logging callback that a parser should use during parsing. */
  setLogger(e) {
    if (!e)
      this.logCallback = null;
    else {
      if (typeof e != "function")
        throw new Error("Logger callback must be a function");
      this.logCallback = e;
    }
    return this;
  }
  /** Get the parser's current logger. */
  getLogger() {
    return this.logCallback;
  }
}, __name(se, "Parser"), se);
const supportedLanguages = {
  cpp: "cpp",
  hpp: "cpp",
  cc: "cpp",
  cxx: "cpp",
  hxx: "cpp",
  cp: "cpp",
  hh: "cpp",
  inc: "cpp",
  // Depended on this PR: https://github.com/tree-sitter/tree-sitter-cpp/pull/173
  // ccm: "cpp",
  // c++m: "cpp",
  // cppm: "cpp",
  // cxxm: "cpp",
  cs: "c_sharp",
  c: "c",
  h: "c",
  css: "css",
  php: "php",
  phtml: "php",
  php3: "php",
  php4: "php",
  php5: "php",
  php7: "php",
  phps: "php",
  "php-s": "php",
  bash: "bash",
  sh: "bash",
  json: "json",
  ts: "typescript",
  mts: "typescript",
  cts: "typescript",
  tsx: "tsx",
  // vue: "vue",  // tree-sitter-vue parser is broken
  // The .wasm file being used is faulty, and yaml is split line-by-line anyway for the most part
  // yaml: "yaml",
  // yml: "yaml",
  elm: "elm",
  js: "javascript",
  jsx: "javascript",
  mjs: "javascript",
  cjs: "javascript",
  py: "python",
  ipynb: "python",
  pyw: "python",
  pyi: "python",
  el: "elisp",
  emacs: "elisp",
  ex: "elixir",
  exs: "elixir",
  go: "go",
  eex: "embedded_template",
  heex: "embedded_template",
  leex: "embedded_template",
  html: "html",
  htm: "html",
  java: "java",
  lua: "lua",
  ocaml: "ocaml",
  ml: "ocaml",
  mli: "ocaml",
  ql: "ql",
  res: "rescript",
  resi: "rescript",
  rb: "ruby",
  erb: "ruby",
  rs: "rust",
  rdl: "systemrdl",
  toml: "toml",
  sol: "solidity"
  // jl: "julia",
  // swift: "swift",
  // kt: "kotlin",
  // scala: "scala",
};
async function getParserForFile(s) {
  try {
    await Parser.init();
    const e = new Parser(), A = await getLanguageForFile(s);
    return A ? (e.setLanguage(A), e) : void 0;
  } catch {
    return;
  }
}
const nameToLanguage = /* @__PURE__ */ new Map();
async function getLanguageForFile(s) {
  try {
    await Parser.init();
    const e = path.extname(s).slice(1), A = supportedLanguages[e];
    if (!A)
      return;
    let g = nameToLanguage.get(A);
    return g || (g = await loadLanguageForFileExt(e), nameToLanguage.set(A, g)), g;
  } catch {
    return;
  }
}
async function loadLanguageForFileExt(s) {
  const e = path.join(
    __dirname,
    ...process.env.NODE_ENV === "test" ? ["node_modules", "tree-sitter-wasms", "out"] : ["..", "treesitter-wasm"],
    `tree-sitter-${supportedLanguages[s]}.wasm`
  );
  return await Language.load(e);
}
async function getAst(s, e) {
  const A = await getParserForFile(s);
  if (A)
    try {
      return A.parse(e) ?? void 0;
    } catch {
      return;
    }
}
function getTreePathAtCursor(s, e) {
  const A = [s.rootNode];
  for (; A[A.length - 1].childCount > 0; ) {
    let g = !1;
    for (const o of A[A.length - 1].children)
      if (o && o.startIndex <= e && o.endIndex >= e) {
        A.push(o), g = !0;
        break;
      }
    if (!g)
      break;
  }
  return A;
}
const FUNCTION_BLOCK_NODE_TYPES = ["block", "statement_block"], FUNCTION_DECLARATION_NODE_TYPES = [
  "method_definition",
  "function_definition",
  "function_item",
  "function_declaration",
  "method_declaration"
];
function gotoInputKey(s) {
  return `${s.name}${s.uri}${s.line}${s.character}`;
}
const MAX_CACHE_SIZE = 50, gotoCache = /* @__PURE__ */ new Map();
async function executeGotoProvider(s) {
  const e = gotoInputKey(s), A = gotoCache.get(e);
  if (A)
    return A;
  try {
    const g = await vscode.commands.executeCommand(
      s.name,
      vscode.Uri.file(s.uri),
      new vscode.Position(s.line, s.character)
    );
    if (!g || !Array.isArray(g))
      return [];
    const o = g.filter((B) => (B.targetUri ?? B.uri) && (B.targetRange ?? B.range)).map((B) => {
      const F = B.targetUri ?? B.uri, x = B.targetRange ?? B.range;
      if (!F || !x)
        throw new Error("Unexpected undefined uri or range");
      return {
        filepath: F.fsPath,
        range: {
          start: {
            line: x.start.line,
            character: x.start.character
          },
          end: {
            line: x.end.line,
            character: x.end.character
          }
        }
      };
    });
    if (gotoCache.size >= MAX_CACHE_SIZE) {
      const B = gotoCache.keys().next().value;
      B && gotoCache.delete(B);
    }
    return gotoCache.set(e, o), o;
  } catch {
    return [];
  }
}
async function readFile(s) {
  try {
    const e = vscode.Uri.file(s), A = await vscode.workspace.fs.readFile(e);
    return new TextDecoder("utf-8").decode(A);
  } catch {
    return "";
  }
}
async function readRangeInFile(s, e) {
  try {
    const A = vscode.Uri.file(s), g = await vscode.workspace.openTextDocument(A), o = new vscode.Range(
      new vscode.Position(e.start.line, e.start.character),
      new vscode.Position(e.end.line, e.end.character)
    );
    return g.getText(o);
  } catch {
    return "";
  }
}
function isRifWithContents(s) {
  return typeof s.contents == "string";
}
function findChildren(s, e, A) {
  let g = [];
  if (A !== void 0 && A <= 0)
    return [];
  e(s) && g.push(s);
  for (const o of s.children)
    o && (g = g.concat(
      findChildren(o, e, A !== void 0 ? A - g.length : void 0)
    ));
  return g;
}
function findTypeIdentifiers(s) {
  return findChildren(
    s,
    (e) => {
      var A;
      return e.type === "type_identifier" || ["ERROR"].includes(((A = e.parent) == null ? void 0 : A.type) ?? "") && e.type === "identifier" && e.text[0].toUpperCase() === e.text[0];
    }
  );
}
function rangesIntersect(s, e) {
  return !(s.end.line < e.start.line || e.end.line < s.start.line || s.end.line === e.start.line && s.end.character < e.start.character || e.end.line === s.start.line && e.end.character < s.start.character);
}
async function crawlTypes(s, e = 1, A = [], g = /* @__PURE__ */ new Set()) {
  const o = isRifWithContents(s) ? s.contents : await readFile(s.filepath), B = await getAst(s.filepath, o);
  if (!B) return A;
  const F = B.rootNode.text.split(`
`).length, x = findTypeIdentifiers(B.rootNode).filter((X) => !g.has(X.text));
  x.forEach((X) => g.add(X.text));
  const b = await Promise.all(
    x.map(async (X) => {
      const [W] = await executeGotoProvider({
        uri: s.filepath,
        line: s.range.start.line + Math.min(X.startPosition.row, F - 1),
        character: s.range.start.character + X.startPosition.column,
        name: "vscode.executeDefinitionProvider"
      });
      if (W)
        return {
          ...W,
          contents: await readRangeInFile(W.filepath, W.range)
        };
    })
  );
  for (const X of b)
    X && (A.some(
      (W) => W.filepath === X.filepath && rangesIntersect(W.range, X.range)
    ) || A.push(X));
  if (e > 0)
    for (const X of [...A])
      await crawlTypes(X, e - 1, A, g);
  return A;
}
async function getDefinitionsForNode(s, e, A) {
  const g = [];
  switch (e.type) {
    case "call_expression": {
      const [o] = await executeGotoProvider({
        uri: s,
        line: e.startPosition.row,
        character: e.startPosition.column,
        name: "vscode.executeDefinitionProvider"
      });
      if (!o)
        return [];
      let B = await readRangeInFile(o.filepath, o.range);
      if (B.split(`
`).length > 15) {
        let x = !1;
        const b = await getAst(o.filepath, B);
        if (b) {
          const [X] = findChildren(
            b.rootNode,
            (W) => FUNCTION_DECLARATION_NODE_TYPES.includes(W.type),
            1
          );
          if (X) {
            const [W] = findChildren(X, (eA) => FUNCTION_BLOCK_NODE_TYPES.includes(eA.type), 1);
            W && (B = b.rootNode.text.slice(0, W.startIndex).trim(), x = !0);
          }
        }
        x || (B = B.split(`
`)[0]);
      }
      g.push(o);
      const F = await crawlTypes({
        ...o,
        contents: B
      });
      g.push(...F);
      break;
    }
    case "variable_declarator":
      break;
    case "impl_item":
      break;
    case "new_expression": {
      const o = e.children.find((b) => (b == null ? void 0 : b.type) === "identifier"), [B] = await executeGotoProvider({
        uri: s,
        line: (o ?? e).endPosition.row,
        character: (o ?? e).endPosition.column,
        name: "vscode.executeDefinitionProvider"
      });
      if (!B)
        break;
      const F = await readRangeInFile(B.filepath, B.range);
      g.push({
        ...B,
        contents: `${o != null && o.text ? `${A.singleLineComment} ${o.text}:
` : ""}${F.trim()}`
      });
      const x = await crawlTypes({ ...B, contents: F });
      g.push(...x.filter(Boolean));
      break;
    }
  }
  return await Promise.all(
    g.map(async (o) => {
      const B = {
        start: {
          line: o.range.start.line,
          character: o.range.start.character
        },
        end: {
          line: o.range.end.line,
          character: o.range.end.character
        }
      };
      return o.range = B, isRifWithContents(o) ? o : {
        ...o,
        contents: await readRangeInFile(o.filepath, o.range)
      };
    })
  );
}
const getDefinitionsFromLsp = async (s, e, A, g) => {
  try {
    const o = await getAst(s, e);
    if (!o) return [];
    const B = getTreePathAtCursor(o, A);
    if (B.length === 0) return [];
    const F = [];
    for (const x of B.reverse()) {
      const b = await getDefinitionsForNode(s, x, g);
      F.push(...b);
    }
    return F.map((x) => ({
      ...x,
      score: 0.8
    }));
  } catch {
    return [];
  }
}, vA = class vA {
  constructor() {
    fA(this, "recentlyEditedRanges", []);
    fA(this, "recentlyEditedDocuments", []);
    vscode.workspace.onDidChangeTextDocument((e) => {
      e.document.uri.scheme === "file" && (e.contentChanges.forEach((A) => {
        const g = {
          uri: e.document.uri,
          range: new vscode.Range(
            new vscode.Position(A.range.start.line, 0),
            new vscode.Position(A.range.end.line + 1, 0)
          ),
          timestamp: Date.now()
        };
        this.insertRange(g);
      }), this.insertDocument(e.document.uri));
    }), setInterval(() => {
      this.removeOldEntries();
    }, 1e3 * 15);
  }
  async insertRange(e) {
    for (let o = 0; o < this.recentlyEditedRanges.length; o++) {
      let B = this.recentlyEditedRanges[o];
      if (B.range.intersection(e.range)) {
        const F = B.range.union(e.range), x = await this._getContentsForRange({
          ...B,
          range: F
        });
        B = {
          ...B,
          range: F,
          lines: x.split(`
`),
          symbols: getSymbolsForSnippet(x)
        };
        return;
      }
    }
    const A = await this._getContentsForRange(e);
    this.recentlyEditedRanges.unshift({
      ...e,
      lines: A.split(`
`),
      symbols: getSymbolsForSnippet(A)
    }) >= vA.maxRecentlyEditedRanges && (this.recentlyEditedRanges = this.recentlyEditedRanges.slice(0, vA.maxRecentlyEditedRanges));
  }
  insertDocument(e) {
    if (this.recentlyEditedDocuments.some((g) => g.uri === e))
      return;
    this.recentlyEditedDocuments.unshift({
      uri: e,
      timestamp: Date.now()
    }) >= vA.maxRecentlyEditedDocuments && (this.recentlyEditedDocuments = this.recentlyEditedDocuments.slice(
      0,
      vA.maxRecentlyEditedDocuments
    ));
  }
  removeOldEntries() {
    this.recentlyEditedRanges = this.recentlyEditedRanges.filter(
      (e) => e.timestamp > Date.now() - vA.staleTime
    );
  }
  async _getContentsForRange(e) {
    return (await vscode.workspace.fs.readFile(e.uri)).toString().split(`
`).slice(e.range.start.line, e.range.end.line + 1).join(`
`);
  }
  /**
   * Get recently edited ranges for autocomplete context
   */
  getRecentlyEditedRanges() {
    return this.recentlyEditedRanges.map((e) => ({
      ...e,
      filepath: e.uri.fsPath,
      range: {
        start: { line: e.range.start.line, character: e.range.start.character },
        end: { line: e.range.end.line, character: e.range.end.character }
      }
    }));
  }
  /**
   * Get recently edited documents for autocomplete context
   */
  async getRecentlyEditedDocuments() {
    return (await Promise.all(
      this.recentlyEditedDocuments.map(async (A) => {
        try {
          const g = await vscode.workspace.fs.readFile(A.uri).then((B) => B.toString()), o = g.split(`
`);
          return {
            filepath: A.uri.fsPath,
            contents: g,
            range: {
              start: { line: 0, character: 0 },
              end: {
                line: o.length - 1,
                character: o[o.length - 1].length
              }
            }
          };
        } catch {
          return null;
        }
      })
    )).filter((A) => A !== null);
  }
};
fA(vA, "staleTime", 1e3 * 60 * 2), fA(vA, "maxRecentlyEditedRanges", 3), fA(vA, "maxRecentlyEditedDocuments", 10);
let RecentlyEditedTracker = vA;
const rx = /[\s.,/#!$%^&*;:{}=\-_`~()[\]]/g;
function getSymbolsForSnippet(s) {
  const e = s.split(rx).map((A) => A.trim()).filter((A) => A !== "");
  return new Set(e);
}
const EXTENSION_NAME = "kiroAgent", AUTOCOMPLETE_ENABLED_FLAG = "enableTabAutocomplete";
var StatusBarStatus = /* @__PURE__ */ ((s) => (s[s.Disabled = 0] = "Disabled", s[s.Enabled = 1] = "Enabled", s[s.Paused = 2] = "Paused", s))(StatusBarStatus || {});
const quickPickStatusText = (s) => {
  switch (s) {
    case void 0:
    case 0:
      return "$(circle-slash) Disable autocomplete";
    case 1:
      return "$(check) Enable autocomplete";
    case 2:
      return "$(debug-pause) Pause autocomplete";
  }
}, getStatusBarStatusFromQuickPickItemLabel = (s) => {
  switch (s) {
    case "$(circle-slash) Disable autocomplete":
      return 0;
    case "$(check) Enable autocomplete":
      return 1;
    case "$(debug-pause) Pause autocomplete":
      return 2;
    default:
      return;
  }
}, statusBarItemText = (s) => {
  switch (s) {
    case void 0:
    case 0:
      return "$(circle-slash) Autocomplete";
    case 1:
      return "$(check) Autocomplete";
    case 2:
      return "$(debug-pause) Autocomplete";
  }
}, statusBarItemTooltip = (s) => {
  switch (s) {
    case void 0:
    case 0:
      return "Click to enable tab autocomplete";
    case 1:
      return "Tab autocomplete is enabled";
    case 2:
      return "Tab autocomplete is paused";
  }
};
let statusBarStatus, statusBarItem, statusBarFalseTimeout;
function stopStatusBarLoading() {
  statusBarFalseTimeout = setTimeout(() => {
    setupStatusBar(1, !1);
  }, 100);
}
function setupStatusBar(s, e) {
  e !== !1 && (clearTimeout(statusBarFalseTimeout), statusBarFalseTimeout = void 0), statusBarItem || (statusBarItem = vscode.window.createStatusBarItem("kiro.status.autocomplete", vscode.StatusBarAlignment.Right)), statusBarItem.text = e ? "$(loading~spin) Autcomplete" : statusBarItemText(s), statusBarItem.tooltip = statusBarItemTooltip(s ?? statusBarStatus), statusBarItem.command = "kiroAgent.openTabAutocompleteConfigMenu", statusBarItem.name = "Tab Autocomplete", statusBarItem.show(), s !== void 0 && (statusBarStatus = s), vscode.workspace.onDidChangeConfiguration((A) => {
    if (A.affectsConfiguration(EXTENSION_NAME)) {
      const g = vscode.workspace.getConfiguration(EXTENSION_NAME).get(AUTOCOMPLETE_ENABLED_FLAG);
      if (g && statusBarStatus === 2)
        return;
      setupStatusBar(
        g ? 1 : 0
        /* Disabled */
      );
    }
  });
}
function getStatusBarStatus() {
  return statusBarStatus;
}
const autocompleteLogger = vscode.window.createOutputChannel("autocomplete-completion");
class ContinueCompletionProvider {
  constructor(e) {
    fA(this, "completionProvider");
    fA(this, "recentlyEditedTracker", new RecentlyEditedTracker());
    fA(this, "_lastShownCompletion");
    fA(this, "_lastVsCodeCompletionInput");
    this.completionProvider = new CompletionProvider(e, this.onError.bind(this), getDefinitionsFromLsp), vscode.workspace.onDidChangeTextDocument((A) => {
      var g;
      A.document.uri.fsPath, (g = this._lastShownCompletion) == null || g.filepath;
    });
  }
  onError(e) {
    vscode.window.showErrorMessage(e.message);
  }
  /**
   * Provide inline completion items for the current cursor position
   */
  async provideInlineCompletionItems(e, A, g, o) {
    const B = getStatusBarStatus() === StatusBarStatus.Enabled;
    if (o.isCancellationRequested || !B || g.selectedCompletionInfo && !g.selectedCompletionInfo.text.startsWith(e.getText(g.selectedCompletionInfo.range)))
      return null;
    const F = void 0, x = {
      context: g,
      document: e,
      position: A
    }, b = g.selectedCompletionInfo;
    this._lastVsCodeCompletionInput = x;
    try {
      const X = new AbortController(), W = X.signal;
      o.onCancellationRequested(() => X.abort());
      const eA = {
        line: A.line,
        character: A.character
      };
      let IA = e.getText();
      if (e.uri.scheme === "vscode-notebook-cell") {
        const h = vscode.workspace.notebookDocuments.find(
          (E) => E.getCells().some((u) => u.document.uri === e.uri)
        );
        if (h) {
          const E = h.getCells();
          IA = E.map((u) => {
            const r = u.document.getText();
            return u.kind === vscode.NotebookCellKind.Markup ? `"""${r}"""` : r;
          }).join(`

`);
          for (const u of E) {
            if (u.document.uri === e.uri)
              break;
            eA.line += u.document.getText().split(`
`).length + 1;
          }
        }
      }
      const z = void 0;
      if (e.uri.scheme === "vscode-scm")
        return null;
      const N = {
        completionId: v4(),
        filepath: e.uri.fsPath,
        pos: eA,
        recentlyEditedFiles: [],
        recentlyEditedRanges: this.recentlyEditedTracker.getRecentlyEditedRanges(),
        manuallyPassFileContents: IA,
        manuallyPassPrefix: z,
        selectedCompletionInfo: b,
        injectDetails: F
      };
      setupStatusBar(void 0, !0);
      const J = await this.completionProvider.provideInlineCompletionItems(autocompleteLogger, N, W);
      if (!J || !J.completion || (b && (J.completion = b.text + J.completion), !this.willDisplay(b, W, J)))
        return null;
      this.completionProvider.markDisplayed(N.completionId, J), this._lastShownCompletion = J;
      const H = (b == null ? void 0 : b.range.start) ?? A, y = new vscode.Range(H, H.translate(0, J.completion.length)), p = new vscode.InlineCompletionItem(J.completion, y, {
        title: "Log Autocomplete Outcome",
        command: "kiroAgent.logAutocompleteOutcome",
        arguments: [N.completionId, this.completionProvider]
      });
      return p.completeBracketPairs = !0, [p];
    } finally {
      stopStatusBarLoading();
    }
  }
  /**
   * Called when a completion is about to be displayed
   */
  willDisplay(e, A, g) {
    if (e) {
      const { text: o, range: B } = e;
      if (!g.completion.startsWith(o))
        return !1;
    }
    return !A.aborted;
  }
}
const triggerThreshold = 0.25, osCoefficientMap = {
  "Mac OS X": -0.1552,
  "Windows 10": -0.0238,
  Windows: 0.0412,
  win32: -0.0559
}, triggerTypeCoefficientMap = {
  SpecialCharacters: 0.0209,
  Enter: 0.2853
}, languageCoefficientMap = {
  java: -0.4622,
  javascript: -0.4688,
  python: -0.3052,
  typescript: -0.6084,
  tsx: -0.6084,
  jsx: -0.4688,
  shell: -0.4718,
  ruby: -0.7356,
  sql: -0.4937,
  rust: -0.4309,
  kotlin: -0.4739,
  php: -0.3917,
  csharp: -0.3475,
  go: -0.3504,
  scala: -0.534,
  cpp: -0.1734,
  json: 0,
  yaml: -0.3,
  tf: -0.55
}, lineNumCoefficient = -0.0416, lengthOfLeftCurrentCoefficient = -1.1747, lengthOfLeftPrevCoefficient = 0.4033, lengthOfRightCoefficient = -0.3321, prevDecisionOtherCoefficient = 0, ideCoefficient = -0.1905, lengthLeft0To5 = -0.8756, lengthLeft5To10 = -0.5463, lengthLeft10To20 = -0.4081, lengthLeft20To30 = -0.3272, lengthLeft30To40 = -0.2442, lengthLeft40To50 = -0.1471, intercept = 0.3738713, maxx = {
  lineNum: 4631,
  lenLeftCur: 157,
  lenLeftPrev: 176,
  lenRight: 10239
}, minn = {
  lineNum: 0,
  lenLeftCur: 0,
  lenLeftPrev: 0,
  lenRight: 0
}, charCoefficients = {
  throw: 1.5868,
  ";": -1.268,
  any: -1.1565,
  7: -1.1347,
  false: -1.1307,
  nil: -1.0653,
  elif: 1.0122,
  9: -1.0098,
  pass: -1.0058,
  True: -1.0002,
  False: -0.9434,
  6: -0.9222,
  true: -0.9142,
  None: -0.9027,
  8: -0.9013,
  break: -0.8475,
  "}": -0.847,
  5: -0.8414,
  4: -0.8197,
  1: -0.8085,
  "\\": -0.8019,
  static: -0.7748,
  0: -0.77,
  end: -0.7617,
  "(": 0.7239,
  "/": -0.7104,
  where: -0.6981,
  readonly: -0.6741,
  async: -0.6723,
  3: -0.654,
  continue: -0.6413,
  struct: -0.64,
  try: -0.6369,
  float: -0.6341,
  using: 0.6079,
  "@": 0.6016,
  "|": 0.5993,
  impl: 0.5808,
  private: -0.5746,
  for: 0.5741,
  2: -0.5634,
  let: -0.5187,
  foreach: 0.5186,
  select: -0.5148,
  export: -0.5,
  mut: -0.4921,
  ")": -0.463,
  "]": -0.4611,
  when: 0.4602,
  virtual: -0.4583,
  extern: -0.4465,
  catch: 0.4446,
  new: 0.4394,
  val: -0.4339,
  map: 0.4284,
  case: 0.4271,
  throws: 0.4221,
  null: -0.4197,
  protected: -0.4133,
  q: 0.4125,
  except: 0.4115,
  ": ": 0.4072,
  "^": -0.407,
  " ": 0.4066,
  $: 0.3981,
  this: 0.3962,
  switch: 0.3947,
  "*": -0.3931,
  module: 0.3912,
  array: 0.385,
  "=": 0.3828,
  p: 0.3728,
  ON: 0.3708,
  "`": 0.3693,
  u: 0.3658,
  a: 0.3654,
  require: 0.3646,
  ">": -0.3644,
  const: -0.3476,
  o: 0.3423,
  sizeof: 0.3416,
  object: 0.3362,
  w: 0.3345,
  print: 0.3344,
  range: 0.3336,
  if: 0.3324,
  abstract: -0.3293,
  var: -0.3239,
  i: 0.321,
  while: 0.3138,
  J: 0.3137,
  c: 0.3118,
  await: -0.3072,
  from: 0.3057,
  f: 0.302,
  echo: 0.2995,
  "#": 0.2984,
  e: 0.2962,
  r: 0.2925,
  mod: 0.2893,
  loop: 0.2874,
  t: 0.2832,
  "~": 0.282,
  final: -0.2816,
  del: 0.2785,
  override: -0.2746,
  ref: -0.2737,
  h: 0.2693,
  m: 0.2681,
  "{": 0.2674,
  implements: 0.2672,
  inline: -0.2642,
  match: 0.2613,
  with: -0.261,
  x: 0.2597,
  namespace: -0.2596,
  operator: 0.2573,
  double: -0.2563,
  source: -0.2482,
  import: -0.2419,
  NULL: -0.2399,
  l: 0.239,
  or: 0.2378,
  s: 0.2366,
  then: 0.2354,
  W: 0.2354,
  y: 0.2333,
  local: 0.2288,
  is: 0.2282,
  n: 0.2254,
  "+": -0.2251,
  G: 0.223,
  public: -0.2229,
  WHERE: 0.2224,
  list: 0.2204,
  Q: 0.2204,
  "[": 0.2136,
  VALUES: 0.2134,
  H: 0.2105,
  g: 0.2094,
  else: -0.208,
  bool: -0.2066,
  long: -0.2059,
  R: 0.2025,
  S: 0.2021,
  d: 0.2003,
  V: 0.1974,
  K: -0.1961,
  "<": 0.1958,
  debugger: -0.1929,
  NOT: -0.1911,
  b: 0.1907,
  boolean: -0.1891,
  z: -0.1866,
  LIKE: -0.1793,
  raise: 0.1782,
  L: 0.1768,
  fn: 0.176,
  delete: 0.1714,
  unsigned: -0.1675,
  auto: -0.1648,
  finally: 0.1616,
  k: 0.1599,
  as: 0.156,
  instanceof: 0.1558,
  "&": 0.1554,
  E: 0.1551,
  M: 0.1542,
  I: 0.1503,
  Y: 0.1493,
  typeof: 0.1475,
  j: 0.1445,
  INTO: 0.1442,
  IF: 0.1437,
  next: 0.1433,
  undef: -0.1427,
  THEN: -0.1416,
  v: 0.1415,
  C: 0.1383,
  P: 0.1353,
  AND: -0.1345,
  constructor: 0.1337,
  void: -0.1336,
  class: -0.1328,
  defer: 0.1316,
  begin: 0.1306,
  FROM: -0.1304,
  SET: 0.1291,
  decimal: -0.1278,
  friend: 0.1277,
  SELECT: -0.1265,
  event: 0.1259,
  lambda: 0.1253,
  enum: 0.1215,
  A: 0.121,
  lock: 0.1187,
  ensure: 0.1184,
  "%": 0.1177,
  isset: 0.1175,
  O: 0.1174,
  ".": 0.1146,
  UNION: -0.1145,
  alias: -0.1129,
  template: -0.1102,
  WHEN: 0.1093,
  rescue: 0.1083,
  DISTINCT: -0.1074,
  trait: -0.1073,
  D: 0.1062,
  in: 0.1045,
  internal: -0.1029,
  ",": 0.1027,
  static_cast: 0.1016,
  do: -0.1005,
  OR: 0.1003,
  AS: -0.1001,
  interface: 0.0996,
  super: 0.0989,
  B: 0.0963,
  U: 0.0962,
  T: 0.0943,
  CALL: -0.0918,
  BETWEEN: -0.0915,
  N: 0.0897,
  yield: 0.0867,
  done: -0.0857,
  string: -0.0837,
  out: -0.0831,
  volatile: -0.0819,
  retry: 0.0816,
  "?": -0.0796,
  number: -0.0791,
  short: 0.0787,
  sealed: -0.0776,
  package: 0.0765,
  OPEN: -0.0756,
  base: 0.0735,
  and: 0.0729,
  exit: 0.0726,
  _: 0.0721,
  keyof: -0.072,
  def: 0.0713,
  crate: -0.0706,
  "-": -0.07,
  FUNCTION: 0.0692,
  declare: -0.0678,
  include: 0.0671,
  COUNT: -0.0669,
  INDEX: -0.0666,
  CLOSE: -0.0651,
  fi: -0.0644,
  uint: 0.0624,
  params: 0.0575,
  HAVING: 0.0575,
  byte: -0.0575,
  clone: -0.0552,
  char: -0.054,
  func: 0.0538,
  never: -0.053,
  unset: -0.0524,
  unless: -0.051,
  esac: -0.0509,
  shift: -0.0507,
  require_once: 0.0486,
  ELSE: -0.0477,
  extends: 0.0461,
  elseif: 0.0452,
  mutable: -0.0451,
  asm: 0.0449,
  "!": 0.0446,
  LIMIT: 0.0444,
  ushort: -0.0438,
  '"': -0.0433,
  Z: 0.0431,
  exec: -0.0431,
  IS: -0.0429,
  DECLARE: -0.0425,
  __LINE__: -0.0424,
  BEGIN: -0.0418,
  typedef: 0.0414,
  EXIT: -0.0412,
  "'": 0.041,
  function: -0.0393,
  dyn: -0.039,
  wchar_t: -0.0388,
  unique: -0.0383,
  include_once: 0.0367,
  stackalloc: 0.0359,
  RETURN: -0.0356,
  const_cast: 0.035,
  MAX: 0.0341,
  assert: -0.0331,
  JOIN: -0.0328,
  use: 0.0318,
  GET: 0.0317,
  VIEW: 0.0314,
  move: 0.0308,
  typename: 0.0308,
  die: 0.0305,
  asserts: -0.0304,
  reinterpret_cast: -0.0302,
  USING: -0.0289,
  elsif: -0.0285,
  FIRST: -0.028,
  self: -0.0278,
  RETURNING: -0.0278,
  symbol: -0.0273,
  OFFSET: 0.0263,
  bigint: 0.0253,
  register: -0.0237,
  union: -0.0227,
  return: -0.0227,
  until: -0.0224,
  endfor: -0.0213,
  implicit: -0.021,
  LOOP: 0.0195,
  pub: 0.0182,
  global: 0.0179,
  EXCEPTION: 0.0175,
  delegate: 0.0173,
  signed: -0.0163,
  FOR: 0.0156,
  unsafe: 0.014,
  NEXT: -0.0133,
  IN: 0.0129,
  MIN: -0.0123,
  go: -0.0112,
  type: -0.0109,
  explicit: -0.0107,
  eval: -0.0104,
  int: -99e-4,
  CASE: -96e-4,
  END: 84e-4,
  UPDATE: 74e-4,
  default: 72e-4,
  chan: 68e-4,
  fixed: 66e-4,
  not: -52e-4,
  X: -47e-4,
  endforeach: 31e-4,
  goto: 28e-4,
  empty: 22e-4,
  checked: 12e-4,
  F: -1e-3
};
function shouldTriggerFromClassifier({
  leftFileContent: s,
  rightFileContent: e,
  triggerType: A,
  lineNumber: g,
  languageName: o,
  logger: B
}) {
  var Q;
  const F = s.split(/\r?\n/), b = F[F.length - 1].trim().split(" ");
  let X = "";
  const W = b[b.length - 1];
  W && W.length > 1 && (X = W);
  const eA = F[F.length - 1].length, IA = ((Q = F[F.length - 2]) == null ? void 0 : Q.length) ?? 0, z = e.trim().length, N = triggerTypeCoefficientMap[A || ""] ?? 0, J = osCoefficientMap[getNormalizedOsName()] ?? 0, $ = 0, H = charCoefficients[X] ?? 0, y = Object.values(languageCoefficientMap), p = y.length > 0 ? y.reduce((d, c) => d + c) / y.length : 0, h = languageCoefficientMap[o.toLowerCase()] ?? p, E = prevDecisionOtherCoefficient;
  let u = 0;
  s.length >= 0 && s.length < 5 ? u = lengthLeft0To5 : s.length >= 5 && s.length < 10 ? u = lengthLeft5To10 : s.length >= 10 && s.length < 20 ? u = lengthLeft10To20 : s.length >= 20 && s.length < 30 ? u = lengthLeft20To30 : s.length >= 30 && s.length < 40 ? u = lengthLeft30To40 : s.length >= 40 && s.length < 50 && (u = lengthLeft40To50);
  const r = sigmoid(
    lengthOfRightCoefficient * (z - minn.lenRight) / (maxx.lenRight - minn.lenRight) + lengthOfLeftCurrentCoefficient * (eA - minn.lenLeftCur) / (maxx.lenLeftCur - minn.lenLeftCur) + lengthOfLeftPrevCoefficient * (IA - minn.lenLeftPrev) / (maxx.lenLeftPrev - minn.lenLeftPrev) + lineNumCoefficient * (g - minn.lineNum) / (maxx.lineNum - minn.lineNum) + J + N + $ + H + ideCoefficient + intercept + E + h + u
  );
  return B == null || B.appendLine(
    JSON.stringify(
      {
        provider: "qdev",
        classifierScore: r,
        triggerThreshold,
        shouldTrigger: r > triggerThreshold
      },
      null,
      2
    )
  ), r > triggerThreshold;
}
function getNormalizedOsName() {
  const s = require$$0$1.platform(), e = require$$0$1.version(), A = s.toLowerCase();
  return A.includes("windows") ? e ? e.includes("Windows NT 10") || e.startsWith("10") ? "Windows 10" : e.includes("6.1") ? "Windows 7" : e.includes("6.3") ? "Windows 8.1" : "Windows" : "Windows" : A.includes("macos") || A.includes("mac os") || A.includes("darwin") ? "Mac OS X" : A.includes("linux") ? "Linux" : s;
}
function sigmoid(s) {
  return 1 / (1 + Math.exp(-s));
}
function recordReferences(s, e) {
  if (e && e.length > 0) {
    const A = e.filter((g) => !!g.licenseName).map(({ licenseName: g, url: o, repository: B }) => ({
      generatedContent: s,
      licenseName: g,
      repository: B,
      url: o
    }));
    A.length > 0 && vscode.commands.executeCommand("kiroAgent.recordReferences", A);
  }
}
function createAutocompleteCommands(s) {
  return {
    "kiroAgent.logAutocompleteOutcome": (...e) => {
      const A = e[0];
      e[1].accept(A);
    },
    "kiroAgent.toggleTabAutocompleteEnabled": () => {
      const e = vscode.workspace.getConfiguration(EXTENSION_NAME), A = e.get("enableTabAutocomplete");
      !e.get("pauseTabAutocompleteOnBattery") || s.isACConnected() ? updateResolvedIDESetting(EXTENSION_NAME, "enableTabAutocomplete", !A) : A ? getStatusBarStatus() === StatusBarStatus.Paused ? setupStatusBar(StatusBarStatus.Enabled) : updateResolvedIDESetting(EXTENSION_NAME, "enableTabAutocomplete", !1) : (setupStatusBar(StatusBarStatus.Paused), updateResolvedIDESetting(EXTENSION_NAME, "enableTabAutocomplete", !0));
    },
    "kiroAgent.openTabAutocompleteConfigMenu": () => {
      const e = vscode.workspace.getConfiguration(EXTENSION_NAME), A = vscode.window.createQuickPick(), g = e.get("pauseTabAutocompleteOnBattery") && !s.isACConnected(), o = getStatusBarStatus();
      let B;
      g ? B = o === StatusBarStatus.Paused ? StatusBarStatus.Enabled : o === StatusBarStatus.Disabled ? StatusBarStatus.Paused : StatusBarStatus.Disabled : B = o === StatusBarStatus.Disabled ? StatusBarStatus.Enabled : StatusBarStatus.Disabled, A.items = [
        {
          label: quickPickStatusText(B)
        }
      ], A.onDidAccept(() => {
        const F = A.selectedItems[0].label, x = getStatusBarStatusFromQuickPickItemLabel(F);
        x !== void 0 && (setupStatusBar(x), updateResolvedIDESetting(
          EXTENSION_NAME,
          "enableTabAutocomplete",
          x === StatusBarStatus.Enabled
        )), A.dispose();
      }), A.show();
    }
  };
}
function registerAutocompleteCommands(s, e) {
  const A = createAutocompleteCommands(e);
  for (const [g, o] of Object.entries(A))
    s.subscriptions.push(vscode.commands.registerCommand(g, o));
}
const Metrics = new MetricReporter(TelemetryNamespace.Continue, "QCompletion");
class RuntimeServiceClient {
  async getCodeWhispererClientConfig() {
    const { region: e, endpoint: A, modelId: g } = await vscode.commands.executeCommand(
      "kiroAgent.configuration.getCodeWhispererConfig"
    ), o = vscode.kiroVersion ?? "0.0.0", B = new https.Agent({
      keepAlive: !0,
      // Optionally set keepAlive timeout (in milliseconds)
      keepAliveMsecs: 3e4,
      // Optionally set maximum sockets
      maxSockets: 20
    }), F = getMachineId();
    return {
      config: {
        region: e,
        endpoint: A,
        token: { token: await authProvider.getToken() },
        customUserAgent: `KiroIDE ${o} ${F}`,
        maxAttempts: 1,
        requestHandler: {
          httpOptions: {
            agent: B
          }
        }
      },
      modelId: g
    };
  }
  async initializeRuntimeClient() {
    const { config: e, modelId: A } = await this.getCodeWhispererClientConfig();
    return { client: new CodeWhispererRuntime(e), modelId: A };
  }
  /**
   * Get tab completion from the CodeWhisperer service
   */
  async tabComplete({
    lineNumber: e,
    leftFileContent: A,
    rightFileContent: g,
    languageName: o,
    logger: B,
    filename: F,
    snippets: x
  }) {
    var N, J, $;
    if (!shouldTriggerFromClassifier({ lineNumber: e, leftFileContent: A, rightFileContent: g, languageName: o, logger: B }))
      return;
    const { client: b, modelId: X } = await this.initializeRuntimeClient();
    addPrivacyHeadersMiddleware(b, "AmazonQDeveloper Runtime"), addAgentModeHeadersMiddleware(b, "autocomplete"), addExternalIdpTokenTypeMiddleware(b, (N = authProvider.readToken()) == null ? void 0 : N.authMethod, "autocomplete"), addRedirectForInternalMiddleware(b, (J = authProvider.readToken()) == null ? void 0 : J.provider);
    const W = await authProvider.getProfileArn(), eA = [];
    x.forEach((H) => {
      eA.push({
        content: H.contents,
        filePath: H.filepath
      });
    });
    const IA = new GenerateCompletionsCommand({
      fileContext: {
        leftFileContent: A,
        rightFileContent: g,
        filename: F,
        programmingLanguage: {
          languageName: o
        }
      },
      supplementalContexts: eA,
      profileArn: W,
      modelId: X
    }), z = performance.now();
    try {
      Metrics.reportCountMetrics({ invoke: 1 });
      const H = await b.send(IA);
      if (Metrics.reportCountMetrics({ success: 1 }), B == null || B.appendLine(
        JSON.stringify(
          {
            provider: "qdev",
            response: {
              id: H.$metadata.requestId,
              competions: H.completions
            },
            request: IA
          },
          null,
          2
        )
      ), H.completions && H.completions.length > 0) {
        const y = H.completions[0];
        if (!y.content) {
          Metrics.reportCountMetrics({ emptyResponse: 1 });
          return;
        }
        return recordReferences(y.content, y.references), Metrics.reportHistogramMetrics({ length: y.content.length }), y.content;
      }
      Metrics.reportCountMetrics({ emptyResponse: 1 });
    } catch (H) {
      const y = ($ = H.$metadata) == null ? void 0 : $.requestId;
      if (B == null || B.appendLine(
        JSON.stringify({
          provider: "qdev",
          requestId: y,
          error: H instanceof Error ? { name: H.name, message: H.message } : H,
          request: IA
        })
      ), H instanceof AccessDeniedException)
        throw new AccessDeniedError("CodeWhispererRuntime: AccessDenied");
      if (H instanceof ThrottlingException && H.reason === "MONTHLY_REQUEST_COUNT") {
        vscode.window.showErrorMessage("Autocomplete Failed: Maximum Kiro usage reached for this month.");
        return;
      }
      if (H instanceof ValidationException) {
        Metrics.reportCountMetrics({ validationError: 1 });
        return;
      }
      if (H instanceof ThrottlingException) {
        Metrics.reportCountMetrics({ throttled: 1 });
        return;
      }
      throw Metrics.reportCountMetrics({ failure: 1 }), H;
    } finally {
      Metrics.reportHistogramMetrics({
        completeLatency: performance.now() - z
      });
    }
  }
}
const isAutoCompleteEnabled = () => vscode.workspace.getConfiguration(EXTENSION_NAME).get(AUTOCOMPLETE_ENABLED_FLAG) ?? !1;
var lib = {};
const version = "5.30.6", require$$0 = {
  version
};
var util = {}, hasRequiredUtil;
function requireUtil() {
  if (hasRequiredUtil) return util;
  hasRequiredUtil = 1;
  const s = require$$0$1, e = require$$1$1, A = require$$2, g = require$$1.spawn, o = require$$1.exec, B = require$$1.execSync, F = require$$4, x = process.platform, b = x === "linux" || x === "android", X = x === "darwin", W = x === "win32", eA = x === "freebsd", IA = x === "openbsd", z = x === "netbsd";
  let N = 0, J = "", $ = null, H = null;
  const y = process.env.WINDIR || "C:\\Windows";
  let p, h = "";
  const E = [];
  let u = !1, r = "";
  const Q = "$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ", d = "--###START###--", c = "--ERROR--", n = "--###ENDCMD###--", L = "--##ID##--", k = {
    windowsHide: !0,
    maxBuffer: 1024 * 102400,
    encoding: "UTF-8",
    env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" })
  }, K = {
    maxBuffer: 1024 * 102400,
    encoding: "UTF-8",
    stdio: ["pipe", "pipe", "ignore"]
  };
  function gA(iA) {
    let sA = parseInt(iA, 10);
    return isNaN(sA) && (sA = 0), sA;
  }
  function v(iA) {
    let sA = !1, Z = "", nA = "";
    for (const CA of iA)
      CA >= "0" && CA <= "9" || sA ? (sA = !0, Z += CA) : nA += CA;
    return [nA, Z];
  }
  const U = new String(), V = new String().replace, m = new String().toLowerCase, a = new String().toString, I = new String().substr, t = new String().substring, l = new String().trim, D = new String().startsWith, f = Math.min;
  function w(iA) {
    return iA && {}.toString.call(iA) === "[object Function]";
  }
  function Y(iA) {
    const sA = [], Z = {};
    for (let nA = 0; nA < iA.length; nA++) {
      let CA = Object.keys(iA[nA]);
      CA.sort((EA, SA) => EA - SA);
      let P = "";
      for (let EA = 0; EA < CA.length; EA++)
        P += JSON.stringify(CA[EA]), P += JSON.stringify(iA[nA][CA[EA]]);
      ({}).hasOwnProperty.call(Z, P) || (sA.push(iA[nA]), Z[P] = !0);
    }
    return sA;
  }
  function _(iA, sA) {
    return iA.sort((Z, nA) => {
      let CA = "", P = "";
      return sA.forEach((EA) => {
        CA = CA + Z[EA], P = P + nA[EA];
      }), CA < P ? -1 : CA > P ? 1 : 0;
    });
  }
  function G() {
    return N === 0 && (N = s.cpus().length), N;
  }
  function q(iA, sA, Z, nA, CA) {
    Z = Z || ":", sA = sA.toLowerCase(), nA = nA || !1, CA = CA || !1;
    let P = "";
    return iA.some((EA) => {
      let SA = EA.toLowerCase().replace(/\t/g, "");
      if (nA && (SA = SA.trim()), SA.startsWith(sA) && (!CA || SA.match(sA + Z) || SA.match(sA + " " + Z))) {
        const yA = nA ? EA.trim().split(Z) : EA.split(Z);
        if (yA.length >= 2)
          return yA.shift(), P = yA.join(Z).trim(), !0;
      }
      return !1;
    }), P;
  }
  function j(iA, sA) {
    return sA = sA || 16, iA.replace(/\\x([0-9A-Fa-f]{2})/g, function() {
      return String.fromCharCode(parseInt(arguments[1], sA));
    });
  }
  function aA(iA) {
    let sA = "", Z = 0;
    return iA.split("").forEach((nA) => {
      nA >= "0" && nA <= "9" ? Z === 1 && Z++ : (Z === 0 && Z++, Z === 1 && (sA += nA));
    }), sA;
  }
  function tA(iA, sA) {
    sA = sA || "", iA = iA.toUpperCase();
    let Z = 0, nA = 0;
    const CA = aA(iA), P = iA.split(CA);
    if (P.length >= 2) {
      P[2] && (P[1] += P[2]);
      let EA = P[1] && P[1].toLowerCase().indexOf("pm") > -1 || P[1].toLowerCase().indexOf("p.m.") > -1 || P[1].toLowerCase().indexOf("p. m.") > -1 || P[1].toLowerCase().indexOf("n") > -1 || P[1].toLowerCase().indexOf("ch") > -1 || P[1].toLowerCase().indexOf("ös") > -1 || sA && P[1].toLowerCase().indexOf(sA) > -1;
      return Z = parseInt(P[0], 10), nA = parseInt(P[1], 10), Z = EA && Z < 12 ? Z + 12 : Z, ("0" + Z).substr(-2) + ":" + ("0" + nA).substr(-2);
    }
  }
  function M(iA, sA) {
    const Z = {
      date: "",
      time: ""
    };
    sA = sA || {};
    const nA = (sA.dateFormat || "").toLowerCase(), CA = sA.pmDesignator || "", P = iA.split(" ");
    if (P[0]) {
      if (P[0].indexOf("/") >= 0) {
        const EA = P[0].split("/");
        EA.length === 3 && (EA[0].length === 4 ? Z.date = EA[0] + "-" + ("0" + EA[1]).substr(-2) + "-" + ("0" + EA[2]).substr(-2) : EA[2].length === 2 ? (nA.indexOf("/d/") > -1 || nA.indexOf("/dd/") > -1, Z.date = "20" + EA[2] + "-" + ("0" + EA[1]).substr(-2) + "-" + ("0" + EA[0]).substr(-2)) : (iA.toLowerCase().indexOf("pm") > -1 || iA.toLowerCase().indexOf("p.m.") > -1 || iA.toLowerCase().indexOf("p. m.") > -1 || iA.toLowerCase().indexOf("am") > -1 || iA.toLowerCase().indexOf("a.m.") > -1 || iA.toLowerCase().indexOf("a. m.") > -1 || nA.indexOf("/d/") > -1 || nA.indexOf("/dd/") > -1) && nA.indexOf("dd/") !== 0 ? Z.date = EA[2] + "-" + ("0" + EA[0]).substr(-2) + "-" + ("0" + EA[1]).substr(-2) : Z.date = EA[2] + "-" + ("0" + EA[1]).substr(-2) + "-" + ("0" + EA[0]).substr(-2));
      }
      if (P[0].indexOf(".") >= 0) {
        const EA = P[0].split(".");
        EA.length === 3 && (nA.indexOf(".d.") > -1 || nA.indexOf(".dd.") > -1 ? Z.date = EA[2] + "-" + ("0" + EA[0]).substr(-2) + "-" + ("0" + EA[1]).substr(-2) : Z.date = EA[2] + "-" + ("0" + EA[1]).substr(-2) + "-" + ("0" + EA[0]).substr(-2));
      }
      if (P[0].indexOf("-") >= 0) {
        const EA = P[0].split("-");
        EA.length === 3 && (Z.date = EA[0] + "-" + ("0" + EA[1]).substr(-2) + "-" + ("0" + EA[2]).substr(-2));
      }
    }
    if (P[1]) {
      P.shift();
      const EA = P.join(" ");
      Z.time = tA(EA, CA);
    }
    return Z;
  }
  function O(iA, sA) {
    let Z = sA > 0, nA = 1, CA = 0, P = 0;
    const EA = [];
    for (let yA = 0; yA < iA.length; yA++)
      nA <= sA ? (/\s/.test(iA[yA]) && !Z && (P = yA - 1, EA.push({
        from: CA,
        to: P + 1,
        cap: iA.substring(CA, P + 1)
      }), CA = P + 2, nA++), Z = iA[yA] === " ") : (!/\s/.test(iA[yA]) && Z && (P = yA - 1, CA < P && EA.push({
        from: CA,
        to: P,
        cap: iA.substring(CA, P)
      }), CA = P + 1, nA++), Z = iA[yA] === " ");
    P = 5e3, EA.push({
      from: CA,
      to: P,
      cap: iA.substring(CA, P)
    });
    let SA = EA.length;
    for (let yA = 0; yA < SA; yA++)
      EA[yA].cap.replace(/\s/g, "").length === 0 && yA + 1 < SA && (EA[yA].to = EA[yA + 1].to, EA[yA].cap = EA[yA].cap + EA[yA + 1].cap, EA.splice(yA + 1, 1), SA = SA - 1);
    return EA;
  }
  function T(iA, sA, Z) {
    for (let nA = 0; nA < iA.length; nA++)
      if (iA[nA][sA] === Z)
        return nA;
    return -1;
  }
  function S() {
    if (r = "powershell.exe", W) {
      const iA = `${y}\\system32\\WindowsPowerShell\\v1.0\\powershell.exe`;
      e.existsSync(iA) && (r = iA);
    }
  }
  function AA() {
    return W ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : "vboxmanage";
  }
  function oA(iA) {
    let sA = "", Z, nA = "";
    if (iA.indexOf(d) >= 0) {
      Z = iA.split(d);
      const P = Z[1].split(L);
      sA = P[0], P.length > 1 && (iA = P.slice(1).join(L));
    }
    iA.indexOf(n) >= 0 && (Z = iA.split(n), nA = Z[0]);
    let CA = -1;
    for (let P = 0; P < E.length; P++)
      E[P].id === sA && (CA = P, E[P].callback(nA));
    CA >= 0 && E.splice(CA, 1);
  }
  function rA() {
    p || (p = g(r, ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-Command", "-"], {
      stdio: "pipe",
      windowsHide: !0,
      maxBuffer: 1024 * 102400,
      encoding: "UTF-8",
      env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" })
    }), p && p.pid && (u = !0, p.stdout.on("data", (iA) => {
      h = h + iA.toString("utf8"), iA.indexOf(n) >= 0 && (oA(h), h = "");
    }), p.stderr.on("data", () => {
      oA(h + c);
    }), p.on("error", () => {
      oA(h + c);
    }), p.on("close", () => {
      p && p.kill();
    })));
  }
  function cA() {
    try {
      p && (p.stdin.write("exit" + s.EOL), p.stdin.end());
    } catch {
      p && p.kill();
    }
    u = !1, p = null;
  }
  function lA(iA) {
    if (u) {
      const sA = Math.random().toString(36).substring(2, 12);
      return new Promise((Z) => {
        process.nextTick(() => {
          function nA(CA) {
            Z(CA);
          }
          E.push({
            id: sA,
            cmd: iA,
            callback: nA,
            start: /* @__PURE__ */ new Date()
          });
          try {
            p && p.pid && p.stdin.write(Q + "echo " + d + sA + L + "; " + s.EOL + iA + s.EOL + "echo " + n + s.EOL);
          } catch {
            Z("");
          }
        });
      });
    } else {
      let sA = "";
      return new Promise((Z) => {
        process.nextTick(() => {
          try {
            const nA = s.release().split(".").map(Number), CA = nA[0] < 10 ? ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-NoExit", "-ExecutionPolicy", "Unrestricted", "-Command", "-"] : ["-NoProfile", "-NoLogo", "-InputFormat", "Text", "-ExecutionPolicy", "Unrestricted", "-Command", Q + iA], P = g(r, CA, {
              stdio: "pipe",
              windowsHide: !0,
              maxBuffer: 1024 * 102400,
              encoding: "UTF-8",
              env: Object.assign({}, process.env, { LANG: "en_US.UTF-8" })
            });
            if (P && !P.pid && P.on("error", () => {
              Z(sA);
            }), P && P.pid) {
              if (P.stdout.on("data", (EA) => {
                sA = sA + EA.toString("utf8");
              }), P.stderr.on("data", () => {
                P.kill(), Z(sA);
              }), P.on("close", () => {
                P.kill(), Z(sA);
              }), P.on("error", () => {
                P.kill(), Z(sA);
              }), nA[0] < 10)
                try {
                  P.stdin.write(Q + iA + s.EOL), P.stdin.write("exit" + s.EOL), P.stdin.end();
                } catch {
                  P.kill(), Z(sA);
                }
            } else
              Z(sA);
          } catch {
            Z(sA);
          }
        });
      });
    }
  }
  function pA(iA, sA, Z) {
    let nA = "";
    return Z = Z || {}, new Promise((CA) => {
      process.nextTick(() => {
        try {
          const P = g(iA, sA, Z);
          P && !P.pid && P.on("error", () => {
            CA(nA);
          }), P && P.pid ? (P.stdout.on("data", (EA) => {
            nA += EA.toString();
          }), P.on("close", () => {
            P.kill(), CA(nA);
          }), P.on("error", () => {
            P.kill(), CA(nA);
          })) : CA(nA);
        } catch {
          CA(nA);
        }
      });
    });
  }
  function BA() {
    if (W) {
      if (!J)
        try {
          const Z = B("chcp", k).toString().split(`\r
`)[0].split(":");
          J = Z.length > 1 ? Z[1].replace(".", "").trim() : "";
        } catch {
          J = "437";
        }
      return J;
    }
    if (b || X || eA || IA || z) {
      if (!J)
        try {
          const Z = B("echo $LANG", K).toString().split(`\r
`)[0].split(".");
          J = Z.length > 1 ? Z[1].trim() : "", J || (J = "UTF-8");
        } catch {
          J = "UTF-8";
        }
      return J;
    }
  }
  function uA() {
    if ($ !== null)
      return $;
    if ($ = !1, W)
      try {
        const iA = B("WHERE smartctl 2>nul", k).toString().split(`\r
`);
        iA && iA.length ? $ = iA[0].indexOf(":\\") >= 0 : $ = !1;
      } catch {
        $ = !1;
      }
    if (b || X || eA || IA || z)
      try {
        $ = B("which smartctl 2>/dev/null", K).toString().split(`\r
`).length > 0;
      } catch {
        F.noop();
      }
    return $;
  }
  function hA(iA) {
    const sA = ["BCM2708", "BCM2709", "BCM2710", "BCM2711", "BCM2712", "BCM2835", "BCM2836", "BCM2837", "BCM2837B0"];
    if (H !== null)
      iA = H;
    else if (iA === void 0)
      try {
        iA = e.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split(`
`), H = iA;
      } catch {
        return !1;
      }
    const Z = q(iA, "hardware"), nA = q(iA, "model");
    return Z && sA.indexOf(Z) > -1 || nA && nA.indexOf("Raspberry Pi") > -1;
  }
  function wA() {
    let iA = [];
    try {
      iA = e.readFileSync("/etc/os-release", { encoding: "utf8" }).toString().split(`
`);
    } catch {
      return !1;
    }
    const sA = q(iA, "id", "=");
    return sA && sA.indexOf("raspbian") > -1;
  }
  function NA(iA, sA, Z) {
    Z || (Z = sA, sA = k);
    let nA = "chcp 65001 > nul && cmd /C " + iA + " && chcp " + J + " > nul";
    o(nA, sA, (CA, P) => {
      Z(CA, P);
    });
  }
  function dA() {
    const iA = e.existsSync("/Library/Developer/CommandLineTools/usr/bin/"), sA = e.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"), Z = e.existsSync("/Library/Developer/Xcode/");
    return iA || Z || sA;
  }
  function RA() {
    const iA = process.hrtime();
    return !Array.isArray(iA) || iA.length !== 2 ? 0 : +iA[0] * 1e9 + +iA[1];
  }
  function LA(iA, sA) {
    sA = sA || "";
    const Z = [];
    return iA.forEach((nA) => {
      nA.startsWith(sA) && Z.indexOf(nA) === -1 && Z.push(nA);
    }), Z.length;
  }
  function mA(iA, sA) {
    sA = sA || "";
    const Z = [];
    return iA.forEach((nA) => {
      nA.startsWith(sA) && Z.push(nA);
    }), Z.length;
  }
  function xA(iA, sA) {
    typeof sA > "u" && (sA = !1);
    const Z = iA || "";
    let nA = "";
    const CA = f(Z.length, 2e3);
    for (let P = 0; P <= CA; P++)
      Z[P] === void 0 || Z[P] === ">" || Z[P] === "<" || Z[P] === "*" || Z[P] === "?" || Z[P] === "[" || Z[P] === "]" || Z[P] === "|" || Z[P] === "˚" || Z[P] === "$" || Z[P] === ";" || Z[P] === "&" || Z[P] === "]" || Z[P] === "#" || Z[P] === "\\" || Z[P] === "	" || Z[P] === `
` || Z[P] === "\r" || Z[P] === "'" || Z[P] === "`" || Z[P] === '"' || Z[P].length > 1 || sA && Z[P] === "(" || sA && Z[P] === ")" || sA && Z[P] === "@" || sA && Z[P] === " " || sA && Z[P] === "{" || sA && Z[P] === ";" || sA && Z[P] === "}" || (nA = nA + Z[P]);
    return nA;
  }
  function FA() {
    const iA = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    let sA = !0, Z = "";
    try {
      Z.__proto__.replace = V, Z.__proto__.toLowerCase = m, Z.__proto__.toString = a, Z.__proto__.substr = I, Z.__proto__.substring = t, Z.__proto__.trim = l, Z.__proto__.startsWith = D;
    } catch {
      Object.setPrototypeOf(Z, U);
    }
    sA = sA || iA.length !== 62;
    const nA = Date.now();
    if (typeof nA == "number" && nA > 16e11) {
      const CA = nA % 100 + 15;
      for (let QA = 0; QA < CA; QA++) {
        const GA = Math.random() * 61.99999999 + 1, YA = parseInt(Math.floor(GA).toString(), 10), bA = parseInt(GA.toString().split(".")[0], 10), XA = Math.random() * 61.99999999 + 1, oe = parseInt(Math.floor(XA).toString(), 10), Ce = parseInt(XA.toString().split(".")[0], 10);
        sA = sA && GA !== XA, sA = sA && YA === bA && oe === Ce, Z += iA[YA - 1];
      }
      sA = sA && Z.length === CA;
      let P = Math.random() * CA * 0.9999999999, EA = Z.substr(0, P) + " " + Z.substr(P, 2e3);
      try {
        EA.__proto__.replace = V;
      } catch {
        Object.setPrototypeOf(EA, U);
      }
      let SA = EA.replace(/ /g, "");
      sA = sA && Z === SA, P = Math.random() * CA * 0.9999999999, EA = Z.substr(0, P) + "{" + Z.substr(P, 2e3), SA = EA.replace(/{/g, ""), sA = sA && Z === SA, P = Math.random() * CA * 0.9999999999, EA = Z.substr(0, P) + "*" + Z.substr(P, 2e3), SA = EA.replace(/\*/g, ""), sA = sA && Z === SA, P = Math.random() * CA * 0.9999999999, EA = Z.substr(0, P) + "$" + Z.substr(P, 2e3), SA = EA.replace(/\$/g, ""), sA = sA && Z === SA;
      const yA = Z.toLowerCase();
      sA = sA && yA.length === CA && yA[CA - 1] && !yA[CA];
      for (let QA = 0; QA < CA; QA++) {
        const GA = Z[QA];
        try {
          GA.__proto__.toLowerCase = m;
        } catch {
          Object.setPrototypeOf(Z, U);
        }
        const YA = yA ? yA[QA] : "", bA = GA.toLowerCase();
        sA = sA && bA[0] === YA && bA[0] && !bA[1];
      }
    }
    return !sA;
  }
  function MA(iA) {
    return ("00000000" + parseInt(iA, 16).toString(2)).substr(-8);
  }
  function kA(iA) {
    const sA = e.lstatSync, Z = e.readdirSync, nA = A.join;
    function CA(QA) {
      return sA(QA).isDirectory();
    }
    function P(QA) {
      return sA(QA).isFile();
    }
    function EA(QA) {
      return Z(QA).map((GA) => nA(QA, GA)).filter(CA);
    }
    function SA(QA) {
      return Z(QA).map((GA) => nA(QA, GA)).filter(P);
    }
    function yA(QA) {
      try {
        return EA(QA).map((bA) => yA(bA)).reduce((bA, XA) => bA.concat(XA), []).concat(SA(QA));
      } catch {
        return [];
      }
    }
    return e.existsSync(iA) ? yA(iA) : [];
  }
  function UA(iA) {
    H === null ? H = iA : iA === void 0 && (iA = H);
    const sA = {
      "0002": {
        type: "B",
        revision: "1.0",
        memory: 256,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "0003": {
        type: "B",
        revision: "1.0",
        memory: 256,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "0004": {
        type: "B",
        revision: "2.0",
        memory: 256,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "0005": {
        type: "B",
        revision: "2.0",
        memory: 256,
        manufacturer: "Qisda",
        processor: "BCM2835"
      },
      "0006": {
        type: "B",
        revision: "2.0",
        memory: 256,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "0007": {
        type: "A",
        revision: "2.0",
        memory: 256,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "0008": {
        type: "A",
        revision: "2.0",
        memory: 256,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "0009": {
        type: "A",
        revision: "2.0",
        memory: 256,
        manufacturer: "Qisda",
        processor: "BCM2835"
      },
      "000d": {
        type: "B",
        revision: "2.0",
        memory: 512,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "000e": {
        type: "B",
        revision: "2.0",
        memory: 512,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "000f": {
        type: "B",
        revision: "2.0",
        memory: 512,
        manufacturer: "Egoman",
        processor: "BCM2835"
      },
      "0010": {
        type: "B+",
        revision: "1.2",
        memory: 512,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "0011": {
        type: "CM1",
        revision: "1.0",
        memory: 512,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "0012": {
        type: "A+",
        revision: "1.1",
        memory: 256,
        manufacturer: "Sony UK",
        processor: "BCM2835"
      },
      "0013": {
        type: "B+",
        revision: "1.2",
        memory: 512,
        manufacturer: "Embest",
        processor: "BCM2835"
      },
      "0014": {
        type: "CM1",
        revision: "1.0",
        memory: 512,
        manufacturer: "Embest",
        processor: "BCM2835"
      },
      "0015": {
        type: "A+",
        revision: "1.1",
        memory: 256,
        manufacturer: "512MB	Embest",
        processor: "BCM2835"
      }
    }, Z = ["BCM2835", "BCM2836", "BCM2837", "BCM2711", "BCM2712"], nA = ["Sony UK", "Egoman", "Embest", "Sony Japan", "Embest", "Stadium"], CA = {
      "00": "A",
      "01": "B",
      "02": "A+",
      "03": "B+",
      "04": "2B",
      "05": "Alpha (early prototype)",
      "06": "CM1",
      "08": "3B",
      "09": "Zero",
      "0a": "CM3",
      "0c": "Zero W",
      "0d": "3B+",
      "0e": "3A+",
      "0f": "Internal use only",
      10: "CM3+",
      11: "4B",
      12: "Zero 2 W",
      13: "400",
      14: "CM4",
      15: "CM4S",
      16: "Internal use only",
      17: "5",
      18: "CM5",
      19: "500/500+",
      "1a": "CM5 Lite"
    }, P = q(iA, "revision", ":", !0), EA = q(iA, "model:", ":", !0), SA = q(iA, "serial", ":", !0);
    let yA = {};
    if ({}.hasOwnProperty.call(sA, P))
      yA = {
        model: EA,
        serial: SA,
        revisionCode: P,
        memory: sA[P].memory,
        manufacturer: sA[P].manufacturer,
        processor: sA[P].processor,
        type: sA[P].type,
        revision: sA[P].revision
      };
    else {
      const QA = ("00000000" + q(iA, "revision", ":", !0).toLowerCase()).substr(-8), GA = parseInt(MA(QA.substr(2, 1)).substr(5, 3), 2) || 0, YA = nA[parseInt(QA.substr(3, 1), 10)], bA = Z[parseInt(QA.substr(4, 1), 10)], XA = QA.substr(5, 2);
      yA = {
        model: EA,
        serial: SA,
        revisionCode: P,
        memory: 256 * Math.pow(2, GA),
        manufacturer: YA,
        processor: bA,
        type: {}.hasOwnProperty.call(CA, XA) ? CA[XA] : "",
        revision: "1." + QA.substr(7, 1)
      };
    }
    return yA;
  }
  function WA(iA) {
    if (H === null && iA !== void 0)
      H = iA;
    else if (iA === void 0 && H !== null)
      iA = H;
    else
      try {
        iA = e.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split(`
`), H = iA;
      } catch {
        return !1;
      }
    const sA = UA(iA);
    return sA.type === "4B" || sA.type === "CM4" || sA.type === "CM4S" || sA.type === "400" ? "VideoCore VI" : sA.type === "5" || sA.type === "500" ? "VideoCore VII" : "VideoCore IV";
  }
  function TA(iA) {
    const sA = iA.map(
      (CA) => new Promise((P) => {
        const EA = new Array(2);
        CA.then((SA) => {
          EA[0] = SA;
        }).catch((SA) => {
          EA[1] = SA;
        }).then(() => {
          P(EA);
        });
      })
    ), Z = [], nA = [];
    return Promise.all(sA).then((CA) => (CA.forEach((P) => {
      P[1] ? (Z.push(P[1]), nA.push(null)) : (Z.push(null), nA.push(P[0]));
    }), {
      errors: Z,
      results: nA
    }));
  }
  function ZA(iA) {
    return () => {
      const sA = Array.prototype.slice.call(arguments);
      return new Promise((Z, nA) => {
        sA.push((CA, P) => {
          CA ? nA(CA) : Z(P);
        }), iA.apply(null, sA);
      });
    };
  }
  function PA(iA) {
    return () => {
      const sA = Array.prototype.slice.call(arguments);
      return new Promise((Z) => {
        sA.push((nA, CA) => {
          Z(CA);
        }), iA.apply(null, sA);
      });
    };
  }
  function jA() {
    let iA = "";
    if (b)
      try {
        iA = B("uname -v", K).toString();
      } catch {
        iA = "";
      }
    return iA;
  }
  function OA(iA) {
    const sA = ["array", "dict", "key", "string", "integer", "date", "real", "data", "boolean", "arrayEmpty"];
    let nA = iA.indexOf("<plist version"), CA = iA.length;
    for (; iA[nA] !== ">" && nA < CA; )
      nA++;
    let P = 0, EA = !1, SA = !1, yA = !1, QA = [{ tagStart: "", tagEnd: "", tagContent: "", key: "", data: null }], GA = "", YA = iA[nA];
    for (; nA < CA; )
      GA = YA, nA + 1 < CA && (YA = iA[nA + 1]), GA === "<" ? (SA = !1, YA === "/" ? yA = !0 : QA[P].tagStart ? (QA[P].tagContent = "", QA[P].data || (QA[P].data = QA[P].tagStart === "array" ? [] : {}), P++, QA.push({ tagStart: "", tagEnd: "", tagContent: "", key: null, data: null }), EA = !0, SA = !1) : EA || (EA = !0)) : GA === ">" ? (QA[P].tagStart === "true/" && (EA = !1, yA = !0, QA[P].tagStart = "", QA[P].tagEnd = "/boolean", QA[P].data = !0), QA[P].tagStart === "false/" && (EA = !1, yA = !0, QA[P].tagStart = "", QA[P].tagEnd = "/boolean", QA[P].data = !1), QA[P].tagStart === "array/" && (EA = !1, yA = !0, QA[P].tagStart = "", QA[P].tagEnd = "/arrayEmpty", QA[P].data = []), SA && (SA = !1), EA && (EA = !1, SA = !0, QA[P].tagStart === "array" && (QA[P].data = []), QA[P].tagStart === "dict" && (QA[P].data = {})), yA && (yA = !1, QA[P].tagEnd && sA.indexOf(QA[P].tagEnd.substr(1)) >= 0 && (QA[P].tagEnd === "/dict" || QA[P].tagEnd === "/array" ? (P > 1 && QA[P - 2].tagStart === "array" && QA[P - 2].data.push(QA[P - 1].data), P > 1 && QA[P - 2].tagStart === "dict" && (QA[P - 2].data[QA[P - 1].key] = QA[P - 1].data), P--, QA.pop(), QA[P].tagContent = "", QA[P].tagStart = "", QA[P].tagEnd = "") : (QA[P].tagEnd === "/key" && QA[P].tagContent ? QA[P].key = QA[P].tagContent : (QA[P].tagEnd === "/real" && QA[P].tagContent && (QA[P].data = parseFloat(QA[P].tagContent) || 0), QA[P].tagEnd === "/integer" && QA[P].tagContent && (QA[P].data = parseInt(QA[P].tagContent) || 0), QA[P].tagEnd === "/string" && QA[P].tagContent && (QA[P].data = QA[P].tagContent || ""), QA[P].tagEnd === "/boolean" && (QA[P].data = QA[P].tagContent || !1), QA[P].tagEnd === "/arrayEmpty" && (QA[P].data = QA[P].tagContent || []), P > 0 && QA[P - 1].tagStart === "array" && QA[P - 1].data.push(QA[P].data), P > 0 && QA[P - 1].tagStart === "dict" && (QA[P - 1].data[QA[P].key] = QA[P].data)), QA[P].tagContent = "", QA[P].tagStart = "", QA[P].tagEnd = "")), QA[P].tagEnd = "", EA = !1, SA = !1)) : (EA && (QA[P].tagStart += GA), yA && (QA[P].tagEnd += GA), SA && (QA[P].tagContent += GA)), nA++;
    return QA[0].data;
  }
  function HA(iA) {
    return typeof iA == "string" && !isNaN(iA) && !isNaN(parseFloat(iA));
  }
  function DA(iA) {
    const sA = iA.split(`
`);
    for (let nA = 0; nA < sA.length; nA++) {
      if (sA[nA].indexOf(" = ") >= 0) {
        const CA = sA[nA].split(" = ");
        if (CA[0] = CA[0].trim(), CA[0].startsWith('"') || (CA[0] = '"' + CA[0] + '"'), CA[1] = CA[1].trim(), CA[1].indexOf('"') === -1 && CA[1].endsWith(";")) {
          const P = CA[1].substring(0, CA[1].length - 1);
          HA(P) || (CA[1] = `"${P}";`);
        }
        if (CA[1].indexOf('"') >= 0 && CA[1].endsWith(";")) {
          const P = CA[1].substring(0, CA[1].length - 1).replace(/"/g, "");
          HA(P) && (CA[1] = `${P};`);
        }
        sA[nA] = CA.join(" : ");
      }
      sA[nA] = sA[nA].replace(/\(/g, "[").replace(/\)/g, "]").replace(/;/g, ",").trim(), sA[nA].startsWith("}") && sA[nA - 1] && sA[nA - 1].endsWith(",") && (sA[nA - 1] = sA[nA - 1].substring(0, sA[nA - 1].length - 1));
    }
    iA = sA.join("");
    let Z = {};
    try {
      Z = JSON.parse(iA);
    } catch {
    }
    return Z;
  }
  function VA(iA, sA) {
    let Z = 0;
    const nA = iA.split("."), CA = sA.split(".");
    return nA[0] < CA[0] ? Z = 1 : nA[0] > CA[0] ? Z = -1 : nA[0] === CA[0] && nA.length >= 2 && CA.length >= 2 && (nA[1] < CA[1] ? Z = 1 : nA[1] > CA[1] ? Z = -1 : nA[1] === CA[1] && (nA.length >= 3 && CA.length >= 3 ? nA[2] < CA[2] ? Z = 1 : nA[2] > CA[2] && (Z = -1) : CA.length >= 3 && (Z = 1))), Z;
  }
  function te(iA) {
    const Z = [
      {
        key: "Mac15,12",
        name: "MacBook Air",
        size: "13-inch",
        processor: "M3",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac14,15",
        name: "MacBook Air",
        size: "15-inch",
        processor: "M2",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac14,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "M2",
        year: "2022",
        additional: ""
      },
      {
        key: "MacBookAir10,1",
        name: "MacBook Air",
        size: "13-inch",
        processor: "M1",
        year: "2020",
        additional: ""
      },
      {
        key: "MacBookAir9,1",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "2020",
        additional: ""
      },
      {
        key: "MacBookAir8,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookAir8,1",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "2018",
        additional: ""
      },
      {
        key: "MacBookAir7,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "2017",
        additional: ""
      },
      {
        key: "MacBookAir7,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Early 2015",
        additional: ""
      },
      {
        key: "MacBookAir7,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Early 2015",
        additional: ""
      },
      {
        key: "MacBookAir6,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Early 2014",
        additional: ""
      },
      {
        key: "MacBookAir6,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Early 2014",
        additional: ""
      },
      {
        key: "MacBookAir6,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Mid 2013",
        additional: ""
      },
      {
        key: "MacBookAir6,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Mid 2013",
        additional: ""
      },
      {
        key: "MacBookAir5,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacBookAir5,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacBookAir4,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "MacBookAir4,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "MacBookAir3,2",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Late 2010",
        additional: ""
      },
      {
        key: "MacBookAir3,1",
        name: "MacBook Air",
        size: "11-inch",
        processor: "",
        year: "Late 2010",
        additional: ""
      },
      {
        key: "MacBookAir2,1",
        name: "MacBook Air",
        size: "13-inch",
        processor: "",
        year: "Mid 2009",
        additional: ""
      },
      {
        key: "Mac16,1",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M4",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac16,6",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M4 Pro",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac16,8",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M4 Max",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac16,5",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M4 Pro",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac16,6",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M4 Max",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac15,3",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M3",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,6",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M3 Pro",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,8",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M3 Pro",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,10",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M3 Max",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,7",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M3 Pro",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,9",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M3 Pro",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac15,11",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M3 Max",
        year: "Nov 2023",
        additional: ""
      },
      {
        key: "Mac14,5",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M2 Max",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,9",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M2 Max",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,6",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M2 Max",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,10",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M2 Max",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,7",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "M2",
        year: "2022",
        additional: ""
      },
      {
        key: "MacBookPro18,3",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M1 Pro",
        year: "2021",
        additional: ""
      },
      {
        key: "MacBookPro18,4",
        name: "MacBook Pro",
        size: "14-inch",
        processor: "M1 Max",
        year: "2021",
        additional: ""
      },
      {
        key: "MacBookPro18,1",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M1 Pro",
        year: "2021",
        additional: ""
      },
      {
        key: "MacBookPro18,2",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "M1 Max",
        year: "2021",
        additional: ""
      },
      {
        key: "MacBookPro17,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "M1",
        year: "2020",
        additional: ""
      },
      {
        key: "MacBookPro16,3",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2020",
        additional: "Two Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro16,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2020",
        additional: "Four Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro16,1",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookPro16,4",
        name: "MacBook Pro",
        size: "16-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookPro15,3",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookPro15,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookPro15,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacBookPro15,4",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2019",
        additional: "Two Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro15,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "2018",
        additional: ""
      },
      {
        key: "MacBookPro15,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2018",
        additional: "Four Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro14,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2017",
        additional: "Two Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro14,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2017",
        additional: "Four Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro14,3",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "2017",
        additional: ""
      },
      {
        key: "MacBookPro13,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2016",
        additional: "Two Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro13,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "2016",
        additional: "Four Thunderbolt 3 ports"
      },
      {
        key: "MacBookPro13,3",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "2016",
        additional: ""
      },
      {
        key: "MacBookPro11,4",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2015",
        additional: ""
      },
      {
        key: "MacBookPro11,5",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2015",
        additional: ""
      },
      {
        key: "MacBookPro12,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Early 2015",
        additional: ""
      },
      {
        key: "MacBookPro11,2",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "MacBookPro11,3",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "MacBookPro11,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "MacBookPro10,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacBookPro10,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Late 2012",
        additional: ""
      },
      {
        key: "MacBookPro9,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacBookPro9,2",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacBookPro8,3",
        name: "MacBook Pro",
        size: "17-inch",
        processor: "",
        year: "Early 2011",
        additional: ""
      },
      {
        key: "MacBookPro8,2",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Early 2011",
        additional: ""
      },
      {
        key: "MacBookPro8,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Early 2011",
        additional: ""
      },
      {
        key: "MacBookPro6,1",
        name: "MacBook Pro",
        size: "17-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "MacBookPro6,2",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "MacBookPro7,1",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "MacBookPro5,2",
        name: "MacBook Pro",
        size: "17-inch",
        processor: "",
        year: "Early 2009",
        additional: ""
      },
      {
        key: "MacBookPro5,3",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Mid 2009",
        additional: ""
      },
      {
        key: "MacBookPro5,5",
        name: "MacBook Pro",
        size: "13-inch",
        processor: "",
        year: "Mid 2009",
        additional: ""
      },
      {
        key: "MacBookPro5,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Late 2008",
        additional: ""
      },
      {
        key: "MacBookPro4,1",
        name: "MacBook Pro",
        size: "15-inch",
        processor: "",
        year: "Early 2008",
        additional: ""
      },
      {
        key: "MacBook10,1",
        name: "MacBook",
        size: "12-inch",
        processor: "",
        year: "2017",
        additional: ""
      },
      {
        key: "MacBook9,1",
        name: "MacBook",
        size: "12-inch",
        processor: "",
        year: "Early 2016",
        additional: ""
      },
      {
        key: "MacBook8,1",
        name: "MacBook",
        size: "12-inch",
        processor: "",
        year: "Early 2015",
        additional: ""
      },
      {
        key: "MacBook7,1",
        name: "MacBook",
        size: "13-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "MacBook6,1",
        name: "MacBook",
        size: "13-inch",
        processor: "",
        year: "Late 2009",
        additional: ""
      },
      {
        key: "MacBook5,2",
        name: "MacBook",
        size: "13-inch",
        processor: "",
        year: "Early 2009",
        additional: ""
      },
      {
        key: "Mac14,13",
        name: "Mac Studio",
        size: "",
        processor: "M2 Max",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,14",
        name: "Mac Studio",
        size: "",
        processor: "M2 Ultra",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac15,14",
        name: "Mac Studio",
        size: "",
        processor: "M3 Ultra",
        year: "2025",
        additional: ""
      },
      {
        key: "Mac16,9",
        name: "Mac Studio",
        size: "",
        processor: "M4 Max",
        year: "2025",
        additional: ""
      },
      {
        key: "Mac13,1",
        name: "Mac Studio",
        size: "",
        processor: "M1 Max",
        year: "2022",
        additional: ""
      },
      {
        key: "Mac13,2",
        name: "Mac Studio",
        size: "",
        processor: "M1 Ultra",
        year: "2022",
        additional: ""
      },
      {
        key: "Mac16,11",
        name: "Mac mini",
        size: "",
        processor: "M4 Pro",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac16,10",
        name: "Mac mini",
        size: "",
        processor: "M4",
        year: "2024",
        additional: ""
      },
      {
        key: "Mac14,3",
        name: "Mac mini",
        size: "",
        processor: "M2",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,12",
        name: "Mac mini",
        size: "",
        processor: "M2 Pro",
        year: "2023",
        additional: ""
      },
      {
        key: "Macmini9,1",
        name: "Mac mini",
        size: "",
        processor: "M1",
        year: "2020",
        additional: ""
      },
      {
        key: "Macmini8,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Late 2018",
        additional: ""
      },
      {
        key: "Macmini7,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Late 2014",
        additional: ""
      },
      {
        key: "Macmini6,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Late 2012",
        additional: ""
      },
      {
        key: "Macmini6,2",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Late 2012",
        additional: ""
      },
      {
        key: "Macmini5,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "Macmini5,2",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "Macmini4,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "Macmini3,1",
        name: "Mac mini",
        size: "",
        processor: "",
        year: "Early 2009",
        additional: ""
      },
      {
        key: "Mac16,3",
        name: "iMac",
        size: "24-inch",
        processor: "M4",
        year: "2024",
        additional: "Four ports"
      },
      {
        key: "Mac16,2",
        name: "iMac",
        size: "24-inch",
        processor: "M4",
        year: "2024",
        additional: "Two ports"
      },
      {
        key: "Mac15,5",
        name: "iMac",
        size: "24-inch",
        processor: "M3",
        year: "2023",
        additional: "Four ports"
      },
      {
        key: "Mac15,4",
        name: "iMac",
        size: "24-inch",
        processor: "M3",
        year: "2023",
        additional: "Two ports"
      },
      {
        key: "iMac21,1",
        name: "iMac",
        size: "24-inch",
        processor: "M1",
        year: "2021",
        additional: ""
      },
      {
        key: "iMac21,2",
        name: "iMac",
        size: "24-inch",
        processor: "M1",
        year: "2021",
        additional: ""
      },
      {
        key: "iMac20,1",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "2020",
        additional: "Retina 5K"
      },
      {
        key: "iMac20,2",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "2020",
        additional: "Retina 5K"
      },
      {
        key: "iMac19,1",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "2019",
        additional: "Retina 5K"
      },
      {
        key: "iMac19,2",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "2019",
        additional: "Retina 4K"
      },
      {
        key: "iMacPro1,1",
        name: "iMac Pro",
        size: "",
        processor: "",
        year: "2017",
        additional: ""
      },
      {
        key: "iMac18,3",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "2017",
        additional: "Retina 5K"
      },
      {
        key: "iMac18,2",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "2017",
        additional: "Retina 4K"
      },
      {
        key: "iMac18,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "2017",
        additional: ""
      },
      {
        key: "iMac17,1",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Late 2015",
        additional: "Retina 5K"
      },
      {
        key: "iMac16,2",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Late 2015",
        additional: "Retina 4K"
      },
      {
        key: "iMac16,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Late 2015",
        additional: ""
      },
      {
        key: "iMac15,1",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Late 2014",
        additional: "Retina 5K"
      },
      {
        key: "iMac14,4",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Mid 2014",
        additional: ""
      },
      {
        key: "iMac14,2",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "iMac14,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "iMac13,2",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Late 2012",
        additional: ""
      },
      {
        key: "iMac13,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Late 2012",
        additional: ""
      },
      {
        key: "iMac12,2",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "iMac12,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Mid 2011",
        additional: ""
      },
      {
        key: "iMac11,3",
        name: "iMac",
        size: "27-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "iMac11,2",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "iMac10,1",
        name: "iMac",
        size: "21.5-inch",
        processor: "",
        year: "Late 2009",
        additional: ""
      },
      {
        key: "iMac9,1",
        name: "iMac",
        size: "20-inch",
        processor: "",
        year: "Early 2009",
        additional: ""
      },
      {
        key: "Mac14,8",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "2023",
        additional: ""
      },
      {
        key: "Mac14,8",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "2023",
        additional: "Rack"
      },
      {
        key: "MacPro7,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "2019",
        additional: ""
      },
      {
        key: "MacPro7,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "2019",
        additional: "Rack"
      },
      {
        key: "MacPro6,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "Late 2013",
        additional: ""
      },
      {
        key: "MacPro5,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "Mid 2012",
        additional: ""
      },
      {
        key: "MacPro5,1",
        name: "Mac Pro Server",
        size: "",
        processor: "",
        year: "Mid 2012",
        additional: "Server"
      },
      {
        key: "MacPro5,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "Mid 2010",
        additional: ""
      },
      {
        key: "MacPro5,1",
        name: "Mac Pro Server",
        size: "",
        processor: "",
        year: "Mid 2010",
        additional: "Server"
      },
      {
        key: "MacPro4,1",
        name: "Mac Pro",
        size: "",
        processor: "",
        year: "Early 2009",
        additional: ""
      }
    ].filter((CA) => CA.key === iA);
    if (Z.length === 0)
      return {
        key: iA,
        model: "Apple",
        version: "Unknown"
      };
    const nA = [];
    return Z[0].size && nA.push(Z[0].size), Z[0].processor && nA.push(Z[0].processor), Z[0].year && nA.push(Z[0].year), Z[0].additional && nA.push(Z[0].additional), {
      key: iA,
      model: Z[0].name,
      version: Z[0].name + " (" + nA.join(", ") + ")"
    };
  }
  function zA(iA, sA = 5e3) {
    const Z = iA.startsWith("https:") || iA.indexOf(":443/") > 0 || iA.indexOf(":8443/") > 0 ? https__default : require$$6, nA = Date.now();
    return new Promise((CA) => {
      const P = Z.get(iA, (EA) => {
        EA.on("data", () => {
        }), EA.on("end", () => {
          CA({
            url: iA,
            statusCode: EA.statusCode,
            message: EA.statusMessage,
            time: Date.now() - nA
          });
        });
      }).on("error", (EA) => {
        CA({
          url: iA,
          statusCode: 404,
          message: EA.message,
          time: Date.now() - nA
        });
      }).setTimeout(sA, () => {
        P.destroy(), CA({
          url: iA,
          statusCode: 408,
          message: "Request Timeout",
          time: Date.now() - nA
        });
      });
    });
  }
  function KA(iA) {
    return iA.replace(/To Be Filled By O.E.M./g, "");
  }
  function _A() {
  }
  return util.toInt = gA, util.splitByNumber = v, util.execOptsWin = k, util.execOptsLinux = K, util.getCodepage = BA, util.execWin = NA, util.isFunction = w, util.unique = Y, util.sortByKey = _, util.cores = G, util.getValue = q, util.decodeEscapeSequence = j, util.parseDateTime = M, util.parseHead = O, util.findObjectByKey = T, util.darwinXcodeExists = dA, util.getVboxmanage = AA, util.powerShell = lA, util.powerShellStart = rA, util.powerShellRelease = cA, util.execSafe = pA, util.nanoSeconds = RA, util.countUniqueLines = LA, util.countLines = mA, util.noop = _A, util.isRaspberry = hA, util.isRaspbian = wA, util.sanitizeShellString = xA, util.isPrototypePolluted = FA, util.decodePiCpuinfo = UA, util.getRpiGpu = WA, util.promiseAll = TA, util.promisify = ZA, util.promisifySave = PA, util.smartMonToolsInstalled = uA, util.linuxVersion = jA, util.plistParser = OA, util.plistReader = DA, util.stringObj = U, util.stringReplace = V, util.stringToLower = m, util.stringToString = a, util.stringSubstr = I, util.stringSubstring = t, util.stringTrim = l, util.stringStartWith = D, util.mathMin = f, util.WINDIR = y, util.getFilesInPath = kA, util.semverCompare = VA, util.getAppleModel = te, util.checkWebsite = zA, util.cleanString = KA, util.getPowershell = S, util;
}
var system = {}, osinfo = {}, hasRequiredOsinfo;
function requireOsinfo() {
  if (hasRequiredOsinfo) return osinfo;
  hasRequiredOsinfo = 1;
  const s = require$$0$1, e = require$$1$1, A = requireUtil(), g = require$$1.exec, o = require$$1.execSync, B = process.platform, F = B === "linux" || B === "android", x = B === "darwin", b = B === "win32", X = B === "freebsd", W = B === "openbsd", eA = B === "netbsd", IA = B === "sunos";
  function z() {
    const d = (/* @__PURE__ */ new Date()).toString().split(" ");
    let c = "";
    try {
      c = Intl.DateTimeFormat().resolvedOptions().timeZone;
    } catch {
      c = d.length >= 7 ? d.slice(6).join(" ").replace(/\(/g, "").replace(/\)/g, "") : "";
    }
    const n = {
      current: Date.now(),
      uptime: s.uptime(),
      timezone: d.length >= 7 ? d[5] : "",
      timezoneName: c
    };
    if (x || F)
      try {
        const k = o("date +%Z && date +%z && ls -l /etc/localtime 2>/dev/null", A.execOptsLinux).toString().split(s.EOL);
        k.length > 3 && !k[0] && k.shift();
        let K = k[0] || "";
        return (K.startsWith("+") || K.startsWith("-")) && (K = "GMT"), {
          current: Date.now(),
          uptime: s.uptime(),
          timezone: k[1] ? K + k[1] : K,
          timezoneName: k[2] && k[2].indexOf("/zoneinfo/") > 0 && k[2].split("/zoneinfo/")[1] || ""
        };
      } catch {
        A.noop();
      }
    return n;
  }
  osinfo.time = z;
  function N(d) {
    d = d || "", d = d.toLowerCase();
    let c = B;
    return b ? c = "windows" : d.indexOf("mac os") !== -1 || d.indexOf("macos") !== -1 ? c = "apple" : d.indexOf("arch") !== -1 ? c = "arch" : d.indexOf("cachy") !== -1 ? c = "cachy" : d.indexOf("centos") !== -1 ? c = "centos" : d.indexOf("coreos") !== -1 ? c = "coreos" : d.indexOf("debian") !== -1 ? c = "debian" : d.indexOf("deepin") !== -1 ? c = "deepin" : d.indexOf("elementary") !== -1 ? c = "elementary" : d.indexOf("endeavour") !== -1 ? c = "endeavour" : d.indexOf("fedora") !== -1 ? c = "fedora" : d.indexOf("gentoo") !== -1 ? c = "gentoo" : d.indexOf("mageia") !== -1 ? c = "mageia" : d.indexOf("mandriva") !== -1 ? c = "mandriva" : d.indexOf("manjaro") !== -1 ? c = "manjaro" : d.indexOf("mint") !== -1 ? c = "mint" : d.indexOf("mx") !== -1 ? c = "mx" : d.indexOf("openbsd") !== -1 ? c = "openbsd" : d.indexOf("freebsd") !== -1 ? c = "freebsd" : d.indexOf("opensuse") !== -1 ? c = "opensuse" : d.indexOf("pclinuxos") !== -1 ? c = "pclinuxos" : d.indexOf("puppy") !== -1 ? c = "puppy" : d.indexOf("popos") !== -1 ? c = "popos" : d.indexOf("raspbian") !== -1 ? c = "raspbian" : d.indexOf("reactos") !== -1 ? c = "reactos" : d.indexOf("redhat") !== -1 ? c = "redhat" : d.indexOf("slackware") !== -1 ? c = "slackware" : d.indexOf("sugar") !== -1 ? c = "sugar" : d.indexOf("steam") !== -1 ? c = "steam" : d.indexOf("suse") !== -1 ? c = "suse" : d.indexOf("mate") !== -1 ? c = "ubuntu-mate" : d.indexOf("lubuntu") !== -1 ? c = "lubuntu" : d.indexOf("xubuntu") !== -1 ? c = "xubuntu" : d.indexOf("ubuntu") !== -1 ? c = "ubuntu" : d.indexOf("solaris") !== -1 ? c = "solaris" : d.indexOf("tails") !== -1 ? c = "tails" : d.indexOf("feren") !== -1 ? c = "ferenos" : d.indexOf("robolinux") !== -1 ? c = "robolinux" : F && d && (c = d.toLowerCase().trim().replace(/\s+/g, "-")), c;
  }
  const J = [
    [26200, "25H2"],
    [26100, "24H2"],
    [22631, "23H2"],
    [22621, "22H2"],
    [19045, "22H2"],
    [22e3, "21H2"],
    [19044, "21H2"],
    [19043, "21H1"],
    [19042, "20H2"],
    [19041, "2004"],
    [18363, "1909"],
    [18362, "1903"],
    [17763, "1809"],
    [17134, "1803"]
  ];
  function $(d) {
    for (const [c, n] of J)
      if (d >= c) return n;
    return "";
  }
  function H() {
    let d = s.hostname;
    if (F || x)
      try {
        d = o("hostname -f 2>/dev/null", A.execOptsLinux).toString().split(s.EOL)[0];
      } catch {
        A.noop();
      }
    if (X || W || eA)
      try {
        d = o("hostname 2>/dev/null").toString().split(s.EOL)[0];
      } catch {
        A.noop();
      }
    if (b)
      try {
        d = o("echo %COMPUTERNAME%.%USERDNSDOMAIN%", A.execOptsWin).toString().replace(".%USERDNSDOMAIN%", "").split(s.EOL)[0];
      } catch {
        A.noop();
      }
    return d;
  }
  function y(d) {
    return new Promise((c) => {
      process.nextTick(() => {
        let n = {
          platform: B === "win32" ? "Windows" : B,
          distro: "unknown",
          release: "unknown",
          codename: "",
          kernel: s.release(),
          arch: s.arch(),
          hostname: s.hostname(),
          fqdn: H(),
          codepage: "",
          logofile: "",
          serial: "",
          build: "",
          servicepack: "",
          uefi: !1
        };
        if (F && g("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release", (L, k) => {
          let K = {};
          k.toString().split(`
`).forEach((m) => {
            m.indexOf("=") !== -1 && (K[m.split("=")[0].trim().toUpperCase()] = m.split("=")[1].trim());
          }), n.distro = (K.DISTRIB_ID || K.NAME || "unknown").replace(/"/g, ""), n.logofile = N(n.distro);
          let v = (K.VERSION || "").replace(/"/g, ""), U = (K.DISTRIB_CODENAME || K.VERSION_CODENAME || "").replace(/"/g, "");
          const V = (K.PRETTY_NAME || "").replace(/"/g, "");
          V.indexOf(n.distro + " ") === 0 && (v = V.replace(n.distro + " ", "").trim()), v.indexOf("(") >= 0 && (U = v.split("(")[1].replace(/[()]/g, "").trim(), v = v.split("(")[0].trim()), n.release = (v || K.DISTRIB_RELEASE || K.VERSION_ID || "unknown").replace(/"/g, ""), n.codename = U, n.codepage = A.getCodepage(), n.build = (K.BUILD_ID || "").replace(/"/g, "").trim(), p().then((m) => {
            n.uefi = m, Q().then((a) => {
              n.serial = a.os, d && d(n), c(n);
            });
          });
        }), (X || W || eA) && g("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml", (L, k) => {
          let K = k.toString().split(`
`);
          const gA = A.getValue(K, "kern.ostype"), v = N(gA), U = A.getValue(K, "kern.osrelease").split("-")[0], V = A.getValue(K, "kern.uuid"), m = A.getValue(K, "machdep.bootmethod"), a = k.toString().indexOf("<type>efi</type>") >= 0, I = m ? m.toLowerCase().indexOf("uefi") >= 0 : a || null;
          n.distro = gA || n.distro, n.logofile = v || n.logofile, n.release = U || n.release, n.serial = V || n.serial, n.codename = "", n.codepage = A.getCodepage(), n.uefi = I || null, d && d(n), c(n);
        }), x && g("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid", (L, k) => {
          let K = k.toString().split(`
`);
          n.serial = A.getValue(K, "kern.uuid"), n.distro = A.getValue(K, "ProductName"), n.release = (A.getValue(K, "ProductVersion", ":", !0, !0) + " " + A.getValue(K, "ProductVersionExtra", ":", !0, !0)).trim(), n.build = A.getValue(K, "BuildVersion"), n.logofile = N(n.distro), n.codename = "macOS", n.codename = n.release.indexOf("10.4") > -1 ? "OS X Tiger" : n.codename, n.codename = n.release.indexOf("10.5") > -1 ? "OS X Leopard" : n.codename, n.codename = n.release.indexOf("10.6") > -1 ? "OS X Snow Leopard" : n.codename, n.codename = n.release.indexOf("10.7") > -1 ? "OS X Lion" : n.codename, n.codename = n.release.indexOf("10.8") > -1 ? "OS X Mountain Lion" : n.codename, n.codename = n.release.indexOf("10.9") > -1 ? "OS X Mavericks" : n.codename, n.codename = n.release.indexOf("10.10") > -1 ? "OS X Yosemite" : n.codename, n.codename = n.release.indexOf("10.11") > -1 ? "OS X El Capitan" : n.codename, n.codename = n.release.indexOf("10.12") > -1 ? "Sierra" : n.codename, n.codename = n.release.indexOf("10.13") > -1 ? "High Sierra" : n.codename, n.codename = n.release.indexOf("10.14") > -1 ? "Mojave" : n.codename, n.codename = n.release.indexOf("10.15") > -1 ? "Catalina" : n.codename, n.codename = n.release.startsWith("11.") ? "Big Sur" : n.codename, n.codename = n.release.startsWith("12.") ? "Monterey" : n.codename, n.codename = n.release.startsWith("13.") ? "Ventura" : n.codename, n.codename = n.release.startsWith("14.") ? "Sonoma" : n.codename, n.codename = n.release.startsWith("15.") ? "Sequoia" : n.codename, n.codename = n.release.startsWith("26.") ? "Tahoe" : n.codename, n.uefi = !0, n.codepage = A.getCodepage(), d && d(n), c(n);
        }), IA && (n.release = n.kernel, g("uname -o", (L, k) => {
          const K = k.toString().split(`
`);
          n.distro = K[0], n.logofile = N(n.distro), d && d(n), c(n);
        })), b) {
          n.logofile = N(), n.release = n.kernel;
          try {
            const L = [];
            L.push(A.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")), L.push(A.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")), L.push(A.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")), L.push(A.powerShell('reg query "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" /v DisplayVersion')), A.promiseAll(L).then((k) => {
              const K = k.results[0] ? k.results[0].toString().split(`\r
`) : [""];
              n.distro = A.getValue(K, "Caption", ":").trim(), n.serial = A.getValue(K, "SerialNumber", ":").trim(), n.build = A.getValue(K, "BuildNumber", ":").trim(), n.servicepack = A.getValue(K, "ServicePackMajorVersion", ":").trim() + "." + A.getValue(K, "ServicePackMinorVersion", ":").trim(), n.codepage = A.getCodepage();
              const gA = k.results[1] ? k.results[1].toString().toLowerCase() : "";
              n.hypervisor = gA.indexOf("true") !== -1;
              const v = k.results[2] ? k.results[2].toString() : "";
              if (k.results[3]) {
                const U = k.results[3].split("REG_SZ");
                n.codename = U.length > 1 ? U[1].trim() : "";
              }
              if (!n.codename) {
                const U = parseInt(n.build, 10);
                n.codename = $(U);
              }
              n.remoteSession = v.toString().toLowerCase().indexOf("true") >= 0, h().then((U) => {
                n.uefi = U, d && d(n), c(n);
              });
            });
          } catch {
            d && d(n), c(n);
          }
        }
      });
    });
  }
  osinfo.osInfo = y;
  function p() {
    return new Promise((d) => {
      process.nextTick(() => {
        e.stat("/sys/firmware/efi", (c) => {
          if (c)
            g('dmesg | grep -E "EFI v"', (n, L) => {
              if (!n) {
                const k = L.toString().split(`
`);
                return d(k.length > 0);
              }
              return d(!1);
            });
          else
            return d(!0);
        });
      });
    });
  }
  function h() {
    return new Promise((d) => {
      process.nextTick(() => {
        try {
          g('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"', A.execOptsWin, (c, n) => {
            if (c)
              g("echo %firmware_type%", A.execOptsWin, (L, k) => {
                if (L)
                  return d(!1);
                {
                  const K = k.toString() || "";
                  return d(K.toLowerCase().indexOf("efi") >= 0);
                }
              });
            else {
              const L = n.toString().split(`
\r`)[0];
              return d(L.toLowerCase().indexOf("efi") >= 0);
            }
          });
        } catch {
          return d(!1);
        }
      });
    });
  }
  function E(d, c) {
    let n = {
      kernel: s.release(),
      apache: "",
      bash: "",
      bun: "",
      deno: "",
      docker: "",
      dotnet: "",
      fish: "",
      gcc: "",
      git: "",
      grunt: "",
      gulp: "",
      homebrew: "",
      java: "",
      mongodb: "",
      mysql: "",
      nginx: "",
      node: "",
      //process.versions.node,
      npm: "",
      openssl: "",
      perl: "",
      php: "",
      pip3: "",
      pip: "",
      pm2: "",
      postfix: "",
      postgresql: "",
      powershell: "",
      python3: "",
      python: "",
      redis: "",
      systemOpenssl: "",
      systemOpensslLib: "",
      tsc: "",
      v8: process.versions.v8,
      virtualbox: "",
      yarn: "",
      zsh: ""
    };
    function L(k) {
      if (k === "*")
        return {
          versions: n,
          counter: 34
        };
      if (!Array.isArray(k)) {
        k = k.trim().toLowerCase().replace(/,+/g, "|").replace(/ /g, "|"), k = k.split("|");
        const K = {
          versions: {},
          counter: 0
        };
        return k.forEach((gA) => {
          if (gA)
            for (let v in n)
              ({}).hasOwnProperty.call(n, v) && v.toLowerCase() === gA.toLowerCase() && !{}.hasOwnProperty.call(K.versions, v) && (K.versions[v] = n[v], v === "openssl" && (K.versions.systemOpenssl = "", K.versions.systemOpensslLib = ""), K.versions[v] || K.counter++);
        }), K;
      }
    }
    return new Promise((k) => {
      process.nextTick(() => {
        if (A.isFunction(d) && !c)
          c = d, d = "*";
        else if (d = d || "*", typeof d != "string")
          return c && c({}), k({});
        const K = L(d);
        let gA = K.counter, v = () => {
          --gA === 0 && (c && c(K.versions), k(K.versions));
        }, U = "";
        try {
          if ({}.hasOwnProperty.call(K.versions, "openssl") && (K.versions.openssl = process.versions.openssl, g("openssl version", (V, m) => {
            if (!V) {
              let I = m.toString().split(`
`)[0].trim().split(" ");
              K.versions.systemOpenssl = I.length > 0 ? I[1] : I[0], K.versions.systemOpensslLib = I.length > 0 ? I[0] : "openssl";
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "npm") && g("npm -v", (V, m) => {
            V || (K.versions.npm = m.toString().split(`
`)[0]), v();
          }), {}.hasOwnProperty.call(K.versions, "pm2") && (U = "pm2", b && (U += ".cmd"), g(`${U} -v`, (V, m) => {
            if (!V) {
              let a = m.toString().split(`
`)[0].trim();
              a.startsWith("[PM2]") || (K.versions.pm2 = a);
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "yarn") && g("yarn --version", (V, m) => {
            V || (K.versions.yarn = m.toString().split(`
`)[0]), v();
          }), {}.hasOwnProperty.call(K.versions, "gulp") && (U = "gulp", b && (U += ".cmd"), g(`${U} --version`, (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.gulp = (a.toLowerCase().split("version")[1] || "").trim();
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "homebrew") && (U = "brew", g(`${U} --version`, (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.homebrew = (a.toLowerCase().split(" ")[1] || "").trim();
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "tsc") && (U = "tsc", b && (U += ".cmd"), g(`${U} --version`, (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.tsc = (a.toLowerCase().split("version")[1] || "").trim();
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "grunt") && (U = "grunt", b && (U += ".cmd"), g(`${U} --version`, (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.grunt = (a.toLowerCase().split("cli v")[1] || "").trim();
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "git"))
            if (x) {
              const V = e.existsSync("/usr/local/Cellar/git") || e.existsSync("/opt/homebrew/bin/git");
              A.darwinXcodeExists() || V ? g("git --version", (m, a) => {
                if (!m) {
                  let I = a.toString().split(`
`)[0] || "";
                  I = (I.toLowerCase().split("version")[1] || "").trim(), K.versions.git = (I.split(" ")[0] || "").trim();
                }
                v();
              }) : v();
            } else
              g("git --version", (V, m) => {
                if (!V) {
                  let a = m.toString().split(`
`)[0] || "";
                  a = (a.toLowerCase().split("version")[1] || "").trim(), K.versions.git = (a.split(" ")[0] || "").trim();
                }
                v();
              });
          if ({}.hasOwnProperty.call(K.versions, "apache") && g("apachectl -v 2>&1", (V, m) => {
            if (!V) {
              const a = (m.toString().split(`
`)[0] || "").split(":");
              K.versions.apache = a.length > 1 ? a[1].replace("Apache", "").replace("/", "").split("(")[0].trim() : "";
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "nginx") && g("nginx -v 2>&1", (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.nginx = (a.toLowerCase().split("/")[1] || "").trim();
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "mysql") && g("mysql -V", (V, m) => {
            if (!V) {
              let a = m.toString().split(`
`)[0] || "";
              if (a = a.toLowerCase(), a.indexOf(",") > -1) {
                a = (a.split(",")[0] || "").trim();
                const I = a.split(" ");
                K.versions.mysql = (I[I.length - 1] || "").trim();
              } else
                a.indexOf(" ver ") > -1 && (a = a.split(" ver ")[1], K.versions.mysql = a.split(" ")[0]);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "php") && g("php -v", (V, m) => {
            if (!V) {
              let I = (m.toString().split(`
`)[0] || "").split("(");
              I[0].indexOf("-") && (I = I[0].split("-")), K.versions.php = I[0].replace(/[^0-9.]/g, "");
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "redis") && g("redis-server --version", (V, m) => {
            if (!V) {
              const I = (m.toString().split(`
`)[0] || "").split(" ");
              K.versions.redis = A.getValue(I, "v", "=", !0);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "docker") && g("docker --version", (V, m) => {
            if (!V) {
              const I = (m.toString().split(`
`)[0] || "").split(" ");
              K.versions.docker = I.length > 2 && I[2].endsWith(",") ? I[2].slice(0, -1) : "";
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "postfix") && g("postconf -d | grep mail_version", (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`) || [];
              K.versions.postfix = A.getValue(a, "mail_version", "=", !0);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "mongodb") && g("mongod --version", (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0] || "";
              K.versions.mongodb = (a.toLowerCase().split(",")[0] || "").replace(/[^0-9.]/g, "");
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "postgresql") && (F ? g("locate bin/postgres", (V, m) => {
            if (V)
              g("psql -V", (a, I) => {
                if (!a) {
                  const t = I.toString().split(`
`)[0].split(" ") || [];
                  K.versions.postgresql = t.length ? t[t.length - 1] : "", K.versions.postgresql = K.versions.postgresql.split("-")[0];
                }
                v();
              });
            else {
              const a = m.toString().split(`
`).sort();
              a.length ? g(a[a.length - 1] + " -V", (I, t) => {
                if (!I) {
                  const l = t.toString().split(`
`)[0].split(" ") || [];
                  K.versions.postgresql = l.length ? l[l.length - 1] : "";
                }
                v();
              }) : v();
            }
          }) : b ? A.powerShell("Get-CimInstance Win32_Service | select caption | fl").then((V) => {
            V.split(/\n\s*\n/).forEach((a) => {
              if (a.trim() !== "") {
                let I = a.trim().split(`\r
`), t = A.getValue(I, "caption", ":", !0).toLowerCase();
                if (t.indexOf("postgresql") > -1) {
                  const l = t.split(" server ");
                  l.length > 1 && (K.versions.postgresql = l[1]);
                }
              }
            }), v();
          }) : g("postgres -V", (V, m) => {
            if (V)
              g("pg_config --version", (a, I) => {
                if (!a) {
                  const t = I.toString().split(`
`)[0].split(" ") || [];
                  K.versions.postgresql = t.length ? t[t.length - 1] : "";
                }
              });
            else {
              const a = m.toString().split(`
`)[0].split(" ") || [];
              K.versions.postgresql = a.length ? a[a.length - 1] : "";
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "perl") && g("perl -v", (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`) || "";
              for (; a.length > 0 && a[0].trim() === ""; )
                a.shift();
              a.length > 0 && (K.versions.perl = a[0].split("(").pop().split(")")[0].replace("v", ""));
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "python"))
            if (x)
              try {
                const m = o("sw_vers").toString().split(`
`), a = A.getValue(m, "ProductVersion", ":"), I = e.existsSync("/usr/local/Cellar/python"), t = e.existsSync("/opt/homebrew/bin/python");
                A.darwinXcodeExists() && A.semverCompare("12.0.1", a) < 0 || I || t ? g(I ? "/usr/local/Cellar/python -V 2>&1" : t ? "/opt/homebrew/bin/python -V 2>&1" : "python -V 2>&1", (D, f) => {
                  if (!D) {
                    const w = f.toString().split(`
`)[0] || "";
                    K.versions.python = w.toLowerCase().replace("python", "").trim();
                  }
                  v();
                }) : v();
              } catch {
                v();
              }
            else
              g("python -V 2>&1", (V, m) => {
                if (!V) {
                  const a = m.toString().split(`
`)[0] || "";
                  K.versions.python = a.toLowerCase().replace("python", "").trim();
                }
                v();
              });
          if ({}.hasOwnProperty.call(K.versions, "python3"))
            if (x) {
              const V = e.existsSync("/usr/local/Cellar/python3") || e.existsSync("/opt/homebrew/bin/python3");
              A.darwinXcodeExists() || V ? g("python3 -V 2>&1", (m, a) => {
                if (!m) {
                  const I = a.toString().split(`
`)[0] || "";
                  K.versions.python3 = I.toLowerCase().replace("python", "").trim();
                }
                v();
              }) : v();
            } else
              g("python3 -V 2>&1", (V, m) => {
                if (!V) {
                  const a = m.toString().split(`
`)[0] || "";
                  K.versions.python3 = a.toLowerCase().replace("python", "").trim();
                }
                v();
              });
          if ({}.hasOwnProperty.call(K.versions, "pip"))
            if (x) {
              const V = e.existsSync("/usr/local/Cellar/pip") || e.existsSync("/opt/homebrew/bin/pip");
              A.darwinXcodeExists() || V ? g("pip -V 2>&1", (m, a) => {
                if (!m) {
                  const t = (a.toString().split(`
`)[0] || "").split(" ");
                  K.versions.pip = t.length >= 2 ? t[1] : "";
                }
                v();
              }) : v();
            } else
              g("pip -V 2>&1", (V, m) => {
                if (!V) {
                  const I = (m.toString().split(`
`)[0] || "").split(" ");
                  K.versions.pip = I.length >= 2 ? I[1] : "";
                }
                v();
              });
          if ({}.hasOwnProperty.call(K.versions, "pip3"))
            if (x) {
              const V = e.existsSync("/usr/local/Cellar/pip3") || e.existsSync("/opt/homebrew/bin/pip3");
              A.darwinXcodeExists() || V ? g("pip3 -V 2>&1", (m, a) => {
                if (!m) {
                  const t = (a.toString().split(`
`)[0] || "").split(" ");
                  K.versions.pip3 = t.length >= 2 ? t[1] : "";
                }
                v();
              }) : v();
            } else
              g("pip3 -V 2>&1", (V, m) => {
                if (!V) {
                  const I = (m.toString().split(`
`)[0] || "").split(" ");
                  K.versions.pip3 = I.length >= 2 ? I[1] : "";
                }
                v();
              });
          ({}).hasOwnProperty.call(K.versions, "java") && (x ? g("/usr/libexec/java_home -V 2>&1", (V, m) => {
            !V && m.toString().toLowerCase().indexOf("no java runtime") === -1 ? g("java -version 2>&1", (a, I) => {
              if (!a) {
                const l = (I.toString().split(`
`)[0] || "").split('"');
                K.versions.java = l.length === 3 ? l[1].trim() : "";
              }
              v();
            }) : v();
          }) : g("java -version 2>&1", (V, m) => {
            if (!V) {
              const I = (m.toString().split(`
`)[0] || "").split('"');
              K.versions.java = I.length === 3 ? I[1].trim() : "";
            }
            v();
          })), {}.hasOwnProperty.call(K.versions, "gcc") && (x && A.darwinXcodeExists() || !x ? g("gcc -dumpversion", (V, m) => {
            V || (K.versions.gcc = m.toString().split(`
`)[0].trim() || ""), K.versions.gcc.indexOf(".") > -1 ? v() : g("gcc --version", (a, I) => {
              if (!a) {
                const t = I.toString().split(`
`)[0].trim();
                if (t.indexOf("gcc") > -1 && t.indexOf(")") > -1) {
                  const l = t.split(")");
                  K.versions.gcc = l[1].trim() || K.versions.gcc;
                }
              }
              v();
            });
          }) : v()), {}.hasOwnProperty.call(K.versions, "virtualbox") && g(A.getVboxmanage() + " -v 2>&1", (V, m) => {
            if (!V) {
              const I = (m.toString().split(`
`)[0] || "").split("r");
              K.versions.virtualbox = I[0];
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "bash") && g("bash --version", (V, m) => {
            if (!V) {
              const I = m.toString().split(`
`)[0].split(" version ");
              I.length > 1 && (K.versions.bash = I[1].split(" ")[0].split("(")[0]);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "zsh") && g("zsh --version", (V, m) => {
            if (!V) {
              const I = m.toString().split(`
`)[0].split("zsh ");
              I.length > 1 && (K.versions.zsh = I[1].split(" ")[0]);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "fish") && g("fish --version", (V, m) => {
            if (!V) {
              const I = m.toString().split(`
`)[0].split(" version ");
              I.length > 1 && (K.versions.fish = I[1].split(" ")[0]);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "bun") && g("bun -v", (V, m) => {
            if (!V) {
              const a = m.toString().split(`
`)[0].trim();
              K.versions.bun = a;
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "deno") && g("deno -v", (V, m) => {
            if (!V) {
              const I = m.toString().split(`
`)[0].trim().split(" ");
              I.length > 1 && (K.versions.deno = I[1]);
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "node") && g("node -v", (V, m) => {
            if (!V) {
              let a = m.toString().split(`
`)[0].trim();
              a.startsWith("v") && (a = a.slice(1)), K.versions.node = a;
            }
            v();
          }), {}.hasOwnProperty.call(K.versions, "powershell") && (b ? A.powerShell("$PSVersionTable").then((V) => {
            const m = V.toString().toLowerCase().split(`
`).map((a) => a.replace(/ +/g, " ").replace(/ +/g, ":"));
            K.versions.powershell = A.getValue(m, "psversion"), v();
          }) : v()), {}.hasOwnProperty.call(K.versions, "dotnet") && (b ? A.powerShell(
            'gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release'
          ).then((V) => {
            const m = V.toString().split(`\r
`);
            let a = "";
            m.forEach((I) => {
              I = I.replace(/ +/g, " ");
              const t = I.split(" ");
              a = a || (t[0].toLowerCase().startsWith("client") && t.length > 2 || t[0].toLowerCase().startsWith("full") && t.length > 2 ? t[1].trim() : "");
            }), K.versions.dotnet = a.trim(), v();
          }) : v());
        } catch {
          c && c(K.versions), k(K.versions);
        }
      });
    });
  }
  osinfo.versions = E;
  function u(d) {
    return new Promise((c) => {
      process.nextTick(() => {
        if (b)
          try {
            A.powerShell(`Get-CimInstance -className win32_process | where-object {$_.ProcessId -eq ${process.ppid} } | select Name`).then((L) => {
              let k = "CMD";
              L && L.toString().toLowerCase().indexOf("powershell") >= 0 && (k = "PowerShell"), d && d(k), c(k);
            });
          } catch {
            d && d(result), c(result);
          }
        else {
          let n = "";
          g("echo $SHELL", (L, k) => {
            L || (n = k.toString().split(`
`)[0]), d && d(n), c(n);
          });
        }
      });
    });
  }
  osinfo.shell = u;
  function r() {
    let d = [];
    try {
      const c = s.networkInterfaces();
      for (let n in c)
        ({}).hasOwnProperty.call(c, n) && c[n].forEach((L) => {
          if (L && L.mac && L.mac !== "00:00:00:00:00:00") {
            const k = L.mac.toLowerCase();
            d.indexOf(k) === -1 && d.push(k);
          }
        });
      d = d.sort((n, L) => n < L ? -1 : n > L ? 1 : 0);
    } catch {
      d.push("00:00:00:00:00:00");
    }
    return d;
  }
  function Q(d) {
    return new Promise((c) => {
      process.nextTick(() => {
        let n = {
          os: "",
          hardware: "",
          macs: r()
        }, L;
        if (x && g("system_profiler SPHardwareDataType -json", (k, K) => {
          if (!k)
            try {
              const gA = JSON.parse(K.toString());
              if (gA.SPHardwareDataType && gA.SPHardwareDataType.length > 0) {
                const v = gA.SPHardwareDataType[0];
                n.os = v.platform_UUID.toLowerCase(), n.hardware = v.serial_number;
              }
            } catch {
              A.noop();
            }
          d && d(n), c(n);
        }), F && g(`echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null ||
cat /etc/machine-id 2> /dev/null; echo;
echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`, (K, gA) => {
          const v = gA.toString().split(`
`);
          if (n.os = A.getValue(v, "os").toLowerCase(), n.hardware = A.getValue(v, "hardware").toLowerCase(), !n.hardware) {
            const U = e.readFileSync("/proc/cpuinfo", { encoding: "utf8" }).toString().split(`
`), V = A.getValue(U, "serial");
            n.hardware = V || "";
          }
          d && d(n), c(n);
        }), (X || W || eA) && g("sysctl -i kern.hostid kern.hostuuid", (k, K) => {
          const gA = K.toString().split(`
`);
          n.hardware = A.getValue(gA, "kern.hostid", ":").toLowerCase(), n.os = A.getValue(gA, "kern.hostuuid", ":").toLowerCase(), n.os.indexOf("unknown") >= 0 && (n.os = ""), n.hardware.indexOf("unknown") >= 0 && (n.hardware = ""), d && d(n), c(n);
        }), b) {
          let k = "%windir%\\System32";
          process.arch === "ia32" && Object.prototype.hasOwnProperty.call(process.env, "PROCESSOR_ARCHITEW6432") && (k = "%windir%\\sysnative\\cmd.exe /c %windir%\\System32"), A.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then((K) => {
            let gA = K.split(`\r
`);
            n.hardware = A.getValue(gA, "uuid", ":").toLowerCase(), g(`${k}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`, A.execOptsWin, (v, U) => {
              L = U.toString().split(`
\r`)[0].split("REG_SZ"), n.os = L.length > 1 ? L[1].replace(/\r+|\n+|\s+/gi, "").toLowerCase() : "", d && d(n), c(n);
            });
          });
        }
      });
    });
  }
  return osinfo.uuid = Q, osinfo;
}
var hasRequiredSystem;
function requireSystem() {
  if (hasRequiredSystem) return system;
  hasRequiredSystem = 1;
  const s = require$$1$1, e = require$$0$1, A = requireUtil(), { uuid: g } = requireOsinfo(), o = require$$1.exec, B = require$$1.execSync, F = A.promisify(require$$1.exec), x = process.platform, b = x === "linux" || x === "android", X = x === "darwin", W = x === "win32", eA = x === "freebsd", IA = x === "openbsd", z = x === "netbsd", N = x === "sunos";
  function J(E) {
    return new Promise((u) => {
      process.nextTick(() => {
        let r = {
          manufacturer: "",
          model: "Computer",
          version: "",
          serial: "-",
          uuid: "-",
          sku: "-",
          virtual: !1
        };
        if ((b || eA || IA || z) && o("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL", (Q, d) => {
          let c = d.toString().split(`
`);
          r.manufacturer = $(A.getValue(c, "manufacturer")), r.model = $(A.getValue(c, "product name")), r.version = $(A.getValue(c, "version")), r.serial = $(A.getValue(c, "serial number")), r.uuid = $(A.getValue(c, "uuid")).toLowerCase(), r.sku = $(A.getValue(c, "sku number"));
          const n = `echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;
            echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;
            echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;
            echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;
            echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;
          try {
            c = B(n, A.execOptsLinux).toString().split(`
`), r.manufacturer = $(r.manufacturer === "" ? A.getValue(c, "sys_vendor") : r.manufacturer), r.model = $(r.model === "" ? A.getValue(c, "product_name") : r.model), r.version = $(r.version === "" ? A.getValue(c, "product_version") : r.version), r.serial = $(r.serial === "" ? A.getValue(c, "product_serial") : r.serial), r.uuid = $(r.uuid === "" ? A.getValue(c, "product_uuid").toLowerCase() : r.uuid);
          } catch {
            A.noop();
          }
          if (r.serial || (r.serial = "-"), r.manufacturer || (r.manufacturer = ""), r.model || (r.model = "Computer"), r.version || (r.version = ""), r.sku || (r.sku = "-"), r.model.toLowerCase() === "virtualbox" || r.model.toLowerCase() === "kvm" || r.model.toLowerCase() === "virtual machine" || r.model.toLowerCase() === "bochs" || r.model.toLowerCase().startsWith("vmware") || r.model.toLowerCase().startsWith("droplet"))
            switch (r.virtual = !0, r.model.toLowerCase()) {
              case "virtualbox":
                r.virtualHost = "VirtualBox";
                break;
              case "vmware":
                r.virtualHost = "VMware";
                break;
              case "kvm":
                r.virtualHost = "KVM";
                break;
              case "bochs":
                r.virtualHost = "bochs";
                break;
            }
          if (r.manufacturer.toLowerCase().startsWith("vmware") || r.manufacturer.toLowerCase() === "xen")
            switch (r.virtual = !0, r.manufacturer.toLowerCase()) {
              case "vmware":
                r.virtualHost = "VMware";
                break;
              case "xen":
                r.virtualHost = "Xen";
                break;
            }
          if (!r.virtual)
            try {
              const L = B("ls -1 /dev/disk/by-id/ 2>/dev/null; pciconf -lv  2>/dev/null", A.execOptsLinux).toString();
              (L.indexOf("_QEMU_") >= 0 || L.indexOf("QEMU ") >= 0) && (r.virtual = !0, r.virtualHost = "QEMU"), L.indexOf("_VBOX_") >= 0 && (r.virtual = !0, r.virtualHost = "VirtualBox");
            } catch {
              A.noop();
            }
          if (eA || IA || z)
            try {
              const L = B("sysctl -i kern.hostuuid kern.hostid hw.model", A.execOptsLinux).toString().split(`
`);
              r.uuid || (r.uuid = A.getValue(L, "kern.hostuuid", ":").toLowerCase()), (!r.serial || r.serial === "-") && (r.serial = A.getValue(L, "kern.hostid", ":").toLowerCase()), (!r.model || r.model === "Computer") && (r.model = A.getValue(L, "hw.model", ":").trim());
            } catch {
              A.noop();
            }
          if (!r.virtual && (e.release().toLowerCase().indexOf("microsoft") >= 0 || e.release().toLowerCase().endsWith("wsl2"))) {
            const L = parseFloat(e.release().toLowerCase());
            r.virtual = !0, r.manufacturer = "Microsoft", r.model = "WSL", r.version = L < 4.19 ? "1" : "2";
          }
          if ((eA || IA || z) && !r.virtualHost)
            try {
              const k = B("dmidecode -t 4", A.execOptsLinux).toString().split(`
`);
              switch (A.getValue(k, "manufacturer", ":", !0).toLowerCase()) {
                case "virtualbox":
                  r.virtualHost = "VirtualBox";
                  break;
                case "vmware":
                  r.virtualHost = "VMware";
                  break;
                case "kvm":
                  r.virtualHost = "KVM";
                  break;
                case "bochs":
                  r.virtualHost = "bochs";
                  break;
              }
            } catch {
              A.noop();
            }
          (s.existsSync("/.dockerenv") || s.existsSync("/.dockerinit")) && (r.model = "Docker Container");
          try {
            const L = B('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');
            L.toString().split(`
`).length > 0 && (r.model === "Computer" && (r.model = "Virtual machine"), r.virtual = !0, L.toString().toLowerCase().indexOf("vmware") >= 0 && !r.virtualHost && (r.virtualHost = "VMware"), L.toString().toLowerCase().indexOf("qemu") >= 0 && !r.virtualHost && (r.virtualHost = "QEMU"), L.toString().toLowerCase().indexOf("xen") >= 0 && !r.virtualHost && (r.virtualHost = "Xen"), L.toString().toLowerCase().indexOf("kvm") >= 0 && !r.virtualHost && (r.virtualHost = "KVM"));
          } catch {
            A.noop();
          }
          r.manufacturer === "" && r.model === "Computer" && r.version === "" ? s.readFile("/proc/cpuinfo", (L, k) => {
            if (!L) {
              let K = k.toString().split(`
`);
              if (r.model = A.getValue(K, "hardware", ":", !0).toUpperCase(), r.version = A.getValue(K, "revision", ":", !0).toLowerCase(), r.serial = A.getValue(K, "serial", ":", !0), A.getValue(K, "model:", ":", !0), A.isRaspberry(K)) {
                const gA = A.decodePiCpuinfo(K);
                r.model = gA.model, r.version = gA.revisionCode, r.manufacturer = "Raspberry Pi Foundation", r.raspberry = {
                  manufacturer: gA.manufacturer,
                  processor: gA.processor,
                  type: gA.type,
                  revision: gA.revision
                };
              }
            }
            E && E(r), u(r);
          }) : (E && E(r), u(r));
        }), X && o("ioreg -c IOPlatformExpertDevice -d 2", (Q, d) => {
          if (!Q) {
            const c = d.toString().replace(/[<>"]/g, "").split(`
`), n = A.getAppleModel(A.getValue(c, "model", "=", !0));
            r.manufacturer = A.getValue(c, "manufacturer", "=", !0), r.model = n.key, r.type = p(n.version), r.version = n.version, r.serial = A.getValue(c, "ioplatformserialnumber", "=", !0), r.uuid = A.getValue(c, "ioplatformuuid", "=", !0).toLowerCase(), r.sku = A.getValue(c, "board-id", "=", !0) || A.getValue(c, "target-sub-type", "=", !0);
          }
          E && E(r), u(r);
        }), N && (E && E(r), u(r)), W)
          try {
            A.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then((Q, d) => {
              if (d)
                E && E(r), u(r);
              else {
                const c = Q.split(`\r
`);
                r.manufacturer = A.getValue(c, "vendor", ":"), r.model = A.getValue(c, "name", ":"), r.version = A.getValue(c, "version", ":"), r.serial = A.getValue(c, "identifyingnumber", ":"), r.uuid = A.getValue(c, "uuid", ":").toLowerCase();
                const n = r.model.toLowerCase();
                (n === "virtualbox" || n === "kvm" || n === "virtual machine" || n === "bochs" || n.startsWith("vmware") || n.startsWith("qemu") || n.startsWith("parallels")) && (r.virtual = !0, n.startsWith("virtualbox") && (r.virtualHost = "VirtualBox"), n.startsWith("vmware") && (r.virtualHost = "VMware"), n.startsWith("kvm") && (r.virtualHost = "KVM"), n.startsWith("bochs") && (r.virtualHost = "bochs"), n.startsWith("qemu") && (r.virtualHost = "KVM"), n.startsWith("parallels") && (r.virtualHost = "Parallels"));
                const L = r.manufacturer.toLowerCase();
                (L.startsWith("vmware") || L.startsWith("qemu") || L === "xen" || L.startsWith("parallels")) && (r.virtual = !0, L.startsWith("vmware") && (r.virtualHost = "VMware"), L.startsWith("xen") && (r.virtualHost = "Xen"), L.startsWith("qemu") && (r.virtualHost = "KVM"), L.startsWith("parallels") && (r.virtualHost = "Parallels")), A.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((k, K) => {
                  if (!K) {
                    const gA = k.split(`\r
`);
                    r.sku = A.getValue(gA, "systemsku", ":");
                  }
                  r.virtual ? (E && E(r), u(r)) : A.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then((gA, v) => {
                    if (v)
                      E && E(r), u(r);
                    else {
                      let U = gA.toString();
                      (U.indexOf("VRTUAL") >= 0 || U.indexOf("A M I ") >= 0 || U.indexOf("VirtualBox") >= 0 || U.indexOf("VMWare") >= 0 || U.indexOf("Xen") >= 0 || U.indexOf("Parallels") >= 0) && (r.virtual = !0, U.indexOf("VirtualBox") >= 0 && !r.virtualHost && (r.virtualHost = "VirtualBox"), U.indexOf("VMware") >= 0 && !r.virtualHost && (r.virtualHost = "VMware"), U.indexOf("Xen") >= 0 && !r.virtualHost && (r.virtualHost = "Xen"), U.indexOf("VRTUAL") >= 0 && !r.virtualHost && (r.virtualHost = "Hyper-V"), U.indexOf("A M I") >= 0 && !r.virtualHost && (r.virtualHost = "Virtual PC"), U.indexOf("Parallels") >= 0 && !r.virtualHost && (r.virtualHost = "Parallels")), E && E(r), u(r);
                    }
                  });
                });
              }
            });
          } catch {
            E && E(r), u(r);
          }
      });
    });
  }
  system.system = J;
  function $(E) {
    const u = E.toLowerCase();
    return u.indexOf("o.e.m.") === -1 && u.indexOf("default string") === -1 && u !== "default" && E || "";
  }
  function H(E) {
    return new Promise((u) => {
      process.nextTick(() => {
        let r = {
          vendor: "",
          version: "",
          releaseDate: "",
          revision: ""
        }, Q = "";
        if ((b || eA || IA || z) && (process.arch === "arm" ? Q = "cat /proc/cpuinfo | grep Serial" : Q = "export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL", o(Q, (d, c) => {
          let n = c.toString().split(`
`);
          r.vendor = A.getValue(n, "Vendor"), r.version = A.getValue(n, "Version");
          let L = A.getValue(n, "Release Date");
          r.releaseDate = A.parseDateTime(L).date, r.revision = A.getValue(n, "BIOS Revision"), r.serial = A.getValue(n, "SerialNumber");
          let k = A.getValue(n, "Currently Installed Language").split("|")[0];
          if (k && (r.language = k), n.length && c.toString().indexOf("Characteristics:") >= 0) {
            const gA = [];
            n.forEach((v) => {
              if (v.indexOf(" is supported") >= 0) {
                const U = v.split(" is supported")[0].trim();
                gA.push(U);
              }
            }), r.features = gA;
          }
          const K = `echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;
            echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
            echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;
          try {
            n = B(K, A.execOptsLinux).toString().split(`
`), r.vendor = r.vendor ? r.vendor : A.getValue(n, "bios_vendor"), r.version = r.version ? r.version : A.getValue(n, "bios_version"), L = A.getValue(n, "bios_date"), r.releaseDate = r.releaseDate ? r.releaseDate : A.parseDateTime(L).date;
          } catch {
            A.noop();
          }
          E && E(r), u(r);
        })), X && (r.vendor = "Apple Inc.", o("system_profiler SPHardwareDataType -json", (d, c) => {
          try {
            const n = JSON.parse(c.toString());
            if (n && n.SPHardwareDataType && n.SPHardwareDataType.length) {
              let L = n.SPHardwareDataType[0].boot_rom_version;
              L = L ? L.split("(")[0].trim() : null, r.version = L;
            }
          } catch {
            A.noop();
          }
          E && E(r), u(r);
        })), N && (r.vendor = "Sun Microsystems", E && E(r), u(r)), W)
          try {
            A.powerShell(
              'Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl'
            ).then((d, c) => {
              if (!c) {
                let n = d.toString().split(`\r
`);
                const L = A.getValue(n, "description", ":"), k = A.getValue(n, "SMBIOSBIOSVersion", ":");
                L.indexOf(" Version ") !== -1 ? (r.vendor = L.split(" Version ")[0].trim(), r.version = L.split(" Version ")[1].trim()) : L.indexOf(" Ver: ") !== -1 ? (r.vendor = A.getValue(n, "manufacturer", ":"), r.version = L.split(" Ver: ")[1].trim()) : (r.vendor = A.getValue(n, "manufacturer", ":"), r.version = k || A.getValue(n, "version", ":")), r.releaseDate = A.getValue(n, "releasedate", ":"), r.revision = A.getValue(n, "buildnumber", ":"), r.serial = $(A.getValue(n, "serialnumber", ":"));
              }
              E && E(r), u(r);
            });
          } catch {
            E && E(r), u(r);
          }
      });
    });
  }
  system.bios = H;
  function y(E) {
    return new Promise((u) => {
      process.nextTick(() => {
        const r = {
          manufacturer: "",
          model: "",
          version: "",
          serial: "-",
          assetTag: "-",
          memMax: null,
          memSlots: null
        };
        let Q = "";
        if (b || eA || IA || z) {
          process.arch === "arm" ? Q = "cat /proc/cpuinfo | grep Serial" : Q = "export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";
          const d = [];
          d.push(F(Q)), d.push(F("export LC_ALL=C; dmidecode -t memory 2>/dev/null")), A.promiseAll(d).then((c) => {
            let n = c.results[0] ? c.results[0].toString().split(`
`) : [""];
            r.manufacturer = $(A.getValue(n, "Manufacturer")), r.model = $(A.getValue(n, "Product Name")), r.version = $(A.getValue(n, "Version")), r.serial = $(A.getValue(n, "Serial Number")), r.assetTag = $(A.getValue(n, "Asset Tag"));
            const L = `echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;
            echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;
            echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;
            echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
            echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;
            try {
              n = B(L, A.execOptsLinux).toString().split(`
`), r.manufacturer = $(r.manufacturer ? r.manufacturer : A.getValue(n, "board_vendor")), r.model = $(r.model ? r.model : A.getValue(n, "board_name")), r.version = $(r.version ? r.version : A.getValue(n, "board_version")), r.serial = $(r.serial ? r.serial : A.getValue(n, "board_serial")), r.assetTag = $(r.assetTag ? r.assetTag : A.getValue(n, "board_asset_tag"));
            } catch {
              A.noop();
            }
            if (n = c.results[1] ? c.results[1].toString().split(`
`) : [""], r.memMax = A.toInt(A.getValue(n, "Maximum Capacity")) * 1024 * 1024 * 1024 || null, r.memSlots = A.toInt(A.getValue(n, "Number Of Devices")) || null, A.isRaspberry()) {
              const k = A.decodePiCpuinfo();
              r.manufacturer = k.manufacturer, r.model = "Raspberry Pi", r.serial = k.serial, r.version = k.type + " - " + k.revision, r.memMax = e.totalmem(), r.memSlots = 0;
            }
            E && E(r), u(r);
          });
        }
        if (X) {
          const d = [];
          d.push(F("ioreg -c IOPlatformExpertDevice -d 2")), d.push(F("system_profiler SPMemoryDataType")), A.promiseAll(d).then((c) => {
            const n = c.results[0] ? c.results[0].toString().replace(/[<>"]/g, "").split(`
`) : [""];
            r.manufacturer = A.getValue(n, "manufacturer", "=", !0), r.model = A.getValue(n, "model", "=", !0), r.version = A.getValue(n, "version", "=", !0), r.serial = A.getValue(n, "ioplatformserialnumber", "=", !0), r.assetTag = A.getValue(n, "board-id", "=", !0);
            let L = c.results[1] ? c.results[1].toString().split("        BANK ") : [""];
            L.length === 1 && (L = c.results[1] ? c.results[1].toString().split("        DIMM") : [""]), L.shift(), r.memSlots = L.length, e.arch() === "arm64" && (r.memSlots = 0, r.memMax = e.totalmem()), E && E(r), u(r);
          });
        }
        if (N && (E && E(r), u(r)), W)
          try {
            const d = [], c = parseInt(e.release()) >= 10, n = c ? "MaxCapacityEx" : "MaxCapacity";
            d.push(A.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")), d.push(A.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${n}, MemoryDevices | fl`)), A.promiseAll(d).then((L) => {
              let k = L.results[0] ? L.results[0].toString().split(`\r
`) : [""];
              r.manufacturer = $(A.getValue(k, "manufacturer", ":")), r.model = $(A.getValue(k, "model", ":")), r.model || (r.model = $(A.getValue(k, "product", ":"))), r.version = $(A.getValue(k, "version", ":")), r.serial = $(A.getValue(k, "serialnumber", ":")), r.assetTag = $(A.getValue(k, "partnumber", ":")), r.assetTag || (r.assetTag = $(A.getValue(k, "sku", ":"))), k = L.results[1] ? L.results[1].toString().split(`\r
`) : [""], r.memMax = A.toInt(A.getValue(k, n, ":")) * (c ? 1024 : 1) || null, r.memSlots = A.toInt(A.getValue(k, "MemoryDevices", ":")) || null, E && E(r), u(r);
            });
          } catch {
            E && E(r), u(r);
          }
      });
    });
  }
  system.baseboard = y;
  function p(E) {
    return E = E.toLowerCase(), E.indexOf("macbookair") >= 0 || E.indexOf("macbook air") >= 0 || E.indexOf("macbookpro") >= 0 || E.indexOf("macbook pro") >= 0 || E.indexOf("macbook") >= 0 ? "Notebook" : E.indexOf("macmini") >= 0 || E.indexOf("mac mini") >= 0 || E.indexOf("imac") >= 0 || E.indexOf("macstudio") >= 0 || E.indexOf("mac studio") >= 0 ? "Desktop" : E.indexOf("macpro") >= 0 || E.indexOf("mac pro") >= 0 ? "Tower" : "Other";
  }
  function h(E) {
    const u = [
      "Other",
      "Unknown",
      "Desktop",
      "Low Profile Desktop",
      "Pizza Box",
      "Mini Tower",
      "Tower",
      "Portable",
      "Laptop",
      "Notebook",
      "Hand Held",
      "Docking Station",
      "All in One",
      "Sub Notebook",
      "Space-Saving",
      "Lunch Box",
      "Main System Chassis",
      "Expansion Chassis",
      "SubChassis",
      "Bus Expansion Chassis",
      "Peripheral Chassis",
      "Storage Chassis",
      "Rack Mount Chassis",
      "Sealed-Case PC",
      "Multi-System Chassis",
      "Compact PCI",
      "Advanced TCA",
      "Blade",
      "Blade Enclosure",
      "Tablet",
      "Convertible",
      "Detachable",
      "IoT Gateway ",
      "Embedded PC",
      "Mini PC",
      "Stick PC"
    ];
    return new Promise((r) => {
      process.nextTick(() => {
        let Q = {
          manufacturer: "",
          model: "",
          type: "",
          version: "",
          serial: "-",
          assetTag: "-",
          sku: ""
        };
        if ((b || eA || IA || z) && o(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
            echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
            echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
            echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
            echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`, (c, n) => {
          let L = n.toString().split(`
`);
          Q.manufacturer = $(A.getValue(L, "chassis_vendor"));
          const k = parseInt(A.getValue(L, "chassis_type").replace(/\D/g, ""));
          Q.type = $(k && !isNaN(k) && k < u.length ? u[k - 1] : ""), Q.version = $(A.getValue(L, "chassis_version")), Q.serial = $(A.getValue(L, "chassis_serial")), Q.assetTag = $(A.getValue(L, "chassis_asset_tag")), E && E(Q), r(Q);
        }), X && o("ioreg -c IOPlatformExpertDevice -d 2", (d, c) => {
          if (!d) {
            const n = c.toString().replace(/[<>"]/g, "").split(`
`), L = A.getAppleModel(A.getValue(n, "model", "=", !0));
            Q.manufacturer = A.getValue(n, "manufacturer", "=", !0), Q.model = L.key, Q.type = p(L.model), Q.version = L.version, Q.serial = A.getValue(n, "ioplatformserialnumber", "=", !0), Q.assetTag = A.getValue(n, "board-id", "=", !0) || A.getValue(n, "target-type", "=", !0), Q.sku = A.getValue(n, "target-sub-type", "=", !0);
          }
          E && E(Q), r(Q);
        }), N && (E && E(Q), r(Q)), W)
          try {
            A.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then((d, c) => {
              if (!c) {
                let n = d.toString().split(`\r
`);
                Q.manufacturer = $(A.getValue(n, "manufacturer", ":")), Q.model = $(A.getValue(n, "model", ":"));
                const L = parseInt(A.getValue(n, "ChassisTypes", ":").replace(/\D/g, ""));
                Q.type = L && !isNaN(L) && L < u.length ? u[L - 1] : "", Q.version = $(A.getValue(n, "version", ":")), Q.serial = $(A.getValue(n, "serialnumber", ":")), Q.assetTag = $(A.getValue(n, "partnumber", ":")), Q.assetTag || (Q.assetTag = $(A.getValue(n, "SMBIOSAssetTag", ":"))), Q.sku = $(A.getValue(n, "sku", ":"));
              }
              E && E(Q), r(Q);
            });
          } catch {
            E && E(Q), r(Q);
          }
      });
    });
  }
  return system.chassis = h, system;
}
var cpu = {}, hasRequiredCpu;
function requireCpu() {
  if (hasRequiredCpu) return cpu;
  hasRequiredCpu = 1;
  const s = require$$0$1, e = require$$1.exec, A = require$$1.execSync, g = require$$1$1, o = requireUtil(), B = process.platform, F = B === "linux" || B === "android", x = B === "darwin", b = B === "win32", X = B === "freebsd", W = B === "openbsd", eA = B === "netbsd", IA = B === "sunos";
  let z = 0, N = {
    user: 0,
    nice: 0,
    system: 0,
    idle: 0,
    irq: 0,
    steal: 0,
    guest: 0,
    load: 0,
    tick: 0,
    ms: 0,
    currentLoad: 0,
    currentLoadUser: 0,
    currentLoadSystem: 0,
    currentLoadNice: 0,
    currentLoadIdle: 0,
    currentLoadIrq: 0,
    currentLoadSteal: 0,
    currentLoadGuest: 0,
    rawCurrentLoad: 0,
    rawCurrentLoadUser: 0,
    rawCurrentLoadSystem: 0,
    rawCurrentLoadNice: 0,
    rawCurrentLoadIdle: 0,
    rawCurrentLoadIrq: 0,
    rawCurrentLoadSteal: 0,
    rawCurrentLoadGuest: 0
  }, J = [], $ = 0;
  const H = {
    8346: "1.8",
    8347: "1.9",
    8350: "2.0",
    8354: "2.2",
    "8356|SE": "2.4",
    8356: "2.3",
    8360: "2.5",
    2372: "2.1",
    2373: "2.1",
    2374: "2.2",
    2376: "2.3",
    2377: "2.3",
    2378: "2.4",
    2379: "2.4",
    2380: "2.5",
    2381: "2.5",
    2382: "2.6",
    2384: "2.7",
    2386: "2.8",
    2387: "2.8",
    2389: "2.9",
    2393: "3.1",
    8374: "2.2",
    8376: "2.3",
    8378: "2.4",
    8379: "2.4",
    8380: "2.5",
    8381: "2.5",
    8382: "2.6",
    8384: "2.7",
    8386: "2.8",
    8387: "2.8",
    8389: "2.9",
    8393: "3.1",
    "2419EE": "1.8",
    "2423HE": "2.0",
    "2425HE": "2.1",
    2427: "2.2",
    2431: "2.4",
    2435: "2.6",
    "2439SE": "2.8",
    "8425HE": "2.1",
    8431: "2.4",
    8435: "2.6",
    "8439SE": "2.8",
    4122: "2.2",
    4130: "2.6",
    "4162EE": "1.7",
    "4164EE": "1.8",
    "4170HE": "2.1",
    "4174HE": "2.3",
    "4176HE": "2.4",
    4180: "2.6",
    4184: "2.8",
    "6124HE": "1.8",
    "6128HE": "2.0",
    "6132HE": "2.2",
    6128: "2.0",
    6134: "2.3",
    6136: "2.4",
    6140: "2.6",
    "6164HE": "1.7",
    "6166HE": "1.8",
    6168: "1.9",
    6172: "2.1",
    6174: "2.2",
    6176: "2.3",
    "6176SE": "2.3",
    "6180SE": "2.5",
    3250: "2.5",
    3260: "2.7",
    3280: "2.4",
    4226: "2.7",
    4228: "2.8",
    4230: "2.9",
    4234: "3.1",
    4238: "3.3",
    4240: "3.4",
    4256: "1.6",
    4274: "2.5",
    4276: "2.6",
    4280: "2.8",
    4284: "3.0",
    6204: "3.3",
    6212: "2.6",
    6220: "3.0",
    6234: "2.4",
    6238: "2.6",
    "6262HE": "1.6",
    6272: "2.1",
    6274: "2.2",
    6276: "2.3",
    6278: "2.4",
    "6282SE": "2.6",
    "6284SE": "2.7",
    6308: "3.5",
    6320: "2.8",
    6328: "3.2",
    "6338P": "2.3",
    6344: "2.6",
    6348: "2.8",
    6366: "1.8",
    "6370P": "2.0",
    6376: "2.3",
    6378: "2.4",
    6380: "2.5",
    6386: "2.8",
    "FX|4100": "3.6",
    "FX|4120": "3.9",
    "FX|4130": "3.8",
    "FX|4150": "3.8",
    "FX|4170": "4.2",
    "FX|6100": "3.3",
    "FX|6120": "3.6",
    "FX|6130": "3.6",
    "FX|6200": "3.8",
    "FX|8100": "2.8",
    "FX|8120": "3.1",
    "FX|8140": "3.2",
    "FX|8150": "3.6",
    "FX|8170": "3.9",
    "FX|4300": "3.8",
    "FX|4320": "4.0",
    "FX|4350": "4.2",
    "FX|6300": "3.5",
    "FX|6350": "3.9",
    "FX|8300": "3.3",
    "FX|8310": "3.4",
    "FX|8320": "3.5",
    "FX|8350": "4.0",
    "FX|8370": "4.0",
    "FX|9370": "4.4",
    "FX|9590": "4.7",
    "FX|8320E": "3.2",
    "FX|8370E": "3.3",
    // ZEN Desktop CPUs
    1200: "3.1",
    "Pro 1200": "3.1",
    "1300X": "3.5",
    "Pro 1300": "3.5",
    1400: "3.2",
    "1500X": "3.5",
    "Pro 1500": "3.5",
    1600: "3.2",
    "1600X": "3.6",
    "Pro 1600": "3.2",
    1700: "3.0",
    "Pro 1700": "3.0",
    "1700X": "3.4",
    "Pro 1700X": "3.4",
    "1800X": "3.6",
    "1900X": "3.8",
    1920: "3.2",
    "1920X": "3.5",
    "1950X": "3.4",
    // ZEN Desktop APUs
    "200GE": "3.2",
    "Pro 200GE": "3.2",
    "220GE": "3.4",
    "240GE": "3.5",
    "3000G": "3.5",
    "300GE": "3.4",
    "3050GE": "3.4",
    "2200G": "3.5",
    "Pro 2200G": "3.5",
    "2200GE": "3.2",
    "Pro 2200GE": "3.2",
    "2400G": "3.6",
    "Pro 2400G": "3.6",
    "2400GE": "3.2",
    "Pro 2400GE": "3.2",
    // ZEN Mobile APUs
    "Pro 200U": "2.3",
    "300U": "2.4",
    "2200U": "2.5",
    "3200U": "2.6",
    "2300U": "2.0",
    "Pro 2300U": "2.0",
    "2500U": "2.0",
    "Pro 2500U": "2.2",
    "2600H": "3.2",
    "2700U": "2.0",
    "Pro 2700U": "2.2",
    "2800H": "3.3",
    // ZEN Server Processors
    7351: "2.4",
    "7351P": "2.4",
    7401: "2.0",
    "7401P": "2.0",
    "7551P": "2.0",
    7551: "2.0",
    7251: "2.1",
    7261: "2.5",
    7281: "2.1",
    7301: "2.2",
    7371: "3.1",
    7451: "2.3",
    7501: "2.0",
    7571: "2.2",
    7601: "2.2",
    // ZEN Embedded Processors
    V1500B: "2.2",
    V1780B: "3.35",
    V1202B: "2.3",
    V1404I: "2.0",
    V1605B: "2.0",
    V1756B: "3.25",
    V1807B: "3.35",
    3101: "2.1",
    3151: "2.7",
    3201: "1.5",
    3251: "2.5",
    3255: "2.5",
    3301: "2.0",
    3351: "1.9",
    3401: "1.85",
    3451: "2.15",
    // ZEN+ Desktop
    "1200|AF": "3.1",
    "2300X": "3.5",
    "2500X": "3.6",
    2600: "3.4",
    "2600E": "3.1",
    "1600|AF": "3.2",
    "2600X": "3.6",
    2700: "3.2",
    "2700E": "2.8",
    "Pro 2700": "3.2",
    "2700X": "3.7",
    "Pro 2700X": "3.6",
    "2920X": "3.5",
    "2950X": "3.5",
    "2970WX": "3.0",
    "2990WX": "3.0",
    // ZEN+ Desktop APU
    "Pro 300GE": "3.4",
    "Pro 3125GE": "3.4",
    "3150G": "3.5",
    "Pro 3150G": "3.5",
    "3150GE": "3.3",
    "Pro 3150GE": "3.3",
    "3200G": "3.6",
    "Pro 3200G": "3.6",
    "3200GE": "3.3",
    "Pro 3200GE": "3.3",
    "3350G": "3.6",
    "Pro 3350G": "3.6",
    "3350GE": "3.3",
    "Pro 3350GE": "3.3",
    "3400G": "3.7",
    "Pro 3400G": "3.7",
    "3400GE": "3.3",
    "Pro 3400GE": "3.3",
    // ZEN+ Mobile
    "3300U": "2.1",
    "PRO 3300U": "2.1",
    "3450U": "2.1",
    "3500U": "2.1",
    "PRO 3500U": "2.1",
    "3500C": "2.1",
    "3550H": "2.1",
    "3580U": "2.1",
    "3700U": "2.3",
    "PRO 3700U": "2.3",
    "3700C": "2.3",
    "3750H": "2.3",
    "3780U": "2.3",
    // ZEN2 Desktop CPUS
    3100: "3.6",
    "3300X": "3.8",
    3500: "3.6",
    "3500X": "3.6",
    3600: "3.6",
    "Pro 3600": "3.6",
    "3600X": "3.8",
    "3600XT": "3.8",
    "Pro 3700": "3.6",
    "3700X": "3.6",
    "3800X": "3.9",
    "3800XT": "3.9",
    3900: "3.1",
    "Pro 3900": "3.1",
    "3900X": "3.8",
    "3900XT": "3.8",
    "3950X": "3.5",
    "3960X": "3.8",
    "3970X": "3.7",
    "3990X": "2.9",
    "3945WX": "4.0",
    "3955WX": "3.9",
    "3975WX": "3.5",
    "3995WX": "2.7",
    // ZEN2 Desktop APUs
    "4300GE": "3.5",
    "Pro 4300GE": "3.5",
    "4300G": "3.8",
    "Pro 4300G": "3.8",
    "4600GE": "3.3",
    "Pro 4650GE": "3.3",
    "4600G": "3.7",
    "Pro 4650G": "3.7",
    "4700GE": "3.1",
    "Pro 4750GE": "3.1",
    "4700G": "3.6",
    "Pro 4750G": "3.6",
    "4300U": "2.7",
    "4450U": "2.5",
    "Pro 4450U": "2.5",
    "4500U": "2.3",
    "4600U": "2.1",
    "PRO 4650U": "2.1",
    "4680U": "2.1",
    "4600HS": "3.0",
    "4600H": "3.0",
    "4700U": "2.0",
    "PRO 4750U": "1.7",
    "4800U": "1.8",
    "4800HS": "2.9",
    "4800H": "2.9",
    "4900HS": "3.0",
    "4900H": "3.3",
    "5300U": "2.6",
    "5500U": "2.1",
    "5700U": "1.8",
    // ZEN2 - EPYC
    "7232P": "3.1",
    "7302P": "3.0",
    "7402P": "2.8",
    "7502P": "2.5",
    "7702P": "2.0",
    7252: "3.1",
    7262: "3.2",
    7272: "2.9",
    7282: "2.8",
    7302: "3.0",
    7352: "2.3",
    7402: "2.8",
    7452: "2.35",
    7502: "2.5",
    7532: "2.4",
    7542: "2.9",
    7552: "2.2",
    7642: "2.3",
    7662: "2.0",
    7702: "2.0",
    7742: "2.25",
    "7H12": "2.6",
    "7F32": "3.7",
    "7F52": "3.5",
    "7F72": "3.2",
    // Epyc (Milan)
    "7773X": "2.2",
    7763: "2.45",
    7713: "2.0",
    "7713P": "2.0",
    7663: "2.0",
    7643: "2.3",
    "7573X": "2.8",
    "75F3": "2.95",
    7543: "2.8",
    "7543P": "2.8",
    7513: "2.6",
    "7473X": "2.8",
    7453: "2.75",
    "74F3": "3.2",
    7443: "2.85",
    "7443P": "2.85",
    7413: "2.65",
    "7373X": "3.05",
    "73F3": "3.5",
    7343: "3.2",
    7313: "3.0",
    "7313P": "3.0",
    "72F3": "3.7",
    // ZEN3
    "5600X": "3.7",
    "5800X": "3.8",
    "5900X": "3.7",
    "5950X": "3.4",
    "5945WX": "4.1",
    "5955WX": "4.0",
    "5965WX": "3.8",
    "5975WX": "3.6",
    "5995WX": "2.7",
    "7960X": "4.2",
    "7970X": "4.0",
    "7980X": "3.2",
    "7965WX": "4.2",
    "7975WX": "4.0",
    "7985WX": "3.2",
    "7995WX": "2.5",
    // ZEN4
    9754: "2.25",
    "9754S": "2.25",
    9734: "2.2",
    "9684X": "2.55",
    "9384X": "3.1",
    "9184X": "3.55",
    "9654P": "2.4",
    9654: "2.4",
    9634: "2.25",
    "9554P": "3.1",
    9554: "3.1",
    9534: "2.45",
    "9474F": "3.6",
    "9454P": "2.75",
    9454: "2.75",
    "9374F": "3.85",
    "9354P": "3.25",
    9354: "3.25",
    9334: "2.7",
    "9274F": "4.05",
    9254: "2.9",
    9224: "2.5",
    "9174F": "4.1",
    9124: "3.0",
    // Epyc 4th gen
    "4124P": "3.8",
    "4244P": "3.8",
    "4344P": "3.8",
    "4364P": "4.5",
    "4464P": "3.7",
    "4484PX": "4.4",
    "4564P": "4.5",
    "4584PX": "4.2",
    "8024P": "2.4",
    "8024PN": "2.05",
    "8124P": "2.45",
    "8124PN": "2.0",
    "8224P": "2.55",
    "8224PN": "2.0",
    "8324P": "2.65",
    "8324PN": "2.05",
    "8434P": "2.5",
    "8434PN": "2.0",
    "8534P": "2.3",
    "8534PN": "2.0",
    // Epyc 5th gen
    9115: "2.6",
    9135: "3.65",
    "9175F": "4.2",
    9255: "3.25",
    "9275F": "4.1",
    9335: "3.0",
    "9355P": "3.55",
    9355: "3.55",
    "9375F": "3.8",
    9365: "3.4",
    "9455P": "3.15",
    9455: "3.15",
    "9475F": "3.65",
    9535: "2.4",
    "9555P": "3.2",
    9555: "3.2",
    "9575F": "3.3",
    9565: "3.15",
    "9655P": "2.5",
    9655: "2.5",
    9755: "2.7",
    "4245P": "3.9",
    "4345P": "3.8",
    "4465P": "3.4",
    "4545P": "3.0",
    "4565P": "4.3",
    "4585PX": "4.3",
    "5900XT": "3.3",
    5900: "3.0",
    5945: "3.0",
    "5800X3D": "3.4",
    "5800XT": "3.8",
    5800: "3.4",
    "5700X3D": "3.0",
    "5700X": "3.4",
    5845: "3.4",
    "5600X3D": "3.3",
    "5600XT": "3.7",
    "5600T": "3.5",
    5600: "3.5",
    "5600F": "3.0",
    5645: "3.7",
    "5500X3D": "3.0",
    "5980HX": "3.3",
    "5980HS": "3.0",
    "5900HX": "3.3",
    "5900HS": "3.0",
    "5800H": "3.2",
    "5800HS": "2.8",
    "5800U": "1.9",
    "5600H": "3.3",
    "5600HS": "3.0",
    "5600U": "2.3",
    "5560U": "2.3",
    "5400U": "2.7",
    "5825U": "2.0",
    "5625U": "2.3",
    "5425U": "2.7",
    "5125C": "3.0",
    "7730U": "2.0",
    "7530U": "2.0",
    "7430U": "2.3",
    "7330U": "2.3",
    7203: "2.8",
    7303: "2.4",
    "7663P": "2.0",
    "6980HX": "3.3",
    "6980HS": "3.3",
    "6900HX": "3.3",
    "6900HS": "3.3",
    "6800H": "3.2",
    "6800HS": "3.2",
    "6800U": "2.7",
    "6600H": "3.3",
    "6600HS": "3.3",
    "6600U": "2.9",
    "7735HS": "3.2",
    "7735H": "3.2",
    "7736U": "2.7",
    "7735U": "2.7",
    "7435HS": "3.1",
    "7435H": "3.1",
    "7535HS": "3.3",
    "7535H": "3.3",
    "7535U": "2.9",
    "7235HS": "3.2",
    "7235H": "3.2",
    "7335U": "3.0",
    270: "4.0",
    260: "3.8",
    250: "3.3",
    240: "4.3",
    230: "3.5",
    220: "3.0",
    210: "2.8",
    "8945HS": "4.0",
    "8845HS": "3.8",
    "8840HS": "3.3",
    "8840U": "3.3",
    "8645HS": "4.3",
    "8640HS": "3.5",
    "8640U": "3.5",
    "8540U": "3.0",
    "8440U": "2.8",
    "9950X3D": "4.3",
    "9950X": "4.3",
    "9900X3D": "4.4",
    "9900X": "4.4",
    "9800X3D": "4.7",
    "9700X": "3.8",
    "9700F": "3.8",
    "9600X": "3.9",
    9600: "3.8",
    "9500F": "3.8",
    "9995WX": "2.5",
    "9985WX": "3.2",
    "9975WX": "4.0",
    "9965WX": "4.2",
    "9955WX": "4.5",
    "9945WX": "4.7",
    "9980X": "3.2",
    "9970X": "4.0",
    "9960X": "4.2",
    "PRO HX375": "2.0",
    HX375: "2.0",
    "PRO HX370": "2.0",
    HX370: "2.0",
    365: "2.0",
    "PRO 360": "2.0",
    350: "2.0",
    "PRO 350": "2.0",
    340: "2.0",
    "PRO 340": "2.0",
    330: "2.0",
    395: "3.0",
    "PRO 395": "3.0",
    390: "3.2",
    "PRO 390": "3.2",
    385: "3.6",
    "PRO 385": "3.6",
    "PRO 380": "3.6",
    "9955HX3D": "2.3",
    "9955HX": "2.5",
    "9850HX": "3.0",
    9015: "3.6",
    9965: "2.25",
    9845: "2.1",
    9825: "2.2",
    9745: "2.4",
    9645: "2.3"
  }, y = {
    1: "Other",
    2: "Unknown",
    3: "Daughter Board",
    4: "ZIF Socket",
    5: "Replacement/Piggy Back",
    6: "None",
    7: "LIF Socket",
    8: "Slot 1",
    9: "Slot 2",
    10: "370 Pin Socket",
    11: "Slot A",
    12: "Slot M",
    13: "423",
    14: "A (Socket 462)",
    15: "478",
    16: "754",
    17: "940",
    18: "939",
    19: "mPGA604",
    20: "LGA771",
    21: "LGA775",
    22: "S1",
    23: "AM2",
    24: "F (1207)",
    25: "LGA1366",
    26: "G34",
    27: "AM3",
    28: "C32",
    29: "LGA1156",
    30: "LGA1567",
    31: "PGA988A",
    32: "BGA1288",
    33: "rPGA988B",
    34: "BGA1023",
    35: "BGA1224",
    36: "LGA1155",
    37: "LGA1356",
    38: "LGA2011",
    39: "FS1",
    40: "FS2",
    41: "FM1",
    42: "FM2",
    43: "LGA2011-3",
    44: "LGA1356-3",
    45: "LGA1150",
    46: "BGA1168",
    47: "BGA1234",
    48: "BGA1364",
    49: "AM4",
    50: "LGA1151",
    51: "BGA1356",
    52: "BGA1440",
    53: "BGA1515",
    54: "LGA3647-1",
    55: "SP3",
    56: "SP3r2",
    57: "LGA2066",
    58: "BGA1392",
    59: "BGA1510",
    60: "BGA1528",
    61: "LGA4189",
    62: "LGA1200",
    63: "LGA4677",
    64: "LGA1700",
    65: "BGA1744",
    66: "BGA1781",
    67: "BGA1211",
    68: "BGA2422",
    69: "LGA1211",
    70: "LGA2422",
    71: "LGA5773",
    72: "BGA5773",
    73: "AM5",
    74: "SP5",
    75: "SP6",
    76: "BGA883",
    77: "BGA1190",
    78: "BGA4129",
    79: "LGA4710",
    80: "LGA7529",
    81: "BGA1964",
    82: "BGA1792",
    83: "BGA2049",
    84: "BGA2551",
    85: "LGA1851",
    86: "BGA2114",
    87: "BGA2833"
  }, p = {
    LGA1150: "i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",
    LGA1151: "i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",
    1155: "G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"
  };
  function h(a) {
    let I = "";
    for (const t in p)
      p[t].split(" ").forEach((D) => {
        a.indexOf(D) >= 0 && (I = t);
      });
    return I;
  }
  function E(a) {
    let I = a;
    return a = a.toLowerCase(), a.indexOf("intel") >= 0 && (I = "Intel"), a.indexOf("amd") >= 0 && (I = "AMD"), a.indexOf("qemu") >= 0 && (I = "QEMU"), a.indexOf("hygon") >= 0 && (I = "Hygon"), a.indexOf("centaur") >= 0 && (I = "WinChip/Via"), a.indexOf("vmware") >= 0 && (I = "VMware"), a.indexOf("Xen") >= 0 && (I = "Xen Hypervisor"), a.indexOf("tcg") >= 0 && (I = "QEMU"), a.indexOf("apple") >= 0 && (I = "Apple"), a.indexOf("sifive") >= 0 && (I = "SiFive"), a.indexOf("thead") >= 0 && (I = "T-Head"), a.indexOf("andestech") >= 0 && (I = "Andes Technology"), I;
  }
  function u(a) {
    a.brand = a.brand.replace(/\(R\)+/g, "®").replace(/\s+/g, " ").trim(), a.brand = a.brand.replace(/\(TM\)+/g, "™").replace(/\s+/g, " ").trim(), a.brand = a.brand.replace(/\(C\)+/g, "©").replace(/\s+/g, " ").trim(), a.brand = a.brand.replace(/CPU+/g, "").replace(/\s+/g, " ").trim(), a.manufacturer = E(a.brand);
    let I = a.brand.split(" ");
    return I.shift(), a.brand = I.join(" "), a;
  }
  function r(a) {
    let I = "0";
    for (let t in H)
      if ({}.hasOwnProperty.call(H, t)) {
        let l = t.split("|"), D = 0;
        l.forEach((f) => {
          a.indexOf(f) > -1 && D++;
        }), D === l.length && (I = H[t]);
      }
    return parseFloat(I);
  }
  function Q() {
    return new Promise((a) => {
      process.nextTick(() => {
        const I = "unknown";
        let t = {
          manufacturer: I,
          brand: I,
          vendor: "",
          family: "",
          model: "",
          stepping: "",
          revision: "",
          voltage: "",
          speed: 0,
          speedMin: 0,
          speedMax: 0,
          governor: "",
          cores: o.cores(),
          physicalCores: o.cores(),
          performanceCores: o.cores(),
          efficiencyCores: 0,
          processors: 1,
          socket: "",
          flags: "",
          virtualization: !1,
          cache: {}
        };
        k().then((l) => {
          if (t.flags = l, t.virtualization = l.indexOf("vmx") > -1 || l.indexOf("svm") > -1, x && e("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily", (D, f) => {
            const w = f.toString().split(`
`), _ = o.getValue(w, "machdep.cpu.brand_string").split("@");
            t.brand = _[0].trim();
            const G = _[1] ? _[1].trim() : "0";
            t.speed = parseFloat(G.replace(/GHz+/g, ""));
            let q = o.getValue(w, "hw.tbfrequency") / 1e9;
            q = q < 0.1 ? q * 100 : q, t.speed = t.speed === 0 ? q : t.speed, z = t.speed, t = u(t), t.speedMin = o.getValue(w, "hw.cpufrequency_min") ? o.getValue(w, "hw.cpufrequency_min") / 1e9 : t.speed, t.speedMax = o.getValue(w, "hw.cpufrequency_max") ? o.getValue(w, "hw.cpufrequency_max") / 1e9 : t.speed, t.vendor = o.getValue(w, "machdep.cpu.vendor") || "Apple", t.family = o.getValue(w, "machdep.cpu.family") || o.getValue(w, "hw.cpufamily"), t.model = o.getValue(w, "machdep.cpu.model"), t.stepping = o.getValue(w, "machdep.cpu.stepping") || o.getValue(w, "hw.cpusubfamily"), t.virtualization = !0;
            const j = o.getValue(w, "hw.packages"), aA = o.getValue(w, "hw.physicalcpu_max"), tA = o.getValue(w, "hw.ncpu");
            if (s.arch() === "arm64") {
              t.socket = "SOC";
              try {
                const M = A("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split(`
`), O = M.filter((S) => S.indexOf('"E"') >= 0).length, T = M.filter((S) => S.indexOf('"P"') >= 0).length;
                t.efficiencyCores = O, t.performanceCores = T;
              } catch {
                o.noop();
              }
            }
            j && (t.processors = parseInt(j, 10) || 1), aA && tA && (t.cores = parseInt(tA) || o.cores(), t.physicalCores = parseInt(aA) || o.cores()), K().then((M) => {
              t.cache = M, a(t);
            });
          }), F) {
            let D = "", f = [];
            s.cpus()[0] && s.cpus()[0].model && (D = s.cpus()[0].model), e('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', (w, Y) => {
              w || (f = Y.toString().split(`
`)), D = o.getValue(f, "model name") || D, D = o.getValue(f, "bios model name") || D, D = o.cleanString(D);
              const _ = D.split("@");
              if (t.brand = _[0].trim(), t.brand.indexOf("Unknown") >= 0 && (t.brand = t.brand.split("Unknown")[0].trim()), t.speed = _[1] ? parseFloat(_[1].trim()) : 0, t.speed === 0 && (t.brand.indexOf("AMD") > -1 || t.brand.toLowerCase().indexOf("ryzen") > -1) && (t.speed = r(t.brand)), t.speed === 0) {
                const O = c();
                O.avg !== 0 && (t.speed = O.avg);
              }
              z = t.speed, t.speedMin = Math.round(parseFloat(o.getValue(f, "cpu min mhz").replace(/,/g, ".")) / 10) / 100, t.speedMax = Math.round(parseFloat(o.getValue(f, "cpu max mhz").replace(/,/g, ".")) / 10) / 100, t = u(t), t.vendor = E(o.getValue(f, "vendor id")), t.family = o.getValue(f, "cpu family"), t.model = o.getValue(f, "model:"), t.stepping = o.getValue(f, "stepping"), t.revision = o.getValue(f, "cpu revision"), t.cache.l1d = o.getValue(f, "l1d cache"), t.cache.l1d && (t.cache.l1d = parseInt(t.cache.l1d) * (t.cache.l1d.indexOf("M") !== -1 ? 1024 * 1024 : t.cache.l1d.indexOf("K") !== -1 ? 1024 : 1)), t.cache.l1i = o.getValue(f, "l1i cache"), t.cache.l1i && (t.cache.l1i = parseInt(t.cache.l1i) * (t.cache.l1i.indexOf("M") !== -1 ? 1024 * 1024 : t.cache.l1i.indexOf("K") !== -1 ? 1024 : 1)), t.cache.l2 = o.getValue(f, "l2 cache"), t.cache.l2 && (t.cache.l2 = parseInt(t.cache.l2) * (t.cache.l2.indexOf("M") !== -1 ? 1024 * 1024 : t.cache.l2.indexOf("K") !== -1 ? 1024 : 1)), t.cache.l3 = o.getValue(f, "l3 cache"), t.cache.l3 && (t.cache.l3 = parseInt(t.cache.l3) * (t.cache.l3.indexOf("M") !== -1 ? 1024 * 1024 : t.cache.l3.indexOf("K") !== -1 ? 1024 : 1));
              const G = o.getValue(f, "thread(s) per core") || "1", q = o.getValue(f, "socket(s)") || "1", j = parseInt(G, 10), aA = parseInt(q, 10) || 1, tA = parseInt(o.getValue(f, "core(s) per socket"), 10);
              if (t.physicalCores = tA ? tA * aA : t.cores / j, t.performanceCores = j > 1 ? t.cores - t.physicalCores : t.cores, t.efficiencyCores = j > 1 ? t.cores - j * t.performanceCores : 0, t.processors = aA, t.governor = o.getValue(f, "governor") || "", t.vendor === "ARM" && o.isRaspberry()) {
                const O = o.decodePiCpuinfo();
                t.family = t.manufacturer, t.manufacturer = O.manufacturer, t.brand = O.processor, t.revision = O.revisionCode, t.socket = "SOC";
              }
              if (o.getValue(f, "architecture") === "riscv64") {
                const O = g.readFileSync("/proc/cpuinfo").toString().split(`
`), T = o.getValue(O, "uarch") || "";
                if (T.indexOf(",") > -1) {
                  const S = T.split(",");
                  t.manufacturer = E(S[0]), t.brand = S[1];
                }
              }
              let M = [];
              e('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL', (O, T) => {
                M = T.toString().split(`
`), M && M.length && (t.socket = o.getValue(M, "Upgrade").replace("Socket", "").trim() || t.socket), a(t);
              });
            });
          }
          if (X || W || eA) {
            let D = "", f = [];
            s.cpus()[0] && s.cpus()[0].model && (D = s.cpus()[0].model), e("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL", (w, Y) => {
              let _ = [];
              if (!w) {
                const tA = Y.toString().split("# dmidecode"), M = tA.length > 1 ? tA[1] : "";
                _ = tA.length > 2 ? tA[2].split("Cache Information") : [], f = M.split(`
`);
              }
              if (t.brand = D.split("@")[0].trim(), t.speed = D.split("@")[1] ? parseFloat(D.split("@")[1].trim()) : 0, t.speed === 0 && (t.brand.indexOf("AMD") > -1 || t.brand.toLowerCase().indexOf("ryzen") > -1) && (t.speed = r(t.brand)), t.speed === 0) {
                const tA = c();
                tA.avg !== 0 && (t.speed = tA.avg);
              }
              z = t.speed, t.speedMin = t.speed, t.speedMax = Math.round(parseFloat(o.getValue(f, "max speed").replace(/Mhz/g, "")) / 10) / 100, t = u(t), t.vendor = E(o.getValue(f, "manufacturer"));
              let G = o.getValue(f, "signature");
              G = G.split(",");
              for (let tA = 0; tA < G.length; tA++)
                G[tA] = G[tA].trim();
              t.family = o.getValue(G, "Family", " ", !0), t.model = o.getValue(G, "Model", " ", !0), t.stepping = o.getValue(G, "Stepping", " ", !0), t.revision = "";
              const q = parseFloat(o.getValue(f, "voltage"));
              t.voltage = isNaN(q) ? "" : q.toFixed(2);
              for (let tA = 0; tA < _.length; tA++) {
                f = _[tA].split(`
`);
                let M = o.getValue(f, "Socket Designation").toLowerCase().replace(" ", "-").split("-");
                M = M.length ? M[0] : "";
                const O = o.getValue(f, "Installed Size").split(" ");
                let T = parseInt(O[0], 10);
                const S = O.length > 1 ? O[1] : "kb";
                T = T * (S === "kb" ? 1024 : S === "mb" ? 1024 * 1024 : S === "gb" ? 1024 * 1024 * 1024 : 1), M && (M === "l1" ? (t.cache[M + "d"] = T / 2, t.cache[M + "i"] = T / 2) : t.cache[M] = T);
              }
              t.socket = o.getValue(f, "Upgrade").replace("Socket", "").trim();
              const j = o.getValue(f, "thread count").trim(), aA = o.getValue(f, "core count").trim();
              aA && j && (t.cores = parseInt(j, 10), t.physicalCores = parseInt(aA, 10)), a(t);
            });
          }
          if (IA && a(t), b)
            try {
              const D = [];
              D.push(
                o.powerShell(
                  "Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl"
                )
              ), D.push(o.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")), D.push(o.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")), Promise.all(D).then((f) => {
                let w = f[0].split(`\r
`), Y = o.getValue(w, "name", ":") || "";
                Y.indexOf("@") >= 0 ? (t.brand = Y.split("@")[0].trim(), t.speed = Y.split("@")[1] ? parseFloat(Y.split("@")[1].trim()) : 0, z = t.speed) : (t.brand = Y.trim(), t.speed = 0), t = u(t), t.revision = o.getValue(w, "revision", ":"), t.vendor = o.getValue(w, "manufacturer", ":"), t.speedMax = Math.round(parseFloat(o.getValue(w, "maxclockspeed", ":").replace(/,/g, ".")) / 10) / 100, t.speed === 0 && (t.brand.indexOf("AMD") > -1 || t.brand.toLowerCase().indexOf("ryzen") > -1) && (t.speed = r(t.brand)), t.speed === 0 && (t.speed = t.speedMax), t.speedMin = t.speed;
                let _ = o.getValue(w, "description", ":").split(" ");
                for (let O = 0; O < _.length; O++)
                  _[O].toLowerCase().startsWith("family") && O + 1 < _.length && _[O + 1] && (t.family = _[O + 1]), _[O].toLowerCase().startsWith("model") && O + 1 < _.length && _[O + 1] && (t.model = _[O + 1]), _[O].toLowerCase().startsWith("stepping") && O + 1 < _.length && _[O + 1] && (t.stepping = _[O + 1]);
                const G = o.getValue(w, "UpgradeMethod", ":");
                y[G] && (t.socket = y[G]);
                const q = h(Y);
                q && (t.socket = q);
                const j = o.countLines(w, "Caption"), aA = o.getValue(w, "NumberOfLogicalProcessors", ":"), tA = o.getValue(w, "NumberOfCores", ":");
                j && (t.processors = parseInt(j) || 1), tA && aA && (t.cores = parseInt(aA) || o.cores(), t.physicalCores = parseInt(tA) || o.cores()), j > 1 && (t.cores = t.cores * j, t.physicalCores = t.physicalCores * j), t.cache = gA(f[0], f[1]);
                const M = f[2] ? f[2].toString().toLowerCase() : "";
                t.virtualization = M.indexOf("true") !== -1, a(t);
              });
            } catch {
              a(t);
            }
        });
      });
    });
  }
  function d(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        Q().then((t) => {
          a && a(t), I(t);
        });
      });
    });
  }
  cpu.cpu = d;
  function c() {
    const a = s.cpus();
    let I = 999999999, t = 0, l = 0;
    const D = [], f = [];
    if (a && a.length && Object.prototype.hasOwnProperty.call(a[0], "speed"))
      for (let w in a)
        f.push(a[w].speed > 100 ? (a[w].speed + 1) / 1e3 : a[w].speed / 10);
    else if (F)
      try {
        const w = A('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3', o.execOptsLinux).toString().split(`
`).filter((Y) => Y.length > 0);
        for (let Y in w)
          f.push(Math.floor(parseInt(w[Y], 10) / 10) / 100);
      } catch {
        o.noop();
      }
    if (f && f.length)
      try {
        for (const w in f)
          l = l + f[w], f[w] > t && (t = f[w]), f[w] < I && (I = f[w]), D.push(parseFloat(f[w].toFixed(2)));
        return l = l / f.length, {
          min: parseFloat(I.toFixed(2)),
          max: parseFloat(t.toFixed(2)),
          avg: parseFloat(l.toFixed(2)),
          cores: D
        };
      } catch {
        return {
          min: 0,
          max: 0,
          avg: 0,
          cores: D
        };
      }
    else
      return {
        min: 0,
        max: 0,
        avg: 0,
        cores: D
      };
  }
  function n(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        let t = c();
        if (t.avg === 0 && z !== 0) {
          const l = parseFloat(z);
          t = {
            min: l,
            max: l,
            avg: l,
            cores: []
          };
        }
        a && a(t), I(t);
      });
    });
  }
  cpu.cpuCurrentSpeed = n;
  function L(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        let t = {
          main: null,
          cores: [],
          max: null,
          socket: [],
          chipset: null
        };
        if (F) {
          try {
            const f = A('cat /sys/class/thermal/thermal_zone*/type  2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;', o.execOptsLinux).toString().split(`-----
`);
            if (f.length === 2) {
              const w = f[0].split(`
`), Y = f[1].split(`
`);
              for (let _ = 0; _ < w.length; _++) {
                const G = w[_].trim();
                G.startsWith("acpi") && Y[_] && t.socket.push(Math.round(parseInt(Y[_], 10) / 100) / 10), G.startsWith("pch") && Y[_] && (t.chipset = Math.round(parseInt(Y[_], 10) / 100) / 10);
              }
            }
          } catch {
            o.noop();
          }
          const l = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';
          try {
            e(l, (D, f) => {
              f = f.toString();
              const w = f.toLowerCase().indexOf("tdie");
              w !== -1 && (f = f.substring(w));
              const Y = f.split(`
`);
              let _ = 0;
              if (Y.forEach((G) => {
                const q = G.split("___"), j = q[0], aA = q.length > 1 && q[1] ? q[1] : "0";
                aA && j && j.toLowerCase() === "tctl" && (_ = t.main = Math.round(parseInt(aA, 10) / 100) / 10), aA && (j === void 0 || j && j.toLowerCase().startsWith("core")) ? t.cores.push(Math.round(parseInt(aA, 10) / 100) / 10) : aA && j && t.main === null && (j.toLowerCase().indexOf("package") >= 0 || j.toLowerCase().indexOf("physical") >= 0 || j.toLowerCase() === "tccd1") && (t.main = Math.round(parseInt(aA, 10) / 100) / 10);
              }), _ && t.main === null && (t.main = _), t.cores.length > 0) {
                t.main === null && (t.main = Math.round(t.cores.reduce((q, j) => q + j, 0) / t.cores.length));
                let G = Math.max.apply(Math, t.cores);
                t.max = G > t.main ? G : t.main;
              }
              if (t.main !== null) {
                t.max === null && (t.max = t.main), a && a(t), I(t);
                return;
              }
              e("sensors", (G, q) => {
                if (!G) {
                  const j = q.toString().split(`
`);
                  let aA = null, tA = !0, M = "";
                  if (j.forEach((O) => {
                    O.trim() === "" ? tA = !0 : tA && (O.trim().toLowerCase().startsWith("acpi") && (M = "acpi"), O.trim().toLowerCase().startsWith("pch") && (M = "pch"), O.trim().toLowerCase().startsWith("core") && (M = "core"), O.trim().toLowerCase().startsWith("k10temp") && (M = "coreAMD"), tA = !1);
                    const T = /[+-]([^°]*)/g, S = O.match(T), AA = O.split(":")[0].toUpperCase();
                    M === "acpi" ? AA.indexOf("TEMP") !== -1 && t.socket.push(parseFloat(S)) : M === "pch" && AA.indexOf("TEMP") !== -1 && !t.chipset && (t.chipset = parseFloat(S)), (AA.indexOf("PHYSICAL") !== -1 || AA.indexOf("PACKAGE") !== -1 || M === "coreAMD" && AA.indexOf("TDIE") !== -1 || AA.indexOf("TEMP") !== -1) && (t.main = parseFloat(S)), AA.indexOf("CORE ") !== -1 && t.cores.push(parseFloat(S)), AA.indexOf("TDIE") !== -1 && aA === null && (aA = parseFloat(S));
                  }), t.cores.length > 0) {
                    t.main = Math.round(t.cores.reduce((T, S) => T + S, 0) / t.cores.length);
                    const O = Math.max.apply(Math, t.cores);
                    t.max = O > t.main ? O : t.main;
                  } else
                    t.main === null && aA !== null && (t.main = aA, t.max = aA);
                  if (t.main !== null && t.max === null && (t.max = t.main), t.main !== null || t.max !== null) {
                    a && a(t), I(t);
                    return;
                  }
                }
                g.stat("/sys/class/thermal/thermal_zone0/temp", (j) => {
                  j === null ? g.readFile("/sys/class/thermal/thermal_zone0/temp", (aA, tA) => {
                    if (!aA) {
                      const M = tA.toString().split(`
`);
                      M.length > 0 && (t.main = parseFloat(M[0]) / 1e3, t.max = t.main);
                    }
                    a && a(t), I(t);
                  }) : e("/opt/vc/bin/vcgencmd measure_temp", (aA, tA) => {
                    if (!aA) {
                      const M = tA.toString().split(`
`);
                      M.length > 0 && M[0].indexOf("=") && (t.main = parseFloat(M[0].split("=")[1]), t.max = t.main);
                    }
                    a && a(t), I(t);
                  });
                });
              });
            });
          } catch {
            a && a(t), I(t);
          }
        }
        if ((X || W || eA) && e("sysctl dev.cpu | grep temp", (l, D) => {
          if (!l) {
            const f = D.toString().split(`
`);
            let w = 0;
            f.forEach((Y) => {
              const _ = Y.split(":");
              if (_.length > 1) {
                const G = parseFloat(_[1].replace(",", "."));
                G > t.max && (t.max = G), w = w + G, t.cores.push(G);
              }
            }), t.cores.length && (t.main = Math.round(w / t.cores.length * 100) / 100);
          }
          a && a(t), I(t);
        }), x) {
          try {
            if (t = require("osx-temperature-sensor").cpuTemperature(), t.main && (t.main = Math.round(t.main * 100) / 100), t.max && (t.max = Math.round(t.max * 100) / 100), t && t.cores && t.cores.length)
              for (let D = 0; D < t.cores.length; D++)
                t.cores[D] = Math.round(t.cores[D] * 100) / 100;
          } catch {
            o.noop();
          }
          try {
            const D = require("macos-temperature-sensor").temperature();
            if (D.cpu && (t.main = Math.round(D.cpu * 100) / 100, t.max = t.main), D.soc && (t.chipset = Math.round(D.soc * 100) / 100), D && D.cpuDieTemps.length)
              for (const f of D.cpuDieTemps)
                t.cores.push(Math.round(f * 100) / 100);
          } catch {
            o.noop();
          }
          a && a(t), I(t);
        }
        if (IA && (a && a(t), I(t)), b)
          try {
            o.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then((l, D) => {
              if (!D) {
                let f = 0;
                l.split(`\r
`).filter((Y) => Y.trim() !== "").filter((Y, _) => _ > 0).forEach((Y) => {
                  const _ = (parseInt(Y, 10) - 2732) / 10;
                  isNaN(_) || (f = f + _, _ > t.max && (t.max = _), t.cores.push(_));
                }), t.cores.length && (t.main = f / t.cores.length);
              }
              a && a(t), I(t);
            });
          } catch {
            a && a(t), I(t);
          }
      });
    });
  }
  cpu.cpuTemperature = L;
  function k(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        let t = "";
        if (b)
          try {
            e('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet', o.execOptsWin, (l, D) => {
              if (!l) {
                let f = D.split("0x").pop().trim(), w = parseInt(f, 16).toString(2), Y = "0".repeat(32 - w.length) + w, _ = [
                  "fpu",
                  "vme",
                  "de",
                  "pse",
                  "tsc",
                  "msr",
                  "pae",
                  "mce",
                  "cx8",
                  "apic",
                  "",
                  "sep",
                  "mtrr",
                  "pge",
                  "mca",
                  "cmov",
                  "pat",
                  "pse-36",
                  "psn",
                  "clfsh",
                  "",
                  "ds",
                  "acpi",
                  "mmx",
                  "fxsr",
                  "sse",
                  "sse2",
                  "ss",
                  "htt",
                  "tm",
                  "ia64",
                  "pbe"
                ];
                for (let G = 0; G < _.length; G++)
                  Y[G] === "1" && _[G] !== "" && (t += " " + _[G]);
                t = t.trim().toLowerCase();
              }
              a && a(t), I(t);
            });
          } catch {
            a && a(t), I(t);
          }
        if (F)
          try {
            e("export LC_ALL=C; lscpu; unset LC_ALL", (l, D) => {
              l || D.toString().split(`
`).forEach((w) => {
                w.split(":")[0].toUpperCase().indexOf("FLAGS") !== -1 && (t = w.split(":")[1].trim().toLowerCase());
              }), t ? (a && a(t), I(t)) : g.readFile("/proc/cpuinfo", (f, w) => {
                if (!f) {
                  let Y = w.toString().split(`
`);
                  t = o.getValue(Y, "features", ":", !0).toLowerCase();
                }
                a && a(t), I(t);
              });
            });
          } catch {
            a && a(t), I(t);
          }
        (X || W || eA) && e("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL", (l, D) => {
          const f = [];
          if (!l) {
            const w = D.toString().split("	Flags:");
            (w.length > 1 ? w[1].split("	Version:")[0].split(`
`) : []).forEach((_) => {
              const G = (_.indexOf("(") ? _.split("(")[0].toLowerCase() : "").trim().replace(/\t/g, "");
              G && f.push(G);
            });
          }
          t = f.join(" ").trim().toLowerCase(), a && a(t), I(t);
        }), x && e("sysctl machdep.cpu.features", (l, D) => {
          if (!l) {
            let f = D.toString().split(`
`);
            f.length > 0 && f[0].indexOf("machdep.cpu.features:") !== -1 && (t = f[0].split(":")[1].trim().toLowerCase());
          }
          a && a(t), I(t);
        }), IA && (a && a(t), I(t));
      });
    });
  }
  cpu.cpuFlags = k;
  function K(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        let t = {
          l1d: null,
          l1i: null,
          l2: null,
          l3: null
        };
        if (F)
          try {
            e("export LC_ALL=C; lscpu; unset LC_ALL", (l, D) => {
              l || D.toString().split(`
`).forEach((w) => {
                const Y = w.split(":");
                Y[0].toUpperCase().indexOf("L1D CACHE") !== -1 && (t.l1d = parseInt(Y[1].trim()) * (Y[1].indexOf("M") !== -1 ? 1024 * 1024 : Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toUpperCase().indexOf("L1I CACHE") !== -1 && (t.l1i = parseInt(Y[1].trim()) * (Y[1].indexOf("M") !== -1 ? 1024 * 1024 : Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toUpperCase().indexOf("L2 CACHE") !== -1 && (t.l2 = parseInt(Y[1].trim()) * (Y[1].indexOf("M") !== -1 ? 1024 * 1024 : Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toUpperCase().indexOf("L3 CACHE") !== -1 && (t.l3 = parseInt(Y[1].trim()) * (Y[1].indexOf("M") !== -1 ? 1024 * 1024 : Y[1].indexOf("K") !== -1 ? 1024 : 1));
              }), a && a(t), I(t);
            });
          } catch {
            a && a(t), I(t);
          }
        if ((X || W || eA) && e("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL", (l, D) => {
          let f = [];
          l || (f = D.toString().split("Cache Information"), f.shift());
          for (let w = 0; w < f.length; w++) {
            const Y = f[w].split(`
`);
            let _ = o.getValue(Y, "Socket Designation").toLowerCase().replace(" ", "-").split("-");
            _ = _.length ? _[0] : "";
            const G = o.getValue(Y, "Installed Size").split(" ");
            let q = parseInt(G[0], 10);
            const j = G.length > 1 ? G[1] : "kb";
            q = q * (j === "kb" ? 1024 : j === "mb" ? 1024 * 1024 : j === "gb" ? 1024 * 1024 * 1024 : 1), _ && (_ === "l1" ? (t.cache[_ + "d"] = q / 2, t.cache[_ + "i"] = q / 2) : t.cache[_] = q);
          }
          a && a(t), I(t);
        }), x && e("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize", (l, D) => {
          l || D.toString().split(`
`).forEach((w) => {
            let Y = w.split(":");
            Y[0].toLowerCase().indexOf("hw.l1icachesize") !== -1 && (t.l1d = parseInt(Y[1].trim()) * (Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toLowerCase().indexOf("hw.l1dcachesize") !== -1 && (t.l1i = parseInt(Y[1].trim()) * (Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toLowerCase().indexOf("hw.l2cachesize") !== -1 && (t.l2 = parseInt(Y[1].trim()) * (Y[1].indexOf("K") !== -1 ? 1024 : 1)), Y[0].toLowerCase().indexOf("hw.l3cachesize") !== -1 && (t.l3 = parseInt(Y[1].trim()) * (Y[1].indexOf("K") !== -1 ? 1024 : 1));
          }), a && a(t), I(t);
        }), IA && (a && a(t), I(t)), b)
          try {
            const l = [];
            l.push(o.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")), l.push(o.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")), Promise.all(l).then((D) => {
              t = gA(D[0], D[1]), a && a(t), I(t);
            });
          } catch {
            a && a(t), I(t);
          }
      });
    });
  }
  function gA(a, I) {
    const t = {
      l1d: null,
      l1i: null,
      l2: null,
      l3: null
    };
    let l = a.split(`\r
`);
    t.l1d = 0, t.l1i = 0, t.l2 = o.getValue(l, "l2cachesize", ":"), t.l3 = o.getValue(l, "l3cachesize", ":"), t.l2 ? t.l2 = parseInt(t.l2, 10) * 1024 : t.l2 = 0, t.l3 ? t.l3 = parseInt(t.l3, 10) * 1024 : t.l3 = 0;
    const D = I.split(/\n\s*\n/);
    let f = 0, w = 0, Y = 0;
    return D.forEach((_) => {
      const G = _.split(`\r
`), q = o.getValue(G, "CacheType"), j = o.getValue(G, "Level"), aA = o.getValue(G, "InstalledSize");
      j === "3" && q === "3" && (t.l1i = t.l1i + parseInt(aA, 10) * 1024), j === "3" && q === "4" && (t.l1d = t.l1d + parseInt(aA, 10) * 1024), j === "3" && q === "5" && (f = parseInt(aA, 10) / 2, w = parseInt(aA, 10) / 2), j === "4" && q === "5" && (Y = Y + parseInt(aA, 10) * 1024);
    }), !t.l1i && !t.l1d && (t.l1i = f, t.l1d = w), Y && (t.l2 = Y), t;
  }
  cpu.cpuCache = K;
  function v() {
    return new Promise((a) => {
      process.nextTick(() => {
        const I = s.loadavg().map((f) => f / o.cores()), t = parseFloat(Math.max.apply(Math, I).toFixed(2));
        let l = {};
        if (Date.now() - N.ms >= 200) {
          N.ms = Date.now();
          const f = s.cpus().map((S) => (S.times.steal = 0, S.times.guest = 0, S));
          let w = 0, Y = 0, _ = 0, G = 0, q = 0, j = 0, aA = 0;
          const tA = [];
          if ($ = f && f.length ? f.length : 0, F)
            try {
              const S = A("cat /proc/stat 2>/dev/null | grep cpu", o.execOptsLinux).toString().split(`
`);
              if (S.length > 1 && (S.shift(), S.length === f.length))
                for (let AA = 0; AA < S.length; AA++) {
                  let oA = S[AA].split(" ");
                  if (oA.length >= 10) {
                    const rA = parseFloat(oA[8]) || 0, cA = parseFloat(oA[9]) || 0;
                    f[AA].times.steal = rA, f[AA].times.guest = cA;
                  }
                }
            } catch {
              o.noop();
            }
          for (let S = 0; S < $; S++) {
            const AA = f[S].times;
            w += AA.user, Y += AA.sys, _ += AA.nice, q += AA.idle, G += AA.irq, j += AA.steal || 0, aA += AA.guest || 0;
            const oA = J && J[S] && J[S].totalTick ? J[S].totalTick : 0, rA = J && J[S] && J[S].totalLoad ? J[S].totalLoad : 0, cA = J && J[S] && J[S].user ? J[S].user : 0, lA = J && J[S] && J[S].sys ? J[S].sys : 0, pA = J && J[S] && J[S].nice ? J[S].nice : 0, BA = J && J[S] && J[S].idle ? J[S].idle : 0, uA = J && J[S] && J[S].irq ? J[S].irq : 0, hA = J && J[S] && J[S].steal ? J[S].steal : 0, wA = J && J[S] && J[S].guest ? J[S].guest : 0;
            J[S] = AA, J[S].totalTick = J[S].user + J[S].sys + J[S].nice + J[S].irq + J[S].steal + J[S].guest + J[S].idle, J[S].totalLoad = J[S].user + J[S].sys + J[S].nice + J[S].irq + J[S].steal + J[S].guest, J[S].currentTick = J[S].totalTick - oA, J[S].load = J[S].totalLoad - rA, J[S].loadUser = J[S].user - cA, J[S].loadSystem = J[S].sys - lA, J[S].loadNice = J[S].nice - pA, J[S].loadIdle = J[S].idle - BA, J[S].loadIrq = J[S].irq - uA, J[S].loadSteal = J[S].steal - hA, J[S].loadGuest = J[S].guest - wA, tA[S] = {}, tA[S].load = J[S].load / J[S].currentTick * 100, tA[S].loadUser = J[S].loadUser / J[S].currentTick * 100, tA[S].loadSystem = J[S].loadSystem / J[S].currentTick * 100, tA[S].loadNice = J[S].loadNice / J[S].currentTick * 100, tA[S].loadIdle = J[S].loadIdle / J[S].currentTick * 100, tA[S].loadIrq = J[S].loadIrq / J[S].currentTick * 100, tA[S].loadSteal = J[S].loadSteal / J[S].currentTick * 100, tA[S].loadGuest = J[S].loadGuest / J[S].currentTick * 100, tA[S].rawLoad = J[S].load, tA[S].rawLoadUser = J[S].loadUser, tA[S].rawLoadSystem = J[S].loadSystem, tA[S].rawLoadNice = J[S].loadNice, tA[S].rawLoadIdle = J[S].loadIdle, tA[S].rawLoadIrq = J[S].loadIrq, tA[S].rawLoadSteal = J[S].loadSteal, tA[S].rawLoadGuest = J[S].loadGuest;
          }
          const M = w + Y + _ + G + j + aA + q, O = w + Y + _ + G + j + aA, T = M - N.tick;
          l = {
            avgLoad: t,
            currentLoad: (O - N.load) / T * 100,
            currentLoadUser: (w - N.user) / T * 100,
            currentLoadSystem: (Y - N.system) / T * 100,
            currentLoadNice: (_ - N.nice) / T * 100,
            currentLoadIdle: (q - N.idle) / T * 100,
            currentLoadIrq: (G - N.irq) / T * 100,
            currentLoadSteal: (j - N.steal) / T * 100,
            currentLoadGuest: (aA - N.guest) / T * 100,
            rawCurrentLoad: O - N.load,
            rawCurrentLoadUser: w - N.user,
            rawCurrentLoadSystem: Y - N.system,
            rawCurrentLoadNice: _ - N.nice,
            rawCurrentLoadIdle: q - N.idle,
            rawCurrentLoadIrq: G - N.irq,
            rawCurrentLoadSteal: j - N.steal,
            rawCurrentLoadGuest: aA - N.guest,
            cpus: tA
          }, N = {
            user: w,
            nice: _,
            system: Y,
            idle: q,
            irq: G,
            steal: j,
            guest: aA,
            tick: M,
            load: O,
            ms: N.ms,
            currentLoad: l.currentLoad,
            currentLoadUser: l.currentLoadUser,
            currentLoadSystem: l.currentLoadSystem,
            currentLoadNice: l.currentLoadNice,
            currentLoadIdle: l.currentLoadIdle,
            currentLoadIrq: l.currentLoadIrq,
            currentLoadSteal: l.currentLoadSteal,
            currentLoadGuest: l.currentLoadGuest,
            rawCurrentLoad: l.rawCurrentLoad,
            rawCurrentLoadUser: l.rawCurrentLoadUser,
            rawCurrentLoadSystem: l.rawCurrentLoadSystem,
            rawCurrentLoadNice: l.rawCurrentLoadNice,
            rawCurrentLoadIdle: l.rawCurrentLoadIdle,
            rawCurrentLoadIrq: l.rawCurrentLoadIrq,
            rawCurrentLoadSteal: l.rawCurrentLoadSteal,
            rawCurrentLoadGuest: l.rawCurrentLoadGuest
          };
        } else {
          const f = [];
          for (let w = 0; w < $; w++)
            f[w] = {}, f[w].load = J[w].load / J[w].currentTick * 100, f[w].loadUser = J[w].loadUser / J[w].currentTick * 100, f[w].loadSystem = J[w].loadSystem / J[w].currentTick * 100, f[w].loadNice = J[w].loadNice / J[w].currentTick * 100, f[w].loadIdle = J[w].loadIdle / J[w].currentTick * 100, f[w].loadIrq = J[w].loadIrq / J[w].currentTick * 100, f[w].rawLoad = J[w].load, f[w].rawLoadUser = J[w].loadUser, f[w].rawLoadSystem = J[w].loadSystem, f[w].rawLoadNice = J[w].loadNice, f[w].rawLoadIdle = J[w].loadIdle, f[w].rawLoadIrq = J[w].loadIrq, f[w].rawLoadSteal = J[w].loadSteal, f[w].rawLoadGuest = J[w].loadGuest;
          l = {
            avgLoad: t,
            currentLoad: N.currentLoad,
            currentLoadUser: N.currentLoadUser,
            currentLoadSystem: N.currentLoadSystem,
            currentLoadNice: N.currentLoadNice,
            currentLoadIdle: N.currentLoadIdle,
            currentLoadIrq: N.currentLoadIrq,
            currentLoadSteal: N.currentLoadSteal,
            currentLoadGuest: N.currentLoadGuest,
            rawCurrentLoad: N.rawCurrentLoad,
            rawCurrentLoadUser: N.rawCurrentLoadUser,
            rawCurrentLoadSystem: N.rawCurrentLoadSystem,
            rawCurrentLoadNice: N.rawCurrentLoadNice,
            rawCurrentLoadIdle: N.rawCurrentLoadIdle,
            rawCurrentLoadIrq: N.rawCurrentLoadIrq,
            rawCurrentLoadSteal: N.rawCurrentLoadSteal,
            rawCurrentLoadGuest: N.rawCurrentLoadGuest,
            cpus: f
          };
        }
        a(l);
      });
    });
  }
  function U(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        v().then((t) => {
          a && a(t), I(t);
        });
      });
    });
  }
  cpu.currentLoad = U;
  function V() {
    return new Promise((a) => {
      process.nextTick(() => {
        const I = s.cpus();
        let t = 0, l = 0, D = 0, f = 0, w = 0, Y = 0;
        if (I && I.length) {
          for (let G = 0, q = I.length; G < q; G++) {
            const j = I[G].times;
            t += j.user, l += j.sys, D += j.nice, f += j.irq, w += j.idle;
          }
          const _ = w + f + D + l + t;
          Y = (_ - w) / _ * 100;
        }
        a(Y);
      });
    });
  }
  function m(a) {
    return new Promise((I) => {
      process.nextTick(() => {
        V().then((t) => {
          a && a(t), I(t);
        });
      });
    });
  }
  return cpu.fullLoad = m, cpu;
}
var memory = {}, hasRequiredMemory;
function requireMemory() {
  if (hasRequiredMemory) return memory;
  hasRequiredMemory = 1;
  const s = require$$0$1, e = require$$1.exec, A = require$$1.execSync, g = requireUtil(), o = require$$1$1;
  let B = process.platform;
  const F = B === "linux" || B === "android", x = B === "darwin", b = B === "win32", X = B === "freebsd", W = B === "openbsd", eA = B === "netbsd", IA = B === "sunos", z = {
    "00CE": "Samsung Electronics Inc",
    "014F": "Transcend Information Inc.",
    "017A": "Apacer Technology Inc.",
    "0198": "HyperX",
    "029E": "Corsair",
    "02FE": "Elpida",
    "04CB": "A-DATA",
    "04CD": "G.Skill International Enterprise",
    "059B": "Crucial",
    1315: "Crucial",
    "2C00": "Micron Technology Inc.",
    5105: "Qimonda AG i. In.",
    "802C": "Micron Technology Inc.",
    "80AD": "Hynix Semiconductor Inc.",
    "80CE": "Samsung Electronics Inc.",
    8551: "Qimonda AG i. In.",
    "859B": "Crucial",
    AD00: "Hynix Semiconductor Inc.",
    CE00: "Samsung Electronics Inc.",
    SAMSUNG: "Samsung Electronics Inc.",
    HYNIX: "Hynix Semiconductor Inc.",
    "G-SKILL": "G-Skill International Enterprise",
    "G.SKILL": "G-Skill International Enterprise",
    TRANSCEND: "Transcend Information",
    APACER: "Apacer Technology Inc",
    MICRON: "Micron Technology Inc.",
    QIMONDA: "Qimonda AG i. In."
  };
  function N($) {
    return new Promise((H) => {
      process.nextTick(() => {
        let y = {
          total: s.totalmem(),
          free: s.freemem(),
          used: s.totalmem() - s.freemem(),
          active: s.totalmem() - s.freemem(),
          // temporarily (fallback)
          available: s.freemem(),
          // temporarily (fallback)
          buffers: 0,
          cached: 0,
          slab: 0,
          buffcache: 0,
          reclaimable: 0,
          swaptotal: 0,
          swapused: 0,
          swapfree: 0,
          writeback: null,
          dirty: null
        };
        if (F)
          try {
            o.readFile("/proc/meminfo", (p, h) => {
              if (!p) {
                const E = h.toString().split(`
`);
                y.total = parseInt(g.getValue(E, "memtotal"), 10), y.total = y.total ? y.total * 1024 : s.totalmem(), y.free = parseInt(g.getValue(E, "memfree"), 10), y.free = y.free ? y.free * 1024 : s.freemem(), y.used = y.total - y.free, y.buffers = parseInt(g.getValue(E, "buffers"), 10), y.buffers = y.buffers ? y.buffers * 1024 : 0, y.cached = parseInt(g.getValue(E, "cached"), 10), y.cached = y.cached ? y.cached * 1024 : 0, y.slab = parseInt(g.getValue(E, "slab"), 10), y.slab = y.slab ? y.slab * 1024 : 0, y.buffcache = y.buffers + y.cached + y.slab;
                let u = parseInt(g.getValue(E, "memavailable"), 10);
                y.available = u ? u * 1024 : y.free + y.buffcache, y.active = y.total - y.available, y.swaptotal = parseInt(g.getValue(E, "swaptotal"), 10), y.swaptotal = y.swaptotal ? y.swaptotal * 1024 : 0, y.swapfree = parseInt(g.getValue(E, "swapfree"), 10), y.swapfree = y.swapfree ? y.swapfree * 1024 : 0, y.swapused = y.swaptotal - y.swapfree, y.writeback = parseInt(g.getValue(E, "writeback"), 10), y.writeback = y.writeback ? y.writeback * 1024 : 0, y.dirty = parseInt(g.getValue(E, "dirty"), 10), y.dirty = y.dirty ? y.dirty * 1024 : 0, y.reclaimable = parseInt(g.getValue(E, "sreclaimable"), 10), y.reclaimable = y.reclaimable ? y.reclaimable * 1024 : 0;
              }
              $ && $(y), H(y);
            });
          } catch {
            $ && $(y), H(y);
          }
        if (X || W || eA)
          try {
            e(
              "/sbin/sysctl hw.realmem hw.physmem vm.stats.vm.v_page_count vm.stats.vm.v_wire_count vm.stats.vm.v_active_count vm.stats.vm.v_inactive_count vm.stats.vm.v_cache_count vm.stats.vm.v_free_count vm.stats.vm.v_page_size",
              (p, h) => {
                if (!p) {
                  const E = h.toString().split(`
`), u = parseInt(g.getValue(E, "vm.stats.vm.v_page_size"), 10), r = parseInt(g.getValue(E, "vm.stats.vm.v_inactive_count"), 10) * u, Q = parseInt(g.getValue(E, "vm.stats.vm.v_cache_count"), 10) * u;
                  y.total = parseInt(g.getValue(E, "hw.realmem"), 10), isNaN(y.total) && (y.total = parseInt(g.getValue(E, "hw.physmem"), 10)), y.free = parseInt(g.getValue(E, "vm.stats.vm.v_free_count"), 10) * u, y.buffcache = r + Q, y.available = y.buffcache + y.free, y.active = y.total - y.free - y.buffcache, y.swaptotal = 0, y.swapfree = 0, y.swapused = 0;
                }
                $ && $(y), H(y);
              }
            );
          } catch {
            $ && $(y), H(y);
          }
        if (IA && ($ && $(y), H(y)), x) {
          let p = 4096;
          try {
            p = g.toInt(A("sysctl -n vm.pagesize").toString()) || p;
          } catch {
            g.noop();
          }
          try {
            e('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive"', (h, E) => {
              if (!h) {
                let u = E.toString().split(`
`);
                y.active = (parseInt(g.getValue(u, "Pages active"), 10) || 0) * p, y.reclaimable = (parseInt(g.getValue(u, "Pages inactive"), 10) || 0) * p, y.buffcache = y.used - y.active, y.available = y.free + y.buffcache;
              }
              e("sysctl -n vm.swapusage 2>/dev/null", (u, r) => {
                if (!u) {
                  let Q = r.toString().split(`
`);
                  Q.length > 0 && Q[0].replace(/,/g, ".").replace(/M/g, "").trim().split("  ").forEach((n) => {
                    n.toLowerCase().indexOf("total") !== -1 && (y.swaptotal = parseFloat(n.split("=")[1].trim()) * 1024 * 1024), n.toLowerCase().indexOf("used") !== -1 && (y.swapused = parseFloat(n.split("=")[1].trim()) * 1024 * 1024), n.toLowerCase().indexOf("free") !== -1 && (y.swapfree = parseFloat(n.split("=")[1].trim()) * 1024 * 1024);
                  });
                }
                $ && $(y), H(y);
              });
            });
          } catch {
            $ && $(y), H(y);
          }
        }
        if (b) {
          let p = 0, h = 0;
          try {
            g.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then((E, u) => {
              u || E.split(`\r
`).filter((Q) => Q.trim() !== "").filter((Q, d) => d > 0).forEach((Q) => {
                Q !== "" && (Q = Q.trim().split(/\s\s+/), p = p + (parseInt(Q[0], 10) || 0), h = h + (parseInt(Q[1], 10) || 0));
              }), y.swaptotal = p * 1024 * 1024, y.swapused = h * 1024 * 1024, y.swapfree = y.swaptotal - y.swapused, $ && $(y), H(y);
            });
          } catch {
            $ && $(y), H(y);
          }
        }
      });
    });
  }
  memory.mem = N;
  function J($) {
    function H(y) {
      const p = y.replace("0x", "").toUpperCase();
      return p.length >= 4 && {}.hasOwnProperty.call(z, p) ? z[p] : y;
    }
    return new Promise((y) => {
      process.nextTick(() => {
        let p = [];
        if ((F || X || W || eA) && e(
          'export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',
          (h, E) => {
            if (!h) {
              const u = E.toString().split("Memory Device");
              u.shift(), u.forEach((r) => {
                const Q = r.split(`
`), d = g.getValue(Q, "Size"), c = d.indexOf("GB") >= 0 ? parseInt(d, 10) * 1024 * 1024 * 1024 : parseInt(d, 10) * 1024 * 1024;
                let n = g.getValue(Q, "Bank Locator");
                if (n.toLowerCase().indexOf("bad") >= 0 && (n = ""), parseInt(g.getValue(Q, "Size"), 10) > 0) {
                  const L = g.toInt(g.getValue(Q, "Total Width")), k = g.toInt(g.getValue(Q, "Data Width"));
                  p.push({
                    size: c,
                    bank: n,
                    type: g.getValue(Q, "Type:"),
                    ecc: k && L ? L > k : !1,
                    clockSpeed: g.getValue(Q, "Configured Clock Speed:") ? parseInt(g.getValue(Q, "Configured Clock Speed:"), 10) : g.getValue(Q, "Speed:") ? parseInt(g.getValue(Q, "Speed:"), 10) : null,
                    formFactor: g.getValue(Q, "Form Factor:"),
                    manufacturer: H(g.getValue(Q, "Manufacturer:")),
                    partNum: g.getValue(Q, "Part Number:"),
                    serialNum: g.getValue(Q, "Serial Number:"),
                    voltageConfigured: parseFloat(g.getValue(Q, "Configured Voltage:")) || null,
                    voltageMin: parseFloat(g.getValue(Q, "Minimum Voltage:")) || null,
                    voltageMax: parseFloat(g.getValue(Q, "Maximum Voltage:")) || null
                  });
                } else
                  p.push({
                    size: 0,
                    bank: n,
                    type: "Empty",
                    ecc: null,
                    clockSpeed: 0,
                    formFactor: g.getValue(Q, "Form Factor:"),
                    partNum: "",
                    serialNum: "",
                    voltageConfigured: null,
                    voltageMin: null,
                    voltageMax: null
                  });
              });
            }
            if (!p.length) {
              p.push({
                size: s.totalmem(),
                bank: "",
                type: "",
                ecc: null,
                clockSpeed: 0,
                formFactor: "",
                partNum: "",
                serialNum: "",
                voltageConfigured: null,
                voltageMin: null,
                voltageMax: null
              });
              try {
                let u = A("cat /proc/cpuinfo 2>/dev/null", g.execOptsLinux), r = u.toString().split(`
`), Q = g.getValue(r, "revision", ":", !0).toLowerCase();
                if (g.isRaspberry(r)) {
                  const d = {
                    0: 400,
                    1: 450,
                    2: 450,
                    3: 3200,
                    4: 4267
                  };
                  p[0].type = "LPDDR2", p[0].type = Q && Q[2] && Q[2] === "3" ? "LPDDR4" : p[0].type, p[0].type = Q && Q[2] && Q[2] === "4" ? "LPDDR4X" : p[0].type, p[0].ecc = !1, p[0].clockSpeed = Q && Q[2] && d[Q[2]] || 400, p[0].clockSpeed = Q && Q[4] && Q[4] === "d" ? 500 : p[0].clockSpeed, p[0].formFactor = "SoC", u = A("vcgencmd get_config sdram_freq 2>/dev/null", g.execOptsLinux), r = u.toString().split(`
`);
                  let c = parseInt(g.getValue(r, "sdram_freq", "=", !0), 10) || 0;
                  c && (p[0].clockSpeed = c), u = A("vcgencmd measure_volts sdram_p 2>/dev/null", g.execOptsLinux), r = u.toString().split(`
`);
                  let n = parseFloat(g.getValue(r, "volt", "=", !0)) || 0;
                  n && (p[0].voltageConfigured = n, p[0].voltageMin = n, p[0].voltageMax = n);
                }
              } catch {
                g.noop();
              }
            }
            $ && $(p), y(p);
          }
        ), x && e("system_profiler SPMemoryDataType", (h, E) => {
          if (!h) {
            const u = E.toString().split(`
`), r = g.getValue(u, "ecc", ":", !0).toLowerCase();
            let Q = E.toString().split("        BANK "), d = !0;
            Q.length === 1 && (Q = E.toString().split("        DIMM"), d = !1), Q.shift(), Q.forEach((c) => {
              const n = c.split(`
`), L = (d ? "BANK " : "DIMM") + n[0].trim().split("/")[0], k = parseInt(g.getValue(n, "          Size"));
              k ? p.push({
                size: k * 1024 * 1024 * 1024,
                bank: L,
                type: g.getValue(n, "          Type:"),
                ecc: r ? r === "enabled" : null,
                clockSpeed: parseInt(g.getValue(n, "          Speed:"), 10),
                formFactor: "",
                manufacturer: H(g.getValue(n, "          Manufacturer:")),
                partNum: g.getValue(n, "          Part Number:"),
                serialNum: g.getValue(n, "          Serial Number:"),
                voltageConfigured: null,
                voltageMin: null,
                voltageMax: null
              }) : p.push({
                size: 0,
                bank: L,
                type: "Empty",
                ecc: null,
                clockSpeed: 0,
                formFactor: "",
                manufacturer: "",
                partNum: "",
                serialNum: "",
                voltageConfigured: null,
                voltageMin: null,
                voltageMax: null
              });
            });
          }
          if (!p.length) {
            const u = E.toString().split(`
`), r = parseInt(g.getValue(u, "      Memory:")), Q = g.getValue(u, "      Type:"), d = g.getValue(u, "      Manufacturer:");
            r && Q && p.push({
              size: r * 1024 * 1024 * 1024,
              bank: "0",
              type: Q,
              ecc: !1,
              clockSpeed: null,
              formFactor: "SOC",
              manufacturer: H(d),
              partNum: "",
              serialNum: "",
              voltageConfigured: null,
              voltageMin: null,
              voltageMax: null
            });
          }
          $ && $(p), y(p);
        }), IA && ($ && $(p), y(p)), b) {
          const h = "Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split(
            "|"
          ), E = "Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");
          try {
            g.powerShell(
              "Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,Speed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl"
            ).then((u, r) => {
              if (!r) {
                const Q = u.toString().split(/\n\s*\n/);
                Q.shift(), Q.forEach((d) => {
                  const c = d.split(`\r
`), n = g.toInt(g.getValue(c, "DataWidth", ":")), L = g.toInt(g.getValue(c, "TotalWidth", ":")), k = parseInt(g.getValue(c, "Capacity", ":"), 10) || 0, K = g.getValue(c, "Tag", ":"), gA = g.splitByNumber(K);
                  k && p.push({
                    size: k,
                    bank: g.getValue(c, "BankLabel", ":") + (gA[1] ? "/" + gA[1] : ""),
                    // BankLabel
                    type: h[parseInt(g.getValue(c, "MemoryType", ":"), 10) || parseInt(g.getValue(c, "SMBIOSMemoryType", ":"), 10)],
                    ecc: n && L ? L > n : !1,
                    clockSpeed: parseInt(g.getValue(c, "ConfiguredClockSpeed", ":"), 10) || parseInt(g.getValue(c, "Speed", ":"), 10) || 0,
                    formFactor: E[parseInt(g.getValue(c, "FormFactor", ":"), 10) || 0],
                    manufacturer: H(g.getValue(c, "Manufacturer", ":")),
                    partNum: g.getValue(c, "PartNumber", ":"),
                    serialNum: g.getValue(c, "SerialNumber", ":"),
                    voltageConfigured: (parseInt(g.getValue(c, "ConfiguredVoltage", ":"), 10) || 0) / 1e3,
                    voltageMin: (parseInt(g.getValue(c, "MinVoltage", ":"), 10) || 0) / 1e3,
                    voltageMax: (parseInt(g.getValue(c, "MaxVoltage", ":"), 10) || 0) / 1e3
                  });
                });
              }
              $ && $(p), y(p);
            });
          } catch {
            $ && $(p), y(p);
          }
        }
      });
    });
  }
  return memory.memLayout = J, memory;
}
var battery, hasRequiredBattery;
function requireBattery() {
  if (hasRequiredBattery) return battery;
  hasRequiredBattery = 1;
  const s = require$$1.exec, e = require$$1$1, A = requireUtil(), g = process.platform, o = g === "linux" || g === "android", B = g === "darwin", F = g === "win32", x = g === "freebsd", b = g === "openbsd", X = g === "netbsd", W = g === "sunos";
  function eA(IA, z, N) {
    const J = {};
    let $ = parseInt(A.getValue(IA, "BatteryStatus", ":").trim(), 10) || 0;
    if ($ >= 0) {
      const H = $;
      J.status = H, J.hasBattery = !0, J.maxCapacity = N || parseInt(A.getValue(IA, "DesignCapacity", ":") || 0), J.designedCapacity = parseInt(A.getValue(IA, "DesignCapacity", ":") || z), J.voltage = (parseInt(A.getValue(IA, "DesignVoltage", ":"), 10) || 0) / 1e3, J.capacityUnit = "mWh", J.percent = parseInt(A.getValue(IA, "EstimatedChargeRemaining", ":"), 10) || 0, J.currentCapacity = parseInt(J.maxCapacity * J.percent / 100), J.isCharging = H >= 6 && H <= 9 || H === 11 || H !== 3 && H !== 1 && J.percent < 100, J.acConnected = J.isCharging || H === 2, J.model = A.getValue(IA, "DeviceID", ":");
    } else
      J.status = -1;
    return J;
  }
  return battery = (IA) => new Promise((z) => {
    process.nextTick(() => {
      let N = {
        hasBattery: !1,
        cycleCount: 0,
        isCharging: !1,
        designedCapacity: 0,
        maxCapacity: 0,
        currentCapacity: 0,
        voltage: 0,
        capacityUnit: "",
        percent: 0,
        timeRemaining: null,
        acConnected: !0,
        type: "",
        model: "",
        manufacturer: "",
        serial: ""
      };
      if (o) {
        let J = "";
        e.existsSync("/sys/class/power_supply/BAT1/uevent") ? J = "/sys/class/power_supply/BAT1/" : e.existsSync("/sys/class/power_supply/BAT0/uevent") && (J = "/sys/class/power_supply/BAT0/");
        let $ = !1, H = "";
        e.existsSync("/sys/class/power_supply/AC/online") ? H = "/sys/class/power_supply/AC/online" : e.existsSync("/sys/class/power_supply/AC0/online") && (H = "/sys/class/power_supply/AC0/online"), H && ($ = e.readFileSync(H).toString().trim() === "1"), J ? e.readFile(J + "uevent", (y, p) => {
          if (y)
            IA && IA(N), z(N);
          else {
            let h = p.toString().split(`
`);
            N.isCharging = A.getValue(h, "POWER_SUPPLY_STATUS", "=").toLowerCase() === "charging", N.acConnected = $ || N.isCharging, N.voltage = parseInt("0" + A.getValue(h, "POWER_SUPPLY_VOLTAGE_NOW", "="), 10) / 1e6, N.capacityUnit = N.voltage ? "mWh" : "mAh", N.cycleCount = parseInt("0" + A.getValue(h, "POWER_SUPPLY_CYCLE_COUNT", "="), 10), N.maxCapacity = Math.round(parseInt("0" + A.getValue(h, "POWER_SUPPLY_CHARGE_FULL", "=", !0, !0), 10) / 1e3 * (N.voltage || 1));
            const E = parseInt("0" + A.getValue(h, "POWER_SUPPLY_VOLTAGE_MIN_DESIGN", "="), 10) / 1e6;
            N.designedCapacity = Math.round(
              parseInt("0" + A.getValue(h, "POWER_SUPPLY_CHARGE_FULL_DESIGN", "=", !0, !0), 10) / 1e3 * (E || N.voltage || 1)
            ), N.currentCapacity = Math.round(parseInt("0" + A.getValue(h, "POWER_SUPPLY_CHARGE_NOW", "="), 10) / 1e3 * (N.voltage || 1)), N.maxCapacity || (N.maxCapacity = parseInt("0" + A.getValue(h, "POWER_SUPPLY_ENERGY_FULL", "=", !0, !0), 10) / 1e3, N.designedCapacity = parseInt("0" + A.getValue(h, "POWER_SUPPLY_ENERGY_FULL_DESIGN", "=", !0, !0), 10) / 1e3 | N.maxCapacity, N.currentCapacity = parseInt("0" + A.getValue(h, "POWER_SUPPLY_ENERGY_NOW", "="), 10) / 1e3);
            const u = A.getValue(h, "POWER_SUPPLY_CAPACITY", "="), r = parseInt("0" + A.getValue(h, "POWER_SUPPLY_ENERGY_NOW", "="), 10), Q = parseInt("0" + A.getValue(h, "POWER_SUPPLY_POWER_NOW", "="), 10), d = parseInt("0" + A.getValue(h, "POWER_SUPPLY_CURRENT_NOW", "="), 10), c = parseInt("0" + A.getValue(h, "POWER_SUPPLY_CHARGE_NOW", "="), 10);
            N.percent = parseInt("0" + u, 10), N.maxCapacity && N.currentCapacity && (N.hasBattery = !0, u || (N.percent = 100 * N.currentCapacity / N.maxCapacity)), N.isCharging && (N.hasBattery = !0), r && Q ? N.timeRemaining = Math.floor(r / Q * 60) : d && c ? N.timeRemaining = Math.floor(c / d * 60) : d && N.currentCapacity && (N.timeRemaining = Math.floor(N.currentCapacity / d * 60)), N.type = A.getValue(h, "POWER_SUPPLY_TECHNOLOGY", "="), N.model = A.getValue(h, "POWER_SUPPLY_MODEL_NAME", "="), N.manufacturer = A.getValue(h, "POWER_SUPPLY_MANUFACTURER", "="), N.serial = A.getValue(h, "POWER_SUPPLY_SERIAL_NUMBER", "="), IA && IA(N), z(N);
          }
        }) : (IA && IA(N), z(N));
      }
      if ((x || b || X) && s("sysctl -i hw.acpi.battery hw.acpi.acline", (J, $) => {
        let H = $.toString().split(`
`);
        const y = parseInt("0" + A.getValue(H, "hw.acpi.battery.units"), 10), p = parseInt("0" + A.getValue(H, "hw.acpi.battery.life"), 10);
        N.hasBattery = y > 0, N.cycleCount = null, N.isCharging = A.getValue(H, "hw.acpi.acline") !== "1", N.acConnected = N.isCharging, N.maxCapacity = null, N.currentCapacity = null, N.capacityUnit = "unknown", N.percent = y ? p : null, IA && IA(N), z(N);
      }), B && s(
        'ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %',
        (J, $) => {
          if ($) {
            let H = $.toString().replace(/ +/g, "").replace(/"+/g, "").replace(/-/g, "").split(`
`);
            N.cycleCount = parseInt("0" + A.getValue(H, "cyclecount", "="), 10), N.voltage = parseInt("0" + A.getValue(H, "voltage", "="), 10) / 1e3, N.capacityUnit = N.voltage ? "mWh" : "mAh", N.maxCapacity = Math.round(parseInt("0" + A.getValue(H, "applerawmaxcapacity", "="), 10) * (N.voltage || 1)), N.currentCapacity = Math.round(parseInt("0" + A.getValue(H, "applerawcurrentcapacity", "="), 10) * (N.voltage || 1)), N.designedCapacity = Math.round(parseInt("0" + A.getValue(H, "DesignCapacity", "="), 10) * (N.voltage || 1)), N.manufacturer = "Apple", N.serial = A.getValue(H, "BatterySerialNumber", "=") || A.getValue(H, "Serial", "="), N.model = A.getValue(H, "DeviceName", "=");
            let y = null, h = A.getValue(H, "internal", "Battery").split(";");
            if (h && h[0]) {
              let E = h[0].split("	");
              E && E[1] && (y = parseFloat(E[1].trim().replace(/%/g, "")));
            }
            h && h[1] ? (N.isCharging = h[1].trim() === "charging", N.acConnected = h[1].trim() !== "discharging") : (N.isCharging = A.getValue(H, "ischarging", "=").toLowerCase() === "yes", N.acConnected = N.isCharging), N.maxCapacity && N.currentCapacity && (N.hasBattery = !0, N.type = "Li-ion", N.percent = y !== null ? y : Math.round(100 * N.currentCapacity / N.maxCapacity), N.isCharging || (N.timeRemaining = parseInt("0" + A.getValue(H, "TimeRemaining", "="), 10)));
          }
          IA && IA(N), z(N);
        }
      ), W && (IA && IA(N), z(N)), F)
        try {
          const J = [];
          J.push(A.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")), J.push(A.powerShell("(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")), J.push(A.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")), A.promiseAll(J).then(($) => {
            if ($) {
              const H = $.results[0].split(/\n\s*\n/), y = [], p = (u) => /\S/.test(u);
              for (let u = 0; u < H.length; u++)
                p(H[u]) && y.push(H[u]);
              const h = $.results[1].split(`\r
`).filter((u) => u), E = $.results[2].split(`\r
`).filter((u) => u);
              if (y.length) {
                let u = !1;
                const r = [];
                for (let Q = 0; Q < y.length; Q++) {
                  const d = y[Q].split(`\r
`), c = h && h.length >= Q + 1 && h[Q] ? A.toInt(h[Q]) : 0, n = E && E.length >= Q + 1 && E[Q] ? A.toInt(E[Q]) : 0, L = eA(d, c, n);
                  !u && L.status > 0 && L.status !== 10 ? (N.hasBattery = L.hasBattery, N.maxCapacity = L.maxCapacity, N.designedCapacity = L.designedCapacity, N.voltage = L.voltage, N.capacityUnit = L.capacityUnit, N.percent = L.percent, N.currentCapacity = L.currentCapacity, N.isCharging = L.isCharging, N.acConnected = L.acConnected, N.model = L.model, u = !0) : L.status !== -1 && r.push({
                    hasBattery: L.hasBattery,
                    maxCapacity: L.maxCapacity,
                    designedCapacity: L.designedCapacity,
                    voltage: L.voltage,
                    capacityUnit: L.capacityUnit,
                    percent: L.percent,
                    currentCapacity: L.currentCapacity,
                    isCharging: L.isCharging,
                    timeRemaining: null,
                    acConnected: L.acConnected,
                    model: L.model,
                    type: "",
                    manufacturer: "",
                    serial: ""
                  });
                }
                !u && r.length && (N = r[0], r.shift()), r.length && (N.additionalBatteries = r);
              }
            }
            IA && IA(N), z(N);
          });
        } catch {
          IA && IA(N), z(N);
        }
    });
  }), battery;
}
var graphics = {}, hasRequiredGraphics;
function requireGraphics() {
  if (hasRequiredGraphics) return graphics;
  hasRequiredGraphics = 1;
  const s = require$$1$1, e = require$$2, A = require$$1.exec, g = require$$1.execSync, o = requireUtil(), B = process.platform;
  let F = "";
  const x = B === "linux" || B === "android", b = B === "darwin", X = B === "win32", W = B === "freebsd", eA = B === "openbsd", IA = B === "netbsd", z = B === "sunos";
  let N = 0, J = 0, $ = 0, H = 0;
  const y = {
    "-2": "UNINITIALIZED",
    "-1": "OTHER",
    0: "HD15",
    1: "SVIDEO",
    2: "Composite video",
    3: "Component video",
    4: "DVI",
    5: "HDMI",
    6: "LVDS",
    8: "D_JPN",
    9: "SDI",
    10: "DP",
    11: "DP embedded",
    12: "UDI",
    13: "UDI embedded",
    14: "SDTVDONGLE",
    15: "MIRACAST",
    2147483648: "INTERNAL"
  };
  function p(Q) {
    const d = [
      { pattern: "^LG.+", manufacturer: "LG" },
      { pattern: "^BENQ.+", manufacturer: "BenQ" },
      { pattern: "^ASUS.+", manufacturer: "Asus" },
      { pattern: "^DELL.+", manufacturer: "Dell" },
      { pattern: "^SAMSUNG.+", manufacturer: "Samsung" },
      { pattern: "^VIEWSON.+", manufacturer: "ViewSonic" },
      { pattern: "^SONY.+", manufacturer: "Sony" },
      { pattern: "^ACER.+", manufacturer: "Acer" },
      { pattern: "^AOC.+", manufacturer: "AOC Monitors" },
      { pattern: "^HP.+", manufacturer: "HP" },
      { pattern: "^EIZO.?", manufacturer: "Eizo" },
      { pattern: "^PHILIPS.?", manufacturer: "Philips" },
      { pattern: "^IIYAMA.?", manufacturer: "Iiyama" },
      { pattern: "^SHARP.?", manufacturer: "Sharp" },
      { pattern: "^NEC.?", manufacturer: "NEC" },
      { pattern: "^LENOVO.?", manufacturer: "Lenovo" },
      { pattern: "COMPAQ.?", manufacturer: "Compaq" },
      { pattern: "APPLE.?", manufacturer: "Apple" },
      { pattern: "INTEL.?", manufacturer: "Intel" },
      { pattern: "AMD.?", manufacturer: "AMD" },
      { pattern: "NVIDIA.?", manufacturer: "NVDIA" }
    ];
    let c = "";
    return Q && (Q = Q.toUpperCase(), d.forEach((n) => {
      RegExp(n.pattern).test(Q) && (c = n.manufacturer);
    })), c;
  }
  function h(Q) {
    return {
      610: "Apple",
      "1e6d": "LG",
      "10ac": "DELL",
      "4dd9": "Sony",
      "38a3": "NEC"
    }[Q] || "";
  }
  function E(Q) {
    let d = "";
    return Q = (Q || "").toLowerCase(), Q.indexOf("apple") >= 0 ? d = "0x05ac" : Q.indexOf("nvidia") >= 0 ? d = "0x10de" : Q.indexOf("intel") >= 0 ? d = "0x8086" : (Q.indexOf("ati") >= 0 || Q.indexOf("amd") >= 0) && (d = "0x1002"), d;
  }
  function u(Q) {
    return {
      spdisplays_mtlgpufamilymac1: "mac1",
      spdisplays_mtlgpufamilymac2: "mac2",
      spdisplays_mtlgpufamilyapple1: "apple1",
      spdisplays_mtlgpufamilyapple2: "apple2",
      spdisplays_mtlgpufamilyapple3: "apple3",
      spdisplays_mtlgpufamilyapple4: "apple4",
      spdisplays_mtlgpufamilyapple5: "apple5",
      spdisplays_mtlgpufamilyapple6: "apple6",
      spdisplays_mtlgpufamilyapple7: "apple7",
      spdisplays_metalfeaturesetfamily11: "family1_v1",
      spdisplays_metalfeaturesetfamily12: "family1_v2",
      spdisplays_metalfeaturesetfamily13: "family1_v3",
      spdisplays_metalfeaturesetfamily14: "family1_v4",
      spdisplays_metalfeaturesetfamily21: "family2_v1"
    }[Q] || "";
  }
  function r(Q) {
    function d(a) {
      const I = {
        controllers: [],
        displays: []
      };
      try {
        return a.forEach((t) => {
          const l = (t.sppci_bus || "").indexOf("builtin") > -1 ? "Built-In" : (t.sppci_bus || "").indexOf("pcie") > -1 ? "PCIe" : "", D = (parseInt(t.spdisplays_vram || "", 10) || 0) * ((t.spdisplays_vram || "").indexOf("GB") > -1 ? 1024 : 1), f = (parseInt(t.spdisplays_vram_shared || "", 10) || 0) * ((t.spdisplays_vram_shared || "").indexOf("GB") > -1 ? 1024 : 1);
          let w = u(t.spdisplays_metal || t.spdisplays_metalfamily || "");
          I.controllers.push({
            vendor: p(t.spdisplays_vendor || "") || t.spdisplays_vendor || "",
            model: t.sppci_model || "",
            bus: l,
            vramDynamic: l === "Built-In",
            vram: D || f || null,
            deviceId: t["spdisplays_device-id"] || "",
            vendorId: t["spdisplays_vendor-id"] || E((t.spdisplays_vendor || "") + (t.sppci_model || "")),
            external: t.sppci_device_type === "spdisplays_egpu",
            cores: t.sppci_cores || null,
            metalVersion: w
          }), t.spdisplays_ndrvs && t.spdisplays_ndrvs.length && t.spdisplays_ndrvs.forEach((Y) => {
            const _ = Y.spdisplays_connection_type || "", G = (Y._spdisplays_resolution || "").split("@"), q = G[0].split("x"), j = (Y._spdisplays_pixels || "").split("x"), aA = Y.spdisplays_depth || "", tA = Y["_spdisplays_display-serial-number"] || Y["_spdisplays_display-serial-number2"] || null;
            I.displays.push({
              vendor: h(Y["_spdisplays_display-vendor-id"] || "") || p(Y._name || ""),
              vendorId: Y["_spdisplays_display-vendor-id"] || "",
              model: Y._name || "",
              productionYear: Y["_spdisplays_display-year"] || null,
              serial: tA !== "0" ? tA : null,
              displayId: Y._spdisplays_displayID || null,
              main: Y.spdisplays_main ? Y.spdisplays_main === "spdisplays_yes" : !1,
              builtin: (Y.spdisplays_display_type || "").indexOf("built-in") > -1,
              connection: _.indexOf("_internal") > -1 ? "Internal" : _.indexOf("_displayport") > -1 ? "Display Port" : _.indexOf("_hdmi") > -1 ? "HDMI" : null,
              sizeX: null,
              sizeY: null,
              pixelDepth: aA === "CGSThirtyBitColor" ? 30 : aA === "CGSThirtytwoBitColor" ? 32 : aA === "CGSTwentyfourBitColor" ? 24 : null,
              resolutionX: j.length > 1 ? parseInt(j[0], 10) : null,
              resolutionY: j.length > 1 ? parseInt(j[1], 10) : null,
              currentResX: q.length > 1 ? parseInt(q[0], 10) : null,
              currentResY: q.length > 1 ? parseInt(q[1], 10) : null,
              positionX: 0,
              positionY: 0,
              currentRefreshRate: G.length > 1 ? parseInt(G[1], 10) : null
            });
          });
        }), I;
      } catch {
        return I;
      }
    }
    function c(a) {
      let I = [], t = {
        vendor: "",
        subVendor: "",
        model: "",
        bus: "",
        busAddress: "",
        vram: null,
        vramDynamic: !1,
        pciID: ""
      }, l = !1, D = [];
      try {
        D = g('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', o.execOptsLinux).toString().split(`
`);
        for (let w = 0; w < D.length; w++)
          D[w] = D[w].replace("Bus Address:", "").replace("0000:", "").trim();
        D = D.filter((w) => w != null && w);
      } catch {
        o.noop();
      }
      let f = 1;
      return a.forEach((w) => {
        let Y = "";
        if (f < a.length && a[f] && (Y = a[f], Y.indexOf(":") > 0 && (Y = Y.split(":")[1])), w.trim() !== "") {
          if (w[0] !== " " && w[0] !== "	") {
            let _ = D.indexOf(w.split(" ")[0]) >= 0, G = w.toLowerCase().indexOf(" vga "), q = w.toLowerCase().indexOf("3d controller");
            if (G !== -1 || q !== -1) {
              q !== -1 && G === -1 && (G = q), (t.vendor || t.model || t.bus || t.vram !== null || t.vramDynamic) && (I.push(t), t = {
                vendor: "",
                model: "",
                bus: "",
                busAddress: "",
                vram: null,
                vramDynamic: !1
              });
              const j = w.split(" ")[0];
              /[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(j) && (t.busAddress = j), l = !0;
              let aA = w.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/), tA = w.substr(G, aA - G).split(":");
              if (t.busAddress = w.substr(0, G).trim(), tA.length > 1 && (tA[1] = tA[1].trim(), tA[1].toLowerCase().indexOf("corporation") >= 0 ? (t.vendor = tA[1].substr(0, tA[1].toLowerCase().indexOf("corporation") + 11).trim(), t.model = tA[1].substr(tA[1].toLowerCase().indexOf("corporation") + 11, 200).split("(")[0].trim(), t.bus = D.length > 0 && _ ? "PCIe" : "Onboard", t.vram = null, t.vramDynamic = !1) : tA[1].toLowerCase().indexOf(" inc.") >= 0 ? ((tA[1].match(/]/g) || []).length > 1 ? (t.vendor = tA[1].substr(0, tA[1].toLowerCase().indexOf("]") + 1).trim(), t.model = tA[1].substr(tA[1].toLowerCase().indexOf("]") + 1, 200).trim().split("(")[0].trim()) : (t.vendor = tA[1].substr(0, tA[1].toLowerCase().indexOf(" inc.") + 5).trim(), t.model = tA[1].substr(tA[1].toLowerCase().indexOf(" inc.") + 5, 200).trim().split("(")[0].trim()), t.bus = D.length > 0 && _ ? "PCIe" : "Onboard", t.vram = null, t.vramDynamic = !1) : tA[1].toLowerCase().indexOf(" ltd.") >= 0 && ((tA[1].match(/]/g) || []).length > 1 ? (t.vendor = tA[1].substr(0, tA[1].toLowerCase().indexOf("]") + 1).trim(), t.model = tA[1].substr(tA[1].toLowerCase().indexOf("]") + 1, 200).trim().split("(")[0].trim()) : (t.vendor = tA[1].substr(0, tA[1].toLowerCase().indexOf(" ltd.") + 5).trim(), t.model = tA[1].substr(tA[1].toLowerCase().indexOf(" ltd.") + 5, 200).trim().split("(")[0].trim())), t.model && Y.indexOf(t.model) !== -1)) {
                const M = Y.split(t.model)[0].trim();
                M && (t.subVendor = M);
              }
            } else
              l = !1;
          }
          if (l) {
            let _ = w.split(":");
            if (_.length > 1 && _[0].replace(/ +/g, "").toLowerCase().indexOf("devicename") !== -1 && _[1].toLowerCase().indexOf("onboard") !== -1 && (t.bus = "Onboard"), _.length > 1 && _[0].replace(/ +/g, "").toLowerCase().indexOf("region") !== -1 && _[1].toLowerCase().indexOf("memory") !== -1) {
              let G = _[1].split("=");
              G.length > 1 && (t.vram = parseInt(G[1]));
            }
          }
        }
        f++;
      }), (t.vendor || t.model || t.bus || t.busAddress || t.vram !== null || t.vramDynamic) && I.push(t), I;
    }
    function n(a, I) {
      const t = /\[([^\]]+)\]\s+(\w+)\s+(.*)/, l = I.reduce((D, f) => {
        const w = t.exec(f.trim());
        return w && (D[w[1]] || (D[w[1]] = {}), D[w[1]][w[2]] = w[3]), D;
      }, {});
      for (let D in l) {
        const f = l[D];
        if (f.CL_DEVICE_TYPE === "CL_DEVICE_TYPE_GPU") {
          let w;
          if (f.CL_DEVICE_TOPOLOGY_AMD) {
            const Y = f.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);
            Y && (w = Y[0]);
          } else if (f.CL_DEVICE_PCI_BUS_ID_NV && f.CL_DEVICE_PCI_SLOT_ID_NV) {
            const Y = parseInt(f.CL_DEVICE_PCI_BUS_ID_NV), _ = parseInt(f.CL_DEVICE_PCI_SLOT_ID_NV);
            if (!isNaN(Y) && !isNaN(_)) {
              const G = Y & 255, q = _ >> 3 & 255, j = _ & 7;
              w = `${G.toString().padStart(2, "0")}:${q.toString().padStart(2, "0")}.${j}`;
            }
          }
          if (w) {
            let Y = a.find((G) => G.busAddress === w);
            Y || (Y = {
              vendor: "",
              model: "",
              bus: "",
              busAddress: w,
              vram: null,
              vramDynamic: !1
            }, a.push(Y)), Y.vendor = f.CL_DEVICE_VENDOR, f.CL_DEVICE_BOARD_NAME_AMD ? Y.model = f.CL_DEVICE_BOARD_NAME_AMD : Y.model = f.CL_DEVICE_NAME;
            const _ = parseInt(f.CL_DEVICE_GLOBAL_MEM_SIZE);
            isNaN(_) || (Y.vram = Math.round(_ / 1024 / 1024));
          }
        }
      }
      return a;
    }
    function L() {
      if (F)
        return F;
      if (X)
        try {
          const a = e.join(o.WINDIR, "System32", "DriverStore", "FileRepository"), I = s.readdirSync(a, { withFileTypes: !0 }).filter((t) => t.isDirectory()).map((t) => {
            const l = e.join(a, t.name, "nvidia-smi.exe");
            try {
              const D = s.statSync(l);
              return { path: l, ctime: D.ctimeMs };
            } catch {
              return null;
            }
          }).filter(Boolean);
          I.length > 0 && (F = I.reduce((t, l) => l.ctime > t.ctime ? l : t).path);
        } catch {
          o.noop();
        }
      else x && (F = "nvidia-smi");
      return F;
    }
    function k(a) {
      const I = L();
      if (a = a || o.execOptsWin, I) {
        const l = `"${I}" --query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits`;
        x && (a.stdio = ["pipe", "pipe", "ignore"]);
        try {
          const D = l + (x ? "  2>/dev/null" : "") + (X ? "  2> nul" : "");
          return g(D, a).toString();
        } catch {
          o.noop();
        }
      }
      return "";
    }
    function K() {
      function a(D) {
        return [null, void 0].includes(D) ? D : parseFloat(D);
      }
      const I = k();
      if (!I)
        return [];
      let l = I.split(`
`).filter(Boolean).map((D) => {
        const f = D.split(", ").map((w) => w.includes("N/A") ? void 0 : w);
        return f.length === 16 ? {
          driverVersion: f[0],
          subDeviceId: f[1],
          name: f[2],
          pciBus: f[3],
          fanSpeed: a(f[4]),
          memoryTotal: a(f[5]),
          memoryUsed: a(f[6]),
          memoryFree: a(f[7]),
          utilizationGpu: a(f[8]),
          utilizationMemory: a(f[9]),
          temperatureGpu: a(f[10]),
          temperatureMemory: a(f[11]),
          powerDraw: a(f[12]),
          powerLimit: a(f[13]),
          clockCore: a(f[14]),
          clockMemory: a(f[15])
        } : {};
      });
      return l = l.filter((D) => "pciBus" in D), l;
    }
    function gA(a, I) {
      return I.driverVersion && (a.driverVersion = I.driverVersion), I.subDeviceId && (a.subDeviceId = I.subDeviceId), I.name && (a.name = I.name), I.pciBus && (a.pciBus = I.pciBus), I.fanSpeed && (a.fanSpeed = I.fanSpeed), I.memoryTotal && (a.memoryTotal = I.memoryTotal, a.vram = I.memoryTotal, a.vramDynamic = !1), I.memoryUsed && (a.memoryUsed = I.memoryUsed), I.memoryFree && (a.memoryFree = I.memoryFree), I.utilizationGpu && (a.utilizationGpu = I.utilizationGpu), I.utilizationMemory && (a.utilizationMemory = I.utilizationMemory), I.temperatureGpu && (a.temperatureGpu = I.temperatureGpu), I.temperatureMemory && (a.temperatureMemory = I.temperatureMemory), I.powerDraw && (a.powerDraw = I.powerDraw), I.powerLimit && (a.powerLimit = I.powerLimit), I.clockCore && (a.clockCore = I.clockCore), I.clockMemory && (a.clockMemory = I.clockMemory), a;
    }
    function v(a) {
      const I = {
        vendor: "",
        model: "",
        deviceName: "",
        main: !1,
        builtin: !1,
        connection: "",
        sizeX: null,
        sizeY: null,
        pixelDepth: null,
        resolutionX: null,
        resolutionY: null,
        currentResX: null,
        currentResY: null,
        positionX: 0,
        positionY: 0,
        currentRefreshRate: null
      };
      let t = 108;
      if (a.substr(t, 6) === "000000" && (t += 36), a.substr(t, 6) === "000000" && (t += 36), a.substr(t, 6) === "000000" && (t += 36), a.substr(t, 6) === "000000" && (t += 36), I.resolutionX = parseInt("0x0" + a.substr(t + 8, 1) + a.substr(t + 4, 2)), I.resolutionY = parseInt("0x0" + a.substr(t + 14, 1) + a.substr(t + 10, 2)), I.sizeX = parseInt("0x0" + a.substr(t + 28, 1) + a.substr(t + 24, 2)), I.sizeY = parseInt("0x0" + a.substr(t + 29, 1) + a.substr(t + 26, 2)), t = a.indexOf("000000fc00"), t >= 0) {
        let l = a.substr(t + 10, 26);
        l.indexOf("0a") !== -1 && (l = l.substr(0, l.indexOf("0a")));
        try {
          l.length > 2 && (I.model = l.match(/.{1,2}/g).map((D) => String.fromCharCode(parseInt(D, 16))).join(""));
        } catch {
          o.noop();
        }
      } else
        I.model = "";
      return I;
    }
    function U(a, I) {
      const t = [];
      let l = {
        vendor: "",
        model: "",
        deviceName: "",
        main: !1,
        builtin: !1,
        connection: "",
        sizeX: null,
        sizeY: null,
        pixelDepth: null,
        resolutionX: null,
        resolutionY: null,
        currentResX: null,
        currentResY: null,
        positionX: 0,
        positionY: 0,
        currentRefreshRate: null
      }, D = !1, f = !1, w = "", Y = 0;
      for (let _ = 1; _ < a.length; _++)
        if (a[_].trim() !== "") {
          if (a[_][0] !== " " && a[_][0] !== "	" && a[_].toLowerCase().indexOf(" connected ") !== -1) {
            (l.model || l.main || l.builtin || l.connection || l.sizeX !== null || l.pixelDepth !== null || l.resolutionX !== null) && (t.push(l), l = {
              vendor: "",
              model: "",
              main: !1,
              builtin: !1,
              connection: "",
              sizeX: null,
              sizeY: null,
              pixelDepth: null,
              resolutionX: null,
              resolutionY: null,
              currentResX: null,
              currentResY: null,
              positionX: 0,
              positionY: 0,
              currentRefreshRate: null
            });
            let G = a[_].split(" ");
            l.connection = G[0], l.main = a[_].toLowerCase().indexOf(" primary ") >= 0, l.builtin = G[0].toLowerCase().indexOf("edp") >= 0;
          }
          if (D)
            if (a[_].search(/\S|$/) > Y)
              w += a[_].toLowerCase().trim();
            else {
              let G = v(w);
              l.vendor = G.vendor, l.model = G.model, l.resolutionX = G.resolutionX, l.resolutionY = G.resolutionY, l.sizeX = G.sizeX, l.sizeY = G.sizeY, l.pixelDepth = I, D = !1;
            }
          if (a[_].toLowerCase().indexOf("edid:") >= 0 && (D = !0, Y = a[_].search(/\S|$/)), a[_].toLowerCase().indexOf("*current") >= 0) {
            const G = a[_].split("(");
            if (G && G.length > 1 && G[0].indexOf("x") >= 0) {
              const q = G[0].trim().split("x");
              l.currentResX = o.toInt(q[0]), l.currentResY = o.toInt(q[1]);
            }
            f = !0;
          }
          if (f && a[_].toLowerCase().indexOf("clock") >= 0 && a[_].toLowerCase().indexOf("hz") >= 0 && a[_].toLowerCase().indexOf("v: height") >= 0) {
            const G = a[_].split("clock");
            G && G.length > 1 && G[1].toLowerCase().indexOf("hz") >= 0 && (l.currentRefreshRate = o.toInt(G[1])), f = !1;
          }
        }
      return (l.model || l.main || l.builtin || l.connection || l.sizeX !== null || l.pixelDepth !== null || l.resolutionX !== null) && t.push(l), t;
    }
    return new Promise((a) => {
      process.nextTick(() => {
        let I = {
          controllers: [],
          displays: []
        };
        if (b && A("system_profiler -xml -detailLevel full SPDisplaysDataType", (l, D) => {
          if (!l) {
            try {
              const f = D.toString();
              I = d(o.plistParser(f)[0]._items);
            } catch {
              o.noop();
            }
            try {
              D = g(
                'defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""',
                { maxBuffer: 1024 * 102400 }
              );
              const f = (D || "").toString(), w = o.plistReader(f);
              if (w.DisplayAnyUserSets && w.DisplayAnyUserSets.Configs && w.DisplayAnyUserSets.Configs[0] && w.DisplayAnyUserSets.Configs[0].DisplayConfig) {
                const Y = w.DisplayAnyUserSets.Configs[0].DisplayConfig;
                let _ = 0;
                Y.forEach((G) => {
                  G.CurrentInfo && G.CurrentInfo.OriginX !== void 0 && I.displays && I.displays[_] && (I.displays[_].positionX = G.CurrentInfo.OriginX), G.CurrentInfo && G.CurrentInfo.OriginY !== void 0 && I.displays && I.displays[_] && (I.displays[_].positionY = G.CurrentInfo.OriginY), _++;
                });
              }
              if (w.DisplayAnyUserSets && w.DisplayAnyUserSets.length > 0 && w.DisplayAnyUserSets[0].length > 0 && w.DisplayAnyUserSets[0][0].DisplayID) {
                const Y = w.DisplayAnyUserSets[0];
                let _ = 0;
                Y.forEach((G) => {
                  "OriginX" in G && I.displays && I.displays[_] && (I.displays[_].positionX = G.OriginX), "OriginY" in G && I.displays && I.displays[_] && (I.displays[_].positionY = G.OriginY), G.Mode && G.Mode.BitsPerPixel !== void 0 && I.displays && I.displays[_] && (I.displays[_].pixelDepth = G.Mode.BitsPerPixel), _++;
                });
              }
            } catch {
              o.noop();
            }
          }
          Q && Q(I), a(I);
        }), x && (o.isRaspberry() && A(`fbset -s 2> /dev/null | grep 'mode "' ; vcgencmd get_mem gpu 2> /dev/null; tvservice -s 2> /dev/null; tvservice -n 2> /dev/null;`, (D, f) => {
          const w = f.toString().split(`
`);
          if (w.length > 3 && w[0].indexOf('mode "') >= -1 && w[2].indexOf("0x12000a") > -1) {
            const Y = w[0].replace("mode", "").replace(/"/g, "").trim().split("x");
            Y.length === 2 && I.displays.push({
              vendor: "",
              model: o.getValue(w, "device_name", "="),
              main: !0,
              builtin: !1,
              connection: "HDMI",
              sizeX: null,
              sizeY: null,
              pixelDepth: null,
              resolutionX: parseInt(Y[0], 10),
              resolutionY: parseInt(Y[1], 10),
              currentResX: null,
              currentResY: null,
              positionX: 0,
              positionY: 0,
              currentRefreshRate: null
            });
          }
          w.length >= 1 && f.toString().indexOf("gpu=") >= -1 && I.controllers.push({
            vendor: "Broadcom",
            model: o.getRpiGpu(),
            bus: "",
            vram: o.getValue(w, "gpu", "=").replace("M", ""),
            vramDynamic: !0
          });
        }), A("lspci -vvv  2>/dev/null", (l, D) => {
          if (!l) {
            const w = D.toString().split(`
`);
            if (I.controllers.length === 0) {
              I.controllers = c(w);
              const Y = K();
              I.controllers = I.controllers.map((_) => gA(_, Y.find((G) => G.pciBus.toLowerCase().endsWith(_.busAddress.toLowerCase())) || {}));
            }
          }
          A("clinfo --raw", (w, Y) => {
            if (!w) {
              const G = Y.toString().split(`
`);
              I.controllers = n(I.controllers, G);
            }
            A("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'", (G, q) => {
              let j = 0;
              if (!G) {
                const tA = q.toString().split(`
`);
                j = parseInt(tA[0]) || 0;
              }
              A("xrandr --verbose 2>/dev/null", (tA, M) => {
                if (!tA) {
                  const O = M.toString().split(`
`);
                  I.displays = U(O, j);
                }
                Q && Q(I), a(I);
              });
            });
          });
        })), (W || eA || IA) && (Q && Q(null), a(null)), z && (Q && Q(null), a(null)), X)
          try {
            const t = [];
            t.push(o.powerShell("Get-CimInstance win32_VideoController | fl *")), t.push(
              o.powerShell(
                'gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl'
              )
            ), t.push(o.powerShell("Get-CimInstance win32_desktopmonitor | fl *")), t.push(o.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")), t.push(o.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")), t.push(o.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")), t.push(
              o.powerShell(
                'gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}'
              )
            );
            const l = K();
            Promise.all(t).then((D) => {
              const f = D[0].replace(/\r/g, "").split(/\n\s*\n/), w = D[1].replace(/\r/g, "").split(/\n\s*\n/);
              I.controllers = V(f, w), I.controllers = I.controllers.map((tA) => tA.vendor.toLowerCase() === "nvidia" ? gA(
                tA,
                l.find((M) => {
                  let O = (tA.subDeviceId || "").toLowerCase();
                  const T = M.subDeviceId.split("x");
                  let S = T.length > 1 ? T[1].toLowerCase() : T[0].toLowerCase();
                  const AA = Math.abs(O.length - S.length);
                  if (O.length > S.length)
                    for (let oA = 0; oA < AA; oA++)
                      S = "0" + S;
                  else if (O.length < S.length)
                    for (let oA = 0; oA < AA; oA++)
                      O = "0" + O;
                  return O === S;
                }) || {}
              ) : tA);
              const Y = D[2].replace(/\r/g, "").split(/\n\s*\n/);
              Y[0].trim() === "" && Y.shift(), Y.length && Y[Y.length - 1].trim() === "" && Y.pop();
              const _ = D[3].replace(/\r/g, "").split("Active ");
              _.shift();
              const G = D[4].replace(/\r/g, "").split("BitsPerPixel ");
              G.shift();
              const q = D[5].replace(/\r/g, "").split(/\n\s*\n/);
              q.shift();
              const j = D[6].replace(/\r/g, "").split(/\n/), aA = [];
              j.forEach((tA) => {
                const M = tA.split("|");
                M.length === 5 && aA.push({
                  vendor: M[0],
                  code: M[1],
                  model: M[2],
                  serial: M[3],
                  instanceId: M[4]
                });
              }), I.displays = m(G, _, Y, q, aA), I.displays.length === 1 && (N && (I.displays[0].resolutionX = N, I.displays[0].currentResX || (I.displays[0].currentResX = N)), J && (I.displays[0].resolutionY = J, I.displays[0].currentResY === 0 && (I.displays[0].currentResY = J)), $ && (I.displays[0].pixelDepth = $)), I.displays = I.displays.map((tA) => (H && !tA.currentRefreshRate && (tA.currentRefreshRate = H), tA)), Q && Q(I), a(I);
            }).catch(() => {
              Q && Q(I), a(I);
            });
          } catch {
            Q && Q(I), a(I);
          }
      });
    });
    function V(a, I) {
      const t = {};
      for (const D in I)
        if ({}.hasOwnProperty.call(I, D) && I[D].trim() !== "") {
          const f = I[D].trim().split(`
`), w = o.getValue(f, "MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);
          if (w) {
            const Y = parseInt(o.getValue(f, "HardwareInformation.qwMemorySize"));
            if (!isNaN(Y)) {
              let _ = w[1].toUpperCase() + "&" + w[2].toUpperCase();
              w[3] && (_ += "&" + w[3].toUpperCase()), w[4] && (_ += "&" + w[4].toUpperCase()), t[_] = Y;
            }
          }
        }
      const l = [];
      for (const D in a)
        if ({}.hasOwnProperty.call(a, D) && a[D].trim() !== "") {
          const f = a[D].trim().split(`
`), w = o.getValue(f, "PNPDeviceID", ":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);
          let Y = null, _ = null;
          if (w) {
            if (Y = w[3] || "", Y && (Y = Y.split("_")[1]), _ == null && w[3] && w[4]) {
              const G = w[1].toUpperCase() + "&" + w[2].toUpperCase() + "&" + w[3].toUpperCase() + "&" + w[4].toUpperCase();
              ({}).hasOwnProperty.call(t, G) && (_ = t[G]);
            }
            if (_ == null && w[3]) {
              const G = w[1].toUpperCase() + "&" + w[2].toUpperCase() + "&" + w[3].toUpperCase();
              ({}).hasOwnProperty.call(t, G) && (_ = t[G]);
            }
            if (_ == null && w[4]) {
              const G = w[1].toUpperCase() + "&" + w[2].toUpperCase() + "&" + w[4].toUpperCase();
              ({}).hasOwnProperty.call(t, G) && (_ = t[G]);
            }
            if (_ == null) {
              const G = w[1].toUpperCase() + "&" + w[2].toUpperCase();
              ({}).hasOwnProperty.call(t, G) && (_ = t[G]);
            }
          }
          l.push({
            vendor: o.getValue(f, "AdapterCompatibility", ":"),
            model: o.getValue(f, "name", ":"),
            bus: o.getValue(f, "PNPDeviceID", ":").startsWith("PCI") ? "PCI" : "",
            vram: (_ ?? o.toInt(o.getValue(f, "AdapterRAM", ":"))) / 1024 / 1024,
            vramDynamic: o.getValue(f, "VideoMemoryType", ":") === "2",
            subDeviceId: Y
          }), N = o.toInt(o.getValue(f, "CurrentHorizontalResolution", ":")) || N, J = o.toInt(o.getValue(f, "CurrentVerticalResolution", ":")) || J, H = o.toInt(o.getValue(f, "CurrentRefreshRate", ":")) || H, $ = o.toInt(o.getValue(f, "CurrentBitsPerPixel", ":")) || $;
        }
      return l;
    }
    function m(a, I, t, l, D) {
      const f = [];
      let w = "", Y = "", _ = "", G = 0, q = 0;
      if (t && t.length) {
        const j = t[0].split(`
`);
        w = o.getValue(j, "MonitorManufacturer", ":"), Y = o.getValue(j, "Name", ":"), _ = o.getValue(j, "PNPDeviceID", ":").replace(/&amp;/g, "&").toLowerCase(), G = o.toInt(o.getValue(j, "ScreenWidth", ":")), q = o.toInt(o.getValue(j, "ScreenHeight", ":"));
      }
      for (let j = 0; j < a.length; j++)
        if (a[j].trim() !== "") {
          a[j] = "BitsPerPixel " + a[j], I[j] = "Active " + I[j], (l.length === 0 || l[j] === void 0) && (l[j] = "Unknown");
          const aA = a[j].split(`
`), tA = I[j].split(`
`), M = l[j].split(`
`), O = o.getValue(aA, "BitsPerPixel"), T = o.getValue(aA, "Bounds").replace("{", "").replace("}", "").replace(/=/g, ":").split(","), S = o.getValue(aA, "Primary"), AA = o.getValue(tA, "MaxHorizontalImageSize"), oA = o.getValue(tA, "MaxVerticalImageSize"), rA = o.getValue(tA, "InstanceName").toLowerCase(), cA = o.getValue(M, "VideoOutputTechnology"), lA = o.getValue(aA, "DeviceName");
          let pA = "", BA = "";
          D.forEach((uA) => {
            uA.instanceId.toLowerCase().startsWith(rA) && w.startsWith("(") && Y.startsWith("PnP") && (pA = uA.vendor, BA = uA.model);
          }), f.push({
            vendor: rA.startsWith(_) && pA === "" ? w : pA,
            model: rA.startsWith(_) && BA === "" ? Y : BA,
            deviceName: lA,
            main: S.toLowerCase() === "true",
            builtin: cA === "2147483648",
            connection: cA && y[cA] ? y[cA] : "",
            resolutionX: o.toInt(o.getValue(T, "Width", ":")),
            resolutionY: o.toInt(o.getValue(T, "Height", ":")),
            sizeX: AA ? parseInt(AA, 10) : null,
            sizeY: oA ? parseInt(oA, 10) : null,
            pixelDepth: O,
            currentResX: o.toInt(o.getValue(T, "Width", ":")),
            currentResY: o.toInt(o.getValue(T, "Height", ":")),
            positionX: o.toInt(o.getValue(T, "X", ":")),
            positionY: o.toInt(o.getValue(T, "Y", ":"))
          });
        }
      return a.length === 0 && f.push({
        vendor: w,
        model: Y,
        main: !0,
        sizeX: null,
        sizeY: null,
        resolutionX: G,
        resolutionY: q,
        pixelDepth: null,
        currentResX: G,
        currentResY: q,
        positionX: 0,
        positionY: 0
      }), f;
    }
  }
  return graphics.graphics = r, graphics;
}
var filesystem = {}, hasRequiredFilesystem;
function requireFilesystem() {
  if (hasRequiredFilesystem) return filesystem;
  hasRequiredFilesystem = 1;
  const s = requireUtil(), e = require$$1$1, A = require$$1.exec, g = require$$1.execSync, o = s.promisifySave(require$$1.exec), B = process.platform, F = B === "linux" || B === "android", x = B === "darwin", b = B === "win32", X = B === "freebsd", W = B === "openbsd", eA = B === "netbsd", IA = B === "sunos", z = {}, N = {};
  function J(m, a) {
    s.isFunction(m) && (a = m, m = "");
    let I = [], t = [];
    function l(Y) {
      if (!Y.startsWith("/"))
        return "NFS";
      const _ = Y.split("/"), G = _[_.length - 1], q = I.filter((j) => j.indexOf(G) >= 0);
      return q.length === 1 && q[0].indexOf("APFS") >= 0 ? "APFS" : "HFS";
    }
    function D(Y) {
      const _ = ["rootfs", "unionfs", "squashfs", "cramfs", "initrd", "initramfs", "devtmpfs", "tmpfs", "udev", "devfs", "specfs", "type", "appimaged"];
      let G = !1;
      return _.forEach((q) => {
        Y.toLowerCase().indexOf(q) >= 0 && (G = !0);
      }), G;
    }
    function f(Y) {
      const _ = Y.toString().split(`
`);
      if (_.shift(), Y.toString().toLowerCase().indexOf("filesystem")) {
        let G = 0;
        for (let q = 0; q < _.length; q++)
          _[q] && _[q].toLowerCase().startsWith("filesystem") && (G = q);
        for (let q = 0; q < G; q++)
          _.shift();
      }
      return _;
    }
    function w(Y) {
      const _ = [];
      return Y.forEach((G) => {
        if (G !== "" && (G = G.replace(/ +/g, " ").split(" "), G && (G[0].startsWith("/") || G[6] && G[6] === "/" || G[0].indexOf("/") > 0 || G[0].indexOf(":") === 1 || !x && !D(G[1])))) {
          const q = G[0], j = F || X || W || eA ? G[1] : l(G[0]), aA = parseInt(F || X || W || eA ? G[2] : G[1], 10) * 1024, tA = parseInt(F || X || W || eA ? G[3] : G[2], 10) * 1024, M = parseInt(F || X || W || eA ? G[4] : G[3], 10) * 1024, O = parseFloat((100 * (tA / (tA + M))).toFixed(2)), T = t && Object.keys(t).length > 0 ? t[q] || !1 : null;
          G.splice(0, F || X || W || eA ? 6 : 5);
          const S = G.join(" ");
          _.find((AA) => AA.fs === q && AA.type === j && AA.mount === S) || _.push({
            fs: q,
            type: j,
            size: aA,
            used: tA,
            available: M,
            use: O,
            mount: S,
            rw: T
          });
        }
      }), _;
    }
    return new Promise((Y) => {
      process.nextTick(() => {
        let _ = [];
        if (F || X || W || eA || x) {
          let G = "";
          if (I = [], t = {}, x) {
            G = "df -kP";
            try {
              I = g("diskutil list").toString().split(`
`).filter((q) => !q.startsWith("/") && q.indexOf(":") > 0), g("mount").toString().split(`
`).filter((q) => q.startsWith("/")).forEach((q) => {
                t[q.split(" ")[0]] = q.toLowerCase().indexOf("read-only") === -1;
              });
            } catch {
              s.noop();
            }
          }
          if (F)
            try {
              G = "export LC_ALL=C; df -kPTx squashfs; unset LC_ALL", g("cat /proc/mounts 2>/dev/null", s.execOptsLinux).toString().split(`
`).filter((q) => q.startsWith("/")).forEach((q) => {
                t[q.split(" ")[0]] = t[q.split(" ")[0]] || !1, q.toLowerCase().indexOf("/snap/") === -1 && (t[q.split(" ")[0]] = q.toLowerCase().indexOf("rw,") >= 0 || q.toLowerCase().indexOf(" rw ") >= 0);
              });
            } catch {
              s.noop();
            }
          if (X || W || eA)
            try {
              G = "df -kPT", g("mount").toString().split(`
`).forEach((q) => {
                t[q.split(" ")[0]] = q.toLowerCase().indexOf("read-only") === -1;
              });
            } catch {
              s.noop();
            }
          A(G, { maxBuffer: 1024 * 1024 }, (q, j) => {
            const aA = f(j);
            _ = w(aA), m && (_ = _.filter((tA) => tA.fs.toLowerCase().indexOf(m.toLowerCase()) >= 0 || tA.mount.toLowerCase().indexOf(m.toLowerCase()) >= 0)), (!q || _.length) && j.toString().trim() !== "" ? (a && a(_), Y(_)) : A("df -kPT 2>/dev/null", { maxBuffer: 1024 * 1024 }, (tA, M) => {
              const O = f(M);
              _ = w(O), a && a(_), Y(_);
            });
          });
        }
        if (IA && (a && a(_), Y(_)), b)
          try {
            const G = m ? s.sanitizeShellString(m, !0) : "", q = `Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${G ? "| where -property Caption -eq " + G : ""} | fl`;
            s.powerShell(q).then((j, aA) => {
              aA || j.toString().split(/\n\s*\n/).forEach((M) => {
                const O = M.split(`\r
`), T = s.toInt(s.getValue(O, "size", ":")), S = s.toInt(s.getValue(O, "freespace", ":")), AA = s.getValue(O, "caption", ":"), oA = s.getValue(O, "access", ":"), rA = oA ? s.toInt(oA) !== 1 : null;
                T && _.push({
                  fs: AA,
                  type: s.getValue(O, "filesystem", ":"),
                  size: T,
                  used: T - S,
                  available: S,
                  use: parseFloat((100 * (T - S) / T).toFixed(2)),
                  mount: AA,
                  rw: rA
                });
              }), a && a(_), Y(_);
            });
          } catch {
            a && a(_), Y(_);
          }
      });
    });
  }
  filesystem.fsSize = J;
  function $(m) {
    return new Promise((a) => {
      process.nextTick(() => {
        const I = {
          max: null,
          allocated: null,
          available: null
        };
        (X || W || eA || x) && A("sysctl -i kern.maxfiles kern.num_files kern.open_files", { maxBuffer: 1024 * 1024 }, (l, D) => {
          if (!l) {
            const f = D.toString().split(`
`);
            I.max = parseInt(s.getValue(f, "kern.maxfiles", ":"), 10), I.allocated = parseInt(s.getValue(f, "kern.num_files", ":"), 10) || parseInt(s.getValue(f, "kern.open_files", ":"), 10), I.available = I.max - I.allocated;
          }
          m && m(I), a(I);
        }), F && e.readFile("/proc/sys/fs/file-nr", (t, l) => {
          if (t)
            e.readFile("/proc/sys/fs/file-max", (D, f) => {
              if (!D) {
                const w = f.toString().split(`
`);
                w[0] && (I.max = parseInt(w[0], 10));
              }
              m && m(I), a(I);
            });
          else {
            const D = l.toString().split(`
`);
            if (D[0]) {
              const f = D[0].replace(/\s+/g, " ").split(" ");
              f.length === 3 && (I.allocated = parseInt(f[0], 10), I.available = parseInt(f[1], 10), I.max = parseInt(f[2], 10), I.available || (I.available = I.max - I.allocated));
            }
            m && m(I), a(I);
          }
        }), IA && (m && m(null), a(null)), b && (m && m(null), a(null));
      });
    });
  }
  filesystem.fsOpenFiles = $;
  function H(m) {
    return parseInt(m.substr(m.indexOf(" (") + 2, m.indexOf(" Bytes)") - 10), 10);
  }
  function y(m) {
    const a = [];
    let I = 0;
    return m.forEach((t) => {
      if (t.length > 0)
        if (t[0] === "*")
          I++;
        else {
          const l = t.split(":");
          l.length > 1 && (a[I] || (a[I] = {
            name: "",
            identifier: "",
            type: "disk",
            fsType: "",
            mount: "",
            size: 0,
            physical: "HDD",
            uuid: "",
            label: "",
            model: "",
            serial: "",
            removable: !1,
            protocol: "",
            group: "",
            device: ""
          }), l[0] = l[0].trim().toUpperCase().replace(/ +/g, ""), l[1] = l[1].trim(), l[0] === "DEVICEIDENTIFIER" && (a[I].identifier = l[1]), l[0] === "DEVICENODE" && (a[I].name = l[1]), l[0] === "VOLUMENAME" && l[1].indexOf("Not applicable") === -1 && (a[I].label = l[1]), l[0] === "PROTOCOL" && (a[I].protocol = l[1]), l[0] === "DISKSIZE" && (a[I].size = H(l[1])), l[0] === "FILESYSTEMPERSONALITY" && (a[I].fsType = l[1]), l[0] === "MOUNTPOINT" && (a[I].mount = l[1]), l[0] === "VOLUMEUUID" && (a[I].uuid = l[1]), l[0] === "READ-ONLYMEDIA" && l[1] === "Yes" && (a[I].physical = "CD/DVD"), l[0] === "SOLIDSTATE" && l[1] === "Yes" && (a[I].physical = "SSD"), l[0] === "VIRTUAL" && (a[I].type = "virtual"), l[0] === "REMOVABLEMEDIA" && (a[I].removable = l[1] === "Removable"), l[0] === "PARTITIONTYPE" && (a[I].type = "part"), l[0] === "DEVICE/MEDIANAME" && (a[I].model = l[1]));
        }
    }), a;
  }
  function p(m) {
    let a = [];
    return m.filter((I) => I !== "").forEach((I) => {
      try {
        I = decodeURIComponent(I.replace(/\\x/g, "%")), I = I.replace(/\\/g, "\\\\");
        const t = JSON.parse(I);
        a.push({
          name: s.sanitizeShellString(t.name),
          type: t.type,
          fsType: t.fsType,
          mount: t.mountpoint,
          size: parseInt(t.size, 10),
          physical: t.type === "disk" ? t.rota === "0" ? "SSD" : "HDD" : t.type === "rom" ? "CD/DVD" : "",
          uuid: t.uuid,
          label: t.label,
          model: (t.model || "").trim(),
          serial: t.serial,
          removable: t.rm === "1",
          protocol: t.tran,
          group: t.group || ""
        });
      } catch {
        s.noop();
      }
    }), a = s.unique(a), a = s.sortByKey(a, ["type", "name"]), a;
  }
  function h(m) {
    const a = s.getValue(m, "md_level", "="), I = s.getValue(m, "md_name", "="), t = s.getValue(m, "md_uuid", "="), l = [];
    return m.forEach((D) => {
      D.toLowerCase().startsWith("md_device_dev") && D.toLowerCase().indexOf("/dev/") > 0 && l.push(D.split("/dev/")[1]);
    }), {
      raid: a,
      label: I,
      uuid: t,
      members: l
    };
  }
  function E(m) {
    let a = m;
    try {
      m.forEach((I) => {
        if (I.type.startsWith("raid")) {
          const t = g(`mdadm --export --detail /dev/${I.name}`, s.execOptsLinux).toString().split(`
`), l = h(t);
          I.label = l.label, I.uuid = l.uuid, l && l.members && l.members.length && l.raid === I.type && (a = a.map((D) => (D.fsType === "linux_raid_member" && l.members.indexOf(D.name) >= 0 && (D.group = I.name), D)));
        }
      });
    } catch {
      s.noop();
    }
    return a;
  }
  function u(m) {
    const a = [];
    return m.forEach((I) => {
      I.type.startsWith("disk") && a.push(I.name);
    }), a;
  }
  function r(m) {
    let a = m;
    try {
      const I = u(m);
      a = a.map((t) => ((t.type.startsWith("part") || t.type.startsWith("disk")) && I.forEach((l) => {
        t.name.startsWith(l) && (t.device = "/dev/" + l);
      }), t));
    } catch {
      s.noop();
    }
    return a;
  }
  function Q(m) {
    const a = [];
    return m.forEach((I) => {
      if (I.type.startsWith("disk") && a.push({ name: I.name, model: I.model, device: I.name }), I.type.startsWith("virtual")) {
        let t = "";
        a.forEach((l) => {
          l.model === I.model && (t = l.device);
        }), t && a.push({ name: I.name, model: I.model, device: t });
      }
    }), a;
  }
  function d(m) {
    let a = m;
    try {
      const I = Q(m);
      a = a.map((t) => ((t.type.startsWith("part") || t.type.startsWith("disk") || t.type.startsWith("virtual")) && I.forEach((l) => {
        t.name.startsWith(l.name) && (t.device = l.device);
      }), t));
    } catch {
      s.noop();
    }
    return a;
  }
  function c(m) {
    const a = [];
    return m.forEach((I) => {
      const t = I.split(`\r
`), l = s.getValue(t, "DeviceID", ":");
      let D = I.split("@{DeviceID=");
      D.length > 1 && (D = D.slice(1), D.forEach((f) => {
        a.push({ name: f.split(";")[0].toUpperCase(), device: l });
      }));
    }), a;
  }
  function n(m, a) {
    const I = c(a);
    return m.map((t) => {
      const l = I.filter((D) => D.name === t.name.toUpperCase());
      return l.length > 0 && (t.device = l[0].device), t;
    }), m;
  }
  function L(m) {
    return m.toString().replace(/NAME=/g, '{"name":').replace(/FSTYPE=/g, ',"fsType":').replace(/TYPE=/g, ',"type":').replace(/SIZE=/g, ',"size":').replace(/MOUNTPOINT=/g, ',"mountpoint":').replace(/UUID=/g, ',"uuid":').replace(/ROTA=/g, ',"rota":').replace(/RO=/g, ',"ro":').replace(/RM=/g, ',"rm":').replace(/TRAN=/g, ',"tran":').replace(/SERIAL=/g, ',"serial":').replace(/LABEL=/g, ',"label":').replace(/MODEL=/g, ',"model":').replace(/OWNER=/g, ',"owner":').replace(/GROUP=/g, ',"group":').replace(/\n/g, `}
`);
  }
  function k(m) {
    return new Promise((a) => {
      process.nextTick(() => {
        let I = [];
        if (F && A("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null", { maxBuffer: 1048576 }, (l, D) => {
          if (l)
            A("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null", { maxBuffer: 1048576 }, (w, Y) => {
              if (!w) {
                const _ = L(Y).split(`
`);
                I = p(_), I = E(I);
              }
              m && m(I), a(I);
            }).on("error", () => {
              m && m(I), a(I);
            });
          else {
            const f = L(D).split(`
`);
            I = p(f), I = E(I), I = r(I), m && m(I), a(I);
          }
        }).on("error", () => {
          m && m(I), a(I);
        }), x && A("diskutil info -all", { maxBuffer: 1048576 }, (l, D) => {
          if (!l) {
            const f = D.toString().split(`
`);
            I = y(f), I = d(I);
          }
          m && m(I), a(I);
        }).on("error", () => {
          m && m(I), a(I);
        }), IA && (m && m(I), a(I)), b) {
          const t = ["Unknown", "NoRoot", "Removable", "Local", "Network", "CD/DVD", "RAM"];
          try {
            const l = [];
            l.push(s.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")), l.push(
              s.powerShell(
                "Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl"
              )
            ), s.promiseAll(l).then((D) => {
              const f = D.results[0].toString().split(/\n\s*\n/), w = D.results[1].toString().split(/\n\s*\n/);
              f.forEach((Y) => {
                const _ = Y.split(`\r
`), G = s.getValue(_, "drivetype", ":");
                G && I.push({
                  name: s.getValue(_, "name", ":"),
                  identifier: s.getValue(_, "caption", ":"),
                  type: "disk",
                  fsType: s.getValue(_, "filesystem", ":").toLowerCase(),
                  mount: s.getValue(_, "caption", ":"),
                  size: s.getValue(_, "size", ":"),
                  physical: G >= 0 && G <= 6 ? t[G] : t[0],
                  uuid: s.getValue(_, "volumeserialnumber", ":"),
                  label: s.getValue(_, "volumename", ":"),
                  model: "",
                  serial: s.getValue(_, "volumeserialnumber", ":"),
                  removable: G === "2",
                  protocol: "",
                  group: "",
                  device: ""
                });
              }), I = n(I, w), m && m(I), a(I);
            });
          } catch {
            m && m(I), a(I);
          }
        }
        (X || W || eA) && (m && m(null), a(null));
      });
    });
  }
  filesystem.blockDevices = k;
  function K(m, a) {
    const I = {
      rx: 0,
      wx: 0,
      tx: 0,
      rx_sec: null,
      wx_sec: null,
      tx_sec: null,
      ms: 0
    };
    return z && z.ms ? (I.rx = m, I.wx = a, I.tx = I.rx + I.wx, I.ms = Date.now() - z.ms, I.rx_sec = (I.rx - z.bytes_read) / (I.ms / 1e3), I.wx_sec = (I.wx - z.bytes_write) / (I.ms / 1e3), I.tx_sec = I.rx_sec + I.wx_sec, z.rx_sec = I.rx_sec, z.wx_sec = I.wx_sec, z.tx_sec = I.tx_sec, z.bytes_read = I.rx, z.bytes_write = I.wx, z.bytes_overall = I.rx + I.wx, z.ms = Date.now(), z.last_ms = I.ms) : (I.rx = m, I.wx = a, I.tx = I.rx + I.wx, z.rx_sec = null, z.wx_sec = null, z.tx_sec = null, z.bytes_read = I.rx, z.bytes_write = I.wx, z.bytes_overall = I.rx + I.wx, z.ms = Date.now(), z.last_ms = 0), I;
  }
  function gA(m) {
    return new Promise((a) => {
      process.nextTick(() => {
        if (b || X || W || eA || IA)
          return a(null);
        let I = {
          rx: 0,
          wx: 0,
          tx: 0,
          rx_sec: null,
          wx_sec: null,
          tx_sec: null,
          ms: 0
        }, t = 0, l = 0;
        z && !z.ms || z && z.ms && Date.now() - z.ms >= 500 ? (F && A("lsblk -r 2>/dev/null | grep /", { maxBuffer: 1048576 }, (f, w) => {
          if (f)
            m && m(I), a(I);
          else {
            const Y = w.toString().split(`
`), _ = [];
            Y.forEach((j) => {
              j !== "" && (j = j.trim().split(" "), _.indexOf(j[0]) === -1 && _.push(j[0]));
            });
            const G = _.join("|");
            A('cat /proc/diskstats | egrep "' + G + '"', { maxBuffer: 1024 * 1024 }, (j, aA) => {
              j || (aA.toString().split(`
`).forEach((M) => {
                M = M.trim(), M !== "" && (M = M.replace(/ +/g, " ").split(" "), t += parseInt(M[5], 10) * 512, l += parseInt(M[9], 10) * 512);
              }), I = K(t, l)), m && m(I), a(I);
            }).on("error", () => {
              m && m(I), a(I);
            });
          }
        }).on("error", () => {
          m && m(I), a(I);
        }), x && A(
          `ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
"`,
          { maxBuffer: 1048576 },
          (f, w) => {
            f || (w.toString().split(`
`).forEach((_) => {
              _ = _.trim(), _ !== "" && (_ = _.split(","), t += parseInt(_[2], 10), l += parseInt(_[9], 10));
            }), I = K(t, l)), m && m(I), a(I);
          }
        ).on("error", () => {
          m && m(I), a(I);
        })) : (I.ms = z.last_ms, I.rx = z.bytes_read, I.wx = z.bytes_write, I.tx = z.bytes_read + z.bytes_write, I.rx_sec = z.rx_sec, I.wx_sec = z.wx_sec, I.tx_sec = z.tx_sec, m && m(I), a(I));
      });
    });
  }
  filesystem.fsStats = gA;
  function v(m, a, I, t, l) {
    const D = {
      rIO: 0,
      wIO: 0,
      tIO: 0,
      rIO_sec: null,
      wIO_sec: null,
      tIO_sec: null,
      rWaitTime: 0,
      wWaitTime: 0,
      tWaitTime: 0,
      rWaitPercent: null,
      wWaitPercent: null,
      tWaitPercent: null,
      ms: 0
    };
    return N && N.ms ? (D.rIO = m, D.wIO = a, D.tIO = m + a, D.ms = Date.now() - N.ms, D.rIO_sec = (D.rIO - N.rIO) / (D.ms / 1e3), D.wIO_sec = (D.wIO - N.wIO) / (D.ms / 1e3), D.tIO_sec = D.rIO_sec + D.wIO_sec, D.rWaitTime = I, D.wWaitTime = t, D.tWaitTime = l, D.rWaitPercent = (D.rWaitTime - N.rWaitTime) * 100 / D.ms, D.wWaitPercent = (D.wWaitTime - N.wWaitTime) * 100 / D.ms, D.tWaitPercent = (D.tWaitTime - N.tWaitTime) * 100 / D.ms, N.rIO = m, N.wIO = a, N.rIO_sec = D.rIO_sec, N.wIO_sec = D.wIO_sec, N.tIO_sec = D.tIO_sec, N.rWaitTime = I, N.wWaitTime = t, N.tWaitTime = l, N.rWaitPercent = D.rWaitPercent, N.wWaitPercent = D.wWaitPercent, N.tWaitPercent = D.tWaitPercent, N.last_ms = D.ms, N.ms = Date.now()) : (D.rIO = m, D.wIO = a, D.tIO = m + a, D.rWaitTime = I, D.wWaitTime = t, D.tWaitTime = l, N.rIO = m, N.wIO = a, N.rIO_sec = null, N.wIO_sec = null, N.tIO_sec = null, N.rWaitTime = I, N.wWaitTime = t, N.tWaitTime = l, N.rWaitPercent = null, N.wWaitPercent = null, N.tWaitPercent = null, N.last_ms = 0, N.ms = Date.now()), D;
  }
  function U(m) {
    return new Promise((a) => {
      process.nextTick(() => {
        if (b || IA)
          return a(null);
        let I = {
          rIO: 0,
          wIO: 0,
          tIO: 0,
          rIO_sec: null,
          wIO_sec: null,
          tIO_sec: null,
          rWaitTime: 0,
          wWaitTime: 0,
          tWaitTime: 0,
          rWaitPercent: null,
          wWaitPercent: null,
          tWaitPercent: null,
          ms: 0
        }, t = 0, l = 0, D = 0, f = 0, w = 0;
        N && !N.ms || N && N.ms && Date.now() - N.ms >= 500 ? ((F || X || W || eA) && A('for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done', { maxBuffer: 1024 * 1024 }, (_, G) => {
          _ ? (m && m(I), a(I)) : (G.split(`
`).forEach((j) => {
            if (!j)
              return;
            const aA = j.split(";");
            t += parseInt(aA[0], 10), l += parseInt(aA[4], 10), D += parseInt(aA[3], 10), f += parseInt(aA[7], 10), w += parseInt(aA[10], 10);
          }), I = v(t, l, D, f, w), m && m(I), a(I));
        }), x && A(
          `ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
"`,
          { maxBuffer: 1024 * 1024 },
          (Y, _) => {
            Y || (_.toString().split(`
`).forEach((q) => {
              q = q.trim(), q !== "" && (q = q.split(","), t += parseInt(q[10], 10), l += parseInt(q[0], 10));
            }), I = v(t, l, D, f, w)), m && m(I), a(I);
          }
        )) : (I.rIO = N.rIO, I.wIO = N.wIO, I.tIO = N.rIO + N.wIO, I.ms = N.last_ms, I.rIO_sec = N.rIO_sec, I.wIO_sec = N.wIO_sec, I.tIO_sec = N.tIO_sec, I.rWaitTime = N.rWaitTime, I.wWaitTime = N.wWaitTime, I.tWaitTime = N.tWaitTime, I.rWaitPercent = N.rWaitPercent, I.wWaitPercent = N.wWaitPercent, I.tWaitPercent = N.tWaitPercent, m && m(I), a(I));
      });
    });
  }
  filesystem.disksIO = U;
  function V(m) {
    function a(I) {
      const t = [
        { pattern: "WESTERN.*", manufacturer: "Western Digital" },
        { pattern: "^WDC.*", manufacturer: "Western Digital" },
        { pattern: "WD.*", manufacturer: "Western Digital" },
        { pattern: "TOSHIBA.*", manufacturer: "Toshiba" },
        { pattern: "HITACHI.*", manufacturer: "Hitachi" },
        { pattern: "^IC.*", manufacturer: "Hitachi" },
        { pattern: "^HTS.*", manufacturer: "Hitachi" },
        { pattern: "SANDISK.*", manufacturer: "SanDisk" },
        { pattern: "KINGSTON.*", manufacturer: "Kingston Technology" },
        { pattern: "^SONY.*", manufacturer: "Sony" },
        { pattern: "TRANSCEND.*", manufacturer: "Transcend" },
        { pattern: "SAMSUNG.*", manufacturer: "Samsung" },
        { pattern: "^ST(?!I\\ ).*", manufacturer: "Seagate" },
        { pattern: "^STI\\ .*", manufacturer: "SimpleTech" },
        { pattern: "^D...-.*", manufacturer: "IBM" },
        { pattern: "^IBM.*", manufacturer: "IBM" },
        { pattern: "^FUJITSU.*", manufacturer: "Fujitsu" },
        { pattern: "^MP.*", manufacturer: "Fujitsu" },
        { pattern: "^MK.*", manufacturer: "Toshiba" },
        { pattern: "MAXTO.*", manufacturer: "Maxtor" },
        { pattern: "PIONEER.*", manufacturer: "Pioneer" },
        { pattern: "PHILIPS.*", manufacturer: "Philips" },
        { pattern: "QUANTUM.*", manufacturer: "Quantum Technology" },
        { pattern: "FIREBALL.*", manufacturer: "Quantum Technology" },
        { pattern: "^VBOX.*", manufacturer: "VirtualBox" },
        { pattern: "CORSAIR.*", manufacturer: "Corsair Components" },
        { pattern: "CRUCIAL.*", manufacturer: "Crucial" },
        { pattern: "ECM.*", manufacturer: "ECM" },
        { pattern: "INTEL.*", manufacturer: "INTEL" },
        { pattern: "EVO.*", manufacturer: "Samsung" },
        { pattern: "APPLE.*", manufacturer: "Apple" }
      ];
      let l = "";
      return I && (I = I.toUpperCase(), t.forEach((D) => {
        RegExp(D.pattern).test(I) && (l = D.manufacturer);
      })), l;
    }
    return new Promise((I) => {
      process.nextTick(() => {
        const t = (f) => {
          for (let w = 0; w < f.length; w++)
            delete f[w].BSDName;
          m && m(f), I(f);
        }, l = [];
        let D = "";
        if (F) {
          let f = "";
          A("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL", { maxBuffer: 1024 * 1024 }, (w, Y) => {
            if (!w)
              try {
                const _ = Y.toString().trim();
                let G = [];
                try {
                  const q = JSON.parse(_);
                  q && {}.hasOwnProperty.call(q, "blockdevices") && (G = q.blockdevices.filter((j) => j.type === "disk" && j.size > 0 && (j.model !== null || j.mountpoint === null && j.label === null && j.fstype === null && j.parttype === null && j.path && j.path.indexOf("/ram") !== 0 && j.path.indexOf("/loop") !== 0 && j["disc-max"] && j["disc-max"] !== 0)));
                } catch {
                  try {
                    const q = g(
                      "export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL",
                      s.execOptsLinux
                    ).toString(), j = L(q).split(`
`);
                    G = p(j).filter((tA) => tA.type === "disk" && tA.size > 0 && (tA.model !== null && tA.model !== "" || tA.mount === "" && tA.label === "" && tA.fsType === ""));
                  } catch {
                    s.noop();
                  }
                }
                G.forEach((q) => {
                  let j = "";
                  const aA = "/dev/" + q.name, tA = q.name;
                  try {
                    j = g("cat /sys/block/" + tA + "/queue/rotational 2>/dev/null", s.execOptsLinux).toString().split(`
`)[0];
                  } catch {
                    s.noop();
                  }
                  let M = q.tran ? q.tran.toUpperCase().trim() : "";
                  M === "NVME" && (j = "2", M = "PCIe"), l.push({
                    device: aA,
                    type: j === "0" ? "SSD" : j === "1" ? "HD" : j === "2" ? "NVMe" : q.model && q.model.indexOf("SSD") > -1 ? "SSD" : q.model && q.model.indexOf("NVM") > -1 ? "NVMe" : "HD",
                    name: q.model || "",
                    vendor: a(q.model) || (q.vendor ? q.vendor.trim() : ""),
                    size: q.size || 0,
                    bytesPerSector: null,
                    totalCylinders: null,
                    totalHeads: null,
                    totalSectors: null,
                    totalTracks: null,
                    tracksPerCylinder: null,
                    sectorsPerTrack: null,
                    firmwareRevision: q.rev ? q.rev.trim() : "",
                    serialNum: q.serial ? q.serial.trim() : "",
                    interfaceType: M,
                    smartStatus: "unknown",
                    temperature: null,
                    BSDName: aA
                  }), D += `printf "
${aA}|"; smartctl -H ${aA} | grep overall;`, f += `${f ? 'printf ",";' : ""}smartctl -a -j ${aA};`;
                });
              } catch {
                s.noop();
              }
            f ? A(f, { maxBuffer: 1024 * 1024 }, (_, G) => {
              try {
                JSON.parse(`[${G}]`).forEach((j) => {
                  const aA = j.smartctl.argv[j.smartctl.argv.length - 1];
                  for (let tA = 0; tA < l.length; tA++)
                    l[tA].BSDName === aA && (l[tA].smartStatus = j.smart_status.passed ? "Ok" : j.smart_status.passed === !1 ? "Predicted Failure" : "unknown", j.temperature && j.temperature.current && (l[tA].temperature = j.temperature.current), l[tA].smartData = j);
                }), t(l);
              } catch {
                D ? (D = D + `printf "
"`, A(D, { maxBuffer: 1024 * 1024 }, (q, j) => {
                  j.toString().split(`
`).forEach((tA) => {
                    if (tA) {
                      const M = tA.split("|");
                      if (M.length === 2) {
                        const O = M[0];
                        M[1] = M[1].trim();
                        const T = M[1].split(":");
                        if (T.length === 2) {
                          T[1] = T[1].trim();
                          const S = T[1].toLowerCase();
                          for (let AA = 0; AA < l.length; AA++)
                            l[AA].BSDName === O && (l[AA].smartStatus = S === "passed" ? "Ok" : S === "failed!" ? "Predicted Failure" : "unknown");
                        }
                      }
                    }
                  }), t(l);
                })) : t(l);
              }
            }) : t(l);
          });
        }
        if ((X || W || eA) && (m && m(l), I(l)), IA && (m && m(l), I(l)), x && A("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType", { maxBuffer: 1024 * 1024 }, (f, w) => {
          if (f)
            t(l);
          else {
            const Y = w.toString().split(`
`), _ = [], G = [], q = [];
            let j = "SATA";
            Y.forEach((aA) => {
              aA === "NVMExpress:" ? j = "NVMe" : aA === "USB:" ? j = "USB" : aA === "SATA/SATA Express:" ? j = "SATA" : j === "SATA" ? _.push(aA) : j === "NVMe" ? G.push(aA) : j === "USB" && q.push(aA);
            });
            try {
              const aA = _.join(`
`).split(" Physical Interconnect: ");
              aA.shift(), aA.forEach((tA) => {
                tA = "InterfaceType: " + tA;
                const M = tA.split(`
`), O = s.getValue(M, "Medium Type", ":", !0).trim(), T = s.getValue(M, "capacity", ":", !0).trim(), S = s.getValue(M, "BSD Name", ":", !0).trim();
                if (T) {
                  let AA = 0;
                  if (T.indexOf("(") >= 0 && (AA = parseInt(
                    T.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, ""),
                    10
                  )), AA || (AA = parseInt(T, 10)), AA) {
                    const oA = s.getValue(M, "S.M.A.R.T. status", ":", !0).trim().toLowerCase();
                    l.push({
                      device: S,
                      type: O.startsWith("Solid") ? "SSD" : "HD",
                      name: s.getValue(M, "Model", ":", !0).trim(),
                      vendor: a(s.getValue(M, "Model", ":", !0).trim()) || s.getValue(M, "Manufacturer", ":", !0),
                      size: AA,
                      bytesPerSector: null,
                      totalCylinders: null,
                      totalHeads: null,
                      totalSectors: null,
                      totalTracks: null,
                      tracksPerCylinder: null,
                      sectorsPerTrack: null,
                      firmwareRevision: s.getValue(M, "Revision", ":", !0).trim(),
                      serialNum: s.getValue(M, "Serial Number", ":", !0).trim(),
                      interfaceType: s.getValue(M, "InterfaceType", ":", !0).trim(),
                      smartStatus: oA === "verified" ? "OK" : oA || "unknown",
                      temperature: null,
                      BSDName: S
                    }), D = D + `printf "
` + S + '|"; diskutil info /dev/' + S + " | grep SMART;";
                  }
                }
              });
            } catch {
              s.noop();
            }
            try {
              const aA = G.join(`
`).split(`

          Capacity:`);
              aA.shift(), aA.forEach((tA) => {
                tA = `!Capacity: ${tA}`;
                const M = tA.split(`
`), O = s.getValue(M, "link width", ":", !0).trim(), T = s.getValue(M, "!capacity", ":", !0).trim(), S = s.getValue(M, "BSD Name", ":", !0).trim();
                if (T) {
                  let AA = 0;
                  if (T.indexOf("(") >= 0 && (AA = parseInt(
                    T.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, ""),
                    10
                  )), AA || (AA = parseInt(T, 10)), AA) {
                    const oA = s.getValue(M, "S.M.A.R.T. status", ":", !0).trim().toLowerCase();
                    l.push({
                      device: S,
                      type: "NVMe",
                      name: s.getValue(M, "Model", ":", !0).trim(),
                      vendor: a(s.getValue(M, "Model", ":", !0).trim()),
                      size: AA,
                      bytesPerSector: null,
                      totalCylinders: null,
                      totalHeads: null,
                      totalSectors: null,
                      totalTracks: null,
                      tracksPerCylinder: null,
                      sectorsPerTrack: null,
                      firmwareRevision: s.getValue(M, "Revision", ":", !0).trim(),
                      serialNum: s.getValue(M, "Serial Number", ":", !0).trim(),
                      interfaceType: ("PCIe " + O).trim(),
                      smartStatus: oA === "verified" ? "OK" : oA || "unknown",
                      temperature: null,
                      BSDName: S
                    }), D = `${D}printf "
${S}|"; diskutil info /dev/${S} | grep SMART;`;
                  }
                }
              });
            } catch {
              s.noop();
            }
            try {
              const aA = q.join(`
`).replaceAll(`Media:
 `, "Model:").split(`

          Product ID:`);
              aA.shift(), aA.forEach((tA) => {
                const M = tA.split(`
`), O = s.getValue(M, "Capacity", ":", !0).trim(), T = s.getValue(M, "BSD Name", ":", !0).trim();
                if (O) {
                  let S = 0;
                  if (O.indexOf("(") >= 0 && (S = parseInt(
                    O.match(/\(([^)]+)\)/)[1].replace(/\./g, "").replace(/,/g, "").replace(/\s/g, ""),
                    10
                  )), S || (S = parseInt(O, 10)), S) {
                    const AA = s.getValue(M, "S.M.A.R.T. status", ":", !0).trim().toLowerCase();
                    l.push({
                      device: T,
                      type: "USB",
                      name: s.getValue(M, "Model", ":", !0).trim().replaceAll(":", ""),
                      vendor: a(s.getValue(M, "Model", ":", !0).trim()),
                      size: S,
                      bytesPerSector: null,
                      totalCylinders: null,
                      totalHeads: null,
                      totalSectors: null,
                      totalTracks: null,
                      tracksPerCylinder: null,
                      sectorsPerTrack: null,
                      firmwareRevision: s.getValue(M, "Revision", ":", !0).trim(),
                      serialNum: s.getValue(M, "Serial Number", ":", !0).trim(),
                      interfaceType: "USB",
                      smartStatus: AA === "verified" ? "OK" : AA || "unknown",
                      temperature: null,
                      BSDName: T
                    }), D = D + `printf "
` + T + '|"; diskutil info /dev/' + T + " | grep SMART;";
                  }
                }
              });
            } catch {
              s.noop();
            }
            D ? (D = D + `printf "
"`, A(D, { maxBuffer: 1024 * 1024 }, (aA, tA) => {
              tA.toString().split(`
`).forEach((O) => {
                if (O) {
                  const T = O.split("|");
                  if (T.length === 2) {
                    const S = T[0];
                    T[1] = T[1].trim();
                    const AA = T[1].split(":");
                    if (AA.length === 2) {
                      AA[1] = AA[1].trim();
                      const oA = AA[1].toLowerCase();
                      for (let rA = 0; rA < l.length; rA++)
                        l[rA].BSDName === S && (l[rA].smartStatus = oA === "not supported" ? "not supported" : oA === "verified" ? "Ok" : oA === "failing" ? "Predicted Failure" : "unknown");
                    }
                  }
                }
              }), t(l);
            })) : t(l);
          }
        }), b)
          try {
            const f = [];
            if (f.push(
              s.powerShell(
                "Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl"
              )
            ), f.push(s.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")), s.smartMonToolsInstalled())
              try {
                const w = JSON.parse(g("smartctl --scan -j").toString());
                w && w.devices && w.devices.length > 0 && w.devices.forEach((Y) => {
                  f.push(o(`smartctl -j -a ${Y.name}`, s.execOptsWin));
                });
              } catch {
                s.noop();
              }
            s.promiseAll(f).then((w) => {
              let Y = w.results[0].toString().split(/\n\s*\n/);
              Y.forEach((_) => {
                const G = _.split(`\r
`), q = s.getValue(G, "Size", ":").trim(), j = s.getValue(G, "Status", ":").trim().toLowerCase();
                q && l.push({
                  device: s.getValue(G, "DeviceId", ":"),
                  // changed from PNPDeviceId to DeviceID (be be able to match devices)
                  type: _.indexOf("SSD") > -1 ? "SSD" : "HD",
                  // just a starting point ... better: MSFT_PhysicalDisk - Media Type ... see below
                  name: s.getValue(G, "Caption", ":"),
                  vendor: a(s.getValue(G, "Caption", ":", !0).trim()),
                  size: parseInt(q, 10),
                  bytesPerSector: parseInt(s.getValue(G, "BytesPerSector", ":"), 10),
                  totalCylinders: parseInt(s.getValue(G, "TotalCylinders", ":"), 10),
                  totalHeads: parseInt(s.getValue(G, "TotalHeads", ":"), 10),
                  totalSectors: parseInt(s.getValue(G, "TotalSectors", ":"), 10),
                  totalTracks: parseInt(s.getValue(G, "TotalTracks", ":"), 10),
                  tracksPerCylinder: parseInt(s.getValue(G, "TracksPerCylinder", ":"), 10),
                  sectorsPerTrack: parseInt(s.getValue(G, "SectorsPerTrack", ":"), 10),
                  firmwareRevision: s.getValue(G, "FirmwareRevision", ":").trim(),
                  serialNum: s.getValue(G, "SerialNumber", ":").trim(),
                  interfaceType: s.getValue(G, "InterfaceType", ":").trim(),
                  smartStatus: j === "ok" ? "Ok" : j === "degraded" ? "Degraded" : j === "pred fail" ? "Predicted Failure" : "Unknown",
                  temperature: null
                });
              }), Y = w.results[1].split(/\n\s*\n/), Y.forEach((_) => {
                const G = _.split(`\r
`), q = s.getValue(G, "SerialNumber", ":").trim(), j = s.getValue(G, "FriendlyName", ":").trim().replace("Msft ", "Microsoft"), aA = s.getValue(G, "Size", ":").trim(), tA = s.getValue(G, "Model", ":").trim(), M = s.getValue(G, "BusType", ":").trim();
                let O = s.getValue(G, "MediaType", ":").trim();
                if ((O === "3" || O === "HDD") && (O = "HD"), O === "4" && (O = "SSD"), O === "5" && (O = "SCM"), O === "Unspecified" && (tA.toLowerCase().indexOf("virtual") > -1 || tA.toLowerCase().indexOf("vbox") > -1) && (O = "Virtual"), aA) {
                  let T = s.findObjectByKey(l, "serialNum", q);
                  (T === -1 || q === "") && (T = s.findObjectByKey(l, "name", j)), T !== -1 && (l[T].type = O, l[T].interfaceType = M);
                }
              }), w.results.shift(), w.results.shift(), w.results.length && w.results.forEach((_) => {
                try {
                  const G = JSON.parse(_);
                  if (G.serial_number) {
                    const q = G.serial_number, j = s.findObjectByKey(l, "serialNum", q);
                    j !== -1 && (l[j].smartStatus = G.smart_status && G.smart_status.passed ? "Ok" : G.smart_status && G.smart_status.passed === !1 ? "Predicted Failure" : "unknown", G.temperature && G.temperature.current && (l[j].temperature = G.temperature.current), l[j].smartData = G);
                  }
                } catch {
                  s.noop();
                }
              }), m && m(l), I(l);
            });
          } catch {
            m && m(l), I(l);
          }
      });
    });
  }
  return filesystem.diskLayout = V, filesystem;
}
var network = {}, hasRequiredNetwork;
function requireNetwork() {
  if (hasRequiredNetwork) return network;
  hasRequiredNetwork = 1;
  const s = require$$0$1, e = require$$1.exec, A = require$$1.execSync, g = require$$1$1, o = requireUtil(), B = process.platform, F = B === "linux" || B === "android", x = B === "darwin", b = B === "win32", X = B === "freebsd", W = B === "openbsd", eA = B === "netbsd", IA = B === "sunos", z = {};
  let N = "", J = {}, $ = [], H = [], y = {}, p;
  function h() {
    let M = "", O = "";
    try {
      const T = s.networkInterfaces();
      let S = 9999;
      for (let AA in T)
        ({}).hasOwnProperty.call(T, AA) && T[AA].forEach((oA) => {
          oA && oA.internal === !1 && (O = O || AA, oA.scopeid && oA.scopeid < S && (M = AA, S = oA.scopeid));
        });
      if (M = M || O || "", b) {
        let AA = "";
        if (A("netstat -r", o.execOptsWin).toString().split(s.EOL).forEach((lA) => {
          if (lA = lA.replace(/\s+/g, " ").trim(), lA.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(lA)) {
            const pA = lA.split(" ");
            pA.length >= 5 && (AA = pA[pA.length - 2]);
          }
        }), AA)
          for (let lA in T)
            ({}).hasOwnProperty.call(T, lA) && T[lA].forEach((pA) => {
              pA && pA.address && pA.address === AA && (M = lA);
            });
      }
      if (F) {
        const rA = A("ip route 2> /dev/null | grep default", o.execOptsLinux).toString().split(`
`)[0].split(/\s+/);
        rA[0] === "none" && rA[5] ? M = rA[5] : rA[4] && (M = rA[4]), M.indexOf(":") > -1 && (M = M.split(":")[1].trim());
      }
      if (x || X || W || eA || IA) {
        let AA = "";
        F && (AA = "ip route 2> /dev/null | grep default | awk '{print $5}'"), x && (AA = "route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"), (X || W || eA || IA) && (AA = "route get 0.0.0.0 | grep interface:"), M = A(AA).toString().split(`
`)[0], M.indexOf(":") > -1 && (M = M.split(":")[1].trim());
      }
    } catch {
      o.noop();
    }
    return M && (N = M), N;
  }
  network.getDefaultNetworkInterface = h;
  function E() {
    let M = "", O = "";
    const T = {};
    if (F || X || W || eA) {
      if (typeof p > "u")
        try {
          const S = A("which ip", o.execOptsLinux).toString().split(`
`);
          S.length && S[0].indexOf(":") === -1 && S[0].indexOf("/") === 0 ? p = S[0] : p = "";
        } catch {
          p = "";
        }
      try {
        const S = "export LC_ALL=C; " + (p ? p + " link show up" : "/sbin/ifconfig") + "; unset LC_ALL", oA = A(S, o.execOptsLinux).toString().split(`
`);
        for (let rA = 0; rA < oA.length; rA++)
          if (oA[rA] && oA[rA][0] !== " ") {
            if (p) {
              const cA = oA[rA + 1].trim().split(" ");
              cA[0] === "link/ether" && (M = oA[rA].split(" ")[1], M = M.slice(0, M.length - 1), O = cA[1]);
            } else
              M = oA[rA].split(" ")[0], O = oA[rA].split("HWaddr ")[1];
            M && O && (T[M] = O.trim(), M = "", O = "");
          }
      } catch {
        o.noop();
      }
    }
    if (x)
      try {
        const oA = A("/sbin/ifconfig").toString().split(`
`);
        for (let rA = 0; rA < oA.length; rA++)
          oA[rA] && oA[rA][0] !== "	" && oA[rA].indexOf(":") > 0 ? M = oA[rA].split(":")[0] : oA[rA].indexOf("	ether ") === 0 && (O = oA[rA].split("	ether ")[1], M && O && (T[M] = O.trim(), M = "", O = ""));
      } catch {
        o.noop();
      }
    return T;
  }
  function u(M) {
    return new Promise((O) => {
      process.nextTick(() => {
        const T = h();
        M && M(T), O(T);
      });
    });
  }
  network.networkInterfaceDefault = u;
  function r(M, O) {
    const T = [];
    for (let S in M)
      try {
        if ({}.hasOwnProperty.call(M, S) && M[S].trim() !== "") {
          const AA = M[S].trim().split(`\r
`);
          let oA = null;
          try {
            oA = O && O[S] ? O[S].trim().split(`\r
`) : [];
          } catch {
            o.noop();
          }
          const rA = o.getValue(AA, "NetEnabled", ":");
          let cA = o.getValue(AA, "AdapterTypeID", ":") === "9" ? "wireless" : "wired";
          const lA = o.getValue(AA, "Name", ":").replace(/\]/g, ")").replace(/\[/g, "("), pA = o.getValue(AA, "NetConnectionID", ":").replace(/\]/g, ")").replace(/\[/g, "(");
          if ((lA.toLowerCase().indexOf("wi-fi") >= 0 || lA.toLowerCase().indexOf("wireless") >= 0) && (cA = "wireless"), rA !== "") {
            const BA = parseInt(o.getValue(AA, "speed", ":").trim(), 10) / 1e6;
            T.push({
              mac: o.getValue(AA, "MACAddress", ":").toLowerCase(),
              dhcp: o.getValue(oA, "dhcpEnabled", ":").toLowerCase() === "true",
              name: lA,
              iface: pA,
              netEnabled: rA === "TRUE",
              speed: isNaN(BA) ? null : BA,
              operstate: o.getValue(AA, "NetConnectionStatus", ":") === "2" ? "up" : "down",
              type: cA
            });
          }
        }
      } catch {
        o.noop();
      }
    return T;
  }
  function Q() {
    return new Promise((M) => {
      process.nextTick(() => {
        let O = "Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";
        O += "Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";
        try {
          o.powerShell(O).then((T) => {
            T = T.split("#-#-#-#");
            const S = (T[0] || "").split(/\n\s*\n/), AA = (T[1] || "").split(/\n\s*\n/);
            M(r(S, AA));
          });
        } catch {
          M([]);
        }
      });
    });
  }
  function d() {
    let M = {};
    const O = {
      primaryDNS: "",
      exitCode: 0,
      ifaces: []
    };
    try {
      return A("ipconfig /all", o.execOptsWin).split(`\r
\r
`).forEach((AA, oA) => {
        if (oA === 1) {
          const rA = AA.split(`\r
`).filter((lA) => lA.toUpperCase().includes("DNS")), cA = rA[0].substring(rA[0].lastIndexOf(":") + 1);
          O.primaryDNS = cA.trim(), O.primaryDNS || (O.primaryDNS = "Not defined");
        }
        if (oA > 1)
          if (oA % 2 === 0) {
            const rA = AA.substring(AA.lastIndexOf(" ") + 1).replace(":", "");
            M.name = rA;
          } else {
            const rA = AA.split(`\r
`).filter((lA) => lA.toUpperCase().includes("DNS")), cA = rA[0].substring(rA[0].lastIndexOf(":") + 1);
            M.dnsSuffix = cA.trim(), O.ifaces.push(M), M = {};
          }
      }), O;
    } catch {
      return {
        primaryDNS: "",
        exitCode: 0,
        ifaces: []
      };
    }
  }
  function c(M, O) {
    let T = "";
    const S = O + ".";
    try {
      const AA = M.filter((oA) => S.includes(oA.name + ".")).map((oA) => oA.dnsSuffix);
      return AA[0] && (T = AA[0]), T || (T = ""), T;
    } catch {
      return "Unknown";
    }
  }
  function n() {
    try {
      return A("netsh lan show profiles", o.execOptsWin).split(`\r
Profile on interface`);
    } catch (M) {
      return M.status === 1 && M.stdout.includes("AutoConfig") ? "Disabled" : [];
    }
  }
  function L(M) {
    try {
      return A(`netsh wlan show  interface name="${M}" | findstr "SSID"`, o.execOptsWin).split(`\r
`).shift().split(":").pop().trim();
    } catch {
      return "Unknown";
    }
  }
  function k(M, O, T) {
    const S = {
      state: "Unknown",
      protocol: "Unknown"
    };
    if (T === "Disabled")
      return S.state = "Disabled", S.protocol = "Not defined", S;
    if (M === "wired" && T.length > 0)
      try {
        const oA = T.find((cA) => cA.includes(O + `\r
`)).split(`\r
`), rA = oA.find((cA) => cA.includes("802.1x"));
        if (rA.includes("Disabled"))
          S.state = "Disabled", S.protocol = "Not defined";
        else if (rA.includes("Enabled")) {
          const cA = oA.find((lA) => lA.includes("EAP"));
          S.protocol = cA.split(":").pop(), S.state = "Enabled";
        }
      } catch {
        return S;
      }
    else if (M === "wireless") {
      let AA = "", oA = "";
      try {
        const rA = L(O);
        if (rA !== "Unknown") {
          let cA = "";
          const lA = o.isPrototypePolluted() ? "---" : o.sanitizeShellString(rA), pA = o.mathMin(lA.length, 32);
          for (let uA = 0; uA <= pA; uA++)
            lA[uA] !== void 0 && (cA = cA + lA[uA]);
          const BA = A(`netsh wlan show profiles "${cA}"`, o.execOptsWin).split(`\r
`);
          AA = (BA.find((uA) => uA.indexOf("802.1X") >= 0) || "").trim(), oA = (BA.find((uA) => uA.indexOf("EAP") >= 0) || "").trim();
        }
        AA.includes(":") && oA.includes(":") && (S.state = AA.split(":").pop(), S.protocol = oA.split(":").pop());
      } catch {
        return error.status === 1 && error.stdout.includes("AutoConfig") && (S.state = "Disabled", S.protocol = "Not defined"), S;
      }
    }
    return S;
  }
  function K(M) {
    const O = [];
    let T = [];
    return M.forEach((S) => {
      !S.startsWith("	") && !S.startsWith(" ") && T.length && (O.push(T), T = []), T.push(S);
    }), T.length && O.push(T), O;
  }
  function gA(M) {
    const O = [];
    return M.forEach((T) => {
      const S = {
        iface: "",
        mtu: null,
        mac: "",
        ip6: "",
        ip4: "",
        speed: null,
        type: "",
        operstate: "",
        duplex: "",
        internal: !1
      }, AA = T[0];
      S.iface = AA.split(":")[0].trim();
      const oA = AA.split("> mtu");
      S.mtu = oA.length > 1 ? parseInt(oA[1], 10) : null, isNaN(S.mtu) && (S.mtu = null), S.internal = oA[0].toLowerCase().indexOf("loopback") > -1, T.forEach((lA) => {
        lA.trim().startsWith("ether ") && (S.mac = lA.split("ether ")[1].toLowerCase().trim()), lA.trim().startsWith("inet6 ") && !S.ip6 && (S.ip6 = lA.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]), lA.trim().startsWith("inet ") && !S.ip4 && (S.ip4 = lA.split("inet ")[1].toLowerCase().split(" ")[0]);
      });
      let rA = o.getValue(T, "link rate");
      S.speed = rA ? parseFloat(rA) : null, S.speed === null ? (rA = o.getValue(T, "uplink rate"), S.speed = rA ? parseFloat(rA) : null, S.speed !== null && rA.toLowerCase().indexOf("gbps") >= 0 && (S.speed = S.speed * 1e3)) : rA.toLowerCase().indexOf("gbps") >= 0 && (S.speed = S.speed * 1e3), S.type = o.getValue(T, "type").toLowerCase().indexOf("wi-fi") > -1 ? "wireless" : "wired";
      const cA = o.getValue(T, "status").toLowerCase();
      S.operstate = cA === "active" ? "up" : cA === "inactive" ? "down" : "unknown", S.duplex = o.getValue(T, "media").toLowerCase().indexOf("half-duplex") > -1 ? "half" : "full", (S.ip6 || S.ip4 || S.mac) && O.push(S);
    }), O;
  }
  function v() {
    const M = "/sbin/ifconfig -v";
    try {
      const O = A(M, { maxBuffer: 104857600 }).toString().split(`
`), T = K(O);
      return gA(T);
    } catch {
      return [];
    }
  }
  function U(M) {
    const O = `nmcli device status 2>/dev/null | grep ${M}`;
    try {
      const oA = A(O, o.execOptsLinux).toString().replace(/\s+/g, " ").trim().split(" ").slice(3).join(" ");
      return oA !== "--" ? oA : "";
    } catch {
      return "";
    }
  }
  function V(M) {
    let O = [];
    try {
      const T = `cat ${M} 2> /dev/null | grep 'iface\\|source'`;
      A(T, o.execOptsLinux).toString().split(`
`).forEach((AA) => {
        const oA = AA.replace(/\s+/g, " ").trim().split(" ");
        if (oA.length >= 4 && AA.toLowerCase().indexOf(" inet ") >= 0 && AA.toLowerCase().indexOf("dhcp") >= 0 && O.push(oA[1]), AA.toLowerCase().includes("source")) {
          const rA = AA.split(" ")[1];
          O = O.concat(V(rA));
        }
      });
    } catch {
      o.noop();
    }
    return O;
  }
  function m() {
    const M = "ip a 2> /dev/null";
    let O = [];
    try {
      const T = A(M, o.execOptsLinux).toString().split(`
`), S = K(T);
      O = a(S);
    } catch {
      o.noop();
    }
    try {
      O = V("/etc/network/interfaces");
    } catch {
      o.noop();
    }
    return O;
  }
  function a(M) {
    const O = [];
    return M && M.length && M.forEach((T) => {
      if (T && T.length && T[0].split(":").length > 2) {
        for (let AA of T)
          if (AA.indexOf(" inet ") >= 0 && AA.indexOf(" dynamic ") >= 0) {
            const oA = AA.split(" "), rA = oA[oA.length - 1].trim();
            O.push(rA);
            break;
          }
      }
    }), O;
  }
  function I(M, O, T) {
    let S = !1;
    if (O) {
      const AA = `nmcli connection show "${O}" 2>/dev/null | grep ipv4.method;`;
      try {
        switch (A(AA, o.execOptsLinux).toString().replace(/\s+/g, " ").trim().split(" ").slice(1).toString()) {
          case "auto":
            S = !0;
            break;
          default:
            S = !1;
            break;
        }
        return S;
      } catch {
        return T.indexOf(M) >= 0;
      }
    } else
      return T.indexOf(M) >= 0;
  }
  function t(M) {
    let O = !1;
    const T = `ipconfig getpacket "${M}" 2>/dev/null | grep lease_time;`;
    try {
      const S = A(T).toString().split(`
`);
      S.length && S[0].startsWith("lease_time") && (O = !0);
    } catch {
      o.noop();
    }
    return O;
  }
  function l(M) {
    if (M) {
      const O = `nmcli connection show "${M}" 2>/dev/null | grep ipv4.dns-search;`;
      try {
        const AA = A(O, o.execOptsLinux).toString().replace(/\s+/g, " ").trim().split(" ").slice(1).toString();
        return AA === "--" ? "Not defined" : AA;
      } catch {
        return "Unknown";
      }
    } else
      return "Unknown";
  }
  function D(M) {
    if (M) {
      const O = `nmcli connection show "${M}" 2>/dev/null | grep 802-1x.eap;`;
      try {
        const AA = A(O, o.execOptsLinux).toString().replace(/\s+/g, " ").trim().split(" ").slice(1).toString();
        return AA === "--" ? "" : AA;
      } catch {
        return "Not defined";
      }
    } else
      return "Not defined";
  }
  function f(M) {
    return M ? M === "Not defined" ? "Disabled" : "Enabled" : "Unknown";
  }
  function w(M, O, T) {
    const S = [
      "00:00:00:00:00:00",
      "00:03:FF",
      "00:05:69",
      "00:0C:29",
      "00:0F:4B",
      "00:13:07",
      "00:13:BE",
      "00:15:5d",
      "00:16:3E",
      "00:1C:42",
      "00:21:F6",
      "00:24:0B",
      "00:50:56",
      "00:A0:B1",
      "00:E0:C8",
      "08:00:27",
      "0A:00:27",
      "18:92:2C",
      "16:DF:49",
      "3C:F3:92",
      "54:52:00",
      "FC:15:97"
    ];
    return T ? S.filter((AA) => T.toUpperCase().toUpperCase().startsWith(AA.substring(0, T.length))).length > 0 || M.toLowerCase().indexOf(" virtual ") > -1 || O.toLowerCase().indexOf(" virtual ") > -1 || M.toLowerCase().indexOf("vethernet ") > -1 || O.toLowerCase().indexOf("vethernet ") > -1 || M.toLowerCase().startsWith("veth") || O.toLowerCase().startsWith("veth") || M.toLowerCase().startsWith("vboxnet") || O.toLowerCase().startsWith("vboxnet") : !1;
  }
  function Y(M, O, T) {
    return typeof M == "string" && (T = M, O = !0, M = null), typeof M == "boolean" && (O = M, M = null, T = ""), typeof O > "u" && (O = !0), T = T || "", T = "" + T, new Promise((S) => {
      process.nextTick(() => {
        const AA = s.networkInterfaces();
        let oA = [], rA = [], cA = [], lA = [];
        if (x || X || W || eA)
          if (JSON.stringify(AA) === JSON.stringify(J) && !O)
            oA = H, M && M(oA), S(oA);
          else {
            const pA = h();
            J = JSON.parse(JSON.stringify(AA)), rA = v(), rA.forEach((BA) => {
              let uA = "", hA = "", wA = "", NA = "";
              BA.ip4 = "", BA.ip6 = "", {}.hasOwnProperty.call(AA, BA.iface) && AA[BA.iface].forEach((mA) => {
                (mA.family === "IPv4" || mA.family === 4) && (!BA.ip4 && !BA.ip4.match(/^169.254/i) && (BA.ip4 = mA.address, BA.ip4subnet = mA.netmask), BA.ip4.match(/^169.254/i) && (uA = mA.address, hA = mA.netmask)), (mA.family === "IPv6" || mA.family === 6) && (!BA.ip6 && !BA.ip6.match(/^fe80::/i) && (BA.ip6 = mA.address, BA.ip6subnet = mA.netmask), BA.ip6.match(/^fe80::/i) && (wA = mA.address, NA = mA.netmask));
              }), !BA.ip4 && uA && (BA.ip4 = uA, BA.ip4subnet = hA), !BA.ip6 && wA && (BA.ip6 = wA, BA.ip6subnet = NA);
              let dA = "";
              const RA = o.isPrototypePolluted() ? "---" : o.sanitizeShellString(BA.iface), LA = o.mathMin(RA.length, 2e3);
              for (let mA = 0; mA <= LA; mA++)
                RA[mA] !== void 0 && (dA = dA + RA[mA]);
              oA.push({
                iface: BA.iface,
                ifaceName: BA.iface,
                default: BA.iface === pA,
                ip4: BA.ip4,
                ip4subnet: BA.ip4subnet || "",
                ip6: BA.ip6,
                ip6subnet: BA.ip6subnet || "",
                mac: BA.mac,
                internal: BA.internal,
                virtual: BA.internal ? !1 : w(BA.iface, BA.iface, BA.mac),
                operstate: BA.operstate,
                type: BA.type,
                duplex: BA.duplex,
                mtu: BA.mtu,
                speed: BA.speed,
                dhcp: t(dA),
                dnsSuffix: "",
                ieee8021xAuth: "",
                ieee8021xState: "",
                carrierChanges: 0
              });
            }), H = oA, T.toLowerCase().indexOf("default") >= 0 && (oA = oA.filter((BA) => BA.default), oA.length > 0 ? oA = oA[0] : oA = []), M && M(oA), S(oA);
          }
        if (F)
          if (JSON.stringify(AA) === JSON.stringify(J) && !O)
            oA = H, M && M(oA), S(oA);
          else {
            J = JSON.parse(JSON.stringify(AA)), $ = m();
            const pA = h();
            for (let BA in AA) {
              let uA = "", hA = "", wA = "", NA = "", dA = "", RA = "", LA = "", mA = null, xA = 0, FA = !1, MA = "", kA = "", UA = "", WA = "", TA = "", ZA = "", PA = "", jA = "";
              if ({}.hasOwnProperty.call(AA, BA)) {
                const OA = BA;
                AA[BA].forEach((CA) => {
                  (CA.family === "IPv4" || CA.family === 4) && (!uA && !uA.match(/^169.254/i) && (uA = CA.address, hA = CA.netmask), uA.match(/^169.254/i) && (TA = CA.address, ZA = CA.netmask)), (CA.family === "IPv6" || CA.family === 6) && (!wA && !wA.match(/^fe80::/i) && (wA = CA.address, NA = CA.netmask), wA.match(/^fe80::/i) && (PA = CA.address, jA = CA.netmask)), dA = CA.mac;
                  const P = parseInt(process.versions.node.split("."), 10);
                  dA.indexOf("00:00:0") > -1 && (F || x) && !CA.internal && P >= 8 && P <= 11 && (Object.keys(y).length === 0 && (y = E()), dA = y[BA] || "");
                }), !uA && TA && (uA = TA, hA = ZA), !wA && PA && (wA = PA, NA = jA);
                const HA = BA.split(":")[0].trim();
                let DA = "";
                const VA = o.isPrototypePolluted() ? "---" : o.sanitizeShellString(HA), te = o.mathMin(VA.length, 2e3);
                for (let CA = 0; CA <= te; CA++)
                  VA[CA] !== void 0 && (DA = DA + VA[CA]);
                const zA = `echo -n "addr_assign_type: "; cat /sys/class/net/${DA}/addr_assign_type 2>/dev/null; echo;
            echo -n "address: "; cat /sys/class/net/${DA}/address 2>/dev/null; echo;
            echo -n "addr_len: "; cat /sys/class/net/${DA}/addr_len 2>/dev/null; echo;
            echo -n "broadcast: "; cat /sys/class/net/${DA}/broadcast 2>/dev/null; echo;
            echo -n "carrier: "; cat /sys/class/net/${DA}/carrier 2>/dev/null; echo;
            echo -n "carrier_changes: "; cat /sys/class/net/${DA}/carrier_changes 2>/dev/null; echo;
            echo -n "dev_id: "; cat /sys/class/net/${DA}/dev_id 2>/dev/null; echo;
            echo -n "dev_port: "; cat /sys/class/net/${DA}/dev_port 2>/dev/null; echo;
            echo -n "dormant: "; cat /sys/class/net/${DA}/dormant 2>/dev/null; echo;
            echo -n "duplex: "; cat /sys/class/net/${DA}/duplex 2>/dev/null; echo;
            echo -n "flags: "; cat /sys/class/net/${DA}/flags 2>/dev/null; echo;
            echo -n "gro_flush_timeout: "; cat /sys/class/net/${DA}/gro_flush_timeout 2>/dev/null; echo;
            echo -n "ifalias: "; cat /sys/class/net/${DA}/ifalias 2>/dev/null; echo;
            echo -n "ifindex: "; cat /sys/class/net/${DA}/ifindex 2>/dev/null; echo;
            echo -n "iflink: "; cat /sys/class/net/${DA}/iflink 2>/dev/null; echo;
            echo -n "link_mode: "; cat /sys/class/net/${DA}/link_mode 2>/dev/null; echo;
            echo -n "mtu: "; cat /sys/class/net/${DA}/mtu 2>/dev/null; echo;
            echo -n "netdev_group: "; cat /sys/class/net/${DA}/netdev_group 2>/dev/null; echo;
            echo -n "operstate: "; cat /sys/class/net/${DA}/operstate 2>/dev/null; echo;
            echo -n "proto_down: "; cat /sys/class/net/${DA}/proto_down 2>/dev/null; echo;
            echo -n "speed: "; cat /sys/class/net/${DA}/speed 2>/dev/null; echo;
            echo -n "tx_queue_len: "; cat /sys/class/net/${DA}/tx_queue_len 2>/dev/null; echo;
            echo -n "type: "; cat /sys/class/net/${DA}/type 2>/dev/null; echo;
            echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${DA}; echo;
            echo -n "wirelessspeed: "; iw dev ${DA} link 2>&1 | grep bitrate; echo;`;
                let KA = [];
                try {
                  KA = A(zA, o.execOptsLinux).toString().split(`
`);
                  const CA = U(DA);
                  FA = I(DA, CA, $), MA = l(CA), kA = D(CA), UA = f(kA);
                } catch {
                  o.noop();
                }
                RA = o.getValue(KA, "duplex"), RA = RA.startsWith("cat") ? "" : RA, LA = parseInt(o.getValue(KA, "mtu"), 10);
                let _A = parseInt(o.getValue(KA, "speed"), 10);
                mA = isNaN(_A) ? null : _A;
                const iA = o.getValue(KA, "tx bitrate");
                mA === null && iA && (_A = parseFloat(iA), mA = isNaN(_A) ? null : _A), xA = parseInt(o.getValue(KA, "carrier_changes"), 10);
                const sA = o.getValue(KA, "operstate");
                WA = sA === "up" ? o.getValue(KA, "wireless").trim() ? "wireless" : "wired" : "unknown", (DA === "lo" || DA.startsWith("bond")) && (WA = "virtual");
                let Z = AA[BA] && AA[BA][0] ? AA[BA][0].internal : !1;
                (BA.toLowerCase().indexOf("loopback") > -1 || OA.toLowerCase().indexOf("loopback") > -1) && (Z = !0);
                const nA = Z ? !1 : w(BA, OA, dA);
                oA.push({
                  iface: DA,
                  ifaceName: OA,
                  default: HA === pA,
                  ip4: uA,
                  ip4subnet: hA,
                  ip6: wA,
                  ip6subnet: NA,
                  mac: dA,
                  internal: Z,
                  virtual: nA,
                  operstate: sA,
                  type: WA,
                  duplex: RA,
                  mtu: LA,
                  speed: mA,
                  dhcp: FA,
                  dnsSuffix: MA,
                  ieee8021xAuth: kA,
                  ieee8021xState: UA,
                  carrierChanges: xA
                });
              }
            }
            H = oA, T.toLowerCase().indexOf("default") >= 0 && (oA = oA.filter((BA) => BA.default), oA.length > 0 ? oA = oA[0] : oA = []), M && M(oA), S(oA);
          }
        if (b)
          if (JSON.stringify(AA) === JSON.stringify(J) && !O)
            oA = H, M && M(oA), S(oA);
          else {
            J = JSON.parse(JSON.stringify(AA));
            const pA = h();
            Q().then((BA) => {
              BA.forEach((uA) => {
                let hA = !1;
                Object.keys(AA).forEach((wA) => {
                  hA || AA[wA].forEach((NA) => {
                    Object.keys(NA).indexOf("mac") >= 0 && (hA = NA.mac === uA.mac);
                  });
                }), hA || (AA[uA.name] = [{ mac: uA.mac }]);
              }), lA = n(), cA = d();
              for (let uA in AA) {
                let hA = "";
                const wA = o.isPrototypePolluted() ? "---" : o.sanitizeShellString(uA), NA = o.mathMin(wA.length, 2e3);
                for (let DA = 0; DA <= NA; DA++)
                  wA[DA] !== void 0 && (hA = hA + wA[DA]);
                let dA = uA, RA = "", LA = "", mA = "", xA = "", FA = "", MA = "", kA = "", UA = null, WA = 0, TA = "down", ZA = !1, PA = "", jA = "", OA = "", HA = "";
                if ({}.hasOwnProperty.call(AA, uA)) {
                  let DA = uA;
                  AA[uA].forEach((_A) => {
                    (_A.family === "IPv4" || _A.family === 4) && (RA = _A.address, LA = _A.netmask), (_A.family === "IPv6" || _A.family === 6) && (!mA || mA.match(/^fe80::/i)) && (mA = _A.address, xA = _A.netmask), FA = _A.mac;
                    const iA = parseInt(process.versions.node.split("."), 10);
                    FA.indexOf("00:00:0") > -1 && (F || x) && !_A.internal && iA >= 8 && iA <= 11 && (Object.keys(y).length === 0 && (y = E()), FA = y[uA] || "");
                  }), PA = c(cA.ifaces, hA);
                  let VA = !1;
                  BA.forEach((_A) => {
                    _A.mac === FA && !VA && (dA = _A.iface || dA, DA = _A.name, ZA = _A.dhcp, TA = _A.operstate, UA = TA === "up" ? _A.speed : 0, HA = _A.type, VA = !0);
                  }), (uA.toLowerCase().indexOf("wlan") >= 0 || DA.toLowerCase().indexOf("wlan") >= 0 || DA.toLowerCase().indexOf("802.11n") >= 0 || DA.toLowerCase().indexOf("wireless") >= 0 || DA.toLowerCase().indexOf("wi-fi") >= 0 || DA.toLowerCase().indexOf("wifi") >= 0) && (HA = "wireless");
                  const te = k(HA, hA, lA);
                  jA = te.protocol, OA = te.state;
                  let zA = AA[uA] && AA[uA][0] ? AA[uA][0].internal : !1;
                  (uA.toLowerCase().indexOf("loopback") > -1 || DA.toLowerCase().indexOf("loopback") > -1) && (zA = !0);
                  const KA = zA ? !1 : w(uA, DA, FA);
                  oA.push({
                    iface: dA,
                    ifaceName: DA,
                    default: dA === pA,
                    ip4: RA,
                    ip4subnet: LA,
                    ip6: mA,
                    ip6subnet: xA,
                    mac: FA,
                    internal: zA,
                    virtual: KA,
                    operstate: TA,
                    type: HA,
                    duplex: MA,
                    mtu: kA,
                    speed: UA,
                    dhcp: ZA,
                    dnsSuffix: PA,
                    ieee8021xAuth: jA,
                    ieee8021xState: OA,
                    carrierChanges: WA
                  });
                }
              }
              H = oA, T.toLowerCase().indexOf("default") >= 0 && (oA = oA.filter((uA) => uA.default), oA.length > 0 ? oA = oA[0] : oA = []), M && M(oA), S(oA);
            });
          }
      });
    });
  }
  network.networkInterfaces = Y;
  function _(M, O, T, S, AA, oA, rA, cA) {
    const lA = {
      iface: M,
      operstate: S,
      rx_bytes: O,
      rx_dropped: AA,
      rx_errors: oA,
      tx_bytes: T,
      tx_dropped: rA,
      tx_errors: cA,
      rx_sec: null,
      tx_sec: null,
      ms: 0
    };
    return z[M] && z[M].ms ? (lA.ms = Date.now() - z[M].ms, lA.rx_sec = O - z[M].rx_bytes >= 0 ? (O - z[M].rx_bytes) / (lA.ms / 1e3) : 0, lA.tx_sec = T - z[M].tx_bytes >= 0 ? (T - z[M].tx_bytes) / (lA.ms / 1e3) : 0, z[M].rx_bytes = O, z[M].tx_bytes = T, z[M].rx_sec = lA.rx_sec, z[M].tx_sec = lA.tx_sec, z[M].ms = Date.now(), z[M].last_ms = lA.ms, z[M].operstate = S) : (z[M] || (z[M] = {}), z[M].rx_bytes = O, z[M].tx_bytes = T, z[M].rx_sec = null, z[M].tx_sec = null, z[M].ms = Date.now(), z[M].last_ms = 0, z[M].operstate = S), lA;
  }
  function G(M, O) {
    let T = [];
    return new Promise((S) => {
      process.nextTick(() => {
        if (o.isFunction(M) && !O)
          O = M, T = [h()];
        else {
          if (typeof M != "string" && M !== void 0)
            return O && O([]), S([]);
          M = M || h();
          try {
            M.__proto__.toLowerCase = o.stringToLower, M.__proto__.replace = o.stringReplace, M.__proto__.toString = o.stringToString, M.__proto__.substr = o.stringSubstr, M.__proto__.substring = o.stringSubstring, M.__proto__.trim = o.stringTrim, M.__proto__.startsWith = o.stringStartWith;
          } catch {
            Object.setPrototypeOf(M, o.stringObj);
          }
          M = M.trim().replace(/,+/g, "|"), T = M.split("|");
        }
        const AA = [], oA = [];
        if (T.length && T[0].trim() === "*")
          T = [], Y(!1).then((rA) => {
            for (let cA of rA)
              T.push(cA.iface);
            G(T.join(",")).then((cA) => {
              O && O(cA), S(cA);
            });
          });
        else {
          for (let rA of T)
            oA.push(q(rA.trim()));
          oA.length ? Promise.all(oA).then((rA) => {
            O && O(rA), S(rA);
          }) : (O && O(AA), S(AA));
        }
      });
    });
  }
  function q(M) {
    function O(T) {
      const S = [];
      for (let AA in T)
        if ({}.hasOwnProperty.call(T, AA) && T[AA].trim() !== "") {
          const oA = T[AA].trim().split(`\r
`);
          S.push({
            name: o.getValue(oA, "Name", ":").replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase(),
            rx_bytes: parseInt(o.getValue(oA, "BytesReceivedPersec", ":"), 10),
            rx_errors: parseInt(o.getValue(oA, "PacketsReceivedErrors", ":"), 10),
            rx_dropped: parseInt(o.getValue(oA, "PacketsReceivedDiscarded", ":"), 10),
            tx_bytes: parseInt(o.getValue(oA, "BytesSentPersec", ":"), 10),
            tx_errors: parseInt(o.getValue(oA, "PacketsOutboundErrors", ":"), 10),
            tx_dropped: parseInt(o.getValue(oA, "PacketsOutboundDiscarded", ":"), 10)
          });
        }
      return S;
    }
    return new Promise((T) => {
      process.nextTick(() => {
        let S = "";
        const AA = o.isPrototypePolluted() ? "---" : o.sanitizeShellString(M), oA = o.mathMin(AA.length, 2e3);
        for (let LA = 0; LA <= oA; LA++)
          AA[LA] !== void 0 && (S = S + AA[LA]);
        let rA = {
          iface: S,
          operstate: "unknown",
          rx_bytes: 0,
          rx_dropped: 0,
          rx_errors: 0,
          tx_bytes: 0,
          tx_dropped: 0,
          tx_errors: 0,
          rx_sec: null,
          tx_sec: null,
          ms: 0
        }, cA = "unknown", lA = 0, pA = 0, BA = 0, uA = 0, hA = 0, wA = 0, NA, dA, RA;
        if (!z[S] || z[S] && !z[S].ms || z[S] && z[S].ms && Date.now() - z[S].ms >= 500) {
          if (F && (g.existsSync("/sys/class/net/" + S) ? (NA = "cat /sys/class/net/" + S + "/operstate; cat /sys/class/net/" + S + "/statistics/rx_bytes; cat /sys/class/net/" + S + "/statistics/tx_bytes; cat /sys/class/net/" + S + "/statistics/rx_dropped; cat /sys/class/net/" + S + "/statistics/rx_errors; cat /sys/class/net/" + S + "/statistics/tx_dropped; cat /sys/class/net/" + S + "/statistics/tx_errors; ", e(NA, (LA, mA) => {
            LA || (dA = mA.toString().split(`
`), cA = dA[0].trim(), lA = parseInt(dA[1], 10), pA = parseInt(dA[2], 10), BA = parseInt(dA[3], 10), uA = parseInt(dA[4], 10), hA = parseInt(dA[5], 10), wA = parseInt(dA[6], 10), rA = _(S, lA, pA, cA, BA, uA, hA, wA)), T(rA);
          })) : T(rA)), (X || W || eA) && (NA = "netstat -ibndI " + S, e(NA, (LA, mA) => {
            if (!LA) {
              dA = mA.toString().split(`
`);
              for (let xA = 1; xA < dA.length; xA++) {
                const FA = dA[xA].replace(/ +/g, " ").split(" ");
                FA && FA[0] && FA[7] && FA[10] && (lA = lA + parseInt(FA[7]), FA[6].trim() !== "-" && (BA = BA + parseInt(FA[6])), FA[5].trim() !== "-" && (uA = uA + parseInt(FA[5])), pA = pA + parseInt(FA[10]), FA[12].trim() !== "-" && (hA = hA + parseInt(FA[12])), FA[9].trim() !== "-" && (wA = wA + parseInt(FA[9])), cA = "up");
              }
              rA = _(S, lA, pA, cA, BA, uA, hA, wA);
            }
            T(rA);
          })), x && (NA = "ifconfig " + S + ' | grep "status"', e(NA, (LA, mA) => {
            rA.operstate = (mA.toString().split(":")[1] || "").trim(), rA.operstate = (rA.operstate || "").toLowerCase(), rA.operstate = rA.operstate === "active" ? "up" : rA.operstate === "inactive" ? "down" : "unknown", NA = "netstat -bdI " + S, e(NA, (xA, FA) => {
              if (!xA && (dA = FA.toString().split(`
`), dA.length > 1 && dA[1].trim() !== "")) {
                RA = dA[1].replace(/ +/g, " ").split(" ");
                const MA = RA.length > 11 ? 1 : 0;
                lA = parseInt(RA[MA + 5]), BA = parseInt(RA[MA + 10]), uA = parseInt(RA[MA + 4]), pA = parseInt(RA[MA + 8]), hA = parseInt(RA[MA + 10]), wA = parseInt(RA[MA + 7]), rA = _(S, lA, pA, rA.operstate, BA, uA, hA, wA);
              }
              T(rA);
            });
          })), b) {
            let LA = [], mA = S;
            o.powerShell(
              "Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl"
            ).then((xA, FA) => {
              if (!FA) {
                const MA = xA.toString().split(/\n\s*\n/);
                LA = O(MA);
              }
              Y(!1).then((MA) => {
                lA = 0, pA = 0, LA.forEach((kA) => {
                  MA.forEach((UA) => {
                    (UA.iface.toLowerCase() === S.toLowerCase() || UA.mac.toLowerCase() === S.toLowerCase() || UA.ip4.toLowerCase() === S.toLowerCase() || UA.ip6.toLowerCase() === S.toLowerCase() || UA.ifaceName.replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase() === S.replace(/[()[\] ]+/g, "").replace("#", "_").toLowerCase()) && UA.ifaceName.replace(/[()[\] ]+/g, "").replace(/#|\//g, "_").toLowerCase() === kA.name && (mA = UA.iface, lA = kA.rx_bytes, BA = kA.rx_dropped, uA = kA.rx_errors, pA = kA.tx_bytes, hA = kA.tx_dropped, wA = kA.tx_errors, cA = UA.operstate);
                  });
                }), lA && pA && (rA = _(mA, parseInt(lA), parseInt(pA), cA, BA, uA, hA, wA)), T(rA);
              });
            });
          }
        } else
          rA.rx_bytes = z[S].rx_bytes, rA.tx_bytes = z[S].tx_bytes, rA.rx_sec = z[S].rx_sec, rA.tx_sec = z[S].tx_sec, rA.ms = z[S].last_ms, rA.operstate = z[S].operstate, T(rA);
      });
    });
  }
  network.networkStats = G;
  function j(M, O) {
    let T = "";
    return M.forEach((S) => {
      const AA = S.split(" ");
      (parseInt(AA[0], 10) || -1) === O && (AA.shift(), T = AA.join(" ").split(":")[0]);
    }), T = T.split(" -")[0], T = T.split(" /")[0], T;
  }
  function aA(M) {
    return new Promise((O) => {
      process.nextTick(() => {
        const T = [];
        if (F || X || W || eA) {
          let S = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
          (X || W || eA) && (S = 'export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'), e(S, { maxBuffer: 1024 * 102400 }, (AA, oA) => {
            let rA = oA.toString().split(`
`);
            !AA && (rA.length > 1 || rA[0] !== "") ? (rA.forEach((cA) => {
              if (cA = cA.replace(/ +/g, " ").split(" "), cA.length >= 7) {
                let lA = cA[3], pA = "";
                const BA = cA[3].split(":");
                BA.length > 1 && (pA = BA[BA.length - 1], BA.pop(), lA = BA.join(":"));
                let uA = cA[4], hA = "";
                const wA = cA[4].split(":");
                wA.length > 1 && (hA = wA[wA.length - 1], wA.pop(), uA = wA.join(":"));
                const NA = cA[5], dA = cA[6].split("/");
                NA && T.push({
                  protocol: cA[0],
                  localAddress: lA,
                  localPort: pA,
                  peerAddress: uA,
                  peerPort: hA,
                  state: NA,
                  pid: dA[0] && dA[0] !== "-" ? parseInt(dA[0], 10) : null,
                  process: dA[1] ? dA[1].split(" ")[0].split(":")[0] : ""
                });
              }
            }), M && M(T), O(T)) : (S = 'ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"', e(S, { maxBuffer: 1024 * 102400 }, (cA, lA) => {
              cA || lA.toString().split(`
`).forEach((BA) => {
                if (BA = BA.replace(/ +/g, " ").split(" "), BA.length >= 6) {
                  let uA = BA[4], hA = "";
                  const wA = BA[4].split(":");
                  wA.length > 1 && (hA = wA[wA.length - 1], wA.pop(), uA = wA.join(":"));
                  let NA = BA[5], dA = "";
                  const RA = BA[5].split(":");
                  RA.length > 1 && (dA = RA[RA.length - 1], RA.pop(), NA = RA.join(":"));
                  let LA = BA[1];
                  LA === "ESTAB" && (LA = "ESTABLISHED"), LA === "TIME-WAIT" && (LA = "TIME_WAIT");
                  let mA = null, xA = "";
                  if (BA.length >= 7 && BA[6].indexOf("users:") > -1) {
                    const FA = BA[6].replace('users:(("', "").replace(/"/g, "").replace("pid=", "").split(",");
                    if (FA.length > 2) {
                      xA = FA[0];
                      const MA = parseInt(FA[1], 10);
                      MA > 0 && (mA = MA);
                    }
                  }
                  LA && T.push({
                    protocol: BA[0],
                    localAddress: uA,
                    localPort: hA,
                    peerAddress: NA,
                    peerPort: dA,
                    state: LA,
                    pid: mA,
                    process: xA
                  });
                }
              }), M && M(T), O(T);
            }));
          });
        }
        if (x) {
          const S = 'netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"', AA = "ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN".split("|");
          e(S, { maxBuffer: 1024 * 102400 }, (oA, rA) => {
            oA || e("ps -axo pid,command", { maxBuffer: 1024 * 102400 }, (cA, lA) => {
              let pA = lA.toString().split(`
`);
              pA = pA.map((hA) => hA.trim().replace(/ +/g, " "));
              const BA = rA.toString().split(`
`);
              BA.shift();
              let uA = 8;
              BA.length > 1 && BA[0].indexOf("pid") > 0 && (uA = (BA.shift() || "").replace(/ Address/g, "_Address").replace(/process:/g, "").replace(/ +/g, " ").split(" ").indexOf("pid")), BA.forEach((hA) => {
                if (hA = hA.replace(/ +/g, " ").split(" "), hA.length >= 8) {
                  let wA = hA[3], NA = "";
                  const dA = hA[3].split(".");
                  dA.length > 1 && (NA = dA[dA.length - 1], dA.pop(), wA = dA.join("."));
                  let RA = hA[4], LA = "";
                  const mA = hA[4].split(".");
                  mA.length > 1 && (LA = mA[mA.length - 1], mA.pop(), RA = mA.join("."));
                  const xA = AA.indexOf(hA[5]) >= 0, FA = xA ? hA[5] : "UNKNOWN";
                  let MA = "";
                  hA[hA.length - 9].indexOf(":") >= 0 ? MA = hA[hA.length - 9].split(":")[1] : (MA = hA[uA + (xA ? 0 : -1)], MA.indexOf(":") >= 0 && (MA = MA.split(":")[1]));
                  const kA = parseInt(MA, 10);
                  FA && T.push({
                    protocol: hA[0],
                    localAddress: wA,
                    localPort: NA,
                    peerAddress: RA,
                    peerPort: LA,
                    state: FA,
                    pid: kA,
                    process: j(pA, kA)
                  });
                }
              }), M && M(T), O(T);
            });
          });
        }
        if (b) {
          let S = "netstat -nao";
          try {
            e(S, o.execOptsWin, (AA, oA) => {
              AA || (oA.toString().split(`\r
`).forEach((cA) => {
                if (cA = cA.trim().replace(/ +/g, " ").split(" "), cA.length >= 4) {
                  let lA = cA[1], pA = "";
                  const BA = cA[1].split(":");
                  BA.length > 1 && (pA = BA[BA.length - 1], BA.pop(), lA = BA.join(":")), lA = lA.replace(/\[/g, "").replace(/\]/g, "");
                  let uA = cA[2], hA = "";
                  const wA = cA[2].split(":");
                  wA.length > 1 && (hA = wA[wA.length - 1], wA.pop(), uA = wA.join(":")), uA = uA.replace(/\[/g, "").replace(/\]/g, "");
                  const NA = o.toInt(cA[4]);
                  let dA = cA[3];
                  dA === "HERGESTELLT" && (dA = "ESTABLISHED"), dA.startsWith("ABH") && (dA = "LISTEN"), dA === "SCHLIESSEN_WARTEN" && (dA = "CLOSE_WAIT"), dA === "WARTEND" && (dA = "TIME_WAIT"), dA === "SYN_GESENDET" && (dA = "SYN_SENT"), dA === "LISTENING" && (dA = "LISTEN"), dA === "SYN_RECEIVED" && (dA = "SYN_RECV"), dA === "FIN_WAIT_1" && (dA = "FIN_WAIT1"), dA === "FIN_WAIT_2" && (dA = "FIN_WAIT2"), cA[0].toLowerCase() !== "udp" && dA ? T.push({
                    protocol: cA[0].toLowerCase(),
                    localAddress: lA,
                    localPort: pA,
                    peerAddress: uA,
                    peerPort: hA,
                    state: dA,
                    pid: NA,
                    process: ""
                  }) : cA[0].toLowerCase() === "udp" && T.push({
                    protocol: cA[0].toLowerCase(),
                    localAddress: lA,
                    localPort: pA,
                    peerAddress: uA,
                    peerPort: hA,
                    state: "",
                    pid: parseInt(cA[3], 10),
                    process: ""
                  });
                }
              }), M && M(T), O(T));
            });
          } catch {
            M && M(T), O(T);
          }
        }
      });
    });
  }
  network.networkConnections = aA;
  function tA(M) {
    return new Promise((O) => {
      process.nextTick(() => {
        let T = "";
        if (F || X || W || eA) {
          const S = "ip route get 1";
          try {
            e(S, { maxBuffer: 1024 * 102400 }, (AA, oA) => {
              if (AA)
                M && M(T), O(T);
              else {
                let rA = oA.toString().split(`
`), lA = (rA && rA[0] ? rA[0] : "").split(" via ");
                lA && lA[1] && (lA = lA[1].split(" "), T = lA[0]), M && M(T), O(T);
              }
            });
          } catch {
            M && M(T), O(T);
          }
        }
        if (x) {
          let S = "route -n get default";
          try {
            e(S, { maxBuffer: 1024 * 102400 }, (AA, oA) => {
              if (!AA) {
                const rA = oA.toString().split(`
`).map((cA) => cA.trim());
                T = o.getValue(rA, "gateway");
              }
              T ? (M && M(T), O(T)) : (S = "netstat -rn | awk '/default/ {print $2}'", e(S, { maxBuffer: 1024 * 102400 }, (rA, cA) => {
                T = cA.toString().split(`
`).map((pA) => pA.trim()).find(
                  (pA) => /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(pA)
                ), M && M(T), O(T);
              }));
            });
          } catch {
            M && M(T), O(T);
          }
        }
        if (b)
          try {
            e("netstat -r", o.execOptsWin, (S, AA) => {
              AA.toString().split(s.EOL).forEach((rA) => {
                if (rA = rA.replace(/\s+/g, " ").trim(), rA.indexOf("0.0.0.0 0.0.0.0") > -1 && !/[a-zA-Z]/.test(rA)) {
                  const cA = rA.split(" ");
                  cA.length >= 5 && cA[cA.length - 3].indexOf(".") > -1 && (T = cA[cA.length - 3]);
                }
              }), T ? (M && M(T), O(T)) : o.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then((rA) => {
                let cA = rA.toString().split(`\r
`);
                cA.length > 1 && !T && (T = o.getValue(cA, "NextHop"), M && M(T), O(T));
              });
            });
          } catch {
            M && M(T), O(T);
          }
      });
    });
  }
  return network.networkGatewayDefault = tA, network;
}
var wifi = {}, hasRequiredWifi;
function requireWifi() {
  if (hasRequiredWifi) return wifi;
  hasRequiredWifi = 1;
  const s = require$$0$1, e = require$$1.exec, A = require$$1.execSync, g = requireUtil();
  let o = process.platform;
  const B = o === "linux" || o === "android", F = o === "darwin", x = o === "win32";
  function b(Q) {
    const d = parseFloat(Q);
    return d < 0 ? 0 : d >= 100 ? -50 : d / 2 - 100;
  }
  function X(Q) {
    const d = 2 * (parseFloat(Q) + 100);
    return d <= 100 ? d : 100;
  }
  const W = {
    1: 2412,
    2: 2417,
    3: 2422,
    4: 2427,
    5: 2432,
    6: 2437,
    7: 2442,
    8: 2447,
    9: 2452,
    10: 2457,
    11: 2462,
    12: 2467,
    13: 2472,
    14: 2484,
    32: 5160,
    34: 5170,
    36: 5180,
    38: 5190,
    40: 5200,
    42: 5210,
    44: 5220,
    46: 5230,
    48: 5240,
    50: 5250,
    52: 5260,
    54: 5270,
    56: 5280,
    58: 5290,
    60: 5300,
    62: 5310,
    64: 5320,
    68: 5340,
    96: 5480,
    100: 5500,
    102: 5510,
    104: 5520,
    106: 5530,
    108: 5540,
    110: 5550,
    112: 5560,
    114: 5570,
    116: 5580,
    118: 5590,
    120: 5600,
    122: 5610,
    124: 5620,
    126: 5630,
    128: 5640,
    132: 5660,
    134: 5670,
    136: 5680,
    138: 5690,
    140: 5700,
    142: 5710,
    144: 5720,
    149: 5745,
    151: 5755,
    153: 5765,
    155: 5775,
    157: 5785,
    159: 5795,
    161: 5805,
    165: 5825,
    169: 5845,
    173: 5865,
    183: 4915,
    184: 4920,
    185: 4925,
    187: 4935,
    188: 4940,
    189: 4945,
    192: 4960,
    196: 4980
  };
  function eA(Q) {
    return {}.hasOwnProperty.call(W, Q) ? W[Q] : null;
  }
  function IA(Q) {
    let d = 0;
    for (let c in W)
      ({}).hasOwnProperty.call(W, c) && W[c] === Q && (d = g.toInt(c));
    return d;
  }
  function z() {
    const Q = [], d = "iw dev 2>/dev/null";
    try {
      const n = A(d, g.execOptsLinux).toString().split(`
`).map((L) => L.trim()).join(`
`).split(`
Interface `);
      return n.shift(), n.forEach((L) => {
        const k = L.split(`
`), K = k[0], gA = g.toInt(g.getValue(k, "ifindex", " ")), v = g.getValue(k, "addr", " "), U = g.toInt(g.getValue(k, "channel", " "));
        Q.push({
          id: gA,
          iface: K,
          mac: v,
          channel: U
        });
      }), Q;
    } catch {
      try {
        const n = A("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null", g.execOptsLinux).toString().split(`

`);
        let L = 1;
        return n.forEach((k) => {
          const K = k.split(`
`), gA = g.getValue(K, "GENERAL.DEVICE"), v = g.getValue(K, "GENERAL.TYPE"), U = L++, V = g.getValue(K, "GENERAL.HWADDR");
          v.toLowerCase() === "wifi" && Q.push({
            id: U,
            iface: gA,
            mac: V,
            channel: ""
          });
        }), Q;
      } catch {
        return [];
      }
    }
  }
  function N(Q) {
    const d = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${Q} 2> /dev/null`;
    try {
      const c = A(d, g.execOptsLinux).toString().split(`
`), n = g.getValue(c, "GENERAL.CONNECTION");
      return {
        iface: Q,
        type: g.getValue(c, "GENERAL.TYPE"),
        vendor: g.getValue(c, "GENERAL.VENDOR"),
        product: g.getValue(c, "GENERAL.PRODUCT"),
        mac: g.getValue(c, "GENERAL.HWADDR").toLowerCase(),
        ssid: n !== "--" ? n : null
      };
    } catch {
      return {};
    }
  }
  function J(Q) {
    const d = `nmcli -t --show-secrets connection show ${Q} 2>/dev/null`;
    try {
      const c = A(d, g.execOptsLinux).toString().split(`
`), n = g.getValue(c, "802-11-wireless.seen-bssids").toLowerCase();
      return {
        ssid: Q !== "--" ? Q : null,
        uuid: g.getValue(c, "connection.uuid"),
        type: g.getValue(c, "connection.type"),
        autoconnect: g.getValue(c, "connection.autoconnect") === "yes",
        security: g.getValue(c, "802-11-wireless-security.key-mgmt"),
        bssid: n !== "--" ? n : null
      };
    } catch {
      return {};
    }
  }
  function $(Q) {
    if (!Q)
      return {};
    const d = `wpa_cli -i ${Q} status 2>&1`;
    try {
      const c = A(d, g.execOptsLinux).toString().split(`
`), n = g.toInt(g.getValue(c, "freq", "="));
      return {
        ssid: g.getValue(c, "ssid", "="),
        uuid: g.getValue(c, "uuid", "="),
        security: g.getValue(c, "key_mgmt", "="),
        freq: n,
        channel: IA(n),
        bssid: g.getValue(c, "bssid", "=").toLowerCase()
      };
    } catch {
      return {};
    }
  }
  function H() {
    const Q = [], d = "nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null";
    try {
      const n = A(d, g.execOptsLinux).toString().split("ACTIVE:");
      return n.shift(), n.forEach((L) => {
        L = "ACTIVE:" + L;
        const k = L.split(s.EOL), K = g.getValue(k, "CHAN"), gA = g.getValue(k, "FREQ").toLowerCase().replace("mhz", "").trim(), v = g.getValue(k, "SECURITY").replace("(", "").replace(")", ""), U = g.getValue(k, "WPA-FLAGS").replace("(", "").replace(")", ""), V = g.getValue(k, "RSN-FLAGS").replace("(", "").replace(")", ""), m = g.getValue(k, "SIGNAL");
        Q.push({
          ssid: g.getValue(k, "SSID"),
          bssid: g.getValue(k, "BSSID").toLowerCase(),
          mode: g.getValue(k, "MODE"),
          channel: K ? parseInt(K, 10) : null,
          frequency: gA ? parseInt(gA, 10) : null,
          signalLevel: b(m),
          quality: m ? parseInt(m, 10) : null,
          security: v && v !== "none" ? v.split(" ") : [],
          wpaFlags: U && U !== "none" ? U.split(" ") : [],
          rsnFlags: V && V !== "none" ? V.split(" ") : []
        });
      }), Q;
    } catch {
      return [];
    }
  }
  function y(Q) {
    const d = [];
    try {
      let c = A(`export LC_ALL=C; iwlist ${Q} scan 2>&1; unset LC_ALL`, g.execOptsLinux).toString().split("        Cell ");
      return c[0].indexOf("resource busy") >= 0 ? -1 : (c.length > 1 && (c.shift(), c.forEach((n) => {
        const L = n.split(`
`), k = g.getValue(L, "channel", ":", !0), K = L && L.length && L[0].indexOf("Address:") >= 0 ? L[0].split("Address:")[1].trim().toLowerCase() : "", gA = g.getValue(L, "mode", ":", !0), v = g.getValue(L, "frequency", ":", !0), V = g.getValue(L, "Quality", "=", !0).toLowerCase().split("signal level="), m = V.length > 1 ? g.toInt(V[1]) : 0, a = m ? X(m) : 0, I = g.getValue(L, "essid", ":", !0), t = n.indexOf(" WPA ") >= 0, l = n.indexOf("WPA2 ") >= 0, D = [];
        t && D.push("WPA"), l && D.push("WPA2");
        const f = [];
        let w = "";
        L.forEach((Y) => {
          const _ = Y.trim().toLowerCase();
          if (_.indexOf("group cipher") >= 0) {
            w && f.push(w);
            const G = _.split(":");
            G.length > 1 && (w = G[1].trim().toUpperCase());
          }
          if (_.indexOf("pairwise cipher") >= 0) {
            const G = _.split(":");
            G.length > 1 && (G[1].indexOf("tkip") ? w = w ? "TKIP/" + w : "TKIP" : G[1].indexOf("ccmp") ? w = w ? "CCMP/" + w : "CCMP" : G[1].indexOf("proprietary") && (w = w ? "PROP/" + w : "PROP"));
          }
          if (_.indexOf("authentication suites") >= 0) {
            const G = _.split(":");
            G.length > 1 && (G[1].indexOf("802.1x") ? w = w ? "802.1x/" + w : "802.1x" : G[1].indexOf("psk") && (w = w ? "PSK/" + w : "PSK"));
          }
        }), w && f.push(w), d.push({
          ssid: I,
          bssid: K,
          mode: gA,
          channel: k ? g.toInt(k) : null,
          frequency: v ? g.toInt(v.replace(".", "")) : null,
          signalLevel: m,
          quality: a,
          security: D,
          wpaFlags: f,
          rsnFlags: []
        });
      })), d);
    } catch {
      return -1;
    }
  }
  function p(Q) {
    const d = [];
    try {
      let c = JSON.parse(Q);
      return c = c.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_airport_other_local_wireless_networks, c.forEach((n) => {
        const L = [], k = n.spairport_security_mode || "";
        k === "spairport_security_mode_wep" ? L.push("WEP") : k === "spairport_security_mode_wpa2_personal" ? L.push("WPA2") : k.startsWith("spairport_security_mode_wpa2_enterprise") ? L.push("WPA2 EAP") : k.startsWith("pairport_security_mode_wpa3_transition") ? L.push("WPA2/WPA3") : k.startsWith("pairport_security_mode_wpa3") && L.push("WPA3");
        const K = parseInt(("" + n.spairport_network_channel).split(" ")[0]) || 0, gA = n.spairport_signal_noise || null;
        d.push({
          ssid: n._name || "",
          bssid: n.spairport_network_bssid || null,
          mode: n.spairport_network_phymode,
          channel: K,
          frequency: eA(K),
          signalLevel: gA ? parseInt(gA, 10) : null,
          quality: X(gA),
          security: L,
          wpaFlags: [],
          rsnFlags: []
        });
      }), d;
    } catch {
      return d;
    }
  }
  function h(Q) {
    return new Promise((d) => {
      process.nextTick(() => {
        let c = [];
        if (B)
          if (c = H(), c.length === 0)
            try {
              const n = A("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL", g.execOptsLinux).toString().split(`

`);
              let L = "";
              if (n.forEach((k) => {
                k.indexOf("no wireless") === -1 && k.trim() !== "" && (L = k.split(" ")[0]);
              }), L) {
                let k = "";
                const K = g.isPrototypePolluted() ? "---" : g.sanitizeShellString(L, !0), gA = g.mathMin(K.length, 2e3);
                for (let U = 0; U <= gA; U++)
                  K[U] !== void 0 && (k = k + K[U]);
                const v = y(k);
                v === -1 ? setTimeout((U) => {
                  const V = y(U);
                  V !== -1 && (c = V), Q && Q(c), d(c);
                }, 4e3) : (c = v, Q && Q(c), d(c));
              } else
                Q && Q(c), d(c);
            } catch {
              Q && Q(c), d(c);
            }
          else
            Q && Q(c), d(c);
        else F ? e("system_profiler SPAirPortDataType -json 2>/dev/null", { maxBuffer: 1024 * 4e4 }, (L, k) => {
          c = p(k.toString()), Q && Q(c), d(c);
        }) : x ? g.powerShell("netsh wlan show networks mode=Bssid").then((L) => {
          const k = L.toString("utf8").split(s.EOL + s.EOL + "SSID ");
          k.shift(), k.forEach((K) => {
            const gA = K.split(s.EOL);
            if (gA && gA.length >= 8 && gA[0].indexOf(":") >= 0) {
              const v = K.split(" BSSID");
              v.shift(), v.forEach((U) => {
                const V = U.split(s.EOL), m = V[0].split(":");
                m.shift();
                const a = m.join(":").trim().toLowerCase(), I = V[3].split(":").pop().trim(), t = V[1].split(":").pop().trim();
                c.push({
                  ssid: gA[0].split(":").pop().trim(),
                  bssid: a,
                  mode: "",
                  channel: I ? parseInt(I, 10) : null,
                  frequency: eA(I),
                  signalLevel: b(t),
                  quality: t ? parseInt(t, 10) : null,
                  security: [gA[2].split(":").pop().trim()],
                  wpaFlags: [gA[3].split(":").pop().trim()],
                  rsnFlags: []
                });
              });
            }
          }), Q && Q(c), d(c);
        }) : (Q && Q(c), d(c));
      });
    });
  }
  wifi.wifiNetworks = h;
  function E(Q) {
    Q = Q.toLowerCase();
    let d = "";
    return Q.indexOf("intel") >= 0 ? d = "Intel" : Q.indexOf("realtek") >= 0 ? d = "Realtek" : Q.indexOf("qualcom") >= 0 ? d = "Qualcom" : Q.indexOf("broadcom") >= 0 ? d = "Broadcom" : Q.indexOf("cavium") >= 0 ? d = "Cavium" : Q.indexOf("cisco") >= 0 ? d = "Cisco" : Q.indexOf("marvel") >= 0 ? d = "Marvel" : Q.indexOf("zyxel") >= 0 ? d = "Zyxel" : Q.indexOf("melanox") >= 0 ? d = "Melanox" : Q.indexOf("d-link") >= 0 ? d = "D-Link" : Q.indexOf("tp-link") >= 0 ? d = "TP-Link" : Q.indexOf("asus") >= 0 ? d = "Asus" : Q.indexOf("linksys") >= 0 && (d = "Linksys"), d;
  }
  function u(Q) {
    return new Promise((d) => {
      process.nextTick(() => {
        const c = [];
        if (B) {
          const n = z(), L = H();
          n.forEach((k) => {
            let K = "";
            const gA = g.isPrototypePolluted() ? "---" : g.sanitizeShellString(k.iface, !0), v = g.mathMin(gA.length, 2e3);
            for (let _ = 0; _ <= v; _++)
              gA[_] !== void 0 && (K = K + gA[_]);
            const U = N(K), V = $(K), m = U.ssid || V.ssid, a = L.filter((_) => _.ssid === m);
            let I = "";
            const t = g.isPrototypePolluted() ? "---" : g.sanitizeShellString(m, !0), l = g.mathMin(t.length, 32);
            for (let _ = 0; _ <= l; _++)
              t[_] !== void 0 && (I = I + t[_]);
            const D = J(I), f = a && a.length && a[0].channel ? a[0].channel : V.channel ? V.channel : null, w = a && a.length && a[0].bssid ? a[0].bssid : V.bssid ? V.bssid : null, Y = a && a.length && a[0].signalLevel ? a[0].signalLevel : null;
            m && w && c.push({
              id: k.id,
              iface: k.iface,
              model: U.product,
              ssid: m,
              bssid: a && a.length && a[0].bssid ? a[0].bssid : V.bssid ? V.bssid : null,
              channel: f,
              frequency: f ? eA(f) : null,
              type: D.type ? D.type : "802.11",
              security: D.security ? D.security : V.security ? V.security : null,
              signalLevel: Y,
              quality: X(Y),
              txRate: null
            });
          }), Q && Q(c), d(c);
        } else F ? e('system_profiler SPNetworkDataType SPAirPortDataType -xml 2>/dev/null; echo "######" ; ioreg -n AppleBCMWLANSkywalkInterface -r 2>/dev/null', (L, k) => {
          try {
            const K = k.toString().split("######"), gA = g.plistParser(K[0]), v = gA[0]._SPCommandLineArguments.indexOf("SPNetworkDataType") >= 0 ? gA[0]._items : gA[1]._items, U = gA[0]._SPCommandLineArguments.indexOf("SPAirPortDataType") >= 0 ? gA[0]._items[0].spairport_airport_interfaces : gA[1]._items[0].spairport_airport_interfaces;
            let V = [];
            K[1].indexOf("  | {") > 0 && K[1].indexOf("  | }") > K[1].indexOf("  | {") && (V = K[1].split("  | {")[1].split("  | }")[0].replace(/ \| /g, "").replace(/"/g, "").split(`
`));
            const m = v.find((f) => f._name === "Wi-Fi"), a = U[0].spairport_current_network_information, I = parseInt(("" + a.spairport_network_channel).split(" ")[0], 10) || 0, t = a.spairport_signal_noise || null, l = [], D = a.spairport_security_mode || "";
            D === "spairport_security_mode_wep" ? l.push("WEP") : D === "spairport_security_mode_wpa2_personal" ? l.push("WPA2") : D.startsWith("spairport_security_mode_wpa2_enterprise") ? l.push("WPA2 EAP") : D.startsWith("pairport_security_mode_wpa3_transition") ? l.push("WPA2/WPA3") : D.startsWith("pairport_security_mode_wpa3") && l.push("WPA3"), c.push({
              id: m._name || "Wi-Fi",
              iface: m.interface || "",
              model: m.hardware || "",
              ssid: (a._name || "").replace("&lt;", "<").replace("&gt;", ">"),
              bssid: a.spairport_network_bssid || "",
              channel: I,
              frequency: I ? eA(I) : null,
              type: a.spairport_network_phymode || "802.11",
              security: l,
              signalLevel: t ? parseInt(t, 10) : null,
              quality: X(t),
              txRate: a.spairport_network_rate || null
            });
          } catch {
            g.noop();
          }
          Q && Q(c), d(c);
        }) : x ? g.powerShell("netsh wlan show interfaces").then((L) => {
          const k = L.toString().split(`\r
`);
          for (let gA = 0; gA < k.length; gA++)
            k[gA] = k[gA].trim();
          const K = k.join(`\r
`).split(`:\r
\r
`);
          K.shift(), K.forEach((gA) => {
            const v = gA.split(`\r
`);
            if (v.length >= 5) {
              const U = v[0].indexOf(":") >= 0 ? v[0].split(":")[1].trim() : "", V = v[1].indexOf(":") >= 0 ? v[1].split(":")[1].trim() : "", m = v[2].indexOf(":") >= 0 ? v[2].split(":")[1].trim() : "", a = g.getValue(v, "SSID", ":", !0), I = g.getValue(v, "BSSID", ":", !0) || g.getValue(v, "AP BSSID", ":", !0), t = g.getValue(v, "Signal", ":", !0), l = b(t), D = g.getValue(v, "Radio type", ":", !0) || g.getValue(v, "Type de radio", ":", !0) || g.getValue(v, "Funktyp", ":", !0) || null, f = g.getValue(v, "authentication", ":", !0) || g.getValue(v, "Authentification", ":", !0) || g.getValue(v, "Authentifizierung", ":", !0) || null, w = g.getValue(v, "Channel", ":", !0) || g.getValue(v, "Canal", ":", !0) || g.getValue(v, "Kanal", ":", !0) || null, Y = g.getValue(v, "Transmit rate (mbps)", ":", !0) || g.getValue(v, "Transmission (mbit/s)", ":", !0) || g.getValue(v, "Empfangsrate (MBit/s)", ":", !0) || null;
              V && m && a && I && c.push({
                id: m,
                iface: U,
                model: V,
                ssid: a,
                bssid: I,
                channel: g.toInt(w),
                frequency: w ? eA(w) : null,
                type: D,
                security: f,
                signalLevel: l,
                quality: t ? parseInt(t, 10) : null,
                txRate: g.toInt(Y) || null
              });
            }
          }), Q && Q(c), d(c);
        }) : (Q && Q(c), d(c));
      });
    });
  }
  wifi.wifiConnections = u;
  function r(Q) {
    return new Promise((d) => {
      process.nextTick(() => {
        const c = [];
        B ? (z().forEach((L) => {
          const k = N(L.iface);
          c.push({
            id: L.id,
            iface: L.iface,
            model: k.product ? k.product : null,
            vendor: k.vendor ? k.vendor : null,
            mac: L.mac
          });
        }), Q && Q(c), d(c)) : F ? e("system_profiler SPNetworkDataType", (L, k) => {
          const K = k.toString().split(`

    Wi-Fi:

`);
          if (K.length > 1) {
            const gA = K[1].split(`

`)[0].split(`
`), v = g.getValue(gA, "BSD Device Name", ":", !0), U = g.getValue(gA, "MAC Address", ":", !0), V = g.getValue(gA, "hardware", ":", !0);
            c.push({
              id: "Wi-Fi",
              iface: v,
              model: V,
              vendor: "",
              mac: U
            });
          }
          Q && Q(c), d(c);
        }) : x ? g.powerShell("netsh wlan show interfaces").then((L) => {
          const k = L.toString().split(`\r
`);
          for (let gA = 0; gA < k.length; gA++)
            k[gA] = k[gA].trim();
          const K = k.join(`\r
`).split(`:\r
\r
`);
          K.shift(), K.forEach((gA) => {
            const v = gA.split(`\r
`);
            if (v.length >= 5) {
              const U = v[0].indexOf(":") >= 0 ? v[0].split(":")[1].trim() : "", V = v[1].indexOf(":") >= 0 ? v[1].split(":")[1].trim() : "", m = v[2].indexOf(":") >= 0 ? v[2].split(":")[1].trim() : "", a = v[3].indexOf(":") >= 0 ? v[3].split(":") : [];
              a.shift();
              const I = a.join(":").trim(), t = E(V);
              U && V && m && I && c.push({
                id: m,
                iface: U,
                model: V,
                vendor: t,
                mac: I
              });
            }
          }), Q && Q(c), d(c);
        }) : (Q && Q(c), d(c));
      });
    });
  }
  return wifi.wifiInterfaces = r, wifi;
}
var processes = {}, hasRequiredProcesses;
function requireProcesses() {
  if (hasRequiredProcesses) return processes;
  hasRequiredProcesses = 1;
  const s = require$$0$1, e = require$$1$1, A = require$$2, g = require$$1.exec, o = require$$1.execSync, B = requireUtil();
  let F = process.platform;
  const x = F === "linux" || F === "android", b = F === "darwin", X = F === "win32", W = F === "freebsd", eA = F === "openbsd", IA = F === "netbsd", z = F === "sunos", N = {
    all: 0,
    all_utime: 0,
    all_stime: 0,
    list: {},
    ms: 0,
    result: {}
  }, J = {
    all: 0,
    list: {},
    ms: 0,
    result: {}
  }, $ = {
    all: 0,
    all_utime: 0,
    all_stime: 0,
    list: {},
    ms: 0,
    result: {}
  }, H = {
    0: "unknown",
    1: "other",
    2: "ready",
    3: "running",
    4: "blocked",
    5: "suspended blocked",
    6: "suspended ready",
    7: "terminated",
    8: "stopped",
    9: "growing"
  };
  function y(c) {
    let n = c, L = c.replace(/ +/g, " ").split(" ");
    return L.length === 5 && (n = L[4] + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(L[1].toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + L[2]).slice(-2) + " " + L[3]), n;
  }
  function p(c) {
    let n = /* @__PURE__ */ new Date();
    n = new Date(n.getTime() - n.getTimezoneOffset() * 6e4);
    const L = c.split("-"), k = L.length - 1, K = k > 0 ? parseInt(L[k - 1]) : 0, gA = L[k].split(":"), v = gA.length === 3 ? parseInt(gA[0] || 0) : 0, U = parseInt(gA[gA.length === 3 ? 1 : 0] || 0), V = parseInt(gA[gA.length === 3 ? 2 : 1] || 0), m = (((K * 24 + v) * 60 + U) * 60 + V) * 1e3;
    let a = new Date(n.getTime()), I = a.toISOString().substring(0, 10) + " " + a.toISOString().substring(11, 19);
    try {
      a = new Date(n.getTime() - m), I = a.toISOString().substring(0, 10) + " " + a.toISOString().substring(11, 19);
    } catch {
      B.noop();
    }
    return I;
  }
  function h(c, n) {
    return B.isFunction(c) && !n && (n = c, c = ""), new Promise((L) => {
      process.nextTick(() => {
        if (typeof c != "string")
          return n && n([]), L([]);
        if (c) {
          let k = "";
          try {
            k.__proto__.toLowerCase = B.stringToLower, k.__proto__.replace = B.stringReplace, k.__proto__.toString = B.stringToString, k.__proto__.substr = B.stringSubstr, k.__proto__.substring = B.stringSubstring, k.__proto__.trim = B.stringTrim, k.__proto__.startsWith = B.stringStartWith;
          } catch {
            Object.setPrototypeOf(k, B.stringObj);
          }
          const K = B.sanitizeShellString(c), gA = B.mathMin(K.length, 2e3);
          for (let m = 0; m <= gA; m++)
            K[m] !== void 0 && (k = k + K[m]);
          k = k.trim().toLowerCase().replace(/, /g, "|").replace(/,+/g, "|"), k === "" && (k = "*"), B.isPrototypePolluted() && k !== "*" && (k = "------");
          let v = k.split("|"), U = [], V = [];
          if (x || W || eA || IA || b) {
            if ((x || W || eA || IA) && k === "*")
              try {
                const a = o("systemctl --all --type=service --no-legend 2> /dev/null", B.execOptsLinux).toString().split(`
`);
                v = [];
                for (const I of a) {
                  const t = I.split(".service")[0];
                  t && I.indexOf(" not-found ") === -1 && v.push(t.trim());
                }
                k = v.join("|");
              } catch {
                try {
                  k = "";
                  const I = o("service --status-all 2> /dev/null", B.execOptsLinux).toString().split(`
`);
                  for (const t of I) {
                    const l = t.split("]");
                    l.length === 2 && (k += (k !== "" ? "|" : "") + l[1].trim());
                  }
                  v = k.split("|");
                } catch {
                  try {
                    const t = o("ls /etc/init.d/ -m 2> /dev/null", B.execOptsLinux).toString().split(`
`).join("");
                    if (k = "", t) {
                      const l = t.split(",");
                      for (const D of l) {
                        const f = D.trim();
                        f && (k += (k !== "" ? "|" : "") + f);
                      }
                      v = k.split("|");
                    }
                  } catch {
                    k = "", v = [];
                  }
                }
              }
            b && k === "*" && (n && n(U), L(U));
            let m = b ? ["-caxo", "pcpu,pmem,pid,command"] : ["-axo", "pcpu,pmem,pid,command"];
            k !== "" && v.length > 0 ? B.execSafe("ps", m).then((a) => {
              if (a) {
                let I = a.replace(/ +/g, " ").replace(/,+/g, ".").split(`
`);
                if (v.forEach(function(t) {
                  let l;
                  b ? l = I.filter(function(f) {
                    return f.toLowerCase().indexOf(t) !== -1;
                  }) : l = I.filter(function(f) {
                    return f.toLowerCase().indexOf(" " + t.toLowerCase() + ":") !== -1 || f.toLowerCase().indexOf("(" + t.toLowerCase() + " ") !== -1 || f.toLowerCase().indexOf("(" + t.toLowerCase() + ")") !== -1 || f.toLowerCase().indexOf(" " + t.toLowerCase().replace(/[0-9.]/g, "") + ":") !== -1 || f.toLowerCase().indexOf("/" + t.toLowerCase()) !== -1;
                  });
                  const D = [];
                  for (const f of l) {
                    const w = f.trim().split(" ")[2];
                    w && D.push(parseInt(w, 10));
                  }
                  U.push({
                    name: t,
                    running: l.length > 0,
                    startmode: "",
                    pids: D,
                    cpu: parseFloat(
                      l.reduce(function(f, w) {
                        return f + parseFloat(w.trim().split(" ")[0]);
                      }, 0).toFixed(2)
                    ),
                    mem: parseFloat(
                      l.reduce(function(f, w) {
                        return f + parseFloat(w.trim().split(" ")[1]);
                      }, 0).toFixed(2)
                    )
                  });
                }), x) {
                  let t = 'cat /proc/stat | grep "cpu "';
                  for (let l in U)
                    for (let D in U[l].pids)
                      t += ";cat /proc/" + U[l].pids[D] + "/stat";
                  g(t, { maxBuffer: 1024 * 102400 }, function(l, D) {
                    let f = D.toString().split(`
`), w = E(f.shift()), Y = {}, _ = {};
                    f.forEach((G) => {
                      if (_ = u(G, w, J), _.pid) {
                        let q = -1;
                        for (let j in U)
                          for (let aA in U[j].pids)
                            parseInt(U[j].pids[aA]) === parseInt(_.pid) && (q = j);
                        q >= 0 && (U[q].cpu += _.cpuu + _.cpus), Y[_.pid] = {
                          cpuu: _.cpuu,
                          cpus: _.cpus,
                          utime: _.utime,
                          stime: _.stime,
                          cutime: _.cutime,
                          cstime: _.cstime
                        };
                      }
                    }), J.all = w, J.list = Object.assign({}, Y), J.ms = Date.now() - J.ms, J.result = Object.assign({}, U), n && n(U), L(U);
                  });
                } else
                  n && n(U), L(U);
              } else
                m = ["-o", "comm"], B.execSafe("ps", m).then((I) => {
                  if (I) {
                    let t = I.replace(/ +/g, " ").replace(/,+/g, ".").split(`
`);
                    v.forEach(function(l) {
                      let D = t.filter(function(f) {
                        return f.indexOf(l) !== -1;
                      });
                      U.push({
                        name: l,
                        running: D.length > 0,
                        startmode: "",
                        cpu: 0,
                        mem: 0
                      });
                    }), n && n(U), L(U);
                  } else
                    v.forEach(function(t) {
                      U.push({
                        name: t,
                        running: !1,
                        startmode: "",
                        cpu: 0,
                        mem: 0
                      });
                    }), n && n(U), L(U);
                });
            }) : (n && n(U), L(U));
          }
          if (X)
            try {
              let m = "Get-CimInstance Win32_Service";
              v[0] !== "*" && (m += ' -Filter "', v.forEach((a) => {
                m += `Name='${a}' or `;
              }), m = `${m.slice(0, -4)}"`), m += " | select Name,Caption,Started,StartMode,ProcessId | fl", B.powerShell(m).then((a, I) => {
                I ? (v.forEach((t) => {
                  U.push({
                    name: t,
                    running: !1,
                    startmode: "",
                    cpu: 0,
                    mem: 0
                  });
                }), n && n(U), L(U)) : (a.split(/\n\s*\n/).forEach((l) => {
                  if (l.trim() !== "") {
                    let D = l.trim().split(`\r
`), f = B.getValue(D, "Name", ":", !0).toLowerCase(), w = B.getValue(D, "Caption", ":", !0).toLowerCase(), Y = B.getValue(D, "Started", ":", !0), _ = B.getValue(D, "StartMode", ":", !0), G = B.getValue(D, "ProcessId", ":", !0);
                    (k === "*" || v.indexOf(f) >= 0 || v.indexOf(w) >= 0) && (U.push({
                      name: f,
                      running: Y.toLowerCase() === "true",
                      startmode: _,
                      pids: [G],
                      cpu: 0,
                      mem: 0
                    }), V.push(f), V.push(w));
                  }
                }), k !== "*" && v.filter((D) => V.indexOf(D) === -1).forEach((D) => {
                  U.push({
                    name: D,
                    running: !1,
                    startmode: "",
                    pids: [],
                    cpu: 0,
                    mem: 0
                  });
                }), n && n(U), L(U));
              });
            } catch {
              n && n(U), L(U);
            }
        } else
          n && n([]), L([]);
      });
    });
  }
  processes.services = h;
  function E(c) {
    const n = c.replace(/ +/g, " ").split(" "), L = n.length >= 2 ? parseInt(n[1]) : 0, k = n.length >= 3 ? parseInt(n[2]) : 0, K = n.length >= 4 ? parseInt(n[3]) : 0, gA = n.length >= 5 ? parseInt(n[4]) : 0, v = n.length >= 6 ? parseInt(n[5]) : 0, U = n.length >= 7 ? parseInt(n[6]) : 0, V = n.length >= 8 ? parseInt(n[7]) : 0, m = n.length >= 9 ? parseInt(n[8]) : 0, a = n.length >= 10 ? parseInt(n[9]) : 0, I = n.length >= 11 ? parseInt(n[10]) : 0;
    return L + k + K + gA + v + U + V + m + a + I;
  }
  function u(c, n, L) {
    let k = c.replace(/ +/g, " ").split(")");
    if (k.length >= 2) {
      let K = k[1].split(" ");
      if (K.length >= 16) {
        let gA = parseInt(k[0].split(" ")[0]), v = parseInt(K[12]), U = parseInt(K[13]), V = parseInt(K[14]), m = parseInt(K[15]), a = 0, I = 0;
        return L.all > 0 && L.list[gA] ? (a = (v + V - L.list[gA].utime - L.list[gA].cutime) / (n - L.all) * 100, I = (U + m - L.list[gA].stime - L.list[gA].cstime) / (n - L.all) * 100) : (a = (v + V) / n * 100, I = (U + m) / n * 100), {
          pid: gA,
          utime: v,
          stime: U,
          cutime: V,
          cstime: m,
          cpuu: a,
          cpus: I
        };
      } else
        return {
          pid: 0,
          utime: 0,
          stime: 0,
          cutime: 0,
          cstime: 0,
          cpuu: 0,
          cpus: 0
        };
    } else
      return {
        pid: 0,
        utime: 0,
        stime: 0,
        cutime: 0,
        cstime: 0,
        cpuu: 0,
        cpus: 0
      };
  }
  function r(c, n, L) {
    let k = 0, K = 0;
    return L.all > 0 && L.list[c.pid] ? (k = (c.utime - L.list[c.pid].utime) / (n - L.all) * 100, K = (c.stime - L.list[c.pid].stime) / (n - L.all) * 100) : (k = c.utime / n * 100, K = c.stime / n * 100), {
      pid: c.pid,
      utime: c.utime,
      stime: c.stime,
      cpuu: k > 0 ? k : 0,
      cpus: K > 0 ? K : 0
    };
  }
  function Q(c) {
    let n = [];
    function L(v) {
      v = v || "";
      let U = v.split(" ")[0];
      if (U.substr(-1) === ":" && (U = U.substr(0, U.length - 1)), U.substr(0, 1) !== "[") {
        let V = U.split("/");
        isNaN(parseInt(V[V.length - 1])) ? U = V[V.length - 1] : U = V[0];
      }
      return U;
    }
    function k(v) {
      let U = 0, V = 0;
      function m(T) {
        U = V, n[T] ? V = v.substring(n[T].to + U, 1e4).indexOf(" ") : V = 1e4;
      }
      m(0);
      const a = parseInt(v.substring(n[0].from + U, n[0].to + V));
      m(1);
      const I = parseInt(v.substring(n[1].from + U, n[1].to + V));
      m(2);
      const t = parseFloat(v.substring(n[2].from + U, n[2].to + V).replace(/,/g, "."));
      m(3);
      const l = parseFloat(v.substring(n[3].from + U, n[3].to + V).replace(/,/g, "."));
      m(4);
      const D = parseInt(v.substring(n[4].from + U, n[4].to + V));
      m(5);
      const f = parseInt(v.substring(n[5].from + U, n[5].to + V));
      m(6);
      const w = parseInt(v.substring(n[6].from + U, n[6].to + V));
      m(7);
      const Y = parseInt(v.substring(n[7].from + U, n[7].to + V)) || 0;
      m(8);
      const _ = z ? y(v.substring(n[8].from + U, n[8].to + V).trim()) : p(v.substring(n[8].from + U, n[8].to + V).trim());
      m(9);
      let G = v.substring(n[9].from + U, n[9].to + V).trim();
      G = G[0] === "R" ? "running" : G[0] === "S" ? "sleeping" : G[0] === "T" ? "stopped" : G[0] === "W" ? "paging" : G[0] === "X" ? "dead" : G[0] === "Z" ? "zombie" : G[0] === "D" || G[0] === "U" ? "blocked" : "unknown", m(10);
      let q = v.substring(n[10].from + U, n[10].to + V).trim();
      (q === "?" || q === "??") && (q = ""), m(11);
      const j = v.substring(n[11].from + U, n[11].to + V).trim();
      m(12);
      let aA = "", tA = "", M = "", O = v.substring(n[12].from + U, n[12].to + V).trim();
      if (O.substr(O.length - 1) === "]" && (O = O.slice(0, -1)), O.substr(0, 1) === "[")
        tA = O.substring(1);
      else {
        const T = O.indexOf("("), S = O.indexOf(")"), AA = O.indexOf("/"), oA = O.indexOf(":");
        if (T < S && T < AA && AA < S)
          tA = O.split(" ")[0], tA = tA.replace(/:/g, "");
        else if (oA > 0 && (AA === -1 || AA > 3))
          tA = O.split(" ")[0], tA = tA.replace(/:/g, "");
        else {
          let rA = O.indexOf(" -"), cA = O.indexOf(" /");
          rA = rA >= 0 ? rA : 1e4, cA = cA >= 0 ? cA : 1e4;
          const lA = Math.min(rA, cA);
          let pA = O.substr(0, lA);
          const BA = O.substr(lA), uA = pA.lastIndexOf("/");
          if (uA >= 0 && (aA = pA.substr(0, uA), pA = pA.substr(uA + 1)), lA === 1e4 && pA.indexOf(" ") > -1) {
            const hA = pA.split(" ");
            e.existsSync(A.join(aA, hA[0])) ? (tA = hA.shift(), M = (hA.join(" ") + " " + BA).trim()) : (tA = pA.trim(), M = BA.trim());
          } else
            tA = pA.trim(), M = BA.trim();
        }
      }
      return {
        pid: a,
        parentPid: I,
        name: x ? L(tA) : tA,
        cpu: t,
        cpuu: 0,
        cpus: 0,
        mem: l,
        priority: D,
        memVsz: f,
        memRss: w,
        nice: Y,
        started: _,
        state: G,
        tty: q,
        user: j,
        command: tA,
        params: M,
        path: aA
      };
    }
    function K(v) {
      let U = [];
      if (v.length > 1) {
        let V = v[0];
        n = B.parseHead(V, 8), v.shift(), v.forEach((m) => {
          m.trim() !== "" && U.push(k(m));
        });
      }
      return U;
    }
    function gA(v) {
      function U(a) {
        const I = ("0" + (a.getMonth() + 1).toString()).slice(-2), t = a.getFullYear().toString(), l = ("0" + a.getDate().toString()).slice(-2), D = ("0" + a.getHours().toString()).slice(-2), f = ("0" + a.getMinutes().toString()).slice(-2), w = ("0" + a.getSeconds().toString()).slice(-2);
        return t + "-" + I + "-" + l + " " + D + ":" + f + ":" + w;
      }
      function V(a) {
        let I = "";
        if (a.indexOf("d") >= 0) {
          const t = a.split("d");
          I = U(new Date(Date.now() - (t[0] * 24 + t[1] * 1) * 60 * 60 * 1e3));
        } else if (a.indexOf("h") >= 0) {
          const t = a.split("h");
          I = U(new Date(Date.now() - (t[0] * 60 + t[1] * 1) * 60 * 1e3));
        } else if (a.indexOf(":") >= 0) {
          const t = a.split(":");
          I = U(new Date(Date.now() - (t.length > 1 ? (t[0] * 60 + t[1]) * 1e3 : t[0] * 1e3)));
        }
        return I;
      }
      let m = [];
      return v.forEach((a) => {
        if (a.trim() !== "") {
          a = a.trim().replace(/ +/g, " ").replace(/,+/g, ".");
          const I = a.split(" "), t = I.slice(9).join(" "), l = parseFloat((1 * parseInt(I[3]) * 1024 / s.totalmem()).toFixed(1)), D = V(I[5]);
          m.push({
            pid: parseInt(I[0]),
            parentPid: parseInt(I[1]),
            name: L(t),
            cpu: 0,
            cpuu: 0,
            cpus: 0,
            mem: l,
            priority: 0,
            memVsz: parseInt(I[2]),
            memRss: parseInt(I[3]),
            nice: parseInt(I[4]),
            started: D,
            state: I[6] === "R" ? "running" : I[6] === "S" ? "sleeping" : I[6] === "T" ? "stopped" : I[6] === "W" ? "paging" : I[6] === "X" ? "dead" : I[6] === "Z" ? "zombie" : I[6] === "D" || I[6] === "U" ? "blocked" : "unknown",
            tty: I[7],
            user: I[8],
            command: t
          });
        }
      }), m;
    }
    return new Promise((v) => {
      process.nextTick(() => {
        let U = {
          all: 0,
          running: 0,
          blocked: 0,
          sleeping: 0,
          unknown: 0,
          list: []
        }, V = "";
        if (N.ms && Date.now() - N.ms >= 500 || N.ms === 0)
          if (x || W || eA || IA || b || z) {
            x && (V = "export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"), (W || eA || IA) && (V = "export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"), b && (V = "ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"), z && (V = "ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm");
            try {
              g(V, { maxBuffer: 1024 * 102400 }, (m, a) => {
                !m && a.toString().trim() ? (U.list = K(a.toString().split(`
`)).slice(), U.all = U.list.length, U.running = U.list.filter((I) => I.state === "running").length, U.blocked = U.list.filter((I) => I.state === "blocked").length, U.sleeping = U.list.filter((I) => I.state === "sleeping").length, x ? (V = 'cat /proc/stat | grep "cpu "', U.list.forEach((I) => {
                  V += ";cat /proc/" + I.pid + "/stat";
                }), g(V, { maxBuffer: 1024 * 102400 }, (I, t) => {
                  let l = t.toString().split(`
`), D = E(l.shift()), f = {}, w = {};
                  l.forEach((Y) => {
                    if (w = u(Y, D, N), w.pid) {
                      let _ = U.list.map((G) => G.pid).indexOf(w.pid);
                      _ >= 0 && (U.list[_].cpu = w.cpuu + w.cpus, U.list[_].cpuu = w.cpuu, U.list[_].cpus = w.cpus), f[w.pid] = {
                        cpuu: w.cpuu,
                        cpus: w.cpus,
                        utime: w.utime,
                        stime: w.stime,
                        cutime: w.cutime,
                        cstime: w.cstime
                      };
                    }
                  }), N.all = D, N.list = Object.assign({}, f), N.ms = Date.now() - N.ms, N.result = Object.assign({}, U), c && c(U), v(U);
                })) : (c && c(U), v(U))) : (V = "ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm", z && (V = "ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"), g(V, { maxBuffer: 1024 * 102400 }, (I, t) => {
                  if (I)
                    c && c(U), v(U);
                  else {
                    let l = t.toString().split(`
`);
                    l.shift(), U.list = gA(l).slice(), U.all = U.list.length, U.running = U.list.filter((D) => D.state === "running").length, U.blocked = U.list.filter((D) => D.state === "blocked").length, U.sleeping = U.list.filter((D) => D.state === "sleeping").length, c && c(U), v(U);
                  }
                }));
              });
            } catch {
              c && c(U), v(U);
            }
          } else if (X)
            try {
              B.powerShell(
                `Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,
                @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | ConvertTo-Json -compress`
              ).then((m, a) => {
                if (!a) {
                  const I = [], t = [], l = {};
                  let D = 0, f = 0, w = [];
                  try {
                    m = m.trim().replace(/^\uFEFF/, ""), w = JSON.parse(m);
                  } catch {
                  }
                  w.forEach((Y) => {
                    const _ = Y.ProcessId, G = Y.ParentProcessId, q = Y.ExecutionState || null, j = Y.Caption, aA = Y.CommandLine, tA = Y.ExecutablePath, M = Y.UserModeTime, O = Y.KernelModeTime, T = Y.WorkingSetSize;
                    D = D + M, f = f + O, U.all++, q || U.unknown++, q === "3" && U.running++, (q === "4" || q === "5") && U.blocked++, t.push({
                      pid: _,
                      utime: M,
                      stime: O,
                      cpu: 0,
                      cpuu: 0,
                      cpus: 0
                    }), I.push({
                      pid: _,
                      parentPid: G,
                      name: j,
                      cpu: 0,
                      cpuu: 0,
                      cpus: 0,
                      mem: T / s.totalmem() * 100,
                      priority: Y.Priority | null,
                      memVsz: Y.PageFileUsage || null,
                      memRss: Math.floor((Y.WorkingSetSize || 0) / 1024),
                      nice: 0,
                      started: Y.CreationDate,
                      state: q ? H[q] : H[0],
                      tty: "",
                      user: "",
                      command: aA || j,
                      path: tA,
                      params: ""
                    });
                  }), U.sleeping = U.all - U.running - U.blocked - U.unknown, U.list = I, t.forEach((Y) => {
                    let _ = r(Y, D + f, N), G = U.list.map((q) => q.pid).indexOf(_.pid);
                    G >= 0 && (U.list[G].cpu = _.cpuu + _.cpus, U.list[G].cpuu = _.cpuu, U.list[G].cpus = _.cpus), l[_.pid] = {
                      cpuu: _.cpuu,
                      cpus: _.cpus,
                      utime: _.utime,
                      stime: _.stime
                    };
                  }), N.all = D + f, N.all_utime = D, N.all_stime = f, N.list = Object.assign({}, l), N.ms = Date.now() - N.ms, N.result = Object.assign({}, U);
                }
                c && c(U), v(U);
              });
            } catch {
              c && c(U), v(U);
            }
          else
            c && c(U), v(U);
        else
          c && c(N.result), v(N.result);
      });
    });
  }
  processes.processes = Q;
  function d(c, n) {
    return B.isFunction(c) && !n && (n = c, c = ""), new Promise((L) => {
      process.nextTick(() => {
        if (c = c || "", typeof c != "string")
          return n && n([]), L([]);
        let k = "";
        try {
          k.__proto__.toLowerCase = B.stringToLower, k.__proto__.replace = B.stringReplace, k.__proto__.toString = B.stringToString, k.__proto__.substr = B.stringSubstr, k.__proto__.substring = B.stringSubstring, k.__proto__.trim = B.stringTrim, k.__proto__.startsWith = B.stringStartWith;
        } catch {
          Object.setPrototypeOf(k, B.stringObj);
        }
        const K = B.sanitizeShellString(c), gA = B.mathMin(K.length, 2e3);
        for (let m = 0; m <= gA; m++)
          K[m] !== void 0 && (k = k + K[m]);
        k = k.trim().toLowerCase().replace(/, /g, "|").replace(/,+/g, "|"), k === "" && (k = "*"), B.isPrototypePolluted() && k !== "*" && (k = "------");
        let v = k.split("|"), U = [];
        if ((B.isPrototypePolluted() ? "" : B.sanitizeShellString(c) || "*") && v.length && v[0] !== "------") {
          if (X)
            try {
              B.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | ConvertTo-Json -compress").then((m, a) => {
                if (!a) {
                  const I = [], t = {};
                  let l = 0, D = 0, f = [];
                  try {
                    m = m.trim().replace(/^\uFEFF/, ""), f = JSON.parse(m);
                  } catch {
                  }
                  f.forEach((w) => {
                    const Y = w.ProcessId, _ = w.Caption, G = w.UserModeTime, q = w.KernelModeTime, j = w.WorkingSetSize;
                    l = l + G, D = D + q, I.push({
                      pid: Y,
                      name: _,
                      utime: G,
                      stime: q,
                      cpu: 0,
                      cpuu: 0,
                      cpus: 0,
                      mem: j
                    });
                    let aA = "", tA = !1;
                    if (v.forEach((M) => {
                      _.toLowerCase().indexOf(M.toLowerCase()) >= 0 && !tA && (tA = !0, aA = M);
                    }), k === "*" || tA) {
                      let M = !1;
                      U.forEach((O) => {
                        O.proc.toLowerCase() === aA.toLowerCase() && (O.pids.push(Y), O.mem += j / s.totalmem() * 100, M = !0);
                      }), M || U.push({
                        proc: aA,
                        pid: Y,
                        pids: [Y],
                        cpu: 0,
                        mem: j / s.totalmem() * 100
                      });
                    }
                  }), k !== "*" && v.filter((Y) => I.filter((_) => _.name.toLowerCase().indexOf(Y) >= 0).length === 0).forEach((Y) => {
                    U.push({
                      proc: Y,
                      pid: null,
                      pids: [],
                      cpu: 0,
                      mem: 0
                    });
                  }), I.forEach((w) => {
                    let Y = r(w, l + D, $), _ = -1;
                    for (let G = 0; G < U.length; G++)
                      (U[G].pid === Y.pid || U[G].pids.indexOf(Y.pid) >= 0) && (_ = G);
                    _ >= 0 && (U[_].cpu += Y.cpuu + Y.cpus), t[Y.pid] = {
                      cpuu: Y.cpuu,
                      cpus: Y.cpus,
                      utime: Y.utime,
                      stime: Y.stime
                    };
                  }), $.all = l + D, $.all_utime = l, $.all_stime = D, $.list = Object.assign({}, t), $.ms = Date.now() - $.ms, $.result = JSON.parse(JSON.stringify(U)), n && n(U), L(U);
                }
              });
            } catch {
              n && n(U), L(U);
            }
          if (b || x || W || eA || IA) {
            const m = ["-axo", "pid,ppid,pcpu,pmem,comm"];
            B.execSafe("ps", m).then((a) => {
              if (a) {
                const I = [], t = a.toString().split(`
`).filter((l) => {
                  if (k === "*")
                    return !0;
                  if (l.toLowerCase().indexOf("grep") !== -1)
                    return !1;
                  let D = !1;
                  return v.forEach((f) => {
                    D = D || l.toLowerCase().indexOf(f.toLowerCase()) >= 0;
                  }), D;
                });
                if (t.shift(), t.forEach((l) => {
                  const D = l.trim().replace(/ +/g, " ").split(" ");
                  if (D.length > 4) {
                    const f = D[4].indexOf("/") >= 0 ? D[4].substring(0, D[4].indexOf("/")) : D[4], w = x ? f : D[4].substring(D[4].lastIndexOf("/") + 1);
                    I.push({
                      name: w,
                      pid: parseInt(D[0]) || 0,
                      ppid: parseInt(D[1]) || 0,
                      cpu: parseFloat(D[2].replace(",", ".")),
                      mem: parseFloat(D[3].replace(",", "."))
                    });
                  }
                }), I.forEach((l) => {
                  let D = -1, f = !1, w = l.name;
                  for (let Y = 0; Y < U.length; Y++)
                    l.name.toLowerCase().indexOf(U[Y].proc.toLowerCase()) >= 0 && (D = Y);
                  v.forEach((Y) => {
                    l.name.toLowerCase().indexOf(Y.toLowerCase()) >= 0 && !f && (f = !0, w = Y);
                  }), (k === "*" || f) && (D < 0 ? w && U.push({
                    proc: w,
                    pid: l.pid,
                    pids: [l.pid],
                    cpu: l.cpu,
                    mem: l.mem
                  }) : (l.ppid < 10 && (U[D].pid = l.pid), U[D].pids.push(l.pid), U[D].cpu += l.cpu, U[D].mem += l.mem));
                }), k !== "*" && v.filter((D) => I.filter((f) => f.name.toLowerCase().indexOf(D) >= 0).length === 0).forEach((D) => {
                  U.push({
                    proc: D,
                    pid: null,
                    pids: [],
                    cpu: 0,
                    mem: 0
                  });
                }), x) {
                  U.forEach((D) => {
                    D.cpu = 0;
                  });
                  let l = 'cat /proc/stat | grep "cpu "';
                  for (let D in U)
                    for (let f in U[D].pids)
                      l += ";cat /proc/" + U[D].pids[f] + "/stat";
                  g(l, { maxBuffer: 1024 * 102400 }, (D, f) => {
                    let w = f.toString().split(`
`), Y = E(w.shift()), _ = {}, G = {};
                    w.forEach((q) => {
                      if (G = u(q, Y, $), G.pid) {
                        let j = -1;
                        for (let aA in U)
                          U[aA].pids.indexOf(G.pid) >= 0 && (j = aA);
                        j >= 0 && (U[j].cpu += G.cpuu + G.cpus), _[G.pid] = {
                          cpuu: G.cpuu,
                          cpus: G.cpus,
                          utime: G.utime,
                          stime: G.stime,
                          cutime: G.cutime,
                          cstime: G.cstime
                        };
                      }
                    }), U.forEach((q) => {
                      q.cpu = Math.round(q.cpu * 100) / 100;
                    }), $.all = Y, $.list = Object.assign({}, _), $.ms = Date.now() - $.ms, $.result = Object.assign({}, U), n && n(U), L(U);
                  });
                } else
                  n && n(U), L(U);
              } else
                n && n(U), L(U);
            });
          }
        }
      });
    });
  }
  return processes.processLoad = d, processes;
}
var users = {}, hasRequiredUsers;
function requireUsers() {
  if (hasRequiredUsers) return users;
  hasRequiredUsers = 1;
  const s = require$$1.exec, e = requireUtil(), A = process.platform, g = A === "linux" || A === "android", o = A === "darwin", B = A === "win32", F = A === "freebsd", x = A === "openbsd", b = A === "netbsd", X = A === "sunos";
  function W(p, h) {
    let E = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
    try {
      E = "" + (/* @__PURE__ */ new Date()).getFullYear() + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(p.toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + h).slice(-2), new Date(E) > /* @__PURE__ */ new Date() && (E = "" + ((/* @__PURE__ */ new Date()).getFullYear() - 1) + "-" + ("0" + ("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(p.toUpperCase()) / 3 + 1)).slice(-2) + "-" + ("0" + h).slice(-2));
    } catch {
      e.noop();
    }
    return E;
  }
  function eA(p, h) {
    const E = [];
    let u = [];
    const r = {};
    let Q = !0, d = [];
    const c = [];
    let n = {}, L = !0, k = !1;
    return p.forEach((K) => {
      if (K === "---")
        L = !1;
      else {
        const gA = K.replace(/ +/g, " ").split(" ");
        if (L) {
          if ((K.toLowerCase().indexOf("unexpected") >= 0 || K.toLowerCase().indexOf("unrecognized") >= 0) && (k = !0, u = []), !k) {
            const v = gA && gA.length > 4 && gA[4].indexOf(":") > 0 ? 4 : 3;
            u.push({
              user: gA[0],
              tty: gA[1],
              date: v === 4 ? W(gA[2], gA[3]) : gA[2],
              time: gA[v],
              ip: gA && gA.length > v + 1 ? gA[v + 1].replace(/\(/g, "").replace(/\)/g, "") : "",
              command: ""
            });
          }
        } else
          Q ? K[0] !== " " && (d = gA, d.forEach((v) => {
            c.push(K.indexOf(v));
          }), Q = !1) : (r.user = K.substring(c[0], c[1] - 1).trim(), r.tty = K.substring(c[1], c[2] - 1).trim(), r.ip = K.substring(c[2], c[3] - 1).replace(/\(/g, "").replace(/\)/g, "").trim(), r.command = K.substring(c[7], 1e3).trim(), u.length || h === 1 ? n = u.filter((v) => v.user.substring(0, 8).trim() === r.user && v.tty === r.tty) : n = [{ user: r.user, tty: r.tty, date: "", time: "", ip: "" }], n.length === 1 && n[0].user !== "" && E.push({
            user: n[0].user,
            tty: n[0].tty,
            date: n[0].date,
            time: n[0].time,
            ip: n[0].ip,
            command: r.command
          }));
      }
    }), E.length === 0 && h === 2 ? u : E;
  }
  function IA(p) {
    const h = [], E = [], u = {};
    let r = {}, Q = !0;
    return p.forEach((d) => {
      if (d === "---")
        Q = !1;
      else {
        const c = d.replace(/ +/g, " ").split(" ");
        Q ? E.push({
          user: c[0],
          tty: c[1],
          date: W(c[2], c[3]),
          time: c[4]
        }) : (u.user = c[0], u.tty = c[1], u.ip = c[2] !== "-" ? c[2] : "", u.command = c.slice(5, 1e3).join(" "), r = E.filter((n) => n.user.substring(0, 10) === u.user.substring(0, 10) && (n.tty.substring(3, 1e3) === u.tty || n.tty === u.tty)), r.length === 1 && h.push({
          user: r[0].user,
          tty: r[0].tty,
          date: r[0].date,
          time: r[0].time,
          ip: u.ip,
          command: u.command
        }));
      }
    }), h;
  }
  function z(p) {
    return new Promise((h) => {
      process.nextTick(() => {
        let E = [];
        if (g && s('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2', (u, r) => {
          if (u)
            p && p(E), h(E);
          else {
            let Q = r.toString().split(`
`);
            E = eA(Q, 1), E.length === 0 ? s('who; echo "---"; w | tail -n +2', (d, c) => {
              d || (Q = c.toString().split(`
`), E = eA(Q, 2)), p && p(E), h(E);
            }) : (p && p(E), h(E));
          }
        }), (F || x || b) && s('who; echo "---"; w -ih', (u, r) => {
          if (!u) {
            const Q = r.toString().split(`
`);
            E = IA(Q);
          }
          p && p(E), h(E);
        }), X && s('who; echo "---"; w -h', (u, r) => {
          if (!u) {
            const Q = r.toString().split(`
`);
            E = IA(Q);
          }
          p && p(E), h(E);
        }), o && s('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL', (u, r) => {
          if (!u) {
            const Q = r.toString().split(`
`);
            E = IA(Q);
          }
          p && p(E), h(E);
        }), B)
          try {
            let u = `Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo '#-#-#-#';`;
            u += "Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';", u += `$process = (Get-CimInstance Win32_Process -Filter "name = 'explorer.exe'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';`, u += "query user", e.powerShell(u).then((r) => {
              if (r) {
                r = r.split("#-#-#-#");
                const Q = N((r[0] || "").split(/\n\s*\n/)), d = H((r[1] || "").split(/\n\s*\n/)), c = y((r[3] || "").split(`\r
`)), n = $((r[2] || "").split(/\n\s*\n/), c);
                for (let L in d)
                  ({}).hasOwnProperty.call(d, L) && (d[L].dateTime = {}.hasOwnProperty.call(Q, L) ? Q[L] : "");
                n.forEach((L) => {
                  let k = "";
                  for (let K in d)
                    ({}).hasOwnProperty.call(d, K) && d[K].user === L.user && (!k || k < d[K].dateTime) && (k = d[K].dateTime);
                  E.push({
                    user: L.user,
                    tty: L.tty,
                    date: `${k.substring(0, 10)}`,
                    time: `${k.substring(11, 19)}`,
                    ip: "",
                    command: ""
                  });
                });
              }
              p && p(E), h(E);
            });
          } catch {
            p && p(E), h(E);
          }
      });
    });
  }
  function N(p) {
    const h = {};
    return p.forEach((E) => {
      const u = E.split(`\r
`), r = e.getValue(u, "LogonId"), Q = e.getValue(u, "starttime");
      r && (h[r] = Q);
    }), h;
  }
  function J(p, h) {
    p = p.toLowerCase(), h = h.toLowerCase();
    let E = 0, u = p.length;
    h.length > u && (u = h.length);
    for (let r = 0; r < u; r++) {
      const Q = p[r] || "", d = h[r] || "";
      Q === d && E++;
    }
    return u > 10 ? E / u > 0.9 : u > 0 ? E / u > 0.8 : !1;
  }
  function $(p, h) {
    const E = [];
    return p.forEach((u) => {
      const r = u.split(`\r
`), Q = e.getValue(r, "domain", ":", !0), d = e.getValue(r, "user", ":", !0), c = e.getValue(r, "sessionid", ":", !0);
      if (d) {
        const n = h.filter((L) => J(L.user, d));
        E.push({
          domain: Q,
          user: d,
          tty: n && n[0] && n[0].tty ? n[0].tty : c
        });
      }
    }), E;
  }
  function H(p) {
    const h = {};
    return p.forEach((E) => {
      const u = E.split(`\r
`);
      let Q = e.getValue(u, "antecedent", ":", !0).split("=");
      const d = Q.length > 2 ? Q[1].split(",")[0].replace(/"/g, "").trim() : "", c = Q.length > 2 ? Q[2].replace(/"/g, "").replace(/\)/g, "").trim() : "";
      Q = e.getValue(u, "dependent", ":", !0).split("=");
      const L = Q.length > 1 ? Q[1].replace(/"/g, "").replace(/\)/g, "").trim() : "";
      L && (h[L] = {
        domain: c,
        user: d
      });
    }), h;
  }
  function y(p) {
    p = p.filter((r) => r);
    let h = [];
    const E = p[0], u = [];
    if (E) {
      const r = E[0] === " " ? 1 : 0;
      u.push(r - 1);
      let Q = 0;
      for (let d = r + 1; d < E.length; d++)
        E[d] === " " && (E[d - 1] === " " || E[d - 1] === ".") ? Q = d : Q && (u.push(Q), Q = 0);
      for (let d = 1; d < p.length; d++)
        if (p[d].trim()) {
          const c = p[d].substring(u[0] + 1, u[1]).trim() || "", n = p[d].substring(u[1] + 1, u[2] - 2).trim() || "";
          h.push({
            user: c,
            tty: n
          });
        }
    }
    return h;
  }
  return users.users = z, users;
}
var internet = {}, hasRequiredInternet;
function requireInternet() {
  if (hasRequiredInternet) return internet;
  hasRequiredInternet = 1;
  const s = requireUtil(), e = process.platform, A = e === "linux" || e === "android", g = e === "darwin", o = e === "win32", B = e === "freebsd", F = e === "openbsd", x = e === "netbsd", b = e === "sunos";
  function X(eA, IA) {
    return new Promise((z) => {
      process.nextTick(() => {
        let N = {
          url: eA,
          ok: !1,
          status: 404,
          ms: null
        };
        if (typeof eA != "string")
          return IA && IA(N), z(N);
        let J = "";
        const $ = s.sanitizeShellString(eA, !0), H = s.mathMin($.length, 2e3);
        for (let y = 0; y <= H; y++)
          if ($[y] !== void 0) {
            try {
              $[y].__proto__.toLowerCase = s.stringToLower;
            } catch {
              Object.setPrototypeOf($[y], s.stringObj);
            }
            const p = $[y].toLowerCase();
            p && p[0] && !p[1] && p[0].length === 1 && (J = J + p[0]);
          }
        N.url = J;
        try {
          if (J && !s.isPrototypePolluted()) {
            try {
              J.__proto__.startsWith = s.stringStartWith;
            } catch {
              Object.setPrototypeOf(J, s.stringObj);
            }
            if (J.startsWith("file:") || J.startsWith("gopher:") || J.startsWith("telnet:") || J.startsWith("mailto:") || J.startsWith("news:") || J.startsWith("nntp:"))
              return IA && IA(N), z(N);
            s.checkWebsite(J).then((y) => {
              N.status = y.statusCode, N.ok = y.statusCode >= 200 && y.statusCode <= 399, N.ms = N.ok ? y.time : null, IA && IA(N), z(N);
            });
          } else
            IA && IA(N), z(N);
        } catch {
          IA && IA(N), z(N);
        }
      });
    });
  }
  internet.inetChecksite = X;
  function W(eA, IA) {
    return s.isFunction(eA) && !IA && (IA = eA, eA = ""), eA = eA || "8.8.8.8", new Promise((z) => {
      process.nextTick(() => {
        if (typeof eA != "string")
          return IA && IA(null), z(null);
        let N = "";
        const J = (s.isPrototypePolluted() ? "8.8.8.8" : s.sanitizeShellString(eA, !0)).trim(), $ = s.mathMin(J.length, 2e3);
        for (let y = 0; y <= $; y++)
          if (J[y] !== void 0) {
            try {
              J[y].__proto__.toLowerCase = s.stringToLower;
            } catch {
              Object.setPrototypeOf(J[y], s.stringObj);
            }
            const p = J[y].toLowerCase();
            p && p[0] && !p[1] && (N = N + p[0]);
          }
        try {
          N.__proto__.startsWith = s.stringStartWith;
        } catch {
          Object.setPrototypeOf(N, s.stringObj);
        }
        if (N.startsWith("file:") || N.startsWith("gopher:") || N.startsWith("telnet:") || N.startsWith("mailto:") || N.startsWith("news:") || N.startsWith("nntp:"))
          return IA && IA(null), z(null);
        let H;
        if ((A || B || F || x || g) && (A && (H = ["-c", "2", "-w", "3", N]), (B || F || x) && (H = ["-c", "2", "-t", "3", N]), g && (H = ["-c2", "-t3", N]), s.execSafe("ping", H).then((y) => {
          let p = null;
          if (y) {
            const E = y.split(`
`).filter((u) => u.indexOf("rtt") >= 0 || u.indexOf("round-trip") >= 0 || u.indexOf("avg") >= 0).join(`
`).split("=");
            if (E.length > 1) {
              const u = E[1].split("/");
              u.length > 1 && (p = parseFloat(u[1]));
            }
          }
          IA && IA(p), z(p);
        })), b) {
          const y = ["-s", "-a", N, "56", "2"], p = "avg";
          s.execSafe("ping", y, { timeout: 3e3 }).then((h) => {
            let E = null;
            if (h) {
              const r = h.split(`
`).filter((Q) => Q.indexOf(p) >= 0).join(`
`).split("=");
              if (r.length > 1) {
                const Q = r[1].split("/");
                Q.length > 1 && (E = parseFloat(Q[1].replace(",", ".")));
              }
            }
            IA && IA(E), z(E);
          });
        }
        if (o) {
          let y = null;
          try {
            const p = [N, "-n", "1"];
            s.execSafe("ping", p, s.execOptsWin).then((h) => {
              if (h) {
                const E = h.split(`\r
`);
                E.shift(), E.forEach((u) => {
                  if ((u.toLowerCase().match(/ms/g) || []).length === 3) {
                    let r = u.replace(/ +/g, " ").split(" ");
                    r.length > 6 && (y = parseFloat(r[r.length - 1]));
                  }
                });
              }
              IA && IA(y), z(y);
            });
          } catch {
            IA && IA(y), z(y);
          }
        }
      });
    });
  }
  return internet.inetLatency = W, internet;
}
var docker = {}, dockerSocket, hasRequiredDockerSocket;
function requireDockerSocket() {
  if (hasRequiredDockerSocket) return dockerSocket;
  hasRequiredDockerSocket = 1;
  const s = require$$0$2, A = require$$0$1.type() === "Windows_NT" ? "//./pipe/docker_engine" : "/var/run/docker.sock";
  class g {
    getInfo(B) {
      try {
        let F = s.createConnection({ path: A }), x = "", b;
        F.on("connect", () => {
          F.write(`GET http:/info HTTP/1.0\r
\r
`);
        }), F.on("data", (X) => {
          x = x + X.toString();
        }), F.on("error", () => {
          F = !1, B({});
        }), F.on("end", () => {
          const X = x.indexOf(`\r
\r
`);
          x = x.substring(X + 4), F = !1;
          try {
            b = JSON.parse(x), B(b);
          } catch {
            B({});
          }
        });
      } catch {
        B({});
      }
    }
    listImages(B, F) {
      try {
        let x = s.createConnection({ path: A }), b = "", X;
        x.on("connect", () => {
          x.write("GET http:/images/json" + (B ? "?all=1" : "") + ` HTTP/1.0\r
\r
`);
        }), x.on("data", (W) => {
          b = b + W.toString();
        }), x.on("error", () => {
          x = !1, F({});
        }), x.on("end", () => {
          const W = b.indexOf(`\r
\r
`);
          b = b.substring(W + 4), x = !1;
          try {
            X = JSON.parse(b), F(X);
          } catch {
            F({});
          }
        });
      } catch {
        F({});
      }
    }
    inspectImage(B, F) {
      if (B = B || "", B)
        try {
          let x = s.createConnection({ path: A }), b = "", X;
          x.on("connect", () => {
            x.write("GET http:/images/" + B + `/json?stream=0 HTTP/1.0\r
\r
`);
          }), x.on("data", (W) => {
            b = b + W.toString();
          }), x.on("error", () => {
            x = !1, F({});
          }), x.on("end", () => {
            const W = b.indexOf(`\r
\r
`);
            b = b.substring(W + 4), x = !1;
            try {
              X = JSON.parse(b), F(X);
            } catch {
              F({});
            }
          });
        } catch {
          F({});
        }
      else
        F({});
    }
    listContainers(B, F) {
      try {
        let x = s.createConnection({ path: A }), b = "", X;
        x.on("connect", () => {
          x.write("GET http:/containers/json" + (B ? "?all=1" : "") + ` HTTP/1.0\r
\r
`);
        }), x.on("data", (W) => {
          b = b + W.toString();
        }), x.on("error", () => {
          x = !1, F({});
        }), x.on("end", () => {
          const W = b.indexOf(`\r
\r
`);
          b = b.substring(W + 4), x = !1;
          try {
            X = JSON.parse(b), F(X);
          } catch {
            F({});
          }
        });
      } catch {
        F({});
      }
    }
    getStats(B, F) {
      if (B = B || "", B)
        try {
          let x = s.createConnection({ path: A }), b = "", X;
          x.on("connect", () => {
            x.write("GET http:/containers/" + B + `/stats?stream=0 HTTP/1.0\r
\r
`);
          }), x.on("data", (W) => {
            b = b + W.toString();
          }), x.on("error", () => {
            x = !1, F({});
          }), x.on("end", () => {
            const W = b.indexOf(`\r
\r
`);
            b = b.substring(W + 4), x = !1;
            try {
              X = JSON.parse(b), F(X);
            } catch {
              F({});
            }
          });
        } catch {
          F({});
        }
      else
        F({});
    }
    getInspect(B, F) {
      if (B = B || "", B)
        try {
          let x = s.createConnection({ path: A }), b = "", X;
          x.on("connect", () => {
            x.write("GET http:/containers/" + B + `/json?stream=0 HTTP/1.0\r
\r
`);
          }), x.on("data", (W) => {
            b = b + W.toString();
          }), x.on("error", () => {
            x = !1, F({});
          }), x.on("end", () => {
            const W = b.indexOf(`\r
\r
`);
            b = b.substring(W + 4), x = !1;
            try {
              X = JSON.parse(b), F(X);
            } catch {
              F({});
            }
          });
        } catch {
          F({});
        }
      else
        F({});
    }
    getProcesses(B, F) {
      if (B = B || "", B)
        try {
          let x = s.createConnection({ path: A }), b = "", X;
          x.on("connect", () => {
            x.write("GET http:/containers/" + B + `/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r
\r
`);
          }), x.on("data", (W) => {
            b = b + W.toString();
          }), x.on("error", () => {
            x = !1, F({});
          }), x.on("end", () => {
            const W = b.indexOf(`\r
\r
`);
            b = b.substring(W + 4), x = !1;
            try {
              X = JSON.parse(b), F(X);
            } catch {
              F({});
            }
          });
        } catch {
          F({});
        }
      else
        F({});
    }
    listVolumes(B) {
      try {
        let F = s.createConnection({ path: A }), x = "", b;
        F.on("connect", () => {
          F.write(`GET http:/volumes HTTP/1.0\r
\r
`);
        }), F.on("data", (X) => {
          x = x + X.toString();
        }), F.on("error", () => {
          F = !1, B({});
        }), F.on("end", () => {
          const X = x.indexOf(`\r
\r
`);
          x = x.substring(X + 4), F = !1;
          try {
            b = JSON.parse(x), B(b);
          } catch {
            B({});
          }
        });
      } catch {
        B({});
      }
    }
  }
  return dockerSocket = g, dockerSocket;
}
var hasRequiredDocker;
function requireDocker() {
  if (hasRequiredDocker) return docker;
  hasRequiredDocker = 1;
  const s = requireUtil(), e = requireDockerSocket(), g = process.platform === "win32", o = {};
  let B, F = 0;
  function x(h) {
    return new Promise((E) => {
      process.nextTick(() => {
        B || (B = new e());
        const u = {};
        B.getInfo((r) => {
          u.id = r.ID, u.containers = r.Containers, u.containersRunning = r.ContainersRunning, u.containersPaused = r.ContainersPaused, u.containersStopped = r.ContainersStopped, u.images = r.Images, u.driver = r.Driver, u.memoryLimit = r.MemoryLimit, u.swapLimit = r.SwapLimit, u.kernelMemory = r.KernelMemory, u.cpuCfsPeriod = r.CpuCfsPeriod, u.cpuCfsQuota = r.CpuCfsQuota, u.cpuShares = r.CPUShares, u.cpuSet = r.CPUSet, u.ipv4Forwarding = r.IPv4Forwarding, u.bridgeNfIptables = r.BridgeNfIptables, u.bridgeNfIp6tables = r.BridgeNfIp6tables, u.debug = r.Debug, u.nfd = r.NFd, u.oomKillDisable = r.OomKillDisable, u.ngoroutines = r.NGoroutines, u.systemTime = r.SystemTime, u.loggingDriver = r.LoggingDriver, u.cgroupDriver = r.CgroupDriver, u.nEventsListener = r.NEventsListener, u.kernelVersion = r.KernelVersion, u.operatingSystem = r.OperatingSystem, u.osType = r.OSType, u.architecture = r.Architecture, u.ncpu = r.NCPU, u.memTotal = r.MemTotal, u.dockerRootDir = r.DockerRootDir, u.httpProxy = r.HttpProxy, u.httpsProxy = r.HttpsProxy, u.noProxy = r.NoProxy, u.name = r.Name, u.labels = r.Labels, u.experimentalBuild = r.ExperimentalBuild, u.serverVersion = r.ServerVersion, u.clusterStore = r.ClusterStore, u.clusterAdvertise = r.ClusterAdvertise, u.defaultRuntime = r.DefaultRuntime, u.liveRestoreEnabled = r.LiveRestoreEnabled, u.isolation = r.Isolation, u.initBinary = r.InitBinary, u.productLicense = r.ProductLicense, h && h(u), E(u);
        });
      });
    });
  }
  docker.dockerInfo = x;
  function b(h, E) {
    s.isFunction(h) && !E && (E = h, h = !1), typeof h == "string" && h === "true" && (h = !0), typeof h != "boolean" && h !== void 0 && (h = !1), h = h || !1;
    let u = [];
    return new Promise((r) => {
      process.nextTick(() => {
        B || (B = new e());
        const Q = [];
        B.listImages(h, (d) => {
          let c = {};
          try {
            c = d, c && Object.prototype.toString.call(c) === "[object Array]" && c.length > 0 ? (c.forEach((n) => {
              n.Names && Object.prototype.toString.call(n.Names) === "[object Array]" && n.Names.length > 0 && (n.Name = n.Names[0].replace(/^\/|\/$/g, "")), Q.push(X(n.Id.trim(), n));
            }), Q.length ? Promise.all(Q).then((n) => {
              E && E(n), r(n);
            }) : (E && E(u), r(u))) : (E && E(u), r(u));
          } catch {
            E && E(u), r(u);
          }
        });
      });
    });
  }
  function X(h, E) {
    return new Promise((u) => {
      process.nextTick(() => {
        if (h = h || "", typeof h != "string")
          return u();
        const r = (s.isPrototypePolluted() ? "" : s.sanitizeShellString(h, !0)).trim();
        r ? (B || (B = new e()), B.inspectImage(r.trim(), (Q) => {
          try {
            u({
              id: E.Id,
              container: Q.Container,
              comment: Q.Comment,
              os: Q.Os,
              architecture: Q.Architecture,
              parent: Q.Parent,
              dockerVersion: Q.DockerVersion,
              size: Q.Size,
              sharedSize: E.SharedSize,
              virtualSize: Q.VirtualSize,
              author: Q.Author,
              created: Q.Created ? Math.round(new Date(Q.Created).getTime() / 1e3) : 0,
              containerConfig: Q.ContainerConfig ? Q.ContainerConfig : {},
              graphDriver: Q.GraphDriver ? Q.GraphDriver : {},
              repoDigests: Q.RepoDigests ? Q.RepoDigests : {},
              repoTags: Q.RepoTags ? Q.RepoTags : {},
              config: Q.Config ? Q.Config : {},
              rootFS: Q.RootFS ? Q.RootFS : {}
            });
          } catch {
            u();
          }
        })) : u();
      });
    });
  }
  docker.dockerImages = b;
  function W(h, E) {
    function u(Q, d) {
      return Q.filter((n) => n.Id && n.Id === d).length > 0;
    }
    s.isFunction(h) && !E && (E = h, h = !1), typeof h == "string" && h === "true" && (h = !0), typeof h != "boolean" && h !== void 0 && (h = !1), h = h || !1;
    let r = [];
    return new Promise((Q) => {
      process.nextTick(() => {
        B || (B = new e());
        const d = [];
        B.listContainers(h, (c) => {
          let n = {};
          try {
            if (n = c, n && Object.prototype.toString.call(n) === "[object Array]" && n.length > 0) {
              for (let L in o)
                ({}).hasOwnProperty.call(o, L) && (u(n, L) || delete o[L]);
              n.forEach((L) => {
                L.Names && Object.prototype.toString.call(L.Names) === "[object Array]" && L.Names.length > 0 && (L.Name = L.Names[0].replace(/^\/|\/$/g, "")), d.push(eA(L.Id.trim(), L));
              }), d.length ? Promise.all(d).then((L) => {
                E && E(L), Q(L);
              }) : (E && E(r), Q(r));
            } else
              E && E(r), Q(r);
          } catch {
            for (let k in o)
              ({}).hasOwnProperty.call(o, k) && (u(n, k) || delete o[k]);
            E && E(r), Q(r);
          }
        });
      });
    });
  }
  function eA(h, E) {
    return new Promise((u) => {
      process.nextTick(() => {
        if (h = h || "", typeof h != "string")
          return u();
        const r = (s.isPrototypePolluted() ? "" : s.sanitizeShellString(h, !0)).trim();
        r ? (B || (B = new e()), B.getInspect(r.trim(), (Q) => {
          try {
            u({
              id: E.Id,
              name: E.Name,
              image: E.Image,
              imageID: E.ImageID,
              command: E.Command,
              created: E.Created,
              started: Q.State && Q.State.StartedAt ? Math.round(new Date(Q.State.StartedAt).getTime() / 1e3) : 0,
              finished: Q.State && Q.State.FinishedAt && !Q.State.FinishedAt.startsWith("0001-01-01") ? Math.round(new Date(Q.State.FinishedAt).getTime() / 1e3) : 0,
              createdAt: Q.Created ? Q.Created : "",
              startedAt: Q.State && Q.State.StartedAt ? Q.State.StartedAt : "",
              finishedAt: Q.State && Q.State.FinishedAt && !Q.State.FinishedAt.startsWith("0001-01-01") ? Q.State.FinishedAt : "",
              state: E.State,
              restartCount: Q.RestartCount || 0,
              platform: Q.Platform || "",
              driver: Q.Driver || "",
              ports: E.Ports,
              mounts: E.Mounts
              // hostconfig: payload.HostConfig,
              // network: payload.NetworkSettings
            });
          } catch {
            u();
          }
        })) : u();
      });
    });
  }
  docker.dockerContainers = W;
  function IA(h, E) {
    if (g) {
      let u = s.nanoSeconds(), r = 0;
      if (F > 0) {
        let Q = u - F, d = h.cpu_usage.total_usage - E.cpu_usage.total_usage;
        Q > 0 && (r = 100 * d / Q);
      }
      return F = u, r;
    } else {
      let u = 0, r = h.cpu_usage.total_usage - E.cpu_usage.total_usage, Q = h.system_cpu_usage - E.system_cpu_usage;
      return Q > 0 && r > 0 && (E.online_cpus ? u = r / Q * E.online_cpus * 100 : u = r / Q * h.cpu_usage.percpu_usage.length * 100), u;
    }
  }
  function z(h) {
    let E, u;
    for (let r in h) {
      if (!{}.hasOwnProperty.call(h, r))
        continue;
      const Q = h[r];
      E = +Q.rx_bytes, u = +Q.tx_bytes;
    }
    return {
      rx: E,
      wx: u
    };
  }
  function N(h) {
    let E = {
      r: 0,
      w: 0
    };
    return h && h.io_service_bytes_recursive && Object.prototype.toString.call(h.io_service_bytes_recursive) === "[object Array]" && h.io_service_bytes_recursive.length > 0 && h.io_service_bytes_recursive.forEach((u) => {
      u.op && u.op.toLowerCase() === "read" && u.value && (E.r += u.value), u.op && u.op.toLowerCase() === "write" && u.value && (E.w += u.value);
    }), E;
  }
  function J(h, E) {
    let u = [];
    return new Promise((r) => {
      process.nextTick(() => {
        if (s.isFunction(h) && !E)
          E = h, u = ["*"];
        else {
          if (h = h || "*", typeof h != "string")
            return E && E([]), r([]);
          let c = "";
          try {
            c.__proto__.toLowerCase = s.stringToLower, c.__proto__.replace = s.stringReplace, c.__proto__.toString = s.stringToString, c.__proto__.substr = s.stringSubstr, c.__proto__.substring = s.stringSubstring, c.__proto__.trim = s.stringTrim, c.__proto__.startsWith = s.stringStartWith;
          } catch {
            Object.setPrototypeOf(c, s.stringObj);
          }
          if (c = h, c = c.trim(), c !== "*") {
            c = "";
            const n = (s.isPrototypePolluted() ? "" : s.sanitizeShellString(h, !0)).trim(), L = s.mathMin(n.length, 2e3);
            for (let k = 0; k <= L; k++)
              if (n[k] !== void 0) {
                n[k].__proto__.toLowerCase = s.stringToLower;
                const K = n[k].toLowerCase();
                K && K[0] && !K[1] && (c = c + K[0]);
              }
          }
          c = c.trim().toLowerCase().replace(/,+/g, "|"), u = c.split("|");
        }
        const Q = [], d = [];
        if (u.length && u[0].trim() === "*")
          u = [], W().then((c) => {
            for (let n of c)
              u.push(n.id.substring(0, 12));
            u.length ? J(u.join(",")).then((n) => {
              E && E(n), r(n);
            }) : (E && E(Q), r(Q));
          });
        else {
          for (let c of u)
            d.push($(c.trim()));
          d.length ? Promise.all(d).then((c) => {
            E && E(c), r(c);
          }) : (E && E(Q), r(Q));
        }
      });
    });
  }
  function $(h) {
    h = h || "";
    const E = {
      id: h,
      memUsage: 0,
      memLimit: 0,
      memPercent: 0,
      cpuPercent: 0,
      pids: 0,
      netIO: {
        rx: 0,
        wx: 0
      },
      blockIO: {
        r: 0,
        w: 0
      },
      restartCount: 0,
      cpuStats: {},
      precpuStats: {},
      memoryStats: {},
      networks: {}
    };
    return new Promise((u) => {
      process.nextTick(() => {
        h ? (B || (B = new e()), B.getInspect(h, (r) => {
          try {
            B.getStats(h, (Q) => {
              try {
                let d = Q;
                d.message || (Q.id && (E.id = Q.id), E.memUsage = d.memory_stats && d.memory_stats.usage ? d.memory_stats.usage : 0, E.memLimit = d.memory_stats && d.memory_stats.limit ? d.memory_stats.limit : 0, E.memPercent = d.memory_stats && d.memory_stats.usage && d.memory_stats.limit ? d.memory_stats.usage / d.memory_stats.limit * 100 : 0, E.cpuPercent = d.cpu_stats && d.precpu_stats ? IA(d.cpu_stats, d.precpu_stats) : 0, E.pids = d.pids_stats && d.pids_stats.current ? d.pids_stats.current : 0, E.restartCount = r.RestartCount ? r.RestartCount : 0, d.networks && (E.netIO = z(d.networks)), d.blkio_stats && (E.blockIO = N(d.blkio_stats)), E.cpuStats = d.cpu_stats ? d.cpu_stats : {}, E.precpuStats = d.precpu_stats ? d.precpu_stats : {}, E.memoryStats = d.memory_stats ? d.memory_stats : {}, E.networks = d.networks ? d.networks : {});
              } catch {
                s.noop();
              }
              u(E);
            });
          } catch {
            s.noop();
          }
        })) : u(E);
      });
    });
  }
  docker.dockerContainerStats = J;
  function H(h, E) {
    let u = [];
    return new Promise((r) => {
      process.nextTick(() => {
        if (h = h || "", typeof h != "string")
          return r(u);
        const Q = (s.isPrototypePolluted() ? "" : s.sanitizeShellString(h, !0)).trim();
        Q ? (B || (B = new e()), B.getProcesses(Q, (d) => {
          try {
            if (d && d.Titles && d.Processes) {
              let c = d.Titles.map(function(f) {
                return f.toUpperCase();
              }), n = c.indexOf("PID"), L = c.indexOf("PPID"), k = c.indexOf("PGID"), K = c.indexOf("VSZ"), gA = c.indexOf("TIME"), v = c.indexOf("ELAPSED"), U = c.indexOf("NI"), V = c.indexOf("RUSER"), m = c.indexOf("USER"), a = c.indexOf("RGROUP"), I = c.indexOf("GROUP"), t = c.indexOf("STAT"), l = c.indexOf("RSS"), D = c.indexOf("COMMAND");
              d.Processes.forEach((f) => {
                u.push({
                  pidHost: n >= 0 ? f[n] : "",
                  ppid: L >= 0 ? f[L] : "",
                  pgid: k >= 0 ? f[k] : "",
                  user: m >= 0 ? f[m] : "",
                  ruser: V >= 0 ? f[V] : "",
                  group: I >= 0 ? f[I] : "",
                  rgroup: a >= 0 ? f[a] : "",
                  stat: t >= 0 ? f[t] : "",
                  time: gA >= 0 ? f[gA] : "",
                  elapsed: v >= 0 ? f[v] : "",
                  nice: U >= 0 ? f[U] : "",
                  rss: l >= 0 ? f[l] : "",
                  vsz: K >= 0 ? f[K] : "",
                  command: D >= 0 ? f[D] : ""
                });
              });
            }
          } catch {
            s.noop();
          }
          E && E(u), r(u);
        })) : (E && E(u), r(u));
      });
    });
  }
  docker.dockerContainerProcesses = H;
  function y(h) {
    let E = [];
    return new Promise((u) => {
      process.nextTick(() => {
        B || (B = new e()), B.listVolumes((r) => {
          let Q = {};
          try {
            Q = r, Q && Q.Volumes && Object.prototype.toString.call(Q.Volumes) === "[object Array]" && Q.Volumes.length > 0 ? (Q.Volumes.forEach((d) => {
              E.push({
                name: d.Name,
                driver: d.Driver,
                labels: d.Labels,
                mountpoint: d.Mountpoint,
                options: d.Options,
                scope: d.Scope,
                created: d.CreatedAt ? Math.round(new Date(d.CreatedAt).getTime() / 1e3) : 0
              });
            }), h && h(E), u(E)) : (h && h(E), u(E));
          } catch {
            h && h(E), u(E);
          }
        });
      });
    });
  }
  docker.dockerVolumes = y;
  function p(h) {
    return new Promise((E) => {
      process.nextTick(() => {
        W(!0).then((u) => {
          if (u && Object.prototype.toString.call(u) === "[object Array]" && u.length > 0) {
            let r = u.length;
            u.forEach((Q) => {
              J(Q.id).then((d) => {
                Q.memUsage = d[0].memUsage, Q.memLimit = d[0].memLimit, Q.memPercent = d[0].memPercent, Q.cpuPercent = d[0].cpuPercent, Q.pids = d[0].pids, Q.netIO = d[0].netIO, Q.blockIO = d[0].blockIO, Q.cpuStats = d[0].cpuStats, Q.precpuStats = d[0].precpuStats, Q.memoryStats = d[0].memoryStats, Q.networks = d[0].networks, H(Q.id).then((c) => {
                  Q.processes = c, r -= 1, r === 0 && (h && h(u), E(u));
                });
              });
            });
          } else
            h && h(u), E(u);
        });
      });
    });
  }
  return docker.dockerAll = p, docker;
}
var virtualbox = {}, hasRequiredVirtualbox;
function requireVirtualbox() {
  if (hasRequiredVirtualbox) return virtualbox;
  hasRequiredVirtualbox = 1;
  const s = require$$0$1, e = require$$1.exec, A = requireUtil();
  function g(o) {
    let B = [];
    return new Promise((F) => {
      process.nextTick(() => {
        try {
          e(A.getVboxmanage() + " list vms --long", (x, b) => {
            let X = (s.EOL + b.toString()).split(s.EOL + "Name:");
            X.shift(), X.forEach((W) => {
              const eA = ("Name:" + W).split(s.EOL), IA = A.getValue(eA, "State"), z = IA.startsWith("running"), N = z ? IA.replace("running (since ", "").replace(")", "").trim() : "";
              let J = 0;
              try {
                if (z) {
                  const y = new Date(N), p = y.getTimezoneOffset();
                  J = Math.round((Date.now() - Date.parse(y)) / 1e3) + p * 60;
                }
              } catch {
                A.noop();
              }
              const $ = z ? "" : IA.replace("powered off (since", "").replace(")", "").trim();
              let H = 0;
              try {
                if (!z) {
                  const y = new Date($), p = y.getTimezoneOffset();
                  H = Math.round((Date.now() - Date.parse(y)) / 1e3) + p * 60;
                }
              } catch {
                A.noop();
              }
              B.push({
                id: A.getValue(eA, "UUID"),
                name: A.getValue(eA, "Name"),
                running: z,
                started: N,
                runningSince: J,
                stopped: $,
                stoppedSince: H,
                guestOS: A.getValue(eA, "Guest OS"),
                hardwareUUID: A.getValue(eA, "Hardware UUID"),
                memory: parseInt(A.getValue(eA, "Memory size", "     "), 10),
                vram: parseInt(A.getValue(eA, "VRAM size"), 10),
                cpus: parseInt(A.getValue(eA, "Number of CPUs"), 10),
                cpuExepCap: A.getValue(eA, "CPU exec cap"),
                cpuProfile: A.getValue(eA, "CPUProfile"),
                chipset: A.getValue(eA, "Chipset"),
                firmware: A.getValue(eA, "Firmware"),
                pageFusion: A.getValue(eA, "Page Fusion") === "enabled",
                configFile: A.getValue(eA, "Config file"),
                snapshotFolder: A.getValue(eA, "Snapshot folder"),
                logFolder: A.getValue(eA, "Log folder"),
                hpet: A.getValue(eA, "HPET") === "enabled",
                pae: A.getValue(eA, "PAE") === "enabled",
                longMode: A.getValue(eA, "Long Mode") === "enabled",
                tripleFaultReset: A.getValue(eA, "Triple Fault Reset") === "enabled",
                apic: A.getValue(eA, "APIC") === "enabled",
                x2Apic: A.getValue(eA, "X2APIC") === "enabled",
                acpi: A.getValue(eA, "ACPI") === "enabled",
                ioApic: A.getValue(eA, "IOAPIC") === "enabled",
                biosApicMode: A.getValue(eA, "BIOS APIC mode"),
                bootMenuMode: A.getValue(eA, "Boot menu mode"),
                bootDevice1: A.getValue(eA, "Boot Device 1"),
                bootDevice2: A.getValue(eA, "Boot Device 2"),
                bootDevice3: A.getValue(eA, "Boot Device 3"),
                bootDevice4: A.getValue(eA, "Boot Device 4"),
                timeOffset: A.getValue(eA, "Time offset"),
                rtc: A.getValue(eA, "RTC")
              });
            }), o && o(B), F(B);
          });
        } catch {
          o && o(B), F(B);
        }
      });
    });
  }
  return virtualbox.vboxInfo = g, virtualbox;
}
var printer = {}, hasRequiredPrinter;
function requirePrinter() {
  if (hasRequiredPrinter) return printer;
  hasRequiredPrinter = 1;
  const s = require$$1.exec, e = requireUtil();
  let A = process.platform;
  const g = A === "linux" || A === "android", o = A === "darwin", B = A === "win32", F = A === "freebsd", x = A === "openbsd", b = A === "netbsd", X = A === "sunos", W = {
    1: "Other",
    2: "Unknown",
    3: "Idle",
    4: "Printing",
    5: "Warmup",
    6: "Stopped Printing",
    7: "Offline"
  };
  function eA(H) {
    const y = {};
    if (H && H.length && H[0].indexOf(" CUPS v") > 0) {
      const p = H[0].split(" CUPS v");
      y.cupsVersion = p[1];
    }
    return y;
  }
  function IA(H) {
    const y = {}, p = e.getValue(H, "PrinterId", " ");
    return y.id = p ? parseInt(p, 10) : null, y.name = e.getValue(H, "Info", " "), y.model = H.length > 0 && H[0] ? H[0].split(" ")[0] : "", y.uri = e.getValue(H, "DeviceURI", " "), y.uuid = e.getValue(H, "UUID", " "), y.status = e.getValue(H, "State", " "), y.local = e.getValue(H, "Location", " ").toLowerCase().startsWith("local"), y.default = null, y.shared = e.getValue(H, "Shared", " ").toLowerCase().startsWith("yes"), y;
  }
  function z(H, y) {
    const p = {};
    return p.id = y, p.name = e.getValue(H, "Description", ":", !0), p.model = H.length > 0 && H[0] ? H[0].split(" ")[0] : "", p.uri = null, p.uuid = null, p.status = H.length > 0 && H[0] ? H[0].indexOf(" idle") > 0 ? "idle" : H[0].indexOf(" printing") > 0 ? "printing" : "unknown" : null, p.local = e.getValue(H, "Location", ":", !0).toLowerCase().startsWith("local"), p.default = null, p.shared = e.getValue(H, "Shared", " ").toLowerCase().startsWith("yes"), p;
  }
  function N(H, y) {
    const p = {}, h = H.uri.split("/");
    return p.id = y, p.name = H._name, p.model = h.length ? h[h.length - 1] : "", p.uri = H.uri, p.uuid = null, p.status = H.status, p.local = H.printserver === "local", p.default = H.default === "yes", p.shared = H.shared === "yes", p;
  }
  function J(H, y) {
    const p = {}, h = parseInt(e.getValue(H, "PrinterStatus", ":"), 10);
    return p.id = y, p.name = e.getValue(H, "name", ":"), p.model = e.getValue(H, "DriverName", ":"), p.uri = null, p.uuid = null, p.status = W[h] ? W[h] : null, p.local = e.getValue(H, "Local", ":").toUpperCase() === "TRUE", p.default = e.getValue(H, "Default", ":").toUpperCase() === "TRUE", p.shared = e.getValue(H, "Shared", ":").toUpperCase() === "TRUE", p;
  }
  function $(H) {
    return new Promise((y) => {
      process.nextTick(() => {
        let p = [];
        if (g || F || x || b) {
          let h = "cat /etc/cups/printers.conf 2>/dev/null";
          s(h, (E, u) => {
            if (!E) {
              const r = u.toString().split("<Printer "), Q = eA(r[0]);
              for (let d = 1; d < r.length; d++) {
                const c = IA(r[d].split(`
`));
                c.name && (c.engine = "CUPS", c.engineVersion = Q.cupsVersion, p.push(c));
              }
            }
            p.length === 0 && g ? (h = "export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL", s(h, (r, Q) => {
              const d = (`
` + Q.toString()).split(`
printer `);
              for (let c = 1; c < d.length; c++) {
                const n = z(d[c].split(`
`), c);
                p.push(n);
              }
            }), H && H(p), y(p)) : (H && H(p), y(p));
          });
        }
        o && s("system_profiler SPPrintersDataType -json", (E, u) => {
          if (!E)
            try {
              const r = JSON.parse(u.toString());
              if (r.SPPrintersDataType && r.SPPrintersDataType.length)
                for (let Q = 0; Q < r.SPPrintersDataType.length; Q++) {
                  const d = N(r.SPPrintersDataType[Q], Q);
                  p.push(d);
                }
            } catch {
              e.noop();
            }
          H && H(p), y(p);
        }), B && e.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then((h, E) => {
          if (!E) {
            const u = h.toString().split(/\n\s*\n/);
            for (let r = 0; r < u.length; r++) {
              const Q = J(u[r].split(`
`), r);
              (Q.name || Q.model) && p.push(Q);
            }
          }
          H && H(p), y(p);
        }), X && y(null);
      });
    });
  }
  return printer.printer = $, printer;
}
var usb = {}, hasRequiredUsb;
function requireUsb() {
  if (hasRequiredUsb) return usb;
  hasRequiredUsb = 1;
  const s = require$$1.exec, e = requireUtil();
  let A = process.platform;
  const g = A === "linux" || A === "android", o = A === "darwin", B = A === "win32", F = A === "freebsd", x = A === "openbsd", b = A === "netbsd", X = A === "sunos";
  function W(H, y) {
    let p = H;
    const h = (y + " " + H).toLowerCase();
    return h.indexOf("camera") >= 0 ? p = "Camera" : h.indexOf("hub") >= 0 ? p = "Hub" : h.indexOf("keybrd") >= 0 || h.indexOf("keyboard") >= 0 ? p = "Keyboard" : h.indexOf("mouse") >= 0 ? p = "Mouse" : h.indexOf("stora") >= 0 ? p = "Storage" : h.indexOf("microp") >= 0 ? p = "Microphone" : (h.indexOf("headset") >= 0 || h.indexOf("audio") >= 0) && (p = "Audio"), p;
  }
  function eA(H) {
    const y = {}, p = H.split(`
`);
    if (p && p.length && p[0].indexOf("Device") >= 0) {
      const m = p[0].split(" ");
      y.bus = parseInt(m[0], 10), m[2] ? y.deviceId = parseInt(m[2], 10) : y.deviceId = null;
    } else
      y.bus = null, y.deviceId = null;
    const h = e.getValue(p, "idVendor", " ", !0).trim();
    let E = h.split(" ");
    E.shift();
    const u = E.join(" "), r = e.getValue(p, "idProduct", " ", !0).trim();
    let Q = r.split(" ");
    Q.shift();
    const d = Q.join(" ");
    let n = e.getValue(p, "bInterfaceClass", " ", !0).trim().split(" ");
    n.shift();
    const L = n.join(" ");
    let K = e.getValue(p, "iManufacturer", " ", !0).trim().split(" ");
    K.shift();
    const gA = K.join(" ");
    let U = e.getValue(p, "iSerial", " ", !0).trim().split(" ");
    U.shift();
    const V = U.join(" ");
    return y.id = (h.startsWith("0x") ? h.split(" ")[0].substr(2, 10) : "") + ":" + (r.startsWith("0x") ? r.split(" ")[0].substr(2, 10) : ""), y.name = d, y.type = W(L, d), y.removable = null, y.vendor = u, y.manufacturer = gA, y.maxPower = e.getValue(p, "MaxPower", " ", !0), y.serialNumber = V, y;
  }
  function IA(H) {
    let y = "";
    return H.indexOf("camera") >= 0 ? y = "Camera" : H.indexOf("touch bar") >= 0 ? y = "Touch Bar" : H.indexOf("controller") >= 0 ? y = "Controller" : H.indexOf("headset") >= 0 ? y = "Audio" : H.indexOf("keyboard") >= 0 ? y = "Keyboard" : H.indexOf("trackpad") >= 0 ? y = "Trackpad" : H.indexOf("sensor") >= 0 ? y = "Sensor" : H.indexOf("bthusb") >= 0 || H.indexOf("bth") >= 0 || H.indexOf("rfcomm") >= 0 ? y = "Bluetooth" : H.indexOf("usbhub") >= 0 || H.indexOf(" hub") >= 0 ? y = "Hub" : H.indexOf("mouse") >= 0 ? y = "Mouse" : H.indexOf("microp") >= 0 ? y = "Microphone" : H.indexOf("removable") >= 0 && (y = "Storage"), y;
  }
  function z(H, y) {
    const p = {};
    p.id = y, H = H.replace(/ \|/g, ""), H = H.trim();
    let h = H.split(`
`);
    h.shift();
    try {
      for (let r = 0; r < h.length; r++) {
        h[r] = h[r].trim(), h[r] = h[r].replace(/=/g, ":"), h[r] !== "{" && h[r] !== "}" && h[r + 1] && h[r + 1].trim() !== "}" && (h[r] = h[r] + ","), h[r] = h[r].replace(":Yes,", ':"Yes",'), h[r] = h[r].replace(": Yes,", ': "Yes",'), h[r] = h[r].replace(": Yes", ': "Yes"'), h[r] = h[r].replace(":No,", ':"No",'), h[r] = h[r].replace(": No,", ': "No",'), h[r] = h[r].replace(": No", ': "No"'), h[r] = h[r].replace("((", "").replace("))", "");
        const Q = /<(\w+)>/.exec(h[r]);
        if (Q) {
          const d = Q[0];
          h[r] = h[r].replace(d, `"${d}"`);
        }
      }
      const E = JSON.parse(h.join(`
`)), u = (E["Built-In"] ? E["Built-In"].toLowerCase() !== "yes" : !0) && (E["non-removable"] ? E["non-removable"].toLowerCase() === "no" : !0);
      return p.bus = null, p.deviceId = null, p.id = E["USB Address"] || null, p.name = E.kUSBProductString || E["USB Product Name"] || null, p.type = IA((E.kUSBProductString || E["USB Product Name"] || "").toLowerCase() + (u ? " removable" : "")), p.removable = E["non-removable"] ? E["non-removable"].toLowerCase() || !1 : !0, p.vendor = E.kUSBVendorString || E["USB Vendor Name"] || null, p.manufacturer = E.kUSBVendorString || E["USB Vendor Name"] || null, p.maxPower = null, p.serialNumber = E.kUSBSerialNumberString || null, p.name ? p : null;
    } catch {
      return null;
    }
  }
  function N(H, y) {
    let p = "";
    return y.indexOf("storage") >= 0 || y.indexOf("speicher") >= 0 ? p = "Storage" : H.indexOf("usbhub") >= 0 ? p = "Hub" : H.indexOf("storage") >= 0 ? p = "Storage" : H.indexOf("usbcontroller") >= 0 ? p = "Controller" : H.indexOf("keyboard") >= 0 ? p = "Keyboard" : H.indexOf("pointing") >= 0 ? p = "Mouse" : H.indexOf("microp") >= 0 ? p = "Microphone" : H.indexOf("disk") >= 0 && (p = "Storage"), p;
  }
  function J(H, y) {
    const p = N(e.getValue(H, "CreationClassName", ":").toLowerCase(), e.getValue(H, "name", ":").toLowerCase());
    if (p) {
      const h = {};
      return h.bus = null, h.deviceId = e.getValue(H, "deviceid", ":"), h.id = y, h.name = e.getValue(H, "name", ":"), h.type = p, h.removable = null, h.vendor = null, h.manufacturer = e.getValue(H, "Manufacturer", ":"), h.maxPower = null, h.serialNumber = null, h;
    } else
      return null;
  }
  function $(H) {
    return new Promise((y) => {
      process.nextTick(() => {
        let p = [];
        g && s("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL", { maxBuffer: 1024 * 1024 * 128 }, function(E, u) {
          if (!E) {
            const r = (`

` + u.toString()).split(`

Bus `);
            for (let Q = 1; Q < r.length; Q++) {
              const d = eA(r[Q]);
              p.push(d);
            }
          }
          H && H(p), y(p);
        }), o && s("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l", { maxBuffer: 1024 * 1024 * 128 }, function(E, u) {
          if (!E) {
            const r = u.toString().split(" +-o ");
            for (let Q = 1; Q < r.length; Q++) {
              const d = z(r[Q]);
              d && p.push(d);
            }
            H && H(p), y(p);
          }
          H && H(p), y(p);
        }), B && e.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((h, E) => {
          if (!E) {
            const u = h.toString().split(/\n\s*\n/);
            for (let r = 0; r < u.length; r++) {
              const Q = J(u[r].split(`
`), r);
              Q && p.filter((d) => d.deviceId === Q.deviceId).length === 0 && p.push(Q);
            }
          }
          H && H(p), y(p);
        }), (X || F || x || b) && y(null);
      });
    });
  }
  return usb.usb = $, usb;
}
var audio = {}, hasRequiredAudio;
function requireAudio() {
  if (hasRequiredAudio) return audio;
  hasRequiredAudio = 1;
  const s = require$$1.exec, e = require$$1.execSync, A = requireUtil(), g = process.platform, o = g === "linux" || g === "android", B = g === "darwin", F = g === "win32", x = g === "freebsd", b = g === "openbsd", X = g === "netbsd", W = g === "sunos";
  function eA(p, h, E) {
    p = p.toLowerCase();
    let u = "";
    return p.indexOf("input") >= 0 && (u = "Microphone"), p.indexOf("display audio") >= 0 && (u = "Speaker"), p.indexOf("speak") >= 0 && (u = "Speaker"), p.indexOf("laut") >= 0 && (u = "Speaker"), p.indexOf("loud") >= 0 && (u = "Speaker"), p.indexOf("head") >= 0 && (u = "Headset"), p.indexOf("mic") >= 0 && (u = "Microphone"), p.indexOf("mikr") >= 0 && (u = "Microphone"), p.indexOf("phone") >= 0 && (u = "Phone"), p.indexOf("controll") >= 0 && (u = "Controller"), p.indexOf("line o") >= 0 && (u = "Line Out"), p.indexOf("digital o") >= 0 && (u = "Digital Out"), p.indexOf("smart sound technology") >= 0 && (u = "Digital Signal Processor"), p.indexOf("high definition audio") >= 0 && (u = "Sound Driver"), !u && E ? u = "Speaker" : !u && h && (u = "Microphone"), u;
  }
  function IA() {
    const p = "lspci -v 2>/dev/null", h = [];
    try {
      return e(p, A.execOptsLinux).toString().split(`

`).forEach((u) => {
        const r = u.split(`
`);
        if (r && r.length && r[0].toLowerCase().indexOf("audio") >= 0) {
          const Q = {};
          Q.slotId = r[0].split(" ")[0], Q.driver = A.getValue(r, "Kernel driver in use", ":", !0) || A.getValue(r, "Kernel modules", ":", !0), h.push(Q);
        }
      }), h;
    } catch {
      return h;
    }
  }
  function z(p) {
    let h = p;
    return p === 1 ? h = "other" : p === 2 ? h = "unknown" : p === 3 ? h = "enabled" : p === 4 ? h = "disabled" : p === 5 && (h = "not applicable"), h;
  }
  function N(p, h) {
    const E = {}, u = A.getValue(p, "Slot"), r = h.filter((Q) => Q.slotId === u);
    return E.id = u, E.name = A.getValue(p, "SDevice"), E.manufacturer = A.getValue(p, "SVendor"), E.revision = A.getValue(p, "Rev"), E.driver = r && r.length === 1 && r[0].driver ? r[0].driver : "", E.default = null, E.channel = "PCIe", E.type = eA(E.name, null, null), E.in = null, E.out = null, E.status = "online", E;
  }
  function J(p) {
    let h = "";
    return p.indexOf("builtin") >= 0 && (h = "Built-In"), p.indexOf("extern") >= 0 && (h = "Audio-Jack"), p.indexOf("hdmi") >= 0 && (h = "HDMI"), p.indexOf("displayport") >= 0 && (h = "Display-Port"), p.indexOf("usb") >= 0 && (h = "USB"), p.indexOf("pci") >= 0 && (h = "PCIe"), h;
  }
  function $(p, h) {
    const E = {}, u = ((p.coreaudio_device_transport || "") + " " + (p._name || "")).toLowerCase();
    return E.id = h, E.name = p._name, E.manufacturer = p.coreaudio_device_manufacturer, E.revision = null, E.driver = null, E.default = !!p.coreaudio_default_audio_input_device || !!p.coreaudio_default_audio_output_device, E.channel = J(u), E.type = eA(E.name, !!p.coreaudio_device_input, !!p.coreaudio_device_output), E.in = !!p.coreaudio_device_input, E.out = !!p.coreaudio_device_output, E.status = "online", E;
  }
  function H(p) {
    const h = {}, E = z(A.getValue(p, "StatusInfo", ":"));
    return h.id = A.getValue(p, "DeviceID", ":"), h.name = A.getValue(p, "name", ":"), h.manufacturer = A.getValue(p, "manufacturer", ":"), h.revision = null, h.driver = null, h.default = null, h.channel = null, h.type = eA(h.name, null, null), h.in = null, h.out = null, h.status = E, h;
  }
  function y(p) {
    return new Promise((h) => {
      process.nextTick(() => {
        const E = [];
        (o || x || b || X) && s("lspci -vmm 2>/dev/null", (r, Q) => {
          if (!r) {
            const d = IA();
            Q.toString().split(`

`).forEach((n) => {
              const L = n.split(`
`);
              if (A.getValue(L, "class", ":", !0).toLowerCase().indexOf("audio") >= 0) {
                const k = N(L, d);
                E.push(k);
              }
            });
          }
          p && p(E), h(E);
        }), B && s("system_profiler SPAudioDataType -json", (r, Q) => {
          if (!r)
            try {
              const d = JSON.parse(Q.toString());
              if (d.SPAudioDataType && d.SPAudioDataType.length && d.SPAudioDataType[0] && d.SPAudioDataType[0]._items && d.SPAudioDataType[0]._items.length)
                for (let c = 0; c < d.SPAudioDataType[0]._items.length; c++) {
                  const n = $(d.SPAudioDataType[0]._items[c], c);
                  E.push(n);
                }
            } catch {
              A.noop();
            }
          p && p(E), h(E);
        }), F && A.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then((u, r) => {
          r || u.toString().split(/\n\s*\n/).forEach((d) => {
            const c = d.split(`
`);
            A.getValue(c, "name", ":") && E.push(H(c));
          }), p && p(E), h(E);
        }), W && h(null);
      });
    });
  }
  return audio.audio = y, audio;
}
var bluetooth = {}, bluetoothVendors, hasRequiredBluetoothVendors;
function requireBluetoothVendors() {
  return hasRequiredBluetoothVendors || (hasRequiredBluetoothVendors = 1, bluetoothVendors = {
    0: "Ericsson Technology Licensing",
    1: "Nokia Mobile Phones",
    2: "Intel Corp.",
    3: "IBM Corp.",
    4: "Toshiba Corp.",
    5: "3Com",
    6: "Microsoft",
    7: "Lucent",
    8: "Motorola",
    9: "Infineon Technologies AG",
    10: "Cambridge Silicon Radio",
    11: "Silicon Wave",
    12: "Digianswer A/S",
    13: "Texas Instruments Inc.",
    14: "Ceva, Inc. (formerly Parthus Technologies, Inc.)",
    15: "Broadcom Corporation",
    16: "Mitel Semiconductor",
    17: "Widcomm, Inc",
    18: "Zeevo, Inc.",
    19: "Atmel Corporation",
    20: "Mitsubishi Electric Corporation",
    21: "RTX Telecom A/S",
    22: "KC Technology Inc.",
    23: "NewLogic",
    24: "Transilica, Inc.",
    25: "Rohde & Schwarz GmbH & Co. KG",
    26: "TTPCom Limited",
    27: "Signia Technologies, Inc.",
    28: "Conexant Systems Inc.",
    29: "Qualcomm",
    30: "Inventel",
    31: "AVM Berlin",
    32: "BandSpeed, Inc.",
    33: "Mansella Ltd",
    34: "NEC Corporation",
    35: "WavePlus Technology Co., Ltd.",
    36: "Alcatel",
    37: "NXP Semiconductors (formerly Philips Semiconductors)",
    38: "C Technologies",
    39: "Open Interface",
    40: "R F Micro Devices",
    41: "Hitachi Ltd",
    42: "Symbol Technologies, Inc.",
    43: "Tenovis",
    44: "Macronix International Co. Ltd.",
    45: "GCT Semiconductor",
    46: "Norwood Systems",
    47: "MewTel Technology Inc.",
    48: "ST Microelectronics",
    49: "Synopsis",
    50: "Red-M (Communications) Ltd",
    51: "Commil Ltd",
    52: "Computer Access Technology Corporation (CATC)",
    53: "Eclipse (HQ Espana) S.L.",
    54: "Renesas Electronics Corporation",
    55: "Mobilian Corporation",
    56: "Terax",
    57: "Integrated System Solution Corp.",
    58: "Matsushita Electric Industrial Co., Ltd.",
    59: "Gennum Corporation",
    60: "BlackBerry Limited (formerly Research In Motion)",
    61: "IPextreme, Inc.",
    62: "Systems and Chips, Inc.",
    63: "Bluetooth SIG, Inc.",
    64: "Seiko Epson Corporation",
    65: "Integrated Silicon Solution Taiwan, Inc.",
    66: "CONWISE Technology Corporation Ltd",
    67: "PARROT SA",
    68: "Socket Mobile",
    69: "Atheros Communications, Inc.",
    70: "MediaTek, Inc.",
    71: "Bluegiga",
    72: "Marvell Technology Group Ltd.",
    73: "3DSP Corporation",
    74: "Accel Semiconductor Ltd.",
    75: "Continental Automotive Systems",
    76: "Apple, Inc.",
    77: "Staccato Communications, Inc.",
    78: "Avago Technologies",
    79: "APT Licensing Ltd.",
    80: "SiRF Technology",
    81: "Tzero Technologies, Inc.",
    82: "J&M Corporation",
    83: "Free2move AB",
    84: "3DiJoy Corporation",
    85: "Plantronics, Inc.",
    86: "Sony Ericsson Mobile Communications",
    87: "Harman International Industries, Inc.",
    88: "Vizio, Inc.",
    89: "Nordic Semiconductor ASA",
    90: "EM Microelectronic-Marin SA",
    91: "Ralink Technology Corporation",
    92: "Belkin International, Inc.",
    93: "Realtek Semiconductor Corporation",
    94: "Stonestreet One, LLC",
    95: "Wicentric, Inc.",
    96: "RivieraWaves S.A.S",
    97: "RDA Microelectronics",
    98: "Gibson Guitars",
    99: "MiCommand Inc.",
    100: "Band XI International, LLC",
    101: "Hewlett-Packard Company",
    102: "9Solutions Oy",
    103: "GN Netcom A/S",
    104: "General Motors",
    105: "A&D Engineering, Inc.",
    106: "MindTree Ltd.",
    107: "Polar Electro OY",
    108: "Beautiful Enterprise Co., Ltd.",
    109: "BriarTek, Inc.",
    110: "Summit Data Communications, Inc.",
    111: "Sound ID",
    112: "Monster, LLC",
    113: "connectBlue AB",
    114: "ShangHai Super Smart Electronics Co. Ltd.",
    115: "Group Sense Ltd.",
    116: "Zomm, LLC",
    117: "Samsung Electronics Co. Ltd.",
    118: "Creative Technology Ltd.",
    119: "Laird Technologies",
    120: "Nike, Inc.",
    121: "lesswire AG",
    122: "MStar Semiconductor, Inc.",
    123: "Hanlynn Technologies",
    124: "A & R Cambridge",
    125: "Seers Technology Co. Ltd",
    126: "Sports Tracking Technologies Ltd.",
    127: "Autonet Mobile",
    128: "DeLorme Publishing Company, Inc.",
    129: "WuXi Vimicro",
    130: "Sennheiser Communications A/S",
    131: "TimeKeeping Systems, Inc.",
    132: "Ludus Helsinki Ltd.",
    133: "BlueRadios, Inc.",
    134: "equinox AG",
    135: "Garmin International, Inc.",
    136: "Ecotest",
    137: "GN ReSound A/S",
    138: "Jawbone",
    139: "Topcorn Positioning Systems, LLC",
    140: "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)",
    141: "Zscan Software",
    142: "Quintic Corp.",
    143: "Stollman E+V GmbH",
    144: "Funai Electric Co., Ltd.",
    145: "Advanced PANMOBIL Systems GmbH & Co. KG",
    146: "ThinkOptics, Inc.",
    147: "Universal Electronics, Inc.",
    148: "Airoha Technology Corp.",
    149: "NEC Lighting, Ltd.",
    150: "ODM Technology, Inc.",
    151: "ConnecteDevice Ltd.",
    152: "zer01.tv GmbH",
    153: "i.Tech Dynamic Global Distribution Ltd.",
    154: "Alpwise",
    155: "Jiangsu Toppower Automotive Electronics Co., Ltd.",
    156: "Colorfy, Inc.",
    157: "Geoforce Inc.",
    158: "Bose Corporation",
    159: "Suunto Oy",
    160: "Kensington Computer Products Group",
    161: "SR-Medizinelektronik",
    162: "Vertu Corporation Limited",
    163: "Meta Watch Ltd.",
    164: "LINAK A/S",
    165: "OTL Dynamics LLC",
    166: "Panda Ocean Inc.",
    167: "Visteon Corporation",
    168: "ARP Devices Limited",
    169: "Magneti Marelli S.p.A",
    170: "CAEN RFID srl",
    171: "Ingenieur-Systemgruppe Zahn GmbH",
    172: "Green Throttle Games",
    173: "Peter Systemtechnik GmbH",
    174: "Omegawave Oy",
    175: "Cinetix",
    176: "Passif Semiconductor Corp",
    177: "Saris Cycling Group, Inc",
    178: "Bekey A/S",
    179: "Clarinox Technologies Pty. Ltd.",
    180: "BDE Technology Co., Ltd.",
    181: "Swirl Networks",
    182: "Meso international",
    183: "TreLab Ltd",
    184: "Qualcomm Innovation Center, Inc. (QuIC)",
    185: "Johnson Controls, Inc.",
    186: "Starkey Laboratories Inc.",
    187: "S-Power Electronics Limited",
    188: "Ace Sensor Inc",
    189: "Aplix Corporation",
    190: "AAMP of America",
    191: "Stalmart Technology Limited",
    192: "AMICCOM Electronics Corporation",
    193: "Shenzhen Excelsecu Data Technology Co.,Ltd",
    194: "Geneq Inc.",
    195: "adidas AG",
    196: "LG Electronics",
    197: "Onset Computer Corporation",
    198: "Selfly BV",
    199: "Quuppa Oy.",
    200: "GeLo Inc",
    201: "Evluma",
    202: "MC10",
    203: "Binauric SE",
    204: "Beats Electronics",
    205: "Microchip Technology Inc.",
    206: "Elgato Systems GmbH",
    207: "ARCHOS SA",
    208: "Dexcom, Inc.",
    209: "Polar Electro Europe B.V.",
    210: "Dialog Semiconductor B.V.",
    211: "Taixingbang Technology (HK) Co,. LTD.",
    212: "Kawantech",
    213: "Austco Communication Systems",
    214: "Timex Group USA, Inc.",
    215: "Qualcomm Technologies, Inc.",
    216: "Qualcomm Connected Experiences, Inc.",
    217: "Voyetra Turtle Beach",
    218: "txtr GmbH",
    219: "Biosentronics",
    220: "Procter & Gamble",
    221: "Hosiden Corporation",
    222: "Muzik LLC",
    223: "Misfit Wearables Corp",
    224: "Google",
    225: "Danlers Ltd",
    226: "Semilink Inc",
    227: "inMusic Brands, Inc",
    228: "L.S. Research Inc.",
    229: "Eden Software Consultants Ltd.",
    230: "Freshtemp",
    231: "KS Technologies",
    232: "ACTS Technologies",
    233: "Vtrack Systems",
    234: "Nielsen-Kellerman Company",
    235: "Server Technology, Inc.",
    236: "BioResearch Associates",
    237: "Jolly Logic, LLC",
    238: "Above Average Outcomes, Inc.",
    239: "Bitsplitters GmbH",
    240: "PayPal, Inc.",
    241: "Witron Technology Limited",
    242: "Aether Things Inc. (formerly Morse Project Inc.)",
    243: "Kent Displays Inc.",
    244: "Nautilus Inc.",
    245: "Smartifier Oy",
    246: "Elcometer Limited",
    247: "VSN Technologies Inc.",
    248: "AceUni Corp., Ltd.",
    249: "StickNFind",
    250: "Crystal Code AB",
    251: "KOUKAAM a.s.",
    252: "Delphi Corporation",
    253: "ValenceTech Limited",
    254: "Reserved",
    255: "Typo Products, LLC",
    256: "TomTom International BV",
    257: "Fugoo, Inc",
    258: "Keiser Corporation",
    259: "Bang & Olufsen A/S",
    260: "PLUS Locations Systems Pty Ltd",
    261: "Ubiquitous Computing Technology Corporation",
    262: "Innovative Yachtter Solutions",
    263: "William Demant Holding A/S",
    264: "Chicony Electronics Co., Ltd.",
    265: "Atus BV",
    266: "Codegate Ltd.",
    267: "ERi, Inc.",
    268: "Transducers Direct, LLC",
    269: "Fujitsu Ten Limited",
    270: "Audi AG",
    271: "HiSilicon Technologies Co., Ltd.",
    272: "Nippon Seiki Co., Ltd.",
    273: "Steelseries ApS",
    274: "vyzybl Inc.",
    275: "Openbrain Technologies, Co., Ltd.",
    276: "Xensr",
    277: "e.solutions",
    278: "1OAK Technologies",
    279: "Wimoto Technologies Inc",
    280: "Radius Networks, Inc.",
    281: "Wize Technology Co., Ltd.",
    282: "Qualcomm Labs, Inc.",
    283: "Aruba Networks",
    284: "Baidu",
    285: "Arendi AG",
    286: "Skoda Auto a.s.",
    287: "Volkswagon AG",
    288: "Porsche AG",
    289: "Sino Wealth Electronic Ltd.",
    290: "AirTurn, Inc.",
    291: "Kinsa, Inc.",
    292: "HID Global",
    293: "SEAT es",
    294: "Promethean Ltd.",
    295: "Salutica Allied Solutions",
    296: "GPSI Group Pty Ltd",
    297: "Nimble Devices Oy",
    298: "Changzhou Yongse Infotech Co., Ltd",
    299: "SportIQ",
    300: "TEMEC Instruments B.V.",
    301: "Sony Corporation",
    302: "ASSA ABLOY",
    303: "Clarion Co., Ltd.",
    304: "Warehouse Innovations",
    305: "Cypress Semiconductor Corporation",
    306: "MADS Inc",
    307: "Blue Maestro Limited",
    308: "Resolution Products, Inc.",
    309: "Airewear LLC",
    310: "Seed Labs, Inc. (formerly ETC sp. z.o.o.)",
    311: "Prestigio Plaza Ltd.",
    312: "NTEO Inc.",
    313: "Focus Systems Corporation",
    314: "Tencent Holdings Limited",
    315: "Allegion",
    316: "Murata Manufacuring Co., Ltd.",
    318: "Nod, Inc.",
    319: "B&B Manufacturing Company",
    320: "Alpine Electronics (China) Co., Ltd",
    321: "FedEx Services",
    322: "Grape Systems Inc.",
    323: "Bkon Connect",
    324: "Lintech GmbH",
    325: "Novatel Wireless",
    326: "Ciright",
    327: "Mighty Cast, Inc.",
    328: "Ambimat Electronics",
    329: "Perytons Ltd.",
    330: "Tivoli Audio, LLC",
    331: "Master Lock",
    332: "Mesh-Net Ltd",
    333: "Huizhou Desay SV Automotive CO., LTD.",
    334: "Tangerine, Inc.",
    335: "B&W Group Ltd.",
    336: "Pioneer Corporation",
    337: "OnBeep",
    338: "Vernier Software & Technology",
    339: "ROL Ergo",
    340: "Pebble Technology",
    341: "NETATMO",
    342: "Accumulate AB",
    343: "Anhui Huami Information Technology Co., Ltd.",
    344: "Inmite s.r.o.",
    345: "ChefSteps, Inc.",
    346: "micas AG",
    347: "Biomedical Research Ltd.",
    348: "Pitius Tec S.L.",
    349: "Estimote, Inc.",
    350: "Unikey Technologies, Inc.",
    351: "Timer Cap Co.",
    352: "AwoX",
    353: "yikes",
    354: "MADSGlobal NZ Ltd.",
    355: "PCH International",
    356: "Qingdao Yeelink Information Technology Co., Ltd.",
    357: "Milwaukee Tool (formerly Milwaukee Electric Tools)",
    358: "MISHIK Pte Ltd",
    359: "Bayer HealthCare",
    360: "Spicebox LLC",
    361: "emberlight",
    362: "Cooper-Atkins Corporation",
    363: "Qblinks",
    364: "MYSPHERA",
    365: "LifeScan Inc",
    366: "Volantic AB",
    367: "Podo Labs, Inc",
    368: "Roche Diabetes Care AG",
    369: "Amazon Fulfillment Service",
    370: "Connovate Technology Private Limited",
    371: "Kocomojo, LLC",
    372: "Everykey LLC",
    373: "Dynamic Controls",
    374: "SentriLock",
    375: "I-SYST inc.",
    376: "CASIO COMPUTER CO., LTD.",
    377: "LAPIS Semiconductor Co., Ltd.",
    378: "Telemonitor, Inc.",
    379: "taskit GmbH",
    380: "Daimler AG",
    381: "BatAndCat",
    382: "BluDotz Ltd",
    383: "XTel ApS",
    384: "Gigaset Communications GmbH",
    385: "Gecko Health Innovations, Inc.",
    386: "HOP Ubiquitous",
    387: "To Be Assigned",
    388: "Nectar",
    389: "bel’apps LLC",
    390: "CORE Lighting Ltd",
    391: "Seraphim Sense Ltd",
    392: "Unico RBC",
    393: "Physical Enterprises Inc.",
    394: "Able Trend Technology Limited",
    395: "Konica Minolta, Inc.",
    396: "Wilo SE",
    397: "Extron Design Services",
    398: "Fitbit, Inc.",
    399: "Fireflies Systems",
    400: "Intelletto Technologies Inc.",
    401: "FDK CORPORATION",
    402: "Cloudleaf, Inc",
    403: "Maveric Automation LLC",
    404: "Acoustic Stream Corporation",
    405: "Zuli",
    406: "Paxton Access Ltd",
    407: "WiSilica Inc",
    408: "Vengit Limited",
    409: "SALTO SYSTEMS S.L.",
    410: "TRON Forum (formerly T-Engine Forum)",
    411: "CUBETECH s.r.o.",
    412: "Cokiya Incorporated",
    413: "CVS Health",
    414: "Ceruus",
    415: "Strainstall Ltd",
    416: "Channel Enterprises (HK) Ltd.",
    417: "FIAMM",
    418: "GIGALANE.CO.,LTD",
    419: "EROAD",
    420: "Mine Safety Appliances",
    421: "Icon Health and Fitness",
    422: "Asandoo GmbH",
    423: "ENERGOUS CORPORATION",
    424: "Taobao",
    425: "Canon Inc.",
    426: "Geophysical Technology Inc.",
    427: "Facebook, Inc.",
    428: "Nipro Diagnostics, Inc.",
    429: "FlightSafety International",
    430: "Earlens Corporation",
    431: "Sunrise Micro Devices, Inc.",
    432: "Star Micronics Co., Ltd.",
    433: "Netizens Sp. z o.o.",
    434: "Nymi Inc.",
    435: "Nytec, Inc.",
    436: "Trineo Sp. z o.o.",
    437: "Nest Labs Inc.",
    438: "LM Technologies Ltd",
    439: "General Electric Company",
    440: "i+D3 S.L.",
    441: "HANA Micron",
    442: "Stages Cycling LLC",
    443: "Cochlear Bone Anchored Solutions AB",
    444: "SenionLab AB",
    445: "Syszone Co., Ltd",
    446: "Pulsate Mobile Ltd.",
    447: "Hong Kong HunterSun Electronic Limited",
    448: "pironex GmbH",
    449: "BRADATECH Corp.",
    450: "Transenergooil AG",
    451: "Bunch",
    452: "DME Microelectronics",
    453: "Bitcraze AB",
    454: "HASWARE Inc.",
    455: "Abiogenix Inc.",
    456: "Poly-Control ApS",
    457: "Avi-on",
    458: "Laerdal Medical AS",
    459: "Fetch My Pet",
    460: "Sam Labs Ltd.",
    461: "Chengdu Synwing Technology Ltd",
    462: "HOUWA SYSTEM DESIGN, k.k.",
    463: "BSH",
    464: "Primus Inter Pares Ltd",
    465: "August",
    466: "Gill Electronics",
    467: "Sky Wave Design",
    468: "Newlab S.r.l.",
    469: "ELAD srl",
    470: "G-wearables inc.",
    471: "Squadrone Systems Inc.",
    472: "Code Corporation",
    473: "Savant Systems LLC",
    474: "Logitech International SA",
    475: "Innblue Consulting",
    476: "iParking Ltd.",
    477: "Koninklijke Philips Electronics N.V.",
    478: "Minelab Electronics Pty Limited",
    479: "Bison Group Ltd.",
    480: "Widex A/S",
    481: "Jolla Ltd",
    482: "Lectronix, Inc.",
    483: "Caterpillar Inc",
    484: "Freedom Innovations",
    485: "Dynamic Devices Ltd",
    486: "Technology Solutions (UK) Ltd",
    487: "IPS Group Inc.",
    488: "STIR",
    489: "Sano, Inc",
    490: "Advanced Application Design, Inc.",
    491: "AutoMap LLC",
    492: "Spreadtrum Communications Shanghai Ltd",
    493: "CuteCircuit LTD",
    494: "Valeo Service",
    495: "Fullpower Technologies, Inc.",
    496: "KloudNation",
    497: "Zebra Technologies Corporation",
    498: "Itron, Inc.",
    499: "The University of Tokyo",
    500: "UTC Fire and Security",
    501: "Cool Webthings Limited",
    502: "DJO Global",
    503: "Gelliner Limited",
    504: "Anyka (Guangzhou) Microelectronics Technology Co, LTD",
    505: "Medtronic, Inc.",
    506: "Gozio, Inc.",
    507: "Form Lifting, LLC",
    508: "Wahoo Fitness, LLC",
    509: "Kontakt Micro-Location Sp. z o.o.",
    510: "Radio System Corporation",
    511: "Freescale Semiconductor, Inc.",
    512: "Verifone Systems PTe Ltd. Taiwan Branch",
    513: "AR Timing",
    514: "Rigado LLC",
    515: "Kemppi Oy",
    516: "Tapcentive Inc.",
    517: "Smartbotics Inc.",
    518: "Otter Products, LLC",
    519: "STEMP Inc.",
    520: "LumiGeek LLC",
    521: "InvisionHeart Inc.",
    522: "Macnica Inc. ",
    523: "Jaguar Land Rover Limited",
    524: "CoroWare Technologies, Inc",
    525: "Simplo Technology Co., LTD",
    526: "Omron Healthcare Co., LTD",
    527: "Comodule GMBH",
    528: "ikeGPS",
    529: "Telink Semiconductor Co. Ltd",
    530: "Interplan Co., Ltd",
    531: "Wyler AG",
    532: "IK Multimedia Production srl",
    533: "Lukoton Experience Oy",
    534: "MTI Ltd",
    535: "Tech4home, Lda",
    536: "Hiotech AB",
    537: "DOTT Limited",
    538: "Blue Speck Labs, LLC",
    539: "Cisco Systems, Inc",
    540: "Mobicomm Inc",
    541: "Edamic",
    542: "Goodnet, Ltd",
    543: "Luster Leaf Products Inc",
    544: "Manus Machina BV",
    545: "Mobiquity Networks Inc",
    546: "Praxis Dynamics",
    547: "Philip Morris Products S.A.",
    548: "Comarch SA",
    549: "Nestl Nespresso S.A.",
    550: "Merlinia A/S",
    551: "LifeBEAM Technologies",
    552: "Twocanoes Labs, LLC",
    553: "Muoverti Limited",
    554: "Stamer Musikanlagen GMBH",
    555: "Tesla Motors",
    556: "Pharynks Corporation",
    557: "Lupine",
    558: "Siemens AG",
    559: "Huami (Shanghai) Culture Communication CO., LTD",
    560: "Foster Electric Company, Ltd",
    561: "ETA SA",
    562: "x-Senso Solutions Kft",
    563: "Shenzhen SuLong Communication Ltd",
    564: "FengFan (BeiJing) Technology Co, Ltd",
    565: "Qrio Inc",
    566: "Pitpatpet Ltd",
    567: "MSHeli s.r.l.",
    568: "Trakm8 Ltd",
    569: "JIN CO, Ltd",
    570: "Alatech Tehnology",
    571: "Beijing CarePulse Electronic Technology Co, Ltd",
    572: "Awarepoint",
    573: "ViCentra B.V.",
    574: "Raven Industries",
    575: "WaveWare Technologies Inc.",
    576: "Argenox Technologies",
    577: "Bragi GmbH",
    578: "16Lab Inc",
    579: "Masimo Corp",
    580: "Iotera Inc",
    581: "Endress+Hauser",
    582: "ACKme Networks, Inc.",
    583: "FiftyThree Inc.",
    584: "Parker Hannifin Corp",
    585: "Transcranial Ltd",
    586: "Uwatec AG",
    587: "Orlan LLC",
    588: "Blue Clover Devices",
    589: "M-Way Solutions GmbH",
    590: "Microtronics Engineering GmbH",
    591: "Schneider Schreibgerte GmbH",
    592: "Sapphire Circuits LLC",
    593: "Lumo Bodytech Inc.",
    594: "UKC Technosolution",
    595: "Xicato Inc.",
    596: "Playbrush",
    597: "Dai Nippon Printing Co., Ltd.",
    598: "G24 Power Limited",
    599: "AdBabble Local Commerce Inc.",
    600: "Devialet SA",
    601: "ALTYOR",
    602: "University of Applied Sciences Valais/Haute Ecole Valaisanne",
    603: "Five Interactive, LLC dba Zendo",
    604: "NetEaseHangzhouNetwork co.Ltd.",
    605: "Lexmark International Inc.",
    606: "Fluke Corporation",
    607: "Yardarm Technologies",
    608: "SensaRx",
    609: "SECVRE GmbH",
    610: "Glacial Ridge Technologies",
    611: "Identiv, Inc.",
    612: "DDS, Inc.",
    613: "SMK Corporation",
    614: "Schawbel Technologies LLC",
    615: "XMI Systems SA",
    616: "Cerevo",
    617: "Torrox GmbH & Co KG",
    618: "Gemalto",
    619: "DEKA Research & Development Corp.",
    620: "Domster Tadeusz Szydlowski",
    621: "Technogym SPA",
    622: "FLEURBAEY BVBA",
    623: "Aptcode Solutions",
    624: "LSI ADL Technology",
    625: "Animas Corp",
    626: "Alps Electric Co., Ltd.",
    627: "OCEASOFT",
    628: "Motsai Research",
    629: "Geotab",
    630: "E.G.O. Elektro-Gertebau GmbH",
    631: "bewhere inc",
    632: "Johnson Outdoors Inc",
    633: "steute Schaltgerate GmbH & Co. KG",
    634: "Ekomini inc.",
    635: "DEFA AS",
    636: "Aseptika Ltd",
    637: "HUAWEI Technologies Co., Ltd. ( )",
    638: "HabitAware, LLC",
    639: "ruwido austria gmbh",
    640: "ITEC corporation",
    641: "StoneL",
    642: "Sonova AG",
    643: "Maven Machines, Inc.",
    644: "Synapse Electronics",
    645: "Standard Innovation Inc.",
    646: "RF Code, Inc.",
    647: "Wally Ventures S.L.",
    648: "Willowbank Electronics Ltd",
    649: "SK Telecom",
    650: "Jetro AS",
    651: "Code Gears LTD",
    652: "NANOLINK APS",
    653: "IF, LLC",
    654: "RF Digital Corp",
    655: "Church & Dwight Co., Inc",
    656: "Multibit Oy",
    657: "CliniCloud Inc",
    658: "SwiftSensors",
    659: "Blue Bite",
    660: "ELIAS GmbH",
    661: "Sivantos GmbH",
    662: "Petzl",
    663: "storm power ltd",
    664: "EISST Ltd",
    665: "Inexess Technology Simma KG",
    666: "Currant, Inc.",
    667: "C2 Development, Inc.",
    668: "Blue Sky Scientific, LLC",
    669: "ALOTTAZS LABS, LLC",
    670: "Kupson spol. s r.o.",
    671: "Areus Engineering GmbH",
    672: "Impossible Camera GmbH",
    673: "InventureTrack Systems",
    674: "LockedUp",
    675: "Itude",
    676: "Pacific Lock Company",
    677: "Tendyron Corporation ( )",
    678: "Robert Bosch GmbH",
    679: "Illuxtron international B.V.",
    680: "miSport Ltd.",
    681: "Chargelib",
    682: "Doppler Lab",
    683: "BBPOS Limited",
    684: "RTB Elektronik GmbH & Co. KG",
    685: "Rx Networks, Inc.",
    686: "WeatherFlow, Inc.",
    687: "Technicolor USA Inc.",
    688: "Bestechnic(Shanghai),Ltd",
    689: "Raden Inc",
    690: "JouZen Oy",
    691: "CLABER S.P.A.",
    692: "Hyginex, Inc.",
    693: "HANSHIN ELECTRIC RAILWAY CO.,LTD.",
    694: "Schneider Electric",
    695: "Oort Technologies LLC",
    696: "Chrono Therapeutics",
    697: "Rinnai Corporation",
    698: "Swissprime Technologies AG",
    699: "Koha.,Co.Ltd",
    700: "Genevac Ltd",
    701: "Chemtronics",
    702: "Seguro Technology Sp. z o.o.",
    703: "Redbird Flight Simulations",
    704: "Dash Robotics",
    705: "LINE Corporation",
    706: "Guillemot Corporation",
    707: "Techtronic Power Tools Technology Limited",
    708: "Wilson Sporting Goods",
    709: "Lenovo (Singapore) Pte Ltd. ( )",
    710: "Ayatan Sensors",
    711: "Electronics Tomorrow Limited",
    712: "VASCO Data Security International, Inc.",
    713: "PayRange Inc.",
    714: "ABOV Semiconductor",
    715: "AINA-Wireless Inc.",
    716: "Eijkelkamp Soil & Water",
    717: "BMA ergonomics b.v.",
    718: "Teva Branded Pharmaceutical Products R&D, Inc.",
    719: "Anima",
    720: "3M",
    721: "Empatica Srl",
    722: "Afero, Inc.",
    723: "Powercast Corporation",
    724: "Secuyou ApS",
    725: "OMRON Corporation",
    726: "Send Solutions",
    727: "NIPPON SYSTEMWARE CO.,LTD.",
    728: "Neosfar",
    729: "Fliegl Agrartechnik GmbH",
    730: "Gilvader",
    731: "Digi International Inc (R)",
    732: "DeWalch Technologies, Inc.",
    733: "Flint Rehabilitation Devices, LLC",
    734: "Samsung SDS Co., Ltd.",
    735: "Blur Product Development",
    736: "University of Michigan",
    737: "Victron Energy BV",
    738: "NTT docomo",
    739: "Carmanah Technologies Corp.",
    740: "Bytestorm Ltd.",
    741: "Espressif Incorporated ( () )",
    742: "Unwire",
    743: "Connected Yard, Inc.",
    744: "American Music Environments",
    745: "Sensogram Technologies, Inc.",
    746: "Fujitsu Limited",
    747: "Ardic Technology",
    748: "Delta Systems, Inc",
    749: "HTC Corporation",
    750: "Citizen Holdings Co., Ltd.",
    751: "SMART-INNOVATION.inc",
    752: "Blackrat Software",
    753: "The Idea Cave, LLC",
    754: "GoPro, Inc.",
    755: "AuthAir, Inc",
    756: "Vensi, Inc.",
    757: "Indagem Tech LLC",
    758: "Intemo Technologies",
    759: "DreamVisions co., Ltd.",
    760: "Runteq Oy Ltd",
    761: "IMAGINATION TECHNOLOGIES LTD",
    762: "CoSTAR TEchnologies",
    763: "Clarius Mobile Health Corp.",
    764: "Shanghai Frequen Microelectronics Co., Ltd.",
    765: "Uwanna, Inc.",
    766: "Lierda Science & Technology Group Co., Ltd.",
    767: "Silicon Laboratories",
    768: "World Moto Inc.",
    769: "Giatec Scientific Inc.",
    770: "Loop Devices, Inc",
    771: "IACA electronique",
    772: "Martians Inc",
    773: "Swipp ApS",
    774: "Life Laboratory Inc.",
    775: "FUJI INDUSTRIAL CO.,LTD.",
    776: "Surefire, LLC",
    777: "Dolby Labs",
    778: "Ellisys",
    779: "Magnitude Lighting Converters",
    780: "Hilti AG",
    781: "Devdata S.r.l.",
    782: "Deviceworx",
    783: "Shortcut Labs",
    784: "SGL Italia S.r.l.",
    785: "PEEQ DATA",
    786: "Ducere Technologies Pvt Ltd",
    787: "DiveNav, Inc.",
    788: "RIIG AI Sp. z o.o.",
    789: "Thermo Fisher Scientific",
    790: "AG Measurematics Pvt. Ltd.",
    791: "CHUO Electronics CO., LTD.",
    792: "Aspenta International",
    793: "Eugster Frismag AG",
    794: "Amber wireless GmbH",
    795: "HQ Inc",
    796: "Lab Sensor Solutions",
    797: "Enterlab ApS",
    798: "Eyefi, Inc.",
    799: "MetaSystem S.p.A.",
    800: "SONO ELECTRONICS. CO., LTD",
    801: "Jewelbots",
    802: "Compumedics Limited",
    803: "Rotor Bike Components",
    804: "Astro, Inc.",
    805: "Amotus Solutions",
    806: "Healthwear Technologies (Changzhou)Ltd",
    807: "Essex Electronics",
    808: "Grundfos A/S",
    809: "Eargo, Inc.",
    810: "Electronic Design Lab",
    811: "ESYLUX",
    812: "NIPPON SMT.CO.,Ltd",
    813: "BM innovations GmbH",
    814: "indoormap",
    815: "OttoQ Inc",
    816: "North Pole Engineering",
    817: "3flares Technologies Inc.",
    818: "Electrocompaniet A.S.",
    819: "Mul-T-Lock",
    820: "Corentium AS",
    821: "Enlighted Inc",
    822: "GISTIC",
    823: "AJP2 Holdings, LLC",
    824: "COBI GmbH",
    825: "Blue Sky Scientific, LLC",
    826: "Appception, Inc.",
    827: "Courtney Thorne Limited",
    828: "Virtuosys",
    829: "TPV Technology Limited",
    830: "Monitra SA",
    831: "Automation Components, Inc.",
    832: "Letsense s.r.l.",
    833: "Etesian Technologies LLC",
    834: "GERTEC BRASIL LTDA.",
    835: "Drekker Development Pty. Ltd.",
    836: "Whirl Inc",
    837: "Locus Positioning",
    838: "Acuity Brands Lighting, Inc",
    839: "Prevent Biometrics",
    840: "Arioneo",
    841: "VersaMe",
    842: "Vaddio",
    843: "Libratone A/S",
    844: "HM Electronics, Inc.",
    845: "TASER International, Inc.",
    846: "SafeTrust Inc.",
    847: "Heartland Payment Systems",
    848: "Bitstrata Systems Inc.",
    849: "Pieps GmbH",
    850: "iRiding(Xiamen)Technology Co.,Ltd.",
    851: "Alpha Audiotronics, Inc.",
    852: "TOPPAN FORMS CO.,LTD.",
    853: "Sigma Designs, Inc.",
    854: "Spectrum Brands, Inc.",
    855: "Polymap Wireless",
    856: "MagniWare Ltd.",
    857: "Novotec Medical GmbH",
    858: "Medicom Innovation Partner a/s",
    859: "Matrix Inc.",
    860: "Eaton Corporation",
    861: "KYS",
    862: "Naya Health, Inc.",
    863: "Acromag",
    864: "Insulet Corporation",
    865: "Wellinks Inc.",
    866: "ON Semiconductor",
    867: "FREELAP SA",
    868: "Favero Electronics Srl",
    869: "BioMech Sensor LLC",
    870: "BOLTT Sports technologies Private limited",
    871: "Saphe International",
    872: "Metormote AB",
    873: "littleBits",
    874: "SetPoint Medical",
    875: "BRControls Products BV",
    876: "Zipcar",
    877: "AirBolt Pty Ltd",
    878: "KeepTruckin Inc",
    879: "Motiv, Inc.",
    880: "Wazombi Labs O",
    881: "ORBCOMM",
    882: "Nixie Labs, Inc.",
    883: "AppNearMe Ltd",
    884: "Holman Industries",
    885: "Expain AS",
    886: "Electronic Temperature Instruments Ltd",
    887: "Plejd AB",
    888: "Propeller Health",
    889: "Shenzhen iMCO Electronic Technology Co.,Ltd",
    890: "Algoria",
    891: "Apption Labs Inc.",
    892: "Cronologics Corporation",
    893: "MICRODIA Ltd.",
    894: "lulabytes S.L.",
    895: "Nestec S.A.",
    896: "LLC MEGA - F service",
    897: "Sharp Corporation",
    898: "Precision Outcomes Ltd",
    899: "Kronos Incorporated",
    900: "OCOSMOS Co., Ltd.",
    901: "Embedded Electronic Solutions Ltd. dba e2Solutions",
    902: "Aterica Inc.",
    903: "BluStor PMC, Inc.",
    904: "Kapsch TrafficCom AB",
    905: "ActiveBlu Corporation",
    906: "Kohler Mira Limited",
    907: "Noke",
    908: "Appion Inc.",
    909: "Resmed Ltd",
    910: "Crownstone B.V.",
    911: "Xiaomi Inc.",
    912: "INFOTECH s.r.o.",
    913: "Thingsquare AB",
    914: "T&D",
    915: "LAVAZZA S.p.A.",
    916: "Netclearance Systems, Inc.",
    917: "SDATAWAY",
    918: "BLOKS GmbH",
    919: "LEGO System A/S",
    920: "Thetatronics Ltd",
    921: "Nikon Corporation",
    922: "NeST",
    923: "South Silicon Valley Microelectronics",
    924: "ALE International",
    925: "CareView Communications, Inc.",
    926: "SchoolBoard Limited",
    927: "Molex Corporation",
    928: "IVT Wireless Limited",
    929: "Alpine Labs LLC",
    930: "Candura Instruments",
    931: "SmartMovt Technology Co., Ltd",
    932: "Token Zero Ltd",
    933: "ACE CAD Enterprise Co., Ltd. (ACECAD)",
    934: "Medela, Inc",
    935: "AeroScout",
    936: "Esrille Inc.",
    937: "THINKERLY SRL",
    938: "Exon Sp. z o.o.",
    939: "Meizu Technology Co., Ltd.",
    940: "Smablo LTD",
    941: "XiQ",
    942: "Allswell Inc.",
    943: "Comm-N-Sense Corp DBA Verigo",
    944: "VIBRADORM GmbH",
    945: "Otodata Wireless Network Inc.",
    946: "Propagation Systems Limited",
    947: "Midwest Instruments & Controls",
    948: "Alpha Nodus, inc.",
    949: "petPOMM, Inc",
    950: "Mattel",
    951: "Airbly Inc.",
    952: "A-Safe Limited",
    953: "FREDERIQUE CONSTANT SA",
    954: "Maxscend Microelectronics Company Limited",
    955: "Abbott Diabetes Care",
    956: "ASB Bank Ltd",
    957: "amadas",
    958: "Applied Science, Inc.",
    959: "iLumi Solutions Inc.",
    960: "Arch Systems Inc.",
    961: "Ember Technologies, Inc.",
    962: "Snapchat Inc",
    963: "Casambi Technologies Oy",
    964: "Pico Technology Inc.",
    965: "St. Jude Medical, Inc.",
    966: "Intricon",
    967: "Structural Health Systems, Inc.",
    968: "Avvel International",
    969: "Gallagher Group",
    970: "In2things Automation Pvt. Ltd.",
    971: "SYSDEV Srl",
    972: "Vonkil Technologies Ltd",
    973: "Wynd Technologies, Inc.",
    974: "CONTRINEX S.A.",
    975: "MIRA, Inc.",
    976: "Watteam Ltd",
    977: "Density Inc.",
    978: "IOT Pot India Private Limited",
    979: "Sigma Connectivity AB",
    980: "PEG PEREGO SPA",
    981: "Wyzelink Systems Inc.",
    982: "Yota Devices LTD",
    983: "FINSECUR",
    984: "Zen-Me Labs Ltd",
    985: "3IWare Co., Ltd.",
    986: "EnOcean GmbH",
    987: "Instabeat, Inc",
    988: "Nima Labs",
    989: "Andreas Stihl AG & Co. KG",
    990: "Nathan Rhoades LLC",
    991: "Grob Technologies, LLC",
    992: "Actions (Zhuhai) Technology Co., Limited",
    993: "SPD Development Company Ltd",
    994: "Sensoan Oy",
    995: "Qualcomm Life Inc",
    996: "Chip-ing AG",
    997: "ffly4u",
    998: "IoT Instruments Oy",
    999: "TRUE Fitness Technology",
    1e3: "Reiner Kartengeraete GmbH & Co. KG.",
    1001: "SHENZHEN LEMONJOY TECHNOLOGY CO., LTD.",
    1002: "Hello Inc.",
    1003: "Evollve Inc.",
    1004: "Jigowatts Inc.",
    1005: "BASIC MICRO.COM,INC.",
    1006: "CUBE TECHNOLOGIES",
    1007: "foolography GmbH",
    1008: "CLINK",
    1009: "Hestan Smart Cooking Inc.",
    1010: "WindowMaster A/S",
    1011: "Flowscape AB",
    1012: "PAL Technologies Ltd",
    1013: "WHERE, Inc.",
    1014: "Iton Technology Corp.",
    1015: "Owl Labs Inc.",
    1016: "Rockford Corp.",
    1017: "Becon Technologies Co.,Ltd.",
    1018: "Vyassoft Technologies Inc",
    1019: "Nox Medical",
    1020: "Kimberly-Clark",
    1021: "Trimble Navigation Ltd.",
    1022: "Littelfuse",
    1023: "Withings",
    1024: "i-developer IT Beratung UG",
    1026: "Sears Holdings Corporation",
    1027: "Gantner Electronic GmbH",
    1028: "Authomate Inc",
    1029: "Vertex International, Inc.",
    1030: "Airtago",
    1031: "Swiss Audio SA",
    1032: "ToGetHome Inc.",
    1033: "AXIS",
    1034: "Openmatics",
    1035: "Jana Care Inc.",
    1036: "Senix Corporation",
    1037: "NorthStar Battery Company, LLC",
    1038: "SKF (U.K.) Limited",
    1039: "CO-AX Technology, Inc.",
    1040: "Fender Musical Instruments",
    1041: "Luidia Inc",
    1042: "SEFAM",
    1043: "Wireless Cables Inc",
    1044: "Lightning Protection International Pty Ltd",
    1045: "Uber Technologies Inc",
    1046: "SODA GmbH",
    1047: "Fatigue Science",
    1048: "Alpine Electronics Inc.",
    1049: "Novalogy LTD",
    1050: "Friday Labs Limited",
    1051: "OrthoAccel Technologies",
    1052: "WaterGuru, Inc.",
    1053: "Benning Elektrotechnik und Elektronik GmbH & Co. KG",
    1054: "Dell Computer Corporation",
    1055: "Kopin Corporation",
    1056: "TecBakery GmbH",
    1057: "Backbone Labs, Inc.",
    1058: "DELSEY SA",
    1059: "Chargifi Limited",
    1060: "Trainesense Ltd.",
    1061: "Unify Software and Solutions GmbH & Co. KG",
    1062: "Husqvarna AB",
    1063: "Focus fleet and fuel management inc",
    1064: "SmallLoop, LLC",
    1065: "Prolon Inc.",
    1066: "BD Medical",
    1067: "iMicroMed Incorporated",
    1068: "Ticto N.V.",
    1069: "Meshtech AS",
    1070: "MemCachier Inc.",
    1071: "Danfoss A/S",
    1072: "SnapStyk Inc.",
    1073: "Amyway Corporation",
    1074: "Silk Labs, Inc.",
    1075: "Pillsy Inc.",
    1076: "Hatch Baby, Inc.",
    1077: "Blocks Wearables Ltd.",
    1078: "Drayson Technologies (Europe) Limited",
    1079: "eBest IOT Inc.",
    1080: "Helvar Ltd",
    1081: "Radiance Technologies",
    1082: "Nuheara Limited",
    1083: "Appside co., ltd.",
    1084: "DeLaval",
    1085: "Coiler Corporation",
    1086: "Thermomedics, Inc.",
    1087: "Tentacle Sync GmbH",
    1088: "Valencell, Inc.",
    1089: "iProtoXi Oy",
    1090: "SECOM CO., LTD.",
    1091: "Tucker International LLC",
    1092: "Metanate Limited",
    1093: "Kobian Canada Inc.",
    1094: "NETGEAR, Inc.",
    1095: "Fabtronics Australia Pty Ltd",
    1096: "Grand Centrix GmbH",
    1097: "1UP USA.com llc",
    1098: "SHIMANO INC.",
    1099: "Nain Inc.",
    1100: "LifeStyle Lock, LLC",
    1101: "VEGA Grieshaber KG",
    1102: "Xtrava Inc.",
    1103: "TTS Tooltechnic Systems AG & Co. KG",
    1104: "Teenage Engineering AB",
    1105: "Tunstall Nordic AB",
    1106: "Svep Design Center AB",
    1107: "GreenPeak Technologies BV",
    1108: "Sphinx Electronics GmbH & Co KG",
    1109: "Atomation",
    1110: "Nemik Consulting Inc",
    1111: "RF INNOVATION",
    1112: "Mini Solution Co., Ltd.",
    1113: "Lumenetix, Inc",
    1114: "2048450 Ontario Inc",
    1115: "SPACEEK LTD",
    1116: "Delta T Corporation",
    1117: "Boston Scientific Corporation",
    1118: "Nuviz, Inc.",
    1119: "Real Time Automation, Inc.",
    1120: "Kolibree",
    1121: "vhf elektronik GmbH",
    1122: "Bonsai Systems GmbH",
    1123: "Fathom Systems Inc.",
    1124: "Bellman & Symfon",
    1125: "International Forte Group LLC",
    1126: "CycleLabs Solutions inc.",
    1127: "Codenex Oy",
    1128: "Kynesim Ltd",
    1129: "Palago AB",
    1130: "INSIGMA INC.",
    1131: "PMD Solutions",
    1132: "Qingdao Realtime Technology Co., Ltd.",
    1133: "BEGA Gantenbrink-Leuchten KG",
    1134: "Pambor Ltd.",
    65535: "SPECIAL USE/DEFAULT"
  }), bluetoothVendors;
}
var hasRequiredBluetooth;
function requireBluetooth() {
  if (hasRequiredBluetooth) return bluetooth;
  hasRequiredBluetooth = 1;
  const s = require$$1.exec, e = require$$1.execSync, A = require$$2, g = requireUtil(), o = requireBluetoothVendors(), B = require$$1$1, F = process.platform, x = F === "linux" || F === "android", b = F === "darwin", X = F === "win32", W = F === "freebsd", eA = F === "openbsd", IA = F === "netbsd", z = F === "sunos";
  function N(E) {
    let u = "";
    return E.indexOf("keyboard") >= 0 && (u = "Keyboard"), E.indexOf("mouse") >= 0 && (u = "Mouse"), E.indexOf("trackpad") >= 0 && (u = "Trackpad"), E.indexOf("audio") >= 0 && (u = "Audio"), E.indexOf("sound") >= 0 && (u = "Audio"), E.indexOf("microph") >= 0 && (u = "Microphone"), E.indexOf("speaker") >= 0 && (u = "Speaker"), E.indexOf("headset") >= 0 && (u = "Headset"), E.indexOf("phone") >= 0 && (u = "Phone"), E.indexOf("macbook") >= 0 && (u = "Computer"), E.indexOf("imac") >= 0 && (u = "Computer"), E.indexOf("ipad") >= 0 && (u = "Tablet"), E.indexOf("watch") >= 0 && (u = "Watch"), E.indexOf("headphone") >= 0 && (u = "Headset"), u;
  }
  function J(E) {
    let u = E.split(" ")[0];
    return E = E.toLowerCase(), E.indexOf("apple") >= 0 && (u = "Apple"), E.indexOf("ipad") >= 0 && (u = "Apple"), E.indexOf("imac") >= 0 && (u = "Apple"), E.indexOf("iphone") >= 0 && (u = "Apple"), E.indexOf("magic mouse") >= 0 && (u = "Apple"), E.indexOf("magic track") >= 0 && (u = "Apple"), E.indexOf("macbook") >= 0 && (u = "Apple"), u;
  }
  function $(E) {
    const u = parseInt(E);
    if (!isNaN(u)) return o[u];
  }
  function H(E, u, r) {
    const Q = {};
    return Q.device = null, Q.name = g.getValue(E, "name", "="), Q.manufacturer = null, Q.macDevice = u, Q.macHost = r, Q.batteryPercent = null, Q.type = N(Q.name.toLowerCase()), Q.connected = !1, Q;
  }
  function y(E, u) {
    const r = {}, Q = ((E.device_minorClassOfDevice_string || E.device_majorClassOfDevice_string || E.device_minorType || "") + (E.device_name || "")).toLowerCase();
    return r.device = E.device_services || "", r.name = E.device_name || "", r.manufacturer = E.device_manufacturer || $(E.device_vendorID) || J(E.device_name || "") || "", r.macDevice = (E.device_addr || E.device_address || "").toLowerCase().replace(/-/g, ":"), r.macHost = u, r.batteryPercent = E.device_batteryPercent || null, r.type = N(Q), r.connected = E.device_isconnected === "attrib_Yes" || !1, r;
  }
  function p(E) {
    const u = {};
    return u.device = null, u.name = g.getValue(E, "name", ":"), u.manufacturer = g.getValue(E, "manufacturer", ":"), u.macDevice = null, u.macHost = null, u.batteryPercent = null, u.type = N(u.name.toLowerCase()), u.connected = null, u;
  }
  function h(E) {
    return new Promise((u) => {
      process.nextTick(() => {
        let r = [];
        if (x) {
          g.getFilesInPath("/var/lib/bluetooth/").forEach((d) => {
            const c = A.basename(d), n = d.split("/"), L = n.length >= 6 ? n[n.length - 2] : null, k = n.length >= 7 ? n[n.length - 3] : null;
            if (c === "info") {
              const K = B.readFileSync(d, { encoding: "utf8" }).split(`
`);
              r.push(H(K, L, k));
            }
          });
          try {
            const d = e("hcitool con", g.execOptsLinux).toString().toLowerCase();
            for (let c = 0; c < r.length; c++)
              r[c].macDevice && r[c].macDevice.length > 10 && d.indexOf(r[c].macDevice.toLowerCase()) >= 0 && (r[c].connected = !0);
          } catch {
            g.noop();
          }
          E && E(r), u(r);
        }
        b && s("system_profiler SPBluetoothDataType -json", (d, c) => {
          if (!d)
            try {
              const n = JSON.parse(c.toString());
              if (n.SPBluetoothDataType && n.SPBluetoothDataType.length && n.SPBluetoothDataType[0] && n.SPBluetoothDataType[0].device_title && n.SPBluetoothDataType[0].device_title.length) {
                let L = null;
                n.SPBluetoothDataType[0].local_device_title && n.SPBluetoothDataType[0].local_device_title.general_address && (L = n.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g, ":")), n.SPBluetoothDataType[0].device_title.forEach((k) => {
                  const K = k, gA = Object.keys(K);
                  if (gA && gA.length === 1) {
                    const v = K[gA[0]];
                    v.device_name = gA[0];
                    const U = y(v, L);
                    r.push(U);
                  }
                });
              }
              if (n.SPBluetoothDataType && n.SPBluetoothDataType.length && n.SPBluetoothDataType[0] && n.SPBluetoothDataType[0].device_connected && n.SPBluetoothDataType[0].device_connected.length) {
                const L = n.SPBluetoothDataType[0].controller_properties && n.SPBluetoothDataType[0].controller_properties.controller_address ? n.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g, ":") : null;
                n.SPBluetoothDataType[0].device_connected.forEach((k) => {
                  const K = k, gA = Object.keys(K);
                  if (gA && gA.length === 1) {
                    const v = K[gA[0]];
                    v.device_name = gA[0], v.device_isconnected = "attrib_Yes";
                    const U = y(v, L);
                    r.push(U);
                  }
                });
              }
              if (n.SPBluetoothDataType && n.SPBluetoothDataType.length && n.SPBluetoothDataType[0] && n.SPBluetoothDataType[0].device_not_connected && n.SPBluetoothDataType[0].device_not_connected.length) {
                const L = n.SPBluetoothDataType[0].controller_properties && n.SPBluetoothDataType[0].controller_properties.controller_address ? n.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g, ":") : null;
                n.SPBluetoothDataType[0].device_not_connected.forEach((k) => {
                  const K = k, gA = Object.keys(K);
                  if (gA && gA.length === 1) {
                    const v = K[gA[0]];
                    v.device_name = gA[0], v.device_isconnected = "attrib_No";
                    const U = y(v, L);
                    r.push(U);
                  }
                });
              }
            } catch {
              g.noop();
            }
          E && E(r), u(r);
        }), X && g.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer, Status, Service, ConfigManagerErrorCode, Present | fl").then((Q, d) => {
          d || Q.toString().split(/\n\s*\n/).forEach((n) => {
            const L = n.split(`
`), k = g.getValue(L, "Service", ":"), K = g.getValue(L, "ConfigManagerErrorCode", ":");
            g.getValue(L, "PNPClass", ":").toLowerCase() === "bluetooth" && K === "0" && k === "" && r.push(p(L));
          }), E && E(r), u(r);
        }), (W || IA || eA || z) && u(null);
      });
    });
  }
  return bluetooth.bluetoothDevices = h, bluetooth;
}
var hasRequiredLib;
function requireLib() {
  return hasRequiredLib || (hasRequiredLib = 1, (function(s) {
    const e = require$$0.version, A = requireUtil(), g = requireSystem(), o = requireOsinfo(), B = requireCpu(), F = requireMemory(), x = requireBattery(), b = requireGraphics(), X = requireFilesystem(), W = requireNetwork(), eA = requireWifi(), IA = requireProcesses(), z = requireUsers(), N = requireInternet(), J = requireDocker(), $ = requireVirtualbox(), H = requirePrinter(), y = requireUsb(), p = requireAudio(), h = requireBluetooth(), E = process.platform, u = E === "win32", r = E === "freebsd", Q = E === "openbsd", d = E === "netbsd", c = E === "sunos";
    u && (A.getCodepage(), A.getPowershell());
    function n() {
      return e;
    }
    function L(U) {
      return new Promise((V) => {
        process.nextTick(() => {
          const m = {};
          m.version = n(), Promise.all([
            g.system(),
            g.bios(),
            g.baseboard(),
            g.chassis(),
            o.osInfo(),
            o.uuid(),
            o.versions(),
            B.cpu(),
            B.cpuFlags(),
            b.graphics(),
            W.networkInterfaces(),
            F.memLayout(),
            X.diskLayout(),
            p.audio(),
            h.bluetoothDevices(),
            y.usb(),
            H.printer()
          ]).then((a) => {
            m.system = a[0], m.bios = a[1], m.baseboard = a[2], m.chassis = a[3], m.os = a[4], m.uuid = a[5], m.versions = a[6], m.cpu = a[7], m.cpu.flags = a[8], m.graphics = a[9], m.net = a[10], m.memLayout = a[11], m.diskLayout = a[12], m.audio = a[13], m.bluetooth = a[14], m.usb = a[15], m.printer = a[16], U && U(m), V(m);
          });
        });
      });
    }
    function k(U, V, m) {
      return A.isFunction(V) && (m = V, V = ""), A.isFunction(U) && (m = U, U = ""), new Promise((a) => {
        process.nextTick(() => {
          V = V || W.getDefaultNetworkInterface(), U = U || "";
          let I = (() => {
            let l = 15;
            return u && (l = 13), (r || Q || d) && (l = 11), c && (l = 6), function() {
              --l === 0 && (m && m(t), a(t));
            };
          })();
          const t = {};
          t.time = o.time(), t.node = process.versions.node, t.v8 = process.versions.v8, B.cpuCurrentSpeed().then((l) => {
            t.cpuCurrentSpeed = l, I();
          }), z.users().then((l) => {
            t.users = l, I();
          }), IA.processes().then((l) => {
            t.processes = l, I();
          }), B.currentLoad().then((l) => {
            t.currentLoad = l, I();
          }), c || B.cpuTemperature().then((l) => {
            t.temp = l, I();
          }), !Q && !r && !d && !c && W.networkStats(V).then((l) => {
            t.networkStats = l, I();
          }), c || W.networkConnections().then((l) => {
            t.networkConnections = l, I();
          }), F.mem().then((l) => {
            t.mem = l, I();
          }), c || x().then((l) => {
            t.battery = l, I();
          }), c || IA.services(U).then((l) => {
            t.services = l, I();
          }), c || X.fsSize().then((l) => {
            t.fsSize = l, I();
          }), !u && !Q && !r && !d && !c && X.fsStats().then((l) => {
            t.fsStats = l, I();
          }), !u && !Q && !r && !d && !c && X.disksIO().then((l) => {
            t.disksIO = l, I();
          }), !Q && !r && !d && !c && eA.wifiNetworks().then((l) => {
            t.wifiNetworks = l, I();
          }), N.inetLatency().then((l) => {
            t.inetLatency = l, I();
          });
        });
      });
    }
    function K(U, V, m) {
      return new Promise((a) => {
        process.nextTick(() => {
          let I = {};
          V && A.isFunction(V) && !m && (m = V, V = ""), U && A.isFunction(U) && !V && !m && (m = U, U = "", V = ""), L().then((t) => {
            I = t, k(U, V).then((l) => {
              for (let D in l)
                ({}).hasOwnProperty.call(l, D) && (I[D] = l[D]);
              m && m(I), a(I);
            });
          });
        });
      });
    }
    function gA(U, V) {
      return new Promise((m) => {
        process.nextTick(() => {
          const a = Object.keys(U).filter((I) => ({}).hasOwnProperty.call(s, I)).map((I) => {
            const t = U[I].substring(U[I].lastIndexOf("(") + 1, U[I].lastIndexOf(")"));
            let l = I.indexOf(")") >= 0 ? I.split(")")[1].trim() : I;
            return l = I.indexOf("|") >= 0 ? I.split("|")[0].trim() : l, t ? s[l](t) : s[l]("");
          });
          Promise.all(a).then((I) => {
            const t = {};
            let l = 0;
            for (let D in U)
              if ({}.hasOwnProperty.call(U, D) && {}.hasOwnProperty.call(s, D) && I.length > l) {
                if (U[D] === "*" || U[D] === "all")
                  t[D] = I[l];
                else {
                  let f = U[D], w = "", Y = [];
                  if (f.indexOf(")") >= 0 && (f = f.split(")")[1].trim()), f.indexOf("|") >= 0 && (w = f.split("|")[1].trim(), Y = w.split(":"), f = f.split("|")[0].trim()), f = f.replace(/,/g, " ").replace(/ +/g, " ").split(" "), I[l])
                    if (Array.isArray(I[l])) {
                      const _ = [];
                      I[l].forEach((G) => {
                        let q = {};
                        if (f.length === 1 && (f[0] === "*" || f[0] === "all") ? q = G : f.forEach((j) => {
                          ({}).hasOwnProperty.call(G, j) && (q[j] = G[j]);
                        }), w && Y.length === 2) {
                          if ({}.hasOwnProperty.call(q, Y[0].trim())) {
                            const j = q[Y[0].trim()];
                            typeof j == "number" ? j === parseFloat(Y[1].trim()) && _.push(q) : typeof j == "string" && j.toLowerCase() === Y[1].trim().toLowerCase() && _.push(q);
                          }
                        } else
                          _.push(q);
                      }), t[D] = _;
                    } else {
                      const _ = {};
                      f.forEach((G) => {
                        ({}).hasOwnProperty.call(I[l], G) && (_[G] = I[l][G]);
                      }), t[D] = _;
                    }
                  else
                    t[D] = {};
                }
                l++;
              }
            V && V(t), m(t);
          });
        });
      });
    }
    function v(U, V, m) {
      let a = null;
      return setInterval(() => {
        gA(U).then((t) => {
          JSON.stringify(a) !== JSON.stringify(t) && (a = Object.assign({}, t), m(t));
        });
      }, V);
    }
    s.version = n, s.system = g.system, s.bios = g.bios, s.baseboard = g.baseboard, s.chassis = g.chassis, s.time = o.time, s.osInfo = o.osInfo, s.versions = o.versions, s.shell = o.shell, s.uuid = o.uuid, s.cpu = B.cpu, s.cpuFlags = B.cpuFlags, s.cpuCache = B.cpuCache, s.cpuCurrentSpeed = B.cpuCurrentSpeed, s.cpuTemperature = B.cpuTemperature, s.currentLoad = B.currentLoad, s.fullLoad = B.fullLoad, s.mem = F.mem, s.memLayout = F.memLayout, s.battery = x, s.graphics = b.graphics, s.fsSize = X.fsSize, s.fsOpenFiles = X.fsOpenFiles, s.blockDevices = X.blockDevices, s.fsStats = X.fsStats, s.disksIO = X.disksIO, s.diskLayout = X.diskLayout, s.networkInterfaceDefault = W.networkInterfaceDefault, s.networkGatewayDefault = W.networkGatewayDefault, s.networkInterfaces = W.networkInterfaces, s.networkStats = W.networkStats, s.networkConnections = W.networkConnections, s.wifiNetworks = eA.wifiNetworks, s.wifiInterfaces = eA.wifiInterfaces, s.wifiConnections = eA.wifiConnections, s.services = IA.services, s.processes = IA.processes, s.processLoad = IA.processLoad, s.users = z.users, s.inetChecksite = N.inetChecksite, s.inetLatency = N.inetLatency, s.dockerInfo = J.dockerInfo, s.dockerImages = J.dockerImages, s.dockerContainers = J.dockerContainers, s.dockerContainerStats = J.dockerContainerStats, s.dockerContainerProcesses = J.dockerContainerProcesses, s.dockerVolumes = J.dockerVolumes, s.dockerAll = J.dockerAll, s.vboxInfo = $.vboxInfo, s.printer = H.printer, s.usb = y.usb, s.audio = p.audio, s.bluetoothDevices = h.bluetoothDevices, s.getStaticData = L, s.getDynamicData = k, s.getAllData = K, s.get = gA, s.observe = v, s.powerShellStart = A.powerShellStart, s.powerShellRelease = A.powerShellRelease;
  })(lib)), lib;
}
var libExports = requireLib();
const UPDATE_INTERVAL_MS = 1e3;
class Battery {
  constructor() {
    fA(this, "updateTimeout");
    fA(this, "onChangeACEmitter", new EventEmitter());
    fA(this, "onChangeLevelEmitter", new EventEmitter());
    fA(this, "acConnected", !0);
    fA(this, "level", 100);
    fA(this, "batteryStatsPromise", libExports.battery());
    fA(this, "onChangeLevel", this.onChangeLevelEmitter.event);
    fA(this, "onChangeAC", this.onChangeACEmitter.event);
    this.updateTimeout = setInterval(() => {
      this.update();
    }, UPDATE_INTERVAL_MS);
  }
  /**
   * Clean up battery monitoring resources
   */
  dispose() {
    this.updateTimeout && clearInterval(this.updateTimeout);
  }
  async update() {
    const e = await this.batteryStatsPromise, A = e.hasBattery ? e.percent : 100, g = !e.hasBattery || e.acConnected || A === 100;
    g !== this.acConnected && (this.acConnected = g, this.onChangeACEmitter.fire(g)), A !== this.level && (this.level = A, this.onChangeLevelEmitter.fire(A));
  }
  /**
   * Get the current battery level percentage
   */
  getLevel() {
    return this.level;
  }
  /**
   * Check if AC power is connected
   */
  isACConnected() {
    return this.acConnected;
  }
}
function registerAutocomplete(s) {
  const e = new Battery();
  s.subscriptions.push(e), setupStatusBar(isAutoCompleteEnabled() ? StatusBarStatus.Enabled : StatusBarStatus.Disabled), s.subscriptions.push(
    vscode.languages.registerInlineCompletionItemProvider(
      [{ pattern: "**" }],
      new ContinueCompletionProvider(new RuntimeServiceClient())
    )
  ), registerAutocompleteCommands(s, e);
}
export {
  registerAutocomplete
};
