/* @ts-self-types="./prem_rs.d.ts" */

class AttestHeaders {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(AttestHeaders.prototype);
        obj.__wbg_ptr = ptr;
        AttestHeadersFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        AttestHeadersFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_attestheaders_free(ptr, 0);
    }
    /**
     * @returns {ResponseHeaders | undefined}
     */
    cpu() {
        const ret = wasm.attestheaders_cpu(this.__wbg_ptr);
        return ret === 0 ? undefined : ResponseHeaders.__wrap(ret);
    }
    /**
     * @returns {ResponseHeaders | undefined}
     */
    gpu() {
        const ret = wasm.attestheaders_gpu(this.__wbg_ptr);
        return ret === 0 ? undefined : ResponseHeaders.__wrap(ret);
    }
}
if (Symbol.dispose) AttestHeaders.prototype[Symbol.dispose] = AttestHeaders.prototype.free;
exports.AttestHeaders = AttestHeaders;

class AttestResult {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(AttestResult.prototype);
        obj.__wbg_ptr = ptr;
        AttestResultFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        AttestResultFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_attestresult_free(ptr, 0);
    }
    /**
     * @returns {AttestHeaders}
     */
    headers() {
        const ret = wasm.attestresult_headers(this.__wbg_ptr);
        return AttestHeaders.__wrap(ret);
    }
    /**
     * @returns {Modules}
     */
    modules() {
        const ret = wasm.attestresult_modules(this.__wbg_ptr);
        return Modules.__wrap(ret);
    }
}
if (Symbol.dispose) AttestResult.prototype[Symbol.dispose] = AttestResult.prototype.free;
exports.AttestResult = AttestResult;

class Client {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(Client.prototype);
        obj.__wbg_ptr = ptr;
        ClientFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ClientFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_client_free(ptr, 0);
    }
    /**
     * Steps:
     * - Gathers modules to attest from attestation server
     * - Iterates through each module and performs end-to-end attestation
     * - Returns the list of attested modules
     * @param {QueryParams | null} [query]
     * @returns {Promise<AttestResult>}
     */
    attest(query) {
        let ptr0 = 0;
        if (!isLikeNone(query)) {
            _assertClass(query, QueryParams);
            ptr0 = query.__destroy_into_raw();
        }
        const ret = wasm.client_attest(this.__wbg_ptr, ptr0);
        return ret;
    }
    /**
     * Completes end-to-end nvidia attestation. Generates nonce and validates claims all in one
     * @param {QueryParams | null} [query]
     * @returns {Promise<ResponseHeaders>}
     */
    attest_nvidia(query) {
        let ptr0 = 0;
        if (!isLikeNone(query)) {
            _assertClass(query, QueryParams);
            ptr0 = query.__destroy_into_raw();
        }
        const ret = wasm.client_attest_nvidia(this.__wbg_ptr, ptr0);
        return ret;
    }
    /**
     * Performs end-to-end sev-snp attestation. Generates nonce and validates claims all in one
     * @param {QueryParams | null} [query]
     * @returns {Promise<void>}
     */
    attest_sev(query) {
        let ptr0 = 0;
        if (!isLikeNone(query)) {
            _assertClass(query, QueryParams);
            ptr0 = query.__destroy_into_raw();
        }
        const ret = wasm.client_attest_sev(this.__wbg_ptr, ptr0);
        return ret;
    }
    /**
     * Performs end-to-end tdx attestation. Generates nonce and validates claims all in one
     * @param {QueryParams | null} [query]
     * @returns {Promise<void>}
     */
    attest_tdx(query) {
        let ptr0 = 0;
        if (!isLikeNone(query)) {
            _assertClass(query, QueryParams);
            ptr0 = query.__destroy_into_raw();
        }
        const ret = wasm.client_attest_tdx(this.__wbg_ptr, ptr0);
        return ret;
    }
    /**
     * Gather available attestable modules from remote attestation endpoint
     * @param {QueryParams | null} [query]
     * @returns {Promise<Modules>}
     */
    request_modules(query) {
        let ptr0 = 0;
        if (!isLikeNone(query)) {
            _assertClass(query, QueryParams);
            ptr0 = query.__destroy_into_raw();
        }
        const ret = wasm.client_request_modules(this.__wbg_ptr, ptr0);
        return ret;
    }
    /**
     * Requests and parses an Nvidia EATToken attestation from the attestation server
     *
     * ### Warning
     * This method exposes core functionality and does not perform cryptographic
     * or measurement checks on the attestation. If you want to perform end-to-end attestation
     * please refer to [`Self::attest_nvidia`]
     * @param {NvidiaNonce} nonce
     * @param {QueryParams} query
     * @returns {Promise<NvidiaAttestResult>}
     */
    request_nvidia(nonce, query) {
        _assertClass(nonce, NvidiaNonce);
        _assertClass(query, QueryParams);
        const ret = wasm.client_request_nvidia(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
        return ret;
    }
    /**
     * Requests and parses a SEV-SNP attestation from the attestation server.
     *
     * ### Warning
     * This method exposes core functionality and does not perform cryptographic
     * or measurement checks on the attestation. If you want to perform end-to-end attestation
     * please refer to [`Self::attest_sev`]
     * @param {SevNonce} nonce
     * @param {QueryParams} query
     * @returns {Promise<ParsedAttestation>}
     */
    request_sev(nonce, query) {
        _assertClass(nonce, SevNonce);
        _assertClass(query, QueryParams);
        const ret = wasm.client_request_sev(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
        return ret;
    }
    /**
     * Requests and parses a TDX quote
     *
     * ### Warning
     * This method exposes core functionality and does not perform cryptographic
     * or measurement checks on the attestation. If you want to perform end-to-end attestation
     * please refer to [`Self::attest_tdx`]
     * @param {TdxNonce} nonce
     * @param {QueryParams} query
     * @returns {Promise<TdxQuote>}
     */
    request_tdx(nonce, query) {
        _assertClass(nonce, TdxNonce);
        _assertClass(query, QueryParams);
        const ret = wasm.client_request_tdx(this.__wbg_ptr, nonce.__wbg_ptr, query.__wbg_ptr);
        return ret;
    }
}
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
exports.Client = Client;

class ClientBuilder {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ClientBuilder.prototype);
        obj.__wbg_ptr = ptr;
        ClientBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ClientBuilderFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_clientbuilder_free(ptr, 0);
    }
    /**
     * @returns {Promise<Client>}
     */
    build() {
        const ptr = this.__destroy_into_raw();
        const ret = wasm.clientbuilder_build(ptr);
        return ret;
    }
    /**
     * @param {string} url
     */
    constructor(url) {
        const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.clientbuilder_new(ptr0, len0);
        this.__wbg_ptr = ret >>> 0;
        ClientBuilderFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * Sets `Authorization` header
     * @param {string} token
     * @returns {ClientBuilder}
     */
    with_authorization(token) {
        const ptr = this.__destroy_into_raw();
        const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.clientbuilder_with_authorization(ptr, ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return ClientBuilder.__wrap(ret[0]);
    }
    /**
     * Sets custom KDS for AMD collateral server
     * @param {Kds} kds
     * @returns {ClientBuilder}
     */
    with_kds(kds) {
        const ptr = this.__destroy_into_raw();
        _assertClass(kds, Kds);
        var ptr0 = kds.__destroy_into_raw();
        const ret = wasm.clientbuilder_with_kds(ptr, ptr0);
        return ClientBuilder.__wrap(ret);
    }
    /**
     * Sets custom PCS for Intel collateral server
     * @param {Pcs} pcs
     * @returns {ClientBuilder}
     */
    with_pcs(pcs) {
        const ptr = this.__destroy_into_raw();
        _assertClass(pcs, Pcs);
        var ptr0 = pcs.__destroy_into_raw();
        const ret = wasm.clientbuilder_with_pcs(ptr, ptr0);
        return ClientBuilder.__wrap(ret);
    }
    /**
     * sets custom url for OPA policies index
     * @param {string} url
     * @returns {ClientBuilder}
     */
    with_policies_url(url) {
        const ptr = this.__destroy_into_raw();
        const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.clientbuilder_with_policies_url(ptr, ptr0, len0);
        return ClientBuilder.__wrap(ret);
    }
}
if (Symbol.dispose) ClientBuilder.prototype[Symbol.dispose] = ClientBuilder.prototype.free;
exports.ClientBuilder = ClientBuilder;

class Collateral {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(Collateral.prototype);
        obj.__wbg_ptr = ptr;
        CollateralFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        CollateralFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_collateral_free(ptr, 0);
    }
}
if (Symbol.dispose) Collateral.prototype[Symbol.dispose] = Collateral.prototype.free;
exports.Collateral = Collateral;

