// noop 替代 @snazzah/davey — DAVE 协议原生绑定的空实现
// 当 daveEncryption 被禁用时，@discordjs/voice 不会实际创建 DAVESession，
// 但它仍然会在顶层 require("@snazzah/davey")，所以需要导出兼容的接口。

const Codec = Object.freeze({});
const MediaType = Object.freeze({});
const SessionStatus = Object.freeze({});
const ProposalsOperationType = Object.freeze({});

const DAVE_PROTOCOL_VERSION = 0;
const VERSION = "0.0.0-noop";
const DEBUG_BUILD = false;

function generateKeyFingerprint() {
  return "";
}
function generatePairwiseFingerprint() {
  return "";
}
function generateDisplayableCode() {
  return "";
}
function generateP256Keypair() {
  return { publicKey: Buffer.alloc(0), privateKey: Buffer.alloc(0) };
}

class DAVESession {
  constructor() {
    throw new Error(
      "@snazzah/davey has been replaced by a noop package. Set daveEncryption: false in your config.",
    );
  }
}

const DaveSession = DAVESession;

module.exports = {
  Codec,
  MediaType,
  SessionStatus,
  ProposalsOperationType,
  DAVE_PROTOCOL_VERSION,
  VERSION,
  DEBUG_BUILD,
  generateKeyFingerprint,
  generatePairwiseFingerprint,
  generateDisplayableCode,
  generateP256Keypair,
  DAVESession,
  DaveSession,
};
