

import { CredoError } from "../../../error/CredoError.mjs";
import "../../../error/index.mjs";
import { injectAll, injectable } from "../../../plugins/index.mjs";
import { __decorateMetadata } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
import { PublicJwk } from "../../kms/jwk/PublicJwk.mjs";
import { __decorateParam } from "../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateParam.mjs";
import { suites } from "./libraries/jsonld-signatures.mjs";

//#region src/modules/vc/data-integrity/SignatureSuiteRegistry.ts
var _ref;
suites.LinkedDataSignature;
const SignatureSuiteToken = Symbol("SignatureSuiteToken");
let SignatureSuiteRegistry = class SignatureSuiteRegistry$1 {
	constructor(suites$1) {
		this.suiteMapping = suites$1.filter((suite) => suite !== "default");
	}
	get supportedProofTypes() {
		return this.suiteMapping.map((x) => x.proofType);
	}
	/**
	* @deprecated recommended to always search by key type instead as that will have broader support
	*/
	getByVerificationMethodType(verificationMethodType) {
		return this.suiteMapping.find((x) => x.verificationMethodTypes.includes(verificationMethodType));
	}
	getAllByPublicJwkType(publicJwkType) {
		const publicJwkClass = publicJwkType instanceof PublicJwk ? publicJwkType.JwkClass : publicJwkType;
		return this.suiteMapping.filter((x) => x.supportedPublicJwkTypes.includes(publicJwkClass));
	}
	getByProofType(proofType) {
		const suiteInfo = this.suiteMapping.find((x) => x.proofType === proofType);
		if (!suiteInfo) throw new CredoError(`No signature suite for proof type: ${proofType}`);
		return suiteInfo;
	}
	getVerificationMethodTypesByProofType(proofType) {
		const suiteInfo = this.suiteMapping.find((suiteInfo$1) => suiteInfo$1.proofType === proofType);
		if (!suiteInfo) throw new CredoError(`No verification method type found for proof type: ${proofType}`);
		return suiteInfo.verificationMethodTypes;
	}
};
SignatureSuiteRegistry = __decorate([
	injectable(),
	__decorateParam(0, injectAll(SignatureSuiteToken)),
	__decorateMetadata("design:paramtypes", [typeof (_ref = typeof Array !== "undefined" && Array) === "function" ? _ref : Object])
], SignatureSuiteRegistry);

//#endregion
export { SignatureSuiteRegistry, SignatureSuiteToken };
//# sourceMappingURL=SignatureSuiteRegistry.mjs.map