/**
 * @enum {0 | 1}
 */
const CpuModule = Object.freeze({
    Sev: 0, "0": "Sev",
    Tdx: 1, "1": "Tdx",
});
exports.CpuModule = CpuModule;

class GatewayError {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(GatewayError.prototype);
        obj.__wbg_ptr = ptr;
        GatewayErrorFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        GatewayErrorFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_gatewayerror_free(ptr, 0);
    }
    /**
     * @returns {string}
     */
    get message() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.__wbg_get_gatewayerror_message(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
    /**
     * @param {string} arg0
     */
    set message(arg0) {
        const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.__wbg_set_gatewayerror_message(this.__wbg_ptr, ptr0, len0);
    }
}
if (Symbol.dispose) GatewayError.prototype[Symbol.dispose] = GatewayError.prototype.free;
exports.GatewayError = GatewayError;

/**
 * @enum {0}
 */
const GpuModule = Object.freeze({
    Nvidia: 0, "0": "Nvidia",
});
exports.GpuModule = GpuModule;

class Modules {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(Modules.prototype);
        obj.__wbg_ptr = ptr;
        ModulesFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ModulesFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_modules_free(ptr, 0);
    }
    /**
     * @returns {CpuModule}
     */
    cpu() {
        const ret = wasm.modules_cpu(this.__wbg_ptr);
        return ret;
    }
    /**
     * @returns {GpuModule | undefined}
     */
    gpu() {
        const ret = wasm.modules_gpu(this.__wbg_ptr);
        return ret === 1 ? undefined : ret;
    }
    /**
     * @returns {boolean}
     */
    has_gpu() {
        const ret = wasm.modules_has_gpu(this.__wbg_ptr);
        return ret !== 0;
    }
}
if (Symbol.dispose) Modules.prototype[Symbol.dispose] = Modules.prototype.free;
exports.Modules = Modules;

class NvidiaAttestResult {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(NvidiaAttestResult.prototype);
        obj.__wbg_ptr = ptr;
        NvidiaAttestResultFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        NvidiaAttestResultFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_nvidiaattestresult_free(ptr, 0);
    }
}
if (Symbol.dispose) NvidiaAttestResult.prototype[Symbol.dispose] = NvidiaAttestResult.prototype.free;
exports.NvidiaAttestResult = NvidiaAttestResult;

