import { createRequire as createRequireShim } from 'module'; const require = createRequireShim(import.meta.url);
import {
  execAsync,
  init_execAsync
} from "./chunk-L2A6JPIQ.js";
import {
  diag,
  init_esm
} from "./chunk-MV6JXS2P.js";
import {
  __esm
} from "./chunk-KVSDPGUI.js";

// ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.0/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/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.0/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-TT64F63B.js.map