// public/publish.js if (window.__PUBLISH_JS_RUNNING__) { console.warn('publish.js ya estaba corriendo, ignorando segunda carga.'); } else { window.__PUBLISH_JS_RUNNING__ = true; const ownerId = new URLSearchParams(location.search).get('ownerId'); if (!ownerId) throw new Error('ownerId requerido'); const MS = window.mediasoupClient; if (!MS?.Device) throw new Error('window.mediasoupClient.Device no existe. Revisa el bundle.'); const $ = (id) => document.getElementById(id); const overlay = $('overlay'); const videoEl = $('localVideo'); const micBtn = $('micBtn'); const camBtn = $('camBtn'); const configBtn = $('configBtn'); const controlsOverlay = $('controlsOverlay'); const controlsPanel = $('controlsPanel'); const closeCfg = $('closeCfg'); const videoSelect = $('videoSelect'); const audioSelect = $('audioSelect'); if (!videoEl) throw new Error("Falta