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 { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
import { DidCommMessage } from "../../../DidCommMessage.mjs";
import { DidCommConnection } from "../models/DidCommConnection.mjs";
import "../models/index.mjs";
import { Type } from "class-transformer";
import { IsInstance, IsOptional, IsString, IsUrl, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/connections/messages/DidCommConnectionRequestMessage.ts
var _ref;
/**
* Message to communicate the DID document to the other agent when creating a connection
*
* @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0160-connection-protocol/README.md#1-connection-request
*/
var DidCommConnectionRequestMessage = class DidCommConnectionRequestMessage extends DidCommMessage {
	/**
	* Create new ConnectionRequestMessage instance.
	* @param options
	*/
	constructor(options) {
		super();
		this.allowDidSovPrefix = true;
		this.type = DidCommConnectionRequestMessage.type.messageTypeUri;
		if (options) {
			this.id = options.id || this.generateId();
			this.label = options.label;
			this.imageUrl = options.imageUrl;
			this.connection = new DidCommConnection({
				did: options.did,
				didDoc: options.didDoc
			});
		}
	}
};
DidCommConnectionRequestMessage.type = parseMessageType("https://didcomm.org/connections/1.0/request");
__decorate([IsValidMessageType(DidCommConnectionRequestMessage.type), __decorateMetadata("design:type", Object)], DidCommConnectionRequestMessage.prototype, "type", void 0);
__decorate([IsString(), __decorateMetadata("design:type", String)], DidCommConnectionRequestMessage.prototype, "label", void 0);
__decorate([
	Type(() => DidCommConnection),
	ValidateNested(),
	IsInstance(DidCommConnection),
	__decorateMetadata("design:type", typeof (_ref = typeof DidCommConnection !== "undefined" && DidCommConnection) === "function" ? _ref : Object)
], DidCommConnectionRequestMessage.prototype, "connection", void 0);
__decorate([
	IsOptional(),
	IsUrl(),
	__decorateMetadata("design:type", String)
], DidCommConnectionRequestMessage.prototype, "imageUrl", void 0);

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