class Pcs {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        PcsFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_pcs_free(ptr, 0);
    }
    /**
     * @param {TdxQuote} quote
     * @returns {Promise<Collateral>}
     */
    fetch_collateral(quote) {
        _assertClass(quote, TdxQuote);
        const ret = wasm.pcs_fetch_collateral(this.__wbg_ptr, quote.__wbg_ptr);
        return ret;
    }
    /**
     * @param {string} base_url
     */
    constructor(base_url) {
        const ptr0 = passStringToWasm0(base_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.pcs_new(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        this.__wbg_ptr = ret[0] >>> 0;
        PcsFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) Pcs.prototype[Symbol.dispose] = Pcs.prototype.free;
exports.Pcs = Pcs;

/**
 * Generic per-request query parameters.
 *
 * The `nonce` key is reserved and will be rejected.
 */
class QueryParams {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(QueryParams.prototype);
        obj.__wbg_ptr = ptr;
        QueryParamsFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        QueryParamsFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_queryparams_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.queryparams_new();
        this.__wbg_ptr = ret >>> 0;
        QueryParamsFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * Appends a query parameter.
     *
     * Reserved keywords for specific queries will get overwritten
     * @param {string} key
     * @param {string} value
     * @returns {QueryParams}
     */
    with(key, value) {
        const ptr = this.__destroy_into_raw();
        const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len1 = WASM_VECTOR_LEN;
        const ret = wasm.queryparams_with(ptr, ptr0, len0, ptr1, len1);
        return QueryParams.__wrap(ret);
    }
}
if (Symbol.dispose) QueryParams.prototype[Symbol.dispose] = QueryParams.prototype.free;
exports.QueryParams = QueryParams;

class QuoteVerifier {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        QuoteVerifierFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_quoteverifier_free(ptr, 0);
    }
    /**
     * @param {Collateral} collateral
     * @param {TdxQuote} quote
     */
    constructor(collateral, quote) {
        _assertClass(collateral, Collateral);
        var ptr0 = collateral.__destroy_into_raw();
        _assertClass(quote, TdxQuote);
        var ptr1 = quote.__destroy_into_raw();
        const ret = wasm.quoteverifier_new(ptr0, ptr1);
        this.__wbg_ptr = ret >>> 0;
        QuoteVerifierFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {TdxNonce} nonce
     */
    verify(nonce) {
        _assertClass(nonce, TdxNonce);
        const ret = wasm.quoteverifier_verify(this.__wbg_ptr, nonce.__wbg_ptr);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
}
if (Symbol.dispose) QuoteVerifier.prototype[Symbol.dispose] = QuoteVerifier.prototype.free;
exports.QuoteVerifier = QuoteVerifier;

class ResponseHeaders {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ResponseHeaders.prototype);
        obj.__wbg_ptr = ptr;
        ResponseHeadersFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ResponseHeadersFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_responseheaders_free(ptr, 0);
    }
    /**
     * @param {string} name
     * @returns {string | undefined}
     */
    get(name) {
        const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.responseheaders_get(this.__wbg_ptr, ptr0, len0);
        let v2;
        if (ret[0] !== 0) {
            v2 = getStringFromWasm0(ret[0], ret[1]).slice();
            wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
        }
        return v2;
    }
    /**
     * @returns {string[]}
     */
    keys() {
        const ret = wasm.responseheaders_keys(this.__wbg_ptr);
        var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
        wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
        return v1;
    }
}
if (Symbol.dispose) ResponseHeaders.prototype[Symbol.dispose] = ResponseHeaders.prototype.free;
exports.ResponseHeaders = ResponseHeaders;

class TcbLevels {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        TcbLevelsFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_tcblevels_free(ptr, 0);
    }
}
if (Symbol.dispose) TcbLevels.prototype[Symbol.dispose] = TcbLevels.prototype.free;
exports.TcbLevels = TcbLevels;

class TdxNonce {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        TdxNonceFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_tdxnonce_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.tdxnonce_generate();
        this.__wbg_ptr = ret >>> 0;
        TdxNonceFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @returns {string}
     */
    to_hex() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.tdxnonce_to_hex(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
}
if (Symbol.dispose) TdxNonce.prototype[Symbol.dispose] = TdxNonce.prototype.free;
exports.TdxNonce = TdxNonce;

class TdxQuote {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(TdxQuote.prototype);
        obj.__wbg_ptr = ptr;
        TdxQuoteFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        TdxQuoteFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_tdxquote_free(ptr, 0);
    }
    /**
     * Attempts to parse a quote from DCAP bytes.
     * @param {Uint8Array} quote
     * @returns {TdxQuote}
     */
    static from_bytes(quote) {
        const ptr0 = passArray8ToWasm0(quote, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.tdxquote_from_bytes(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return TdxQuote.__wrap(ret[0]);
    }
}
if (Symbol.dispose) TdxQuote.prototype[Symbol.dispose] = TdxQuote.prototype.free;
exports.TdxQuote = TdxQuote;

class DecodedClaims {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(DecodedClaims.prototype);
        obj.__wbg_ptr = ptr;
        DecodedClaimsFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        DecodedClaimsFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_nvidia__decodedclaims_free(ptr, 0);
    }
}
if (Symbol.dispose) DecodedClaims.prototype[Symbol.dispose] = DecodedClaims.prototype.free;

class EATToken {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(EATToken.prototype);
        obj.__wbg_ptr = ptr;
        EATTokenFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        EATTokenFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_nvidia__eattoken_free(ptr, 0);
    }
    /**
     * @param {string} from
     * @returns {EATToken}
     */
    static parse(from) {
        const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.eattoken_parse(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return EATToken.__wrap(ret[0]);
    }
    /**
     * @param {KeyChain} keys
     * @param {NvidiaNonce} nonce
     * @returns {DecodedClaims}
     */
    verify(keys, nonce) {
        const ptr = this.__destroy_into_raw();
        _assertClass(keys, KeyChain);
        _assertClass(nonce, NvidiaNonce);
        const ret = wasm.eattoken_verify(ptr, keys.__wbg_ptr, nonce.__wbg_ptr);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return DecodedClaims.__wrap(ret[0]);
    }
}
if (Symbol.dispose) EATToken.prototype[Symbol.dispose] = EATToken.prototype.free;

class KeyChain {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(KeyChain.prototype);
        obj.__wbg_ptr = ptr;
        KeyChainFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        KeyChainFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_nvidia__keychain_free(ptr, 0);
    }
}
if (Symbol.dispose) KeyChain.prototype[Symbol.dispose] = KeyChain.prototype.free;

class NvidiaNonce {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(NvidiaNonce.prototype);
        obj.__wbg_ptr = ptr;
        NvidiaNonceFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        NvidiaNonceFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_nvidia__nvidianonce_free(ptr, 0);
    }
    /**
     * @returns {NvidiaNonce}
     */
    static generate() {
        const ret = wasm.nvidianonce_generate();
        return NvidiaNonce.__wrap(ret);
    }
    /**
     * @returns {string}
     */
    to_hex() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.nvidianonce_to_hex(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
}
if (Symbol.dispose) NvidiaNonce.prototype[Symbol.dispose] = NvidiaNonce.prototype.free;

