/**
* @module constants
*/
// ----- Build Flags -----
/**
* When true, the app is running against a local embedded server.
* Auth UI, shared projects, and server management are hidden.
* Controlled by the LOCAL_MODE environment variable on the server.
*/
export const LOCAL_MODE = typeof document !== 'undefined' && document.querySelector('meta[name="local-mode"]')?.content === 'true';
// ----- Waveform Constants -----
/** Canvas fill color for unplayed waveform regions outside the visible viewport. */
export const CTX_DIM_COLOR = '#222226'; // unplayed, outside viewport
/** Canvas fill color for unplayed waveform regions inside the visible viewport. */
export const CTX_LIT_COLOR = '#4a4a58'; // unplayed, inside viewport
/** Canvas fill color for played waveform regions outside the visible viewport (accent hue, low luminance). */
export const CTX_DIM_PLAYED = '#2a2d12'; // played, outside viewport (accent hue, low luminance)
/** Canvas fill color for played waveform regions inside the visible viewport (accent hue, mid luminance). */
export const CTX_LIT_PLAYED = '#5a6020'; // played, inside viewport (accent hue, mid luminance)
/** Minimum zoom multiplier (1× = fit entire track in visible width). */
export const MIN_ZOOM = 1; // 1× = fit entire track in visible width
/** Maximum zoom multiplier (acts as a floor — dynamic max may be higher for long files). */
export const MAX_ZOOM = 200; // maximum zoom multiplier
/** Minimum seconds visible at maximum zoom. Dynamic max zoom = duration / MIN_VISIBLE_SECS. */
export const MIN_VISIBLE_SECS = 2.5;
/** Number of waveform peaks extracted per second of audio. Kept constant across all file lengths
* so that any N-second window always has the same visual resolution regardless of total duration. */
export const PEAKS_PER_SECOND = 140;
// ----- Audio Constants ----- //
// Files larger than this skip the full in-memory decode and use chunked decoding instead.
// Decoding a 5-hour stereo MP3 at 44.1 kHz produces ~6 GB of raw float32 data.
export const LARGE_FILE_THRESHOLD_BYTES = 200 * 1024 * 1024; // 200 MB
// Extensions that the app supports, used as a fallback when the browser reports
// an empty or incorrect MIME type (common on Windows drag-and-drop for .flac and
// .m4a, and for .m4a files that some OS/browsers tag as "video/mp4").
export const SUPPORTED_AUDIO_EXTENSIONS = new Set(['.mp3', '.wav', '.flac', '.ogg', '.m4a', '.aac', '.webm', '.opus']);
// Size of each slice passed to decodeAudioData during chunked extraction.
// At 128 kbps this is ~250 seconds per chunk; decoded PCM peaks at ~44 MB.
export const CHUNK_SIZE_BYTES = 4 * 1024 * 1024; // 4 MB
// ----- Transcript Constants -----
/** Minimum gap in seconds between segments required to start a new paragraph. */
export const GAP_THRESHOLD = 1.0; // The minimum time between segments to be considered a new paragraph
// ----- Transcript Export Constants ----- //
export const SCRIPT_SPEAKER_INDENT = 14;
export const SCRIPT_DIALOGUE_INDENT = 2;
// ----- Speaker Constants -----