

import { KeyDidRegistrar } from "./methods/key/KeyDidRegistrar.mjs";
import { KeyDidResolver } from "./methods/key/KeyDidResolver.mjs";
import { PeerDidRegistrar } from "./methods/peer/PeerDidRegistrar.mjs";
import { PeerDidResolver } from "./methods/peer/PeerDidResolver.mjs";
import { WebDidResolver } from "./methods/web/WebDidResolver.mjs";
import { JwkDidRegistrar } from "./methods/jwk/JwkDidRegistrar.mjs";
import { JwkDidResolver } from "./methods/jwk/JwkDidResolver.mjs";
import "./methods/index.mjs";

//#region src/modules/dids/DidsModuleConfig.ts
var DidsModuleConfig = class {
	constructor(options) {
		this.options = options ?? {};
	}
	/** See {@link DidsModuleConfigOptions.registrars} */
	get registrars() {
		if (this._registrars) return this._registrars;
		let registrars = this.options.registrars ?? [
			new KeyDidRegistrar(),
			new PeerDidRegistrar(),
			new JwkDidRegistrar()
		];
		if (!registrars.find((registrar) => registrar instanceof PeerDidRegistrar)) registrars = [...registrars, new PeerDidRegistrar()];
		if (!registrars.find((registrar) => registrar instanceof KeyDidRegistrar)) registrars = [...registrars, new KeyDidRegistrar()];
		this._registrars = registrars;
		return registrars;
	}
	addRegistrar(registrar) {
		this.registrars.push(registrar);
	}
	/** See {@link DidsModuleConfigOptions.resolvers} */
	get resolvers() {
		if (this._resolvers) return this._resolvers;
		let resolvers = this.options.resolvers ?? [
			new WebDidResolver(),
			new KeyDidResolver(),
			new PeerDidResolver(),
			new JwkDidResolver()
		];
		if (!resolvers.find((resolver) => resolver instanceof PeerDidResolver)) resolvers = [...resolvers, new PeerDidResolver()];
		if (!resolvers.find((resolver) => resolver instanceof KeyDidResolver)) resolvers = [...resolvers, new KeyDidResolver()];
		this._resolvers = resolvers;
		return resolvers;
	}
	addResolver(resolver) {
		this.resolvers.push(resolver);
	}
};

//#endregion
export { DidsModuleConfig };
//# sourceMappingURL=DidsModuleConfig.mjs.map