/**
 * Same as [`KeyChain:fetch_keychain`], put in for better wasm compatibility
 * @returns {Promise<KeyChain>}
 */
function fetch_keychain() {
    const ret = wasm.nvidia__fetch_keychain();
    return ret;
}

const nvidia = {};
nvidia.DecodedClaims = DecodedClaims;
nvidia.EATToken = EATToken;
nvidia.KeyChain = KeyChain;
nvidia.NvidiaNonce = NvidiaNonce;
nvidia.fetch_keychain = fetch_keychain;
exports.nvidia = nvidia;

/**
 * A parsed certificate revocation list
 */
class CRL {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(CRL.prototype);
        obj.__wbg_ptr = ptr;
        CRLFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        CRLFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__crl_free(ptr, 0);
    }
    /**
     * Passes if the certificates are not in the certificate revocation list
     * Throws `AttestationError` on fail
     * @param {VerifiedChain} chain
     */
    check_chain(chain) {
        _assertClass(chain, VerifiedChain);
        const ret = wasm.crl_check_chain(this.__wbg_ptr, chain.__wbg_ptr);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
    /**
     * Parses a certificate revocation list from DER format binary data
     * @param {Uint8Array} list
     * @returns {CRL}
     */
    static from_der(list) {
        const ptr0 = passArray8ToWasm0(list, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.crl_from_der(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return CRL.__wrap(ret[0]);
    }
}
if (Symbol.dispose) CRL.prototype[Symbol.dispose] = CRL.prototype.free;

class ExportPem {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ExportPem.prototype);
        obj.__wbg_ptr = ptr;
        ExportPemFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ExportPemFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__exportpem_free(ptr, 0);
    }
    /**
     * @returns {Uint8Array}
     */
    get ark() {
        const ret = wasm.__wbg_get_sev__exportpem_ark(this.__wbg_ptr);
        var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
        wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
        return v1;
    }
    /**
     * @returns {Uint8Array}
     */
    get ask() {
        const ret = wasm.__wbg_get_sev__exportpem_ask(this.__wbg_ptr);
        var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
        wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
        return v1;
    }
    /**
     * @returns {Uint8Array}
     */
    get vek() {
        const ret = wasm.__wbg_get_sev__exportpem_vek(this.__wbg_ptr);
        var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
        wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
        return v1;
    }
    /**
     * @param {Uint8Array} arg0
     */
    set ark(arg0) {
        const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.__wbg_set_sev__exportpem_ark(this.__wbg_ptr, ptr0, len0);
    }
    /**
     * @param {Uint8Array} arg0
     */
    set ask(arg0) {
        const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.__wbg_set_sev__exportpem_ask(this.__wbg_ptr, ptr0, len0);
    }
    /**
     * @param {Uint8Array} arg0
     */
    set vek(arg0) {
        const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.__wbg_set_sev__exportpem_vek(this.__wbg_ptr, ptr0, len0);
    }
}
if (Symbol.dispose) ExportPem.prototype[Symbol.dispose] = ExportPem.prototype.free;

