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, IsBoolean, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";

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

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