// packages/php-wasm/node-builds/8-5/src/index.ts
import { jspi } from "wasm-feature-detect";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { existsSync } from "node:fs";
var currentDirPath = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
var packageDir = existsSync(join(currentDirPath, "jspi")) ? currentDirPath : dirname(currentDirPath);
async function getPHPLoaderModule() {
  if (await jspi()) {
    return await import("./jspi/php_8_5.js");
  } else {
    return await import("./asyncify/php_8_5.js");
  }
}
async function getIntlExtensionPath() {
  if (await jspi()) {
    return join(packageDir, "jspi/extensions/intl/8_5/intl.so");
  } else {
    return join(packageDir, "asyncify/extensions/intl/8_5/intl.so");
  }
}
async function getXdebugExtensionPath() {
  if (await jspi()) {
    return join(packageDir, "jspi/extensions/xdebug/8_5/xdebug.so");
  } else {
    return join(packageDir, "asyncify/extensions/xdebug/8_5/xdebug.so");
  }
}
export {
  getIntlExtensionPath,
  getPHPLoaderModule,
  getXdebugExtensionPath,
  jspi
};
