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 { DidCommAttachment } from "../../../../../decorators/attachment/DidCommAttachment.mjs";
import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
import { DidCommProofFormatSpec } from "../../../models/DidCommProofFormatSpec.mjs";
import { utils } from "@credo-ts/core";
import { Expose, Type } from "class-transformer";
import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/proofs/protocol/v2/messages/DidCommProposePresentationV2Message.ts
var DidCommProposePresentationV2Message = class DidCommProposePresentationV2Message extends DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommProposePresentationV2Message.type.messageTypeUri;
		if (options) {
			this.formats = [];
			this.proposalAttachments = [];
			this.id = options.id ?? utils.uuid();
			this.comment = options.comment;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.formats = options.formats;
			this.proposalAttachments = options.proposalAttachments;
		}
	}
	getProposalAttachmentById(id) {
		return this.proposalAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommProposePresentationV2Message.type = parseMessageType("https://didcomm.org/present-proof/2.0/propose-presentation");
__decorate([IsValidMessageType(DidCommProposePresentationV2Message.type), __decorateMetadata("design:type", Object)], DidCommProposePresentationV2Message.prototype, "type", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommProposePresentationV2Message.prototype, "comment", void 0);
__decorate([
	Expose({ name: "goal_code" }),
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommProposePresentationV2Message.prototype, "goalCode", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommProposePresentationV2Message.prototype, "goal", void 0);
__decorate([
	Type(() => DidCommProofFormatSpec),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommProofFormatSpec, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommProposePresentationV2Message.prototype, "formats", void 0);
__decorate([
	Expose({ name: "proposals~attach" }),
	Type(() => DidCommAttachment),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommAttachment, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommProposePresentationV2Message.prototype, "proposalAttachments", void 0);

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