var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/php-wasm/node-builds/7-4/src/index.ts
var src_exports = {};
__export(src_exports, {
  getIntlExtensionPath: () => getIntlExtensionPath,
  getPHPLoaderModule: () => getPHPLoaderModule,
  getXdebugExtensionPath: () => getXdebugExtensionPath,
  jspi: () => import_wasm_feature_detect.jspi
});
module.exports = __toCommonJS(src_exports);
var import_wasm_feature_detect = require("wasm-feature-detect");
var import_node_url = require("node:url");
var import_node_path = require("node:path");
var import_node_fs = require("node:fs");
var import_meta = {};
var currentDirPath = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
var packageDir = (0, import_node_fs.existsSync)((0, import_node_path.join)(currentDirPath, "jspi")) ? currentDirPath : (0, import_node_path.dirname)(currentDirPath);
async function getPHPLoaderModule() {
  if (await (0, import_wasm_feature_detect.jspi)()) {
    return await import("./jspi/php_7_4.js");
  } else {
    return await import("./asyncify/php_7_4.js");
  }
}
async function getIntlExtensionPath() {
  if (await (0, import_wasm_feature_detect.jspi)()) {
    return (0, import_node_path.join)(packageDir, "jspi/extensions/intl/7_4/intl.so");
  } else {
    return (0, import_node_path.join)(packageDir, "asyncify/extensions/intl/7_4/intl.so");
  }
}
async function getXdebugExtensionPath() {
  if (await (0, import_wasm_feature_detect.jspi)()) {
    return (0, import_node_path.join)(packageDir, "jspi/extensions/xdebug/7_4/xdebug.so");
  } else {
    return (0, import_node_path.join)(packageDir, "asyncify/extensions/xdebug/7_4/xdebug.so");
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getIntlExtensionPath,
  getPHPLoaderModule,
  getXdebugExtensionPath,
  jspi
});
