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 { ReturnRouteTypes, TransportDecorator } from "./TransportDecorator.mjs";
import { Expose, Type } from "class-transformer";
import { IsInstance, IsOptional, ValidateNested } from "class-validator";

//#region ../didcomm/src/decorators/transport/TransportDecoratorExtension.ts
function TransportDecorated(Base) {
	var _ref;
	class TransportDecoratorExtension extends Base {
		setReturnRouting(type, thread) {
			this.transport = new TransportDecorator({
				returnRoute: type,
				returnRouteThread: thread
			});
		}
		hasReturnRouting(threadId) {
			if (!this.transport || !this.transport.returnRoute || this.transport.returnRoute === ReturnRouteTypes.none) return false;
			if (this.transport.returnRoute === ReturnRouteTypes.all) return true;
			if (this.transport.returnRoute === ReturnRouteTypes.thread && this.transport.returnRouteThread === threadId) return true;
			return false;
		}
		hasAnyReturnRoute() {
			const returnRoute = this.transport?.returnRoute;
			return returnRoute === ReturnRouteTypes.all || returnRoute === ReturnRouteTypes.thread;
		}
	}
	__decorate([
		Expose({ name: "~transport" }),
		Type(() => TransportDecorator),
		ValidateNested(),
		IsOptional(),
		IsInstance(TransportDecorator),
		__decorateMetadata("design:type", typeof (_ref = typeof TransportDecorator !== "undefined" && TransportDecorator) === "function" ? _ref : Object)
	], TransportDecoratorExtension.prototype, "transport", void 0);
	return TransportDecoratorExtension;
}

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