

import { JsonTransformer } from "../../../utils/JsonTransformer.mjs";
import "../../../utils/index.mjs";
import { Jwt } from "../../../crypto/jose/jwt/Jwt.mjs";
import "../../../crypto/index.mjs";
import { W3cJsonLdVerifiablePresentation } from "../../vc/data-integrity/models/W3cJsonLdVerifiablePresentation.mjs";
import { W3cJwtVerifiablePresentation } from "../../vc/jwt-vc/W3cJwtVerifiablePresentation.mjs";
import "../../vc/index.mjs";
import { MdocDeviceResponse } from "../../mdoc/MdocDeviceResponse.mjs";
import "../../mdoc/index.mjs";
import { SdJwtVcApi } from "../../sd-jwt-vc/SdJwtVcApi.mjs";
import "../../sd-jwt-vc/index.mjs";

//#region src/modules/dif-presentation-exchange/utils/transform.ts
function getSphereonOriginalVerifiableCredential(credentialRecord) {
	return credentialRecord.encoded;
}
function getSphereonOriginalVerifiablePresentation(verifiablePresentation) {
	return verifiablePresentation.encoded;
}
function getVerifiablePresentationFromEncoded(agentContext, encodedVerifiablePresentation) {
	if (typeof encodedVerifiablePresentation === "string" && encodedVerifiablePresentation.includes("~")) return agentContext.dependencyManager.resolve(SdJwtVcApi).fromCompact(encodedVerifiablePresentation);
	if (typeof encodedVerifiablePresentation === "string" && Jwt.format.test(encodedVerifiablePresentation)) return W3cJwtVerifiablePresentation.fromSerializedJwt(encodedVerifiablePresentation);
	if (typeof encodedVerifiablePresentation === "object" && "@context" in encodedVerifiablePresentation) return JsonTransformer.fromJSON(encodedVerifiablePresentation, W3cJsonLdVerifiablePresentation);
	return MdocDeviceResponse.fromBase64Url(encodedVerifiablePresentation);
}

//#endregion
export { getSphereonOriginalVerifiableCredential, getSphereonOriginalVerifiablePresentation, getVerifiablePresentationFromEncoded };
//# sourceMappingURL=transform.mjs.map