import {
html, useState, useEffect, useReducer, useRef, useCallback,
} from './vendor/htm-preact.js';
import { queueReducer, emptyQueue } from './queue-ops.js';
import { t } from './i18n.js';
import { Icon } from './icon.js';
import { useStickyBand } from './sticky.js';
import { CHUNK_SIZE, pipelinedDownload } from './file-utils.js';
/**
* The Music app's persistent player bar (docs/MESHBAY_DESIGN.md §9.8).
*
* Owned and rendered by app.js — the router's parent — so playback survives
* navigating between groups, search, and other pages. Both group-page.js
* and search-page.js trigger playback by calling `onPlayQueue(tracks,
* startIndex)`, which flows up to app.js.
*
* Each track carries a `groupId`; the player calls `getConnection(groupId)`
* per track to obtain the right transport — a pool-based lazy connection
* that transparently handles single-group and cross-group queues.
*
* No streaming, no MSE, no node-side transcode pool for the common case: a
* track is a few megabytes, so it is downloaded and decrypted once through
* the same chunk pipeline Files already uses (file-utils.js's
* pipelinedDownload), then played from a blob URL — the deliberate
* simplification recorded in docs/MESHBAY_DESIGN.md §9.8. WMA and Musepack are
* the one exception (`NEEDS_TRANSCODE_RE` below): neither decodes in a
* browser's