class Kds {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        KdsFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__kds_free(ptr, 0);
    }
    /**
     * @param {ParsedAttestation} attestation
     * @returns {Promise<VerifiedChain>}
     */
    fetch_certificates(attestation) {
        _assertClass(attestation, ParsedAttestation);
        const ret = wasm.kds_fetch_certificates(this.__wbg_ptr, attestation.__wbg_ptr);
        return ret;
    }
    /**
     * Fetches the certificate revocation list from AMD's KDS
     * @param {ParsedAttestation} attestation
     * @returns {Promise<CRL>}
     */
    fetch_crl(attestation) {
        _assertClass(attestation, ParsedAttestation);
        const ret = wasm.kds_fetch_crl(this.__wbg_ptr, attestation.__wbg_ptr);
        return ret;
    }
    /**
     * @param {string} cache_url
     */
    constructor(cache_url) {
        const ptr0 = passStringToWasm0(cache_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.kds_new(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        this.__wbg_ptr = ret[0] >>> 0;
        KdsFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) Kds.prototype[Symbol.dispose] = Kds.prototype.free;

/**
 * Represents a parsed attestation report with some already
 * parsed commonly accessed fields
 */
class ParsedAttestation {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ParsedAttestation.prototype);
        obj.__wbg_ptr = ptr;
        ParsedAttestationFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ParsedAttestationFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__parsedattestation_free(ptr, 0);
    }
    /**
     * @returns {number}
     */
    cpu_fam_id() {
        const ret = wasm.parsedattestation_cpu_fam_id(this.__wbg_ptr);
        return ret;
    }
    /**
     * @returns {number}
     */
    cpu_mod_id() {
        const ret = wasm.parsedattestation_cpu_mod_id(this.__wbg_ptr);
        return ret;
    }
    /**
     * Parses and constructs a new attestation report from a stream of binary data
     * @param {Uint8Array} bytes
     * @returns {ParsedAttestation}
     */
    static new(bytes) {
        const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.parsedattestation_new(ptr0, len0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return ParsedAttestation.__wrap(ret[0]);
    }
    /**
     * Verifies the attestation report against a certificate chain
     * @param {VerifiedChain} chain
     * @param {SevNonce} nonce
     */
    verify(chain, nonce) {
        _assertClass(chain, VerifiedChain);
        _assertClass(nonce, SevNonce);
        const ret = wasm.parsedattestation_verify(this.__wbg_ptr, chain.__wbg_ptr, nonce.__wbg_ptr);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
}
if (Symbol.dispose) ParsedAttestation.prototype[Symbol.dispose] = ParsedAttestation.prototype.free;

class SevNonce {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(SevNonce.prototype);
        obj.__wbg_ptr = ptr;
        SevNonceFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        SevNonceFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__sevnonce_free(ptr, 0);
    }
    /**
     * @returns {SevNonce}
     */
    static generate() {
        const ret = wasm.sevnonce_generate();
        return SevNonce.__wrap(ret);
    }
    /**
     * @returns {string}
     */
    to_hex() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.sevnonce_to_hex(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
}
if (Symbol.dispose) SevNonce.prototype[Symbol.dispose] = SevNonce.prototype.free;

/**
 * A chain which has been cryptographically verified
 */
class VerifiedChain {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(VerifiedChain.prototype);
        obj.__wbg_ptr = ptr;
        VerifiedChainFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        VerifiedChainFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sev__verifiedchain_free(ptr, 0);
    }
    /**
     * parses a triad of ark, ask and vek certificates in the PEM format,
     * cryptographically verifies the chain is valid, returns a `VerifiedChain` object
     * @param {string} ark_pem
     * @param {string} ask_pem
     * @param {string} vek_pem
     * @returns {VerifiedChain}
     */
    static parse_verify(ark_pem, ask_pem, vek_pem) {
        const ptr0 = passStringToWasm0(ark_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passStringToWasm0(ask_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len1 = WASM_VECTOR_LEN;
        const ptr2 = passStringToWasm0(vek_pem, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len2 = WASM_VECTOR_LEN;
        const ret = wasm.verifiedchain_parse_verify(ptr0, len0, ptr1, len1, ptr2, len2);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return VerifiedChain.__wrap(ret[0]);
    }
    /**
     * @returns {ExportPem}
     */
    to_pem() {
        const ret = wasm.verifiedchain_to_pem(this.__wbg_ptr);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return ExportPem.__wrap(ret[0]);
    }
}
if (Symbol.dispose) VerifiedChain.prototype[Symbol.dispose] = VerifiedChain.prototype.free;

const sev = {};
sev.CRL = CRL;
sev.ExportPem = ExportPem;
sev.Kds = Kds;
sev.ParsedAttestation = ParsedAttestation;
sev.SevNonce = SevNonce;
sev.VerifiedChain = VerifiedChain;
exports.sev = sev;

function __wbg_get_imports() {
    const import0 = {
        __proto__: null,
        __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
            const ret = debugString(arg1);
            const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
            const len1 = WASM_VECTOR_LEN;
            getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
            getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
        },
        __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
            const ret = typeof(arg0) === 'function';
            return ret;
        },
        __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
            const val = arg0;
            const ret = typeof(val) === 'object' && val !== null;
            return ret;
        },
        __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
            const ret = typeof(arg0) === 'string';
            return ret;
        },
        __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
            const ret = arg0 === undefined;
            return ret;
        },
        __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
            const obj = arg1;
            const ret = typeof(obj) === 'string' ? obj : undefined;
            var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
            var len1 = WASM_VECTOR_LEN;
            getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
            getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
        },
        __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
            throw new Error(getStringFromWasm0(arg0, arg1));
        },
        __wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
            arg0._wbg_cb_unref();
        },
        __wbg_abort_5ee4083ce26e0b01: function(arg0) {
            arg0.abort();
        },
        __wbg_abort_7a67cb8f9383baa1: function(arg0, arg1) {
            arg0.abort(arg1);
        },
        __wbg_append_c015600138ae60bb: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
            arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
        }, arguments); },
        __wbg_arrayBuffer_dae084a298aa5fe0: function() { return handleError(function (arg0) {
            const ret = arg0.arrayBuffer();
            return ret;
        }, arguments); },
        __wbg_attestresult_new: function(arg0) {
            const ret = AttestResult.__wrap(arg0);
            return ret;
        },
        __wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
            const ret = arg0.call(arg1);
            return ret;
        }, arguments); },
        __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
            const ret = arg0.call(arg1, arg2);
            return ret;
        }, arguments); },
        __wbg_clearTimeout_2256f1e7b94ef517: function(arg0) {
            const ret = clearTimeout(arg0);
            return ret;
        },
        __wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
            const ret = clearTimeout(arg0);
            return ret;
        },
        __wbg_client_new: function(arg0) {
            const ret = Client.__wrap(arg0);
            return ret;
        },
        __wbg_collateral_new: function(arg0) {
            const ret = Collateral.__wrap(arg0);
            return ret;
        },
        __wbg_crypto_48300657fced39f9: function(arg0) {
            const ret = arg0.crypto;
            return ret;
        },
        __wbg_done_547d467e97529006: function(arg0) {
            const ret = arg0.done;
            return ret;
        },
        __wbg_entries_69f235654ec4ccc6: function(arg0) {
            const ret = arg0.entries();
            return ret;
        },
        __wbg_fetch_1a731e18c5e21884: function(arg0, arg1) {
            const ret = arg0.fetch(arg1);
            return ret;
        },
        __wbg_fetch_43b2f110608a59ff: function(arg0) {
            const ret = fetch(arg0);
            return ret;
        },
        __wbg_fetch_9dad4fe911207b37: function(arg0) {
            const ret = fetch(arg0);
            return ret;
        },
        __wbg_gatewayerror_new: function(arg0) {
            const ret = GatewayError.__wrap(arg0);
            return ret;
        },
        __wbg_getRandomValues_263d0aa5464054ee: function() { return handleError(function (arg0, arg1) {
            arg0.getRandomValues(arg1);
        }, arguments); },
        __wbg_getRandomValues_76dfc69825c9c552: function() { return handleError(function (arg0, arg1) {
            globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
        }, arguments); },
        __wbg_getTime_f6ac312467f7cf09: function(arg0) {
            const ret = arg0.getTime();
            return ret;
        },
        __wbg_get_4848e350b40afc16: function(arg0, arg1) {
            const ret = arg0[arg1 >>> 0];
            return ret;
        },
        __wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
            const ret = Reflect.get(arg0, arg1);
            return ret;
        }, arguments); },
        __wbg_has_3ec5c22db2e5237a: function() { return handleError(function (arg0, arg1) {
            const ret = Reflect.has(arg0, arg1);
            return ret;
        }, arguments); },
        __wbg_headers_e08dcb5aa09b9a63: function(arg0) {
            const ret = arg0.headers;
            return ret;
        },
        __wbg_instanceof_Response_06795eab66cc4036: function(arg0) {
            let result;
            try {
                result = arg0 instanceof Response;
            } catch (_) {
                result = false;
            }
            const ret = result;
            return ret;
        },
        __wbg_isArray_db61795ad004c139: function(arg0) {
            const ret = Array.isArray(arg0);
            return ret;
        },
        __wbg_iterator_de403ef31815a3e6: function() {
            const ret = Symbol.iterator;
            return ret;
        },
        __wbg_length_0c32cb8543c8e4c8: function(arg0) {
            const ret = arg0.length;
            return ret;
        },
        __wbg_modules_new: function(arg0) {
            const ret = Modules.__wrap(arg0);
            return ret;
        },
        __wbg_msCrypto_8c6d45a75ef1d3da: function(arg0) {
            const ret = arg0.msCrypto;
            return ret;
        },
        __wbg_new_0_bfa2ef4bc447daa2: function() {
            const ret = new Date();
            return ret;
        },
        __wbg_new_3a112826a89cb962: function() { return handleError(function () {
            const ret = new Headers();
            return ret;
        }, arguments); },
        __wbg_new_4f9fafbb3909af72: function() {
            const ret = new Object();
            return ret;
        },
        __wbg_new_9abbf7148481485e: function() { return handleError(function () {
            const ret = new AbortController();
            return ret;
        }, arguments); },
        __wbg_new_a560378ea1240b14: function(arg0) {
            const ret = new Uint8Array(arg0);
            return ret;
        },
        __wbg_new_e3b04b4d53d1b593: function(arg0, arg1) {
            const ret = new Error(getStringFromWasm0(arg0, arg1));
            return ret;
        },
        __wbg_new_from_slice_2580ff33d0d10520: function(arg0, arg1) {
            const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
            return ret;
        },
        __wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
            try {
                var state0 = {a: arg0, b: arg1};
                var cb0 = (arg0, arg1) => {
                    const a = state0.a;
                    state0.a = 0;
                    try {
                        return wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(a, state0.b, arg0, arg1);
                    } finally {
                        state0.a = a;
                    }
                };
                const ret = new Promise(cb0);
                return ret;
            } finally {
                state0.a = 0;
            }
        },
        __wbg_new_with_length_9cedd08484b73942: function(arg0) {
            const ret = new Uint8Array(arg0 >>> 0);
            return ret;
        },
        __wbg_new_with_str_and_init_f663b6d334baa878: function() { return handleError(function (arg0, arg1, arg2) {
            const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
            return ret;
        }, arguments); },
        __wbg_next_01132ed6134b8ef5: function(arg0) {
            const ret = arg0.next;
            return ret;
        },
        __wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
            const ret = arg0.next();
            return ret;
        }, arguments); },
        __wbg_node_95beb7570492fd97: function(arg0) {
            const ret = arg0.node;
            return ret;
        },
        __wbg_nvidia__keychain_new: function(arg0) {
            const ret = KeyChain.__wrap(arg0);
            return ret;
        },
        __wbg_nvidiaattestresult_new: function(arg0) {
            const ret = NvidiaAttestResult.__wrap(arg0);
            return ret;
        },
        __wbg_process_b2fea42461d03994: function(arg0) {
            const ret = arg0.process;
            return ret;
        },
        __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
            Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
        },
        __wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
            const ret = arg0.queueMicrotask;
            return ret;
        },
        __wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
            queueMicrotask(arg0);
        },
        __wbg_randomFillSync_ca9f178fb14c88cb: function() { return handleError(function (arg0, arg1) {
            arg0.randomFillSync(arg1);
        }, arguments); },
        __wbg_require_7a9419e39d796c95: function() { return handleError(function () {
            const ret = module.require;
            return ret;
        }, arguments); },
        __wbg_resolve_0a79de24e9d2267b: function(arg0) {
            const ret = Promise.resolve(arg0);
            return ret;
        },
        __wbg_responseheaders_new: function(arg0) {
            const ret = ResponseHeaders.__wrap(arg0);
            return ret;
        },
        __wbg_setTimeout_b188b3bcc8977c7d: function(arg0, arg1) {
            const ret = setTimeout(arg0, arg1);
            return ret;
        },
        __wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
            const ret = setTimeout(arg0, arg1);
            return ret;
        },
        __wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
            const ret = Reflect.set(arg0, arg1, arg2);
            return ret;
        }, arguments); },
        __wbg_set_body_a304d09cb50cefbe: function(arg0, arg1) {
            arg0.body = arg1;
        },
        __wbg_set_cache_cc687e2b96e9608c: function(arg0, arg1) {
            arg0.cache = __wbindgen_enum_RequestCache[arg1];
        },
        __wbg_set_cause_5a9e15c02aba2509: function(arg0, arg1) {
            arg0.cause = arg1;
        },
        __wbg_set_credentials_7693e63055f5e838: function(arg0, arg1) {
            arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
        },
        __wbg_set_headers_6ab1105e542834e2: function(arg0, arg1) {
            arg0.headers = arg1;
        },
        __wbg_set_method_1971272fe557e972: function(arg0, arg1, arg2) {
            arg0.method = getStringFromWasm0(arg1, arg2);
        },
        __wbg_set_mode_d1b643087602281a: function(arg0, arg1) {
            arg0.mode = __wbindgen_enum_RequestMode[arg1];
        },
        __wbg_set_name_ab9c98596fd7310a: function(arg0, arg1, arg2) {
            arg0.name = getStringFromWasm0(arg1, arg2);
        },
        __wbg_set_signal_8564a226c5c6853c: function(arg0, arg1) {
            arg0.signal = arg1;
        },
        __wbg_sev__crl_new: function(arg0) {
            const ret = CRL.__wrap(arg0);
            return ret;
        },
        __wbg_sev__parsedattestation_new: function(arg0) {
            const ret = ParsedAttestation.__wrap(arg0);
            return ret;
        },
        __wbg_sev__verifiedchain_new: function(arg0) {
            const ret = VerifiedChain.__wrap(arg0);
            return ret;
        },
        __wbg_signal_9172c3282bfba2f5: function(arg0) {
            const ret = arg0.signal;
            return ret;
        },
        __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
            const ret = typeof globalThis === 'undefined' ? null : globalThis;
            return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
        },
        __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
            const ret = typeof global === 'undefined' ? null : global;
            return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
        },
        __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
            const ret = typeof self === 'undefined' ? null : self;
            return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
        },
        __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
            const ret = typeof window === 'undefined' ? null : window;
            return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
        },
        __wbg_status_44ecb0ac1da253f4: function(arg0) {
            const ret = arg0.status;
            return ret;
        },
        __wbg_stringify_a2c39d991e1bf91d: function() { return handleError(function (arg0) {
            const ret = JSON.stringify(arg0);
            return ret;
        }, arguments); },
        __wbg_subarray_0f98d3fb634508ad: function(arg0, arg1, arg2) {
            const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
            return ret;
        },
        __wbg_tdxquote_new: function(arg0) {
            const ret = TdxQuote.__wrap(arg0);
            return ret;
        },
        __wbg_text_43bdfba45e602cf9: function() { return handleError(function (arg0) {
            const ret = arg0.text();
            return ret;
        }, arguments); },
        __wbg_then_00eed3ac0b8e82cb: function(arg0, arg1, arg2) {
            const ret = arg0.then(arg1, arg2);
            return ret;
        },
        __wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
            const ret = arg0.then(arg1);
            return ret;
        },
        __wbg_url_95d8a83d33709572: function(arg0, arg1) {
            const ret = arg1.url;
            const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
            const len1 = WASM_VECTOR_LEN;
            getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
            getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
        },
        __wbg_value_7f6052747ccf940f: function(arg0) {
            const ret = arg0.value;
            return ret;
        },
        __wbg_versions_215a3ab1c9d5745a: function(arg0) {
            const ret = arg0.versions;
            return ret;
        },
        __wbindgen_cast_0000000000000001: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1943, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7);
            return ret;
        },
        __wbindgen_cast_0000000000000002: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1775, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c);
            return ret;
        },
        __wbindgen_cast_0000000000000003: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 885, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3);
            return ret;
        },
        __wbindgen_cast_0000000000000004: function(arg0, arg1) {
            // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
            const ret = getArrayU8FromWasm0(arg0, arg1);
            return ret;
        },
        __wbindgen_cast_0000000000000005: function(arg0, arg1) {
            // Cast intrinsic for `Ref(String) -> Externref`.
            const ret = getStringFromWasm0(arg0, arg1);
            return ret;
        },
        __wbindgen_cast_0000000000000006: function(arg0, arg1) {
            var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
            wasm.__wbindgen_free(arg0, arg1 * 4, 4);
            // Cast intrinsic for `Vector(NamedExternref("string")) -> Externref`.
            const ret = v0;
            return ret;
        },
        __wbindgen_init_externref_table: function() {
            const table = wasm.__wbindgen_externrefs;
            const offset = table.grow(4);
            table.set(0, undefined);
            table.set(offset + 0, undefined);
            table.set(offset + 1, null);
            table.set(offset + 2, true);
            table.set(offset + 3, false);
        },
    };
    return {
        __proto__: null,
        "./prem_rs_bg.js": import0,
    };
}

function wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c(arg0, arg1) {
    wasm.wasm_bindgen__convert__closures_____invoke__h88cd12797a81f64c(arg0, arg1);
}

function wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3(arg0, arg1) {
    wasm.wasm_bindgen__convert__closures_____invoke__h9c983d8434b53ce3(arg0, arg1);
}

function wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7(arg0, arg1, arg2) {
    const ret = wasm.wasm_bindgen__convert__closures_____invoke__hc791e2887154c2d7(arg0, arg1, arg2);
    if (ret[1]) {
        throw takeFromExternrefTable0(ret[0]);
    }
}

function wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(arg0, arg1, arg2, arg3) {
    wasm.wasm_bindgen__convert__closures_____invoke__h4ce58f9281138292(arg0, arg1, arg2, arg3);
}


const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];


const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];


const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
const AttestHeadersFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_attestheaders_free(ptr >>> 0, 1));
const AttestResultFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_attestresult_free(ptr >>> 0, 1));
const CRLFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__crl_free(ptr >>> 0, 1));
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
const ClientBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_clientbuilder_free(ptr >>> 0, 1));
const CollateralFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_collateral_free(ptr >>> 0, 1));
const DecodedClaimsFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_nvidia__decodedclaims_free(ptr >>> 0, 1));
const EATTokenFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_nvidia__eattoken_free(ptr >>> 0, 1));
const ExportPemFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__exportpem_free(ptr >>> 0, 1));
const GatewayErrorFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_gatewayerror_free(ptr >>> 0, 1));
const KdsFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__kds_free(ptr >>> 0, 1));
const KeyChainFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_nvidia__keychain_free(ptr >>> 0, 1));
const ModulesFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_modules_free(ptr >>> 0, 1));
const NvidiaAttestResultFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_nvidiaattestresult_free(ptr >>> 0, 1));
const NvidiaNonceFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_nvidia__nvidianonce_free(ptr >>> 0, 1));
const ParsedAttestationFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__parsedattestation_free(ptr >>> 0, 1));
const PcsFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_pcs_free(ptr >>> 0, 1));
const QueryParamsFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_queryparams_free(ptr >>> 0, 1));
const QuoteVerifierFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_quoteverifier_free(ptr >>> 0, 1));
const ResponseHeadersFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_responseheaders_free(ptr >>> 0, 1));
const SevNonceFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__sevnonce_free(ptr >>> 0, 1));
const TcbLevelsFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_tcblevels_free(ptr >>> 0, 1));
const TdxNonceFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_tdxnonce_free(ptr >>> 0, 1));
const TdxQuoteFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_tdxquote_free(ptr >>> 0, 1));
const VerifiedChainFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sev__verifiedchain_free(ptr >>> 0, 1));

