const require_rolldown_runtime = require('../../../../../../../../_virtual/rolldown_runtime.js');
const require_index = require('../../../../../../../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer/cjs/index.js');
const require_index$1 = require('../../../../../../../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/index.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');
const require_DidCommAttachment = require('../../../../../decorators/attachment/DidCommAttachment.js');
const require_messageType = require('../../../../../util/messageType.js');
const require_DidCommMessage = require('../../../../../DidCommMessage.js');
const require_DidCommCredentialFormatSpec = require('../../../models/DidCommCredentialFormatSpec.js');
require('../../../models/index.js');

//#region ../didcomm/src/modules/credentials/protocol/v2/messages/DidCommIssueCredentialV2Message.ts
var import_cjs = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.require_cjs());
var import_cjs$1 = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index$1.require_cjs());
var DidCommIssueCredentialV2Message = class DidCommIssueCredentialV2Message extends require_DidCommMessage.DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommIssueCredentialV2Message.type.messageTypeUri;
		if (options) {
			this.id = options.id ?? this.generateId();
			this.comment = options.comment;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.formats = options.formats;
			this.credentialAttachments = options.credentialAttachments;
		}
	}
	getCredentialAttachmentById(id) {
		return this.credentialAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommIssueCredentialV2Message.type = require_messageType.parseMessageType("https://didcomm.org/issue-credential/2.0/issue-credential");
require_decorate.__decorate([
	(0, import_cjs.Type)(() => require_DidCommCredentialFormatSpec.DidCommCredentialFormatSpec),
	(0, import_cjs$1.ValidateNested)(),
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.IsInstance)(require_DidCommCredentialFormatSpec.DidCommCredentialFormatSpec, { each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidCommIssueCredentialV2Message.prototype, "formats", void 0);
require_decorate.__decorate([require_messageType.IsValidMessageType(DidCommIssueCredentialV2Message.type), require_decorateMetadata.__decorateMetadata("design:type", Object)], DidCommIssueCredentialV2Message.prototype, "type", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "comment", void 0);
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "credentials~attach" }),
	(0, import_cjs.Type)(() => require_DidCommAttachment.DidCommAttachment),
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.ValidateNested)({ each: true }),
	(0, import_cjs$1.IsInstance)(require_DidCommAttachment.DidCommAttachment, { each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidCommIssueCredentialV2Message.prototype, "credentialAttachments", void 0);
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "goal_code" }),
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "goalCode", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommIssueCredentialV2Message.prototype, "goal", void 0);

//#endregion
exports.DidCommIssueCredentialV2Message = DidCommIssueCredentialV2Message;