/**

 * Node ESM loader for web_node policy tests.

 * Remaps CDN imports and wallet_crypto to a lightweight stub (no PQ needed for policy tests).

 *

 * Run: node --import ./js/node_esm_hooks.js ./js/policy_tests.js

 */

import { register } from "node:module";

import { pathToFileURL } from "node:url";

import path from "node:path";

import { fileURLToPath } from "node:url";



const __dirname = path.dirname(fileURLToPath(import.meta.url));



register("./node_esm_resolve.js", pathToFileURL(path.join(__dirname, "node_esm_hooks.js")), {

  data: {

    stubWallet: pathToFileURL(path.join(__dirname, "wallet_crypto_test_stub.js")).href,

  },

});