function addToExternrefTable0(obj) {
    const idx = wasm.__externref_table_alloc();
    wasm.__wbindgen_externrefs.set(idx, obj);
    return idx;
}

function _assertClass(instance, klass) {
    if (!(instance instanceof klass)) {
        throw new Error(`expected instance of ${klass.name}`);
    }
}

const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));

function debugString(val) {
    // primitive types
    const type = typeof val;
    if (type == 'number' || type == 'boolean' || val == null) {
        return  `${val}`;
    }
    if (type == 'string') {
        return `"${val}"`;
    }
    if (type == 'symbol') {
        const description = val.description;
        if (description == null) {
            return 'Symbol';
        } else {
            return `Symbol(${description})`;
        }
    }
    if (type == 'function') {
        const name = val.name;
        if (typeof name == 'string' && name.length > 0) {
            return `Function(${name})`;
        } else {
            return 'Function';
        }
    }
    // objects
    if (Array.isArray(val)) {
        const length = val.length;
        let debug = '[';
        if (length > 0) {
            debug += debugString(val[0]);
        }
        for(let i = 1; i < length; i++) {
            debug += ', ' + debugString(val[i]);
        }
        debug += ']';
        return debug;
    }
    // Test for built-in
    const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
    let className;
    if (builtInMatches && builtInMatches.length > 1) {
        className = builtInMatches[1];
    } else {
        // Failed to match the standard '[object ClassName]'
        return toString.call(val);
    }
    if (className == 'Object') {
        // we're a user defined class or Object
        // JSON.stringify avoids problems with cycles, and is generally much
        // easier than looping through ownProperties of `val`.
        try {
            return 'Object(' + JSON.stringify(val) + ')';
        } catch (_) {
            return 'Object';
        }
    }
    // errors
    if (val instanceof Error) {
        return `${val.name}: ${val.message}\n${val.stack}`;
    }
    // TODO we could test for more things here, like `Set`s and `Map`s.
    return className;
}

function getArrayJsValueFromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    const mem = getDataViewMemory0();
    const result = [];
    for (let i = ptr; i < ptr + 4 * len; i += 4) {
        result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
    }
    wasm.__externref_drop_slice(ptr, len);
    return result;
}

function getArrayU8FromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}

let cachedDataViewMemory0 = null;
function getDataViewMemory0() {
    if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
        cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
    }
    return cachedDataViewMemory0;
}

function getStringFromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return decodeText(ptr, len);
}

let cachedUint8ArrayMemory0 = null;
function getUint8ArrayMemory0() {
    if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
        cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
    }
    return cachedUint8ArrayMemory0;
}

function handleError(f, args) {
    try {
        return f.apply(this, args);
    } catch (e) {
        const idx = addToExternrefTable0(e);
        wasm.__wbindgen_exn_store(idx);
    }
}

function isLikeNone(x) {
    return x === undefined || x === null;
}

function makeMutClosure(arg0, arg1, f) {
    const state = { a: arg0, b: arg1, cnt: 1 };
    const real = (...args) => {

        // First up with a closure we increment the internal reference
        // count. This ensures that the Rust closure environment won't
        // be deallocated while we're invoking it.
        state.cnt++;
        const a = state.a;
        state.a = 0;
        try {
            return f(a, state.b, ...args);
        } finally {
            state.a = a;
            real._wbg_cb_unref();
        }
    };
    real._wbg_cb_unref = () => {
        if (--state.cnt === 0) {
            wasm.__wbindgen_destroy_closure(state.a, state.b);
            state.a = 0;
            CLOSURE_DTORS.unregister(state);
        }
    };
    CLOSURE_DTORS.register(real, state, state);
    return real;
}

function passArray8ToWasm0(arg, malloc) {
    const ptr = malloc(arg.length * 1, 1) >>> 0;
    getUint8ArrayMemory0().set(arg, ptr / 1);
    WASM_VECTOR_LEN = arg.length;
    return ptr;
}

function passStringToWasm0(arg, malloc, realloc) {
    if (realloc === undefined) {
        const buf = cachedTextEncoder.encode(arg);
        const ptr = malloc(buf.length, 1) >>> 0;
        getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
        WASM_VECTOR_LEN = buf.length;
        return ptr;
    }

    let len = arg.length;
    let ptr = malloc(len, 1) >>> 0;

    const mem = getUint8ArrayMemory0();

    let offset = 0;

    for (; offset < len; offset++) {
        const code = arg.charCodeAt(offset);
        if (code > 0x7F) break;
        mem[ptr + offset] = code;
    }
    if (offset !== len) {
        if (offset !== 0) {
            arg = arg.slice(offset);
        }
        ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
        const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
        const ret = cachedTextEncoder.encodeInto(arg, view);

        offset += ret.written;
        ptr = realloc(ptr, len, offset, 1) >>> 0;
    }

    WASM_VECTOR_LEN = offset;
    return ptr;
}

function takeFromExternrefTable0(idx) {
    const value = wasm.__wbindgen_externrefs.get(idx);
    wasm.__externref_table_dealloc(idx);
    return value;
}

let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
function decodeText(ptr, len) {
    return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}

const cachedTextEncoder = new TextEncoder();

if (!('encodeInto' in cachedTextEncoder)) {
    cachedTextEncoder.encodeInto = function (arg, view) {
        const buf = cachedTextEncoder.encode(arg);
        view.set(buf);
        return {
            read: arg.length,
            written: buf.length
        };
    };
}

let WASM_VECTOR_LEN = 0;

const wasmPath = `${__dirname}/prem_rs_bg.wasm`;
const wasmBytes = require('fs').readFileSync(wasmPath);
const wasmModule = new WebAssembly.Module(wasmBytes);
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
wasm.__wbindgen_start();
