

const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.js');
const require_decorateMetadata = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
require('../../agent/index.js');
const require_Mdoc = require('./Mdoc.js');
const require_MdocDeviceResponse = require('./MdocDeviceResponse.js');
const require_MdocRecord = require('./repository/MdocRecord.js');
const require_MdocRepository = require('./repository/MdocRepository.js');
require('./repository/index.js');
let tsyringe = require("tsyringe");
tsyringe = require_rolldown_runtime.__toESM(tsyringe);

//#region src/modules/mdoc/MdocService.ts
var _ref;
let MdocService = class MdocService$1 {
	constructor(mdocRepository) {
		this.MdocRepository = mdocRepository;
	}
	mdocFromBase64Url(hexEncodedMdoc) {
		return require_Mdoc.Mdoc.fromBase64Url(hexEncodedMdoc);
	}
	signMdoc(agentContext, options) {
		return require_Mdoc.Mdoc.sign(agentContext, options);
	}
	async verifyMdoc(agentContext, mdoc, options) {
		return await mdoc.verify(agentContext, options);
	}
	async createDeviceResponse(agentContext, options) {
		return require_MdocDeviceResponse.MdocDeviceResponse.createDeviceResponse(agentContext, options);
	}
	async createPresentationDefinitionDeviceResponse(agentContext, options) {
		return require_MdocDeviceResponse.MdocDeviceResponse.createPresentationDefinitionDeviceResponse(agentContext, options);
	}
	async verifyDeviceResponse(agentContext, options) {
		return require_MdocDeviceResponse.MdocDeviceResponse.fromBase64Url(options.deviceResponse).verify(agentContext, options);
	}
	async store(agentContext, mdoc) {
		const mdocRecord = new require_MdocRecord.MdocRecord({ mdoc });
		await this.MdocRepository.save(agentContext, mdocRecord);
		return mdocRecord;
	}
	async getById(agentContext, id) {
		return await this.MdocRepository.getById(agentContext, id);
	}
	async getAll(agentContext) {
		return await this.MdocRepository.getAll(agentContext);
	}
	async findByQuery(agentContext, query, queryOptions) {
		return await this.MdocRepository.findByQuery(agentContext, query, queryOptions);
	}
	async deleteById(agentContext, id) {
		await this.MdocRepository.deleteById(agentContext, id);
	}
	async update(agentContext, mdocRecord) {
		await this.MdocRepository.update(agentContext, mdocRecord);
	}
};
MdocService = require_decorate.__decorate([(0, tsyringe.injectable)(), require_decorateMetadata.__decorateMetadata("design:paramtypes", [typeof (_ref = typeof require_MdocRepository.MdocRepository !== "undefined" && require_MdocRepository.MdocRepository) === "function" ? _ref : Object])], MdocService);

//#endregion
Object.defineProperty(exports, 'MdocService', {
  enumerable: true,
  get: function () {
    return MdocService;
  }
});