"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.srpcQueryMetadata = srpcQueryMetadata;
const SystemQueryParameterNames = new Set(['pv', '_v', 'appv', 'ts', 'nonce', 'aud', 'id', 'cid', 'signature', 'cap', 'supersede', '_supersede']);
/** Returns custom handshake metadata, excluding sRPC transport parameters. */
function srpcQueryMetadata(query) {
    const legacyMetadata = {};
    const metadata = {};
    for (const [key, value] of Object.entries(query)) {
        if (SystemQueryParameterNames.has(key))
            continue;
        if (key.startsWith('m--'))
            legacyMetadata[key.slice(3)] = value;
        else
            metadata[key] = value;
    }
    return { ...legacyMetadata, ...metadata };
}
//# sourceMappingURL=handshake.js.map