const { ErrorCtor: _p_ErrorCtor } = require('../primordials/error.js')
const { SetCtor: _p_SetCtor } = require('../primordials/map-set.js')

const { ObjectAssign: _p_ObjectAssign, ObjectKeys: _p_ObjectKeys, ObjectValues: _p_ObjectValues } = require('../primordials/object.js')

"use strict";
/**
 * Bundled from libnpmexec
 * This is a zero-dependency bundle created by esbuild.
 */
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};

// node_modules/.pnpm/libnpmexec@10.2.3_supports-color@10.2.2/node_modules/libnpmexec/lib/get-bin-from-manifest.js
var require_get_bin_from_manifest = __commonJS({
  "node_modules/.pnpm/libnpmexec@10.2.3_supports-color@10.2.2/node_modules/libnpmexec/lib/get-bin-from-manifest.js"(exports2, module2) {
    var getBinFromManifest2 = /* @__PURE__ */ __name((mani) => {
      const bin = mani.bin || {};
      if (new _p_SetCtor(_p_ObjectValues(bin)).size === 1) {
        return _p_ObjectKeys(bin)[0];
      }
      const name = mani.name.replace(/^@[^/]+\//, "");
      if (bin[name]) {
        return name;
      }
      throw _p_ObjectAssign(new _p_ErrorCtor("could not determine executable to run"), {
        pkgid: mani._id
      });
    }, "getBinFromManifest");
    module2.exports = getBinFromManifest2;
  }
});

// src/external/libnpmexec.js
var getBinFromManifest = require_get_bin_from_manifest();
module.exports = {
  getBinFromManifest
};
