

const require_CredoError = require('../../../error/CredoError.js');
require('../../../error/index.js');
const require_Jwt = require('../../../crypto/jose/jwt/Jwt.js');
const require_ClaimFormat = require('../models/ClaimFormat.js');
const require_presentationTransformer = require('./presentationTransformer.js');
require('../models/index.js');

//#region src/modules/vc/jwt-vc/W3cJwtVerifiablePresentation.ts
var W3cJwtVerifiablePresentation = class W3cJwtVerifiablePresentation {
	constructor(options) {
		this.jwt = options.jwt;
		this._presentation = require_presentationTransformer.getPresentationFromJwtPayload(this.jwt.payload);
	}
	static fromSerializedJwt(serializedJwt) {
		const jwt = require_Jwt.Jwt.fromSerializedJwt(serializedJwt);
		if (!jwt.payload.additionalClaims.nonce) throw new require_CredoError.CredoError(`JWT payload does not contain required claim 'nonce'`);
		return new W3cJwtVerifiablePresentation({ jwt });
	}
	/**
	* Get the W3cPresentation from the JWT payload. This does not include the JWT wrapper,
	* and thus is not suitable for sharing. If you need a JWT, use the `serializedJwt` property.
	*
	* All properties and getters from the `W3cPresentation` interface are implemented as getters
	* on the `W3cJwtVerifiablePresentation` class itself, so you can also use this directly
	* instead of accessing the inner `presentation` property.
	*/
	get presentation() {
		return this._presentation;
	}
	get serializedJwt() {
		return this.jwt.serializedJwt;
	}
	get context() {
		return this.presentation.context;
	}
	get id() {
		return this.presentation.id;
	}
	get type() {
		return this.presentation.type;
	}
	get holder() {
		return this.presentation.holder;
	}
	get verifiableCredential() {
		return this.presentation.verifiableCredential;
	}
	get holderId() {
		return this.presentation.holderId;
	}
	/**
	* The {@link ClaimFormat} of the presentation. For JWT presentations this is always `jwt_vp`.
	*/
	get claimFormat() {
		return require_ClaimFormat.ClaimFormat.JwtVp;
	}
	/**
	* Get the encoded variant of the W3C Verifiable Presentation. For JWT presentations this is
	* a JWT string.
	*/
	get encoded() {
		return this.serializedJwt;
	}
};

//#endregion
exports.W3cJwtVerifiablePresentation = W3cJwtVerifiablePresentation;