export type Scenario =
  | 'default'
  | 'slow'
  | 'loading'
  | 'empty'
  | 'error'
  // upload-only (the multipart POST is hand-written XHR, so it bypasses the HTTP
  // interceptor — these are simulated in upload.adapter.ts instead):
  | 'upload-slow'
  | 'upload-fail';

const VALID: Scenario[] = ['default', 'slow', 'loading', 'empty', 'error', 'upload-slow', 'upload-fail'];

/** Reads ?scenario= from the URL so a demo can force each async state. */
export function currentScenario(): Scenario {
  const s = new URLSearchParams(window.location.search).get('scenario') as Scenario | null;
  return s && VALID.includes(s) ? s : 'default';
}
