import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);
import {
  execAsync,
  init_execAsync
} from "./chunk-XALGXSKB.js";
import {
  diag,
  init_esm
} from "./chunk-LRULMAAA.js";
import {
  __esm
} from "./chunk-5H446C7X.js";

// ../../node_modules/.bun/@opentelemetry+resources@2.5.1+460773ef8ff1e07c/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js
import * as process from "process";
async function getMachineId() {
  const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
  let command = "%windir%\\System32\\REG.exe";
  if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) {
    command = "%windir%\\sysnative\\cmd.exe /c " + command;
  }
  try {
    const result = await execAsync(`${command} ${args}`);
    const parts = result.stdout.split("REG_SZ");
    if (parts.length === 2) {
      return parts[1].trim();
    }
  } catch (e) {
    diag.debug(`error reading machine id: ${e}`);
  }
  return void 0;
}
var init_getMachineId_win = __esm({
  "../../node_modules/.bun/@opentelemetry+resources@2.5.1+460773ef8ff1e07c/node_modules/@opentelemetry/resources/build/esm/detectors/platform/node/machine-id/getMachineId-win.js"() {
    init_execAsync();
    init_esm();
  }
});
init_getMachineId_win();
export {
  getMachineId
};
//# sourceMappingURL=getMachineId-win-YZ36S7VA.js.map