import { ENCLAVE_URL as e } from "./constant.mjs";
import { httpClient as t } from "../../data-structures/http/HttpClient.mjs";
import "../../data-structures/http/index.mjs";
import { makeEnclaveHandshakeAndEncryptInput as n } from "../utils/encryptInputForEnclave.mjs";
import { getWASMFile as r, getZKeyFile as i } from "./getZKFiles.mjs";
//#region libs/shared/common/src/functions/snarkjs/generateZkProofEnclave.ts
var a = (e) => {
	if (e.startsWith("http")) {
		let t = e.split("/").at(-1);
		if (!t) throw Error("invalid verifierName");
		return t;
	}
	return e;
}, o = async (o, s, c) => {
	let l = a(r(s, o)), u = a(i(s, o)), { keyCiphertext: d, inputCiphertext: f } = await n(c), p = {
		circuit_wasm: l,
		circuit_zkey: u,
		input: f,
		key: d
	}, { public_signals: m, zk_calldata: h } = await t.post(`${e}/generate`, p);
	return {
		zkCallData: h,
		publicSignals: m
	};
};
//#endregion
export { o as generateZkProofEnclave };
