

const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.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_validators = require('../../../../utils/validators.js');
require('../../../../utils/index.js');
let class_transformer = require("class-transformer");
class_transformer = require_rolldown_runtime.__toESM(class_transformer);
let class_validator = require("class-validator");
class_validator = require_rolldown_runtime.__toESM(class_validator);

//#region src/modules/vc/models/credential/W3cV2Issuer.ts
/**
* Represents a credential issuer.
*
* @see https://www.w3.org/TR/vc-data-model-2.0/#issuer
*/
var W3cV2Issuer = class {
	constructor(options) {
		if (options) {
			const { id,...rest } = options;
			(0, class_transformer.plainToClassFromExist)(this, rest);
			this.id = id;
		}
	}
};
require_decorate.__decorate([require_validators.IsUri(), require_decorateMetadata.__decorateMetadata("design:type", String)], W3cV2Issuer.prototype, "id", void 0);
function W3cV2IssuerTransformer() {
	return (0, class_transformer.Transform)(({ value, type }) => {
		if (type === class_transformer.TransformationType.PLAIN_TO_CLASS) {
			if ((0, class_validator.isString)(value)) return value;
			return (0, class_transformer.plainToInstance)(W3cV2Issuer, value);
		}
		if (type === class_transformer.TransformationType.CLASS_TO_PLAIN) {
			if ((0, class_validator.isString)(value)) return value;
			return (0, class_transformer.instanceToPlain)(value);
		}
		return value;
	});
}
function IsW3cV2Issuer(validationOptions) {
	return (0, class_validator.ValidateBy)({
		name: "IsW3cV2Issuer",
		validator: {
			validate: (value) => {
				return typeof value === "string" && require_validators.isUri(value) || (0, class_validator.isInstance)(value, W3cV2Issuer) && require_validators.isUri(value.id);
			},
			defaultMessage: (0, class_validator.buildMessage)((eachPrefix) => `${eachPrefix}$property must be an URL or a valid W3cV2Issuer instance`, validationOptions)
		}
	}, validationOptions);
}

//#endregion
exports.IsW3cV2Issuer = IsW3cV2Issuer;
exports.W3cV2Issuer = W3cV2Issuer;
exports.W3cV2IssuerTransformer = W3cV2IssuerTransformer;