// @ts-check
/* profile-data.jsx — Brewly mock data for the Profile feature.
   Exports to window. */

const ME = {
  name: 'Ria',
  handle: '@steeped.in.drama',
  avatar: 'assets/avatars/av1.png',
  bio: "professional overthinker · spilling tea responsibly · she/her · brewing since '24",
  joined: 'Mar 2024',
  stats: { brews: 27, paps: 1284, stakeout: 312 },
  verifiedPseudonym: true,
};

/* a "Brew" = a post. kind: 'tea' (Kettle, unverified) | 'take' (commentary on The Wire) */
const BREWS = [
  {
    id: 'b1', kind: 'tea', time: '2h',
    body: "campus wifi died during finals week and suddenly everyone's a hardcover-book person again 📚 character development fr",
    image: 'assets/posts/img-wifi.png',
    sips: 1840, splash: 212, whispers: 9,
    takes: [
      { by: '@oat_milk_oracle', av: 'assets/avatars/av2.png', t: '1h', text: 'the library being full for the first time in human history', image: 'assets/posts/img-library.png', sips: 88 },
      { by: '@decaf_dragon', av: 'assets/avatars/av4.png', t: '54m', text: 'i read an entire chapter. ONE. and i feel like a victorian scholar', sips: 142 },
      { by: '@chai_minded', av: 'assets/avatars/av3.png', t: '32m', text: 'not me hotspotting the whole floor like a hero 🦸', sips: 60 },
    ],
  },
  {
    id: 'b2', kind: 'take', time: '6h', wire: 'TechWire · foldable phone recall', wireUrl: 'thewire.brewly.app/foldable-recall',
    body: "they shipped a foldable that folds the wrong way and called it 'a bold new gesture'. babe that's a defect with a marketing budget",
    image: 'assets/posts/img-foldable.png',
    sips: 3120, splash: 540, whispers: 24,
    takes: [
      { by: '@espresso_yourself', av: 'assets/avatars/av5.png', t: '5h', text: 'bold new gesture = falling apart in your pocket', sips: 301 },
      { by: '@brewhaha', av: 'assets/avatars/av6.png', t: '4h', text: 'the linked article is even worse than the headline, go read it', sips: 77 },
    ],
  },
  {
    id: 'b3', kind: 'tea', time: '1d',
    body: "petition to make 'i'll circle back' a federal offense. you will NOT circle back. we both know this.",
    sips: 920, splash: 88, whispers: 3,
    takes: [
      { by: '@latteludite', av: 'assets/avatars/av3.png', t: '22h', text: 'circling back is just ghosting with a calendar invite', sips: 210 },
    ],
  },
  {
    id: 'b4', kind: 'take', time: '1d', wire: 'GreenWire · ocean cleanup hits target', wireUrl: 'thewire.brewly.app/ocean-cleanup',
    body: "ok the ocean cleanup numbers are actually hopeful for once?? logging off before the next headline ruins it. let me have this",
    image: 'assets/posts/img-ocean.png',
    sips: 2050, splash: 410, whispers: 12,
    takes: [
      { by: '@chai_minded', av: 'assets/avatars/av3.png', t: '20h', text: 'a non-doom day on the wire, framing it', sips: 188 },
      { by: '@oat_milk_oracle', av: 'assets/avatars/av2.png', t: '18h', text: 'source actually checks out, i clicked through 🫡', sips: 96 },
    ],
  },
  {
    id: 'b5', kind: 'tea', time: '2d',
    body: "found out about my situationship's hard launch from the Kettle BEFORE the Wire. the tea was faster than the news. priorities 💀",
    image: 'assets/posts/img-launch.png',
    sips: 4400, splash: 980, whispers: 61,
    takes: [
      { by: '@frothing', av: 'assets/avatars/av6.png', t: '2d', text: 'the kettle stays undefeated', sips: 540 },
      { by: '@decaf_dragon', av: 'assets/avatars/av4.png', t: '2d', text: 'breaking news desk could never', sips: 322 },
      { by: '@espresso_yourself', av: 'assets/avatars/av5.png', t: '1d', text: 'sending you a Whisper, hang in there 🫂', sips: 71 },
    ],
  },
  {
    id: 'b6', kind: 'take', time: '3d', wire: 'SportsWire · 9-seed makes the final',
    body: "underdog energy is unmatched this year and i WILL be insufferable about it. screenshot this brew for the parade",
    sips: 1610, splash: 233, whispers: 7,
    takes: [
      { by: '@brewhaha', av: 'assets/avatars/av6.png', t: '3d', text: 'saved. see you at the parade 🏆', sips: 119 },
    ],
  },
  {
    id: 'b7', kind: 'tea', time: '4d',
    body: "started journaling to romanticize my life. day 1: forgot. day 2: see day 1. day 3: this brew counts right",
    sips: 760, splash: 54, whispers: 2,
    takes: [
      { by: '@latteludite', av: 'assets/avatars/av3.png', t: '4d', text: 'this is the journal now. congrats', sips: 88 },
    ],
  },
  {
    id: 'b8', kind: 'take', time: '5d', wire: 'CultureWire · surprise album drop', wireUrl: 'thewire.brewly.app/surprise-drop',
    body: "new album is 11 tracks of him being mildly inconvenienced and honestly? deeply relatable. 4 stars, would sulk again",
    image: 'assets/posts/img-album.png',
    sips: 2890, splash: 470, whispers: 19,
    takes: [
      { by: '@oat_milk_oracle', av: 'assets/avatars/av2.png', t: '5d', text: 'track 7 is just a man sighing for 3 minutes and i cried', sips: 402 },
      { by: '@chai_minded', av: 'assets/avatars/av3.png', t: '5d', text: 'mildly inconvenienced core, my whole personality', sips: 150 },
    ],
  },
];

const DELETE_REASONS = [
  { id: 'break', label: 'Just taking a break', emoji: '😮‍💨' },
  { id: 'time', label: 'Spending too much time here', emoji: '⏳' },
  { id: 'tea', label: 'Too much drama in the Kettle', emoji: '🫖' },
  { id: 'privacy', label: 'Privacy concerns', emoji: '🔒' },
  { id: 'dupe', label: 'I have another account', emoji: '👯' },
  { id: 'bored', label: 'Not for me anymore', emoji: '🥱' },
  { id: 'other', label: 'Something else', emoji: '✍️' },
];

const NOTIF_DEFAULTS = [
  { id: 'sips', label: 'Sips on your Brews', sub: 'when someone likes your post', on: true },
  { id: 'takes', label: 'New Takes', sub: 'comments on your Brews', on: true },
  { id: 'splash', label: 'Splashes', sub: 'when your Brew gets reposted', on: true },
  { id: 'paps', label: 'New Paps', sub: 'when someone follows you', on: true },
  { id: 'whispers', label: 'Whispers', sub: 'direct messages', on: true },
  { id: 'claw', label: 'Claw Bot replies', sub: 'disclosed AI accounts', on: false },
  { id: 'wire', label: 'The Wire — breaking', sub: 'verified news alerts', on: true },
  { id: 'kettle', label: 'The Kettle — trending', sub: 'hot unverified tea', on: false },
];

function fmtN(n) {
  if (n >= 1000000) return (n / 1000000).toFixed(1).replace(/\.0$/, '') + 'M';
  if (n >= 1000) return (n / 1000).toFixed(1).replace(/\.0$/, '') + 'k';
  return String(n);
}

Object.assign(window, { ME, BREWS, DELETE_REASONS, NOTIF_DEFAULTS, fmtN });
