// data.jsx — mock content for "hire a human"
// Exposed on window for other babel scripts.

const CATEGORIES = [
  { id: "errands",   label: "Delivery & errands",   icon: "box" },
  { id: "fieldwork", label: "Research & fieldwork",  icon: "search" },
  { id: "marketing", label: "Marketing campaigns",   icon: "mega" },
  { id: "media",     label: "Creative & media",      icon: "camera" },
  { id: "events",    label: "Events & social",       icon: "ticket" },
  { id: "home",      label: "Home & personal",       icon: "home" },
  { id: "reviews",   label: "Reviews & UGC",         icon: "star" },
];

const CAT = Object.fromEntries(CATEGORIES.map((c) => [c.id, c]));

// avatar palette — deterministic colored initials
const AV = [
  ["#DC4B2E", "#fff"], ["#1F7A55", "#fff"], ["#3B5BDB", "#fff"],
  ["#B5179E", "#fff"], ["#E8A33D", "#2a2010"], ["#0E7C86", "#fff"],
  ["#6C4AB6", "#fff"], ["#C2410C", "#fff"],
];
function avatarFor(name) {
  let h = 0;
  for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) >>> 0;
  const [bg, fg] = AV[h % AV.length];
  const parts = name.replace(/[^A-Za-z ]/g, "").trim().split(/\s+/);
  const initials = (parts[0]?.[0] || "?") + (parts[1]?.[0] || "");
  return { bg, fg, initials: initials.toUpperCase() };
}

const PEOPLE = {
  meera:   { name: "Meera Iyer",      handle: "@meera",     city: "Hyderabad",   verified: true,  rating: 4.9, jobs: 212, strikes: 0, banned: false, bio: "Detail-obsessed and quick to respond. I run errands, scout stores, and cover events across Hyderabad.", skills: ["Field research", "Photography", "Event coverage", "Mystery shopping"], availabilityDays: ["weekday", "weekend", "afternoon"], availabilityHours: "20-40", travelRadius: "city", vehicle: "car" },
  arjun:   { name: "Arjun Rao",       handle: "@arjunr",    city: "Bangalore",   verified: true,  rating: 4.8, jobs: 88,  strikes: 0, banned: false, bio: "Reliable and on-time. Great with deliveries, store checks, and anything that needs a steady pair of hands.", skills: ["Driving", "Deliveries", "Store checks", "Heavy lifting"], availabilityDays: ["weekday", "evening"], availabilityHours: "10-20", travelRadius: "15", vehicle: "bike" },
  priya:   { name: "Priya Nair",      handle: "@priyan",    city: "Mumbai",      verified: false, rating: 4.7, jobs: 31, strikes: 0, banned: false },
  dev:     { name: "Dev Sharma",      handle: "@devs",      city: "Hyderabad",   verified: true,  rating: 5.0, jobs: 140, strikes: 0, banned: false },
  lena:    { name: "Lena Cruz",       handle: "@lenac",     city: "Los Angeles", verified: true,  rating: 4.9, jobs: 305, strikes: 0, banned: false },
  marcus:  { name: "Marcus Bell",     handle: "@mbell",     city: "San Francisco", verified: true, rating: 4.8, jobs: 176, strikes: 0, banned: false },
  sana:    { name: "Sana Q.",         handle: "@sanaq",     city: "Remote",      verified: false, rating: 4.6, jobs: 12, strikes: 0, banned: false },
  tomi:    { name: "Tomi Adeyemi",    handle: "@tomi",      city: "New York",    verified: true,  rating: 4.9, jobs: 64, strikes: 0, banned: false },
  __me:    { name: "You",             handle: "@you",       city: "Hyderabad",   verified: true,  rating: 4.9, jobs: 7, strikes: 0, banned: false },
};

// the signed-in user (for dashboard)
const ME = {
  name: "You", handle: "@you", city: "Hyderabad", verified: true, rating: 4.9, jobs: 7, strikes: 0, banned: false,
  phone: "+91 90000 00000",
  bio: "Friendly and reliable — happy to help with errands, photos, and quick local tasks.",
  skills: ["Photography", "Driving", "Quick errands"],
  availabilityDays: ["weekend", "evening"], availabilityHours: "10-20",
  travelRadius: "15", vehicle: "bike", avatarUrl: null,
};

let _id = 0;
const uid = () => "t" + (++_id);

// ── deadline helpers ─────────────────────────────────────────
const inDays = (days, hour = 18) => {
  const x = new Date();
  x.setDate(x.getDate() + days);
  x.setHours(hour, 0, 0, 0);
  return x.toISOString();
};

// true when a task's deadline has already passed
function isTaskExpired(task) {
  return !!(task && task.deadline && new Date(task.deadline).getTime() < Date.now());
}

// turn an ISO deadline into display info (relative + absolute + urgency)
function deadlineInfo(iso) {
  if (!iso) return null;
  const due = new Date(iso);
  if (isNaN(due.getTime())) return null;
  const diff = due.getTime() - Date.now();
  const overdue = diff < 0;
  const abs = Math.abs(diff);
  const mins = Math.round(abs / 60000);
  const hrs = Math.floor(abs / 3600000);
  const days = Math.floor(abs / 86400000);
  const rel = mins < 60 ? `${Math.max(mins, 1)}m` : hrs < 24 ? `${hrs}h` : `${days}d`;
  const sameYear = due.getFullYear() === new Date().getFullYear();
  const label = due.toLocaleString("en-US", { month: "short", day: "numeric", hour: "numeric", minute: "2-digit", ...(sameYear ? {} : { year: "numeric" }) });
  return {
    iso, due, overdue, rel, label,
    soon: !overdue && abs < 24 * 3600000,            // due within a day
    text: overdue ? `Overdue by ${rel}` : `Due ${label} · ${rel} left`,
    short: overdue ? "Overdue" : `${rel} left`,
  };
}

// status: open | applied (by me) | filled
const TASKS = [
  {
    id: uid(), cat: "fieldwork", poster: "meera",
    title: "Check iPad Pro availability at the Apple Store",
    city: "Hyderabad", remote: false,
    pay: { kind: "fixed", amount: 600, cur: "₹" },
    posted: "2h", applicants: 4, urgent: true,
    blurb: "Drop by the Apple Store at Sarath City Mall and check if the latest 13\" iPad Pro (M-series) is in stock.",
    details: [
      "Photograph the display models — front and the spec/price card.",
      "Note exact in-store pricing for the 256GB and 512GB.",
      "Ask staff about delivery timeline if it's out of stock.",
    ],
    proof: "Photos of the display + price cards, and a one-line stock summary.",
  },
  {
    id: uid(), cat: "marketing", poster: "arjun",
    title: "Hold a startup sign near the metro for 30 minutes",
    city: "Bangalore", remote: false,
    pay: { kind: "fixed", amount: 1200, cur: "₹" },
    posted: "5h", applicants: 9, urgent: false,
    blurb: "Stand near MG Road metro exit during evening rush and hold our branded sign. We'll courier the sign to you.",
    details: [
      "30 minutes between 6–8pm on a weekday.",
      "Record a 30-second clip of foot traffic passing the sign.",
      "Smile, be visible, don't block the walkway.",
    ],
    proof: "A 30-second video + 3 timestamped photos.",
  },
  {
    id: uid(), cat: "errands", poster: "priya",
    title: "Pick up a birthday gift and deliver it across town",
    city: "Mumbai", remote: false,
    pay: { kind: "fixed", amount: 450, cur: "₹" },
    posted: "1h", applicants: 2, urgent: true,
    blurb: "Collect a wrapped gift from a shop in Bandra and hand-deliver it to an address in Lower Parel by 6pm today.",
    details: [
      "Pickup: Le Cadeau, Linking Road (paid for already).",
      "Keep it flat — there's a cake involved.",
      "Text the recipient 10 minutes before arrival.",
    ],
    proof: "Photo of handover + delivery confirmation.",
  },
  {
    id: uid(), cat: "events", poster: "dev",
    title: "Attend a startup meetup and summarize the announcements",
    city: "Hyderabad", remote: false,
    pay: { kind: "fixed", amount: 800, cur: "₹" },
    posted: "1d", applicants: 6, urgent: false,
    blurb: "Go to the T-Hub founders meetup Thursday evening, take notes, collect brochures, and write up the key announcements.",
    details: [
      "Photograph the slides for each speaker.",
      "Collect any printed brochures / flyers.",
      "Send a 1-page summary of announcements within 24h.",
    ],
    proof: "Photos + a 1-page written summary.",
  },
  {
    id: uid(), cat: "reviews", poster: "meera",
    title: "Visit a restaurant, take authentic photos & post a review",
    city: "Hyderabad", remote: false,
    pay: { kind: "fixed", amount: 350, cur: "₹" },
    posted: "3h", applicants: 5, urgent: false,
    blurb: "Eat at our new café in Jubilee Hills, shoot a few honest photos, and post a genuine review on Google + Instagram.",
    details: [
      "Order at least one main + a drink (reimbursed up to ₹500).",
      "Take 4–6 well-lit photos of the food and space.",
      "Only post if you genuinely had a good time.",
    ],
    proof: "Links to your posted review + the photos.",
  },
  {
    id: uid(), cat: "home", poster: "lena",
    title: "Walk my dog for a week while I'm travelling",
    city: "Los Angeles", remote: false,
    pay: { kind: "fixed", amount: 175, cur: "$" },
    posted: "6h", applicants: 11, urgent: false,
    blurb: "Friendly golden retriever, two 30-minute walks a day for 7 days. Keys handed over in person beforehand.",
    details: [
      "Morning (8am) and evening (6pm) walks.",
      "Fresh water + a quick play in the yard.",
      "Send one photo per walk so I know he's happy.",
    ],
    proof: "Daily photos during each walk.",
  },
  {
    id: uid(), cat: "media", poster: "marcus",
    title: "Film a 60-second product review video",
    city: "Remote", remote: true,
    pay: { kind: "fixed", amount: 150, cur: "$" },
    posted: "8h", applicants: 7, urgent: false,
    blurb: "We'll ship you our gadget. Film an honest, well-lit 60-second review on your phone — vertical, good audio.",
    details: [
      "Vertical 9:16, natural light, clear audio.",
      "Hit 3 talking points we'll provide.",
      "Raw clip + one usable take is fine.",
    ],
    proof: "The final 60-second video file.",
  },
  {
    id: uid(), cat: "fieldwork", poster: "marcus",
    title: "Test 5 coffee shops and write short reviews",
    city: "San Francisco", remote: false,
    pay: { kind: "fixed", amount: 200, cur: "$" },
    posted: "1d", applicants: 8, urgent: false,
    blurb: "Visit 5 specialty coffee shops in the Mission, order a flat white at each, and write a 3-sentence review of each.",
    details: [
      "Drinks reimbursed on top of the fee.",
      "Note wait time, vibe, and quality.",
      "One photo per shop.",
    ],
    proof: "5 mini-reviews + photos.",
  },
  // favor / free tasks
  {
    id: uid(), cat: "home", poster: "sana",
    title: "Water my plants while I'm away for the weekend",
    city: "Hyderabad", remote: false,
    pay: { kind: "favor", note: "Coffee's on me ☕" },
    posted: "4h", applicants: 1, urgent: false,
    blurb: "Six potted plants on the balcony. Just need someone trustworthy to pop in twice over the weekend.",
    details: [
      "Sat + Sun, any time of day.",
      "Watering can and key location shared on accept.",
      "Neighbour can vouch for entry.",
    ],
    proof: "A quick text that they've been watered.",
  },
  {
    id: uid(), cat: "home", poster: "tomi",
    title: "Help me carry a couch up two flights of stairs",
    city: "New York", remote: false,
    pay: { kind: "favor", note: "Pizza + drinks 🍕" },
    posted: "30m", applicants: 3, urgent: true,
    blurb: "Just bought a couch off Marketplace, need one strong pair of hands for 20 minutes this evening. No stairs experience required, just grit.",
    details: [
      "Tonight around 7pm, Bushwick.",
      "Takes ~20 minutes with two people.",
      "Pizza and a cold one after, obviously.",
    ],
    proof: "None — just show up.",
  },
];

// give a few demo tasks a deadline so the timing UI is visible
TASKS[0].deadline = inDays(1, 18);   // iPad stock check — tomorrow 6pm
TASKS[2].deadline = inDays(0, 18);   // gift delivery — today 6pm
TASKS[3].deadline = inDays(2, 19);   // meetup summary — in 2 days
TASKS[9].deadline = inDays(0, 20);   // couch — tonight 8pm

// Verification state for current user
const MY_VERIFICATION = {
  phone: { status: "unverified", value: "" },
  email: { status: "unverified", value: "" },
  govId: { status: "unverified", type: "", file: null },
  selfie: { status: "unverified", file: null },
  address: { status: "unverified", file: null },
};

// Mock admin data — pending verifications
const ADMIN_VERIFICATIONS = [
  { id: "v1", user: "priya", name: "Priya Nair", handle: "@priyan", city: "Mumbai", submitted: "2h ago", status: "pending", docType: "Aadhaar Card", docId: "XXXX-XXXX-3847", aadhaarName: "Priya Nair", aadhaarLast4: "3847", upiId: "priya.n@okicici", hasSelfie: true, hasVideo: true, hasAddress: true, email: "priya.nair@gmail.com", phone: "+91 98765 43210" },
  { id: "v2", user: "sana", name: "Sana Q.", handle: "@sanaq", city: "Remote", submitted: "5h ago", status: "pending", docType: "PAN Card", docId: "BQPS8721K", aadhaarName: "Sana Quereshi", aadhaarLast4: "8721", upiId: "sana.q@paytm", hasSelfie: true, hasVideo: false, hasAddress: false, email: "sana.q@outlook.com", phone: "+91 87654 32109" },
  { id: "v3", user: "arjun", name: "Arjun Rao", handle: "@arjunr", city: "Bangalore", submitted: "1d ago", status: "approved", docType: "Aadhaar Card", docId: "XXXX-XXXX-9012", aadhaarName: "Arjun Rao", aadhaarLast4: "9012", upiId: "arjun.r@oksbi", hasSelfie: true, hasVideo: true, hasAddress: true, email: "arjun.rao@gmail.com", phone: "+91 99887 76655" },
  { id: "v4", user: "tomi", name: "Tomi Adeyemi", handle: "@tomi", city: "New York", submitted: "1d ago", status: "approved", docType: "Passport", docId: "A12345678", aadhaarName: "Tomi Adeyemi", aadhaarLast4: "5678", upiId: "tomi.a@okaxis", hasSelfie: true, hasVideo: true, hasAddress: true, email: "tomi.a@gmail.com", phone: "+1 212 555 0147" },
  { id: "v5", user: "marcus", name: "Marcus Bell", handle: "@mbell", city: "San Francisco", submitted: "3d ago", status: "rejected", docType: "Driver License", docId: "D1234567", aadhaarName: "Marcus J. Bell", aadhaarLast4: "4567", upiId: "mbell@okhdfc", hasSelfie: true, hasVideo: true, hasAddress: true, email: "mbell@gmail.com", phone: "+1 415 555 0198", rejectReason: "ID photo blurry — please resubmit" },
];

// Mock admin data — transactions
const ADMIN_TRANSACTIONS = [
  { id: "TXN-20260601", taskTitle: "Check iPad Pro availability at the Apple Store", buyer: "Meera Iyer", seller: "Dev Sharma", amount: 600, cur: "₹", method: "UPI", date: "Jun 1, 2026", status: "completed",
    payerAccount: "meera@okaxis", payeeAccount: "dev.sharma@upi", platformFee: 30, netToSeller: 570,
    reason: null,
    timeline: [
      { time: "Jun 1, 10:14am", event: "Payment initiated", detail: "Buyer paid ₹600 via UPI (meera@okaxis)" },
      { time: "Jun 1, 10:14am", event: "Funds held in escrow", detail: "Amount held securely until task completion" },
      { time: "Jun 1, 3:42pm", event: "Task marked complete", detail: "Seller submitted proof: photos of display + price cards" },
      { time: "Jun 1, 4:01pm", event: "Buyer confirmed", detail: "Buyer approved the deliverables" },
      { time: "Jun 1, 4:01pm", event: "Funds released to seller", detail: "₹570 released to dev.sharma@upi (₹30 platform fee)" },
    ]},
  { id: "TXN-20260602", taskTitle: "Hold a startup sign near the metro for 30 minutes", buyer: "Arjun Rao", seller: "Priya Nair", amount: 1200, cur: "₹", method: "Bank Transfer", date: "Jun 2, 2026", status: "completed",
    payerAccount: "HDFC ••7823", payeeAccount: "SBI ••4510", platformFee: 60, netToSeller: 1140,
    reason: null,
    timeline: [
      { time: "Jun 2, 9:00am", event: "Payment initiated", detail: "Buyer paid ₹1,200 via bank transfer (HDFC ••7823)" },
      { time: "Jun 2, 9:02am", event: "Funds held in escrow", detail: "Amount held securely until task completion" },
      { time: "Jun 2, 7:48pm", event: "Task marked complete", detail: "Seller submitted 30-sec video + 3 timestamped photos" },
      { time: "Jun 2, 8:30pm", event: "Buyer confirmed", detail: "Buyer approved the deliverables" },
      { time: "Jun 2, 8:30pm", event: "Funds released to seller", detail: "₹1,140 released to SBI ••4510 (₹60 platform fee)" },
    ]},
  { id: "TXN-20260603", taskTitle: "Pick up a birthday gift and deliver it across town", buyer: "Priya Nair", seller: "Sana Q.", amount: 450, cur: "₹", method: "UPI", date: "Jun 3, 2026", status: "held",
    payerAccount: "priya.n@okicici", payeeAccount: "sana.q@paytm", platformFee: 22, netToSeller: 428,
    reason: "Task is in progress — seller accepted 2h ago. Awaiting proof of delivery before funds can be released.",
    timeline: [
      { time: "Jun 3, 11:20am", event: "Payment initiated", detail: "Buyer paid ₹450 via UPI (priya.n@okicici)" },
      { time: "Jun 3, 11:20am", event: "Funds held in escrow", detail: "Amount held securely until task completion" },
      { time: "Jun 3, 1:35pm", event: "Seller accepted task", detail: "Sana Q. accepted and is en route to pickup" },
    ]},
  { id: "TXN-20260604", taskTitle: "Film a 60-second product review video", buyer: "Marcus Bell", seller: "Lena Cruz", amount: 150, cur: "$", method: "Stripe", date: "Jun 3, 2026", status: "completed",
    payerAccount: "Visa ••4242", payeeAccount: "Stripe Connect (Lena)", platformFee: 7.5, netToSeller: 142.5,
    reason: null,
    timeline: [
      { time: "Jun 3, 2:00pm", event: "Payment initiated", detail: "Buyer charged $150 via Stripe (Visa ••4242)" },
      { time: "Jun 3, 2:00pm", event: "Funds held in escrow", detail: "Amount held via Stripe Connect" },
      { time: "Jun 4, 11:15am", event: "Task marked complete", detail: "Seller uploaded 60-second product review video" },
      { time: "Jun 4, 12:00pm", event: "Buyer confirmed", detail: "Buyer approved the deliverable" },
      { time: "Jun 4, 12:00pm", event: "Funds released to seller", detail: "$142.50 released to Stripe Connect (Lena) ($7.50 fee)" },
    ]},
  { id: "TXN-20260605", taskTitle: "Walk my dog for a week while I'm travelling", buyer: "Lena Cruz", seller: "Tomi Adeyemi", amount: 175, cur: "$", method: "Stripe", date: "Jun 4, 2026", status: "held",
    payerAccount: "Mastercard ••8910", payeeAccount: "Stripe Connect (Tomi)", platformFee: 8.75, netToSeller: 166.25,
    reason: "Multi-day task still in progress. Seller is completing daily walks (day 3 of 7). Funds will release after buyer confirms final day.",
    timeline: [
      { time: "Jun 4, 8:00am", event: "Payment initiated", detail: "Buyer charged $175 via Stripe (Mastercard ••8910)" },
      { time: "Jun 4, 8:00am", event: "Funds held in escrow", detail: "Amount held via Stripe Connect" },
      { time: "Jun 4, 8:30am", event: "Seller started task", detail: "Tomi confirmed first walk — sent photo of the dog" },
      { time: "Jun 5, 8:45am", event: "Day 2 update", detail: "Morning + evening walks completed, photos sent" },
      { time: "Jun 6, 9:10am", event: "Day 3 update", detail: "Morning walk done — awaiting remaining 4 days" },
    ]},
  { id: "TXN-20260606", taskTitle: "Test 5 coffee shops and write short reviews", buyer: "Marcus Bell", seller: "Arjun Rao", amount: 200, cur: "$", method: "PayPal", date: "Jun 4, 2026", status: "refunded",
    payerAccount: "marcus.bell@gmail.com", payeeAccount: "arjun.rao@gmail.com", platformFee: 0, netToSeller: 0,
    reason: "Seller did not complete the task within agreed timeframe (72h). Only 2 of 5 coffee shops visited. Buyer requested refund — admin approved after reviewing chat logs.",
    timeline: [
      { time: "Jun 1, 3:00pm", event: "Payment initiated", detail: "Buyer paid $200 via PayPal (marcus.bell@gmail.com)" },
      { time: "Jun 1, 3:00pm", event: "Funds held in escrow", detail: "Amount held via PayPal" },
      { time: "Jun 1, 4:20pm", event: "Seller accepted task", detail: "Arjun Rao accepted — deadline set to Jun 4" },
      { time: "Jun 3, 6:00pm", event: "Partial submission", detail: "Seller submitted reviews for 2/5 shops only" },
      { time: "Jun 4, 10:00am", event: "Deadline passed", detail: "72h window expired — task incomplete" },
      { time: "Jun 4, 10:30am", event: "Buyer raised refund request", detail: "Only 2 of 5 shops reviewed, not as agreed" },
      { time: "Jun 4, 11:15am", event: "Admin approved refund", detail: "$200 refunded to marcus.bell@gmail.com — reviewed chat logs" },
    ]},
  { id: "TXN-20260607", taskTitle: "Attend a startup meetup and summarize the announcements", buyer: "Dev Sharma", seller: "Meera Iyer", amount: 800, cur: "₹", method: "UPI", date: "Jun 5, 2026", status: "held",
    payerAccount: "dev.s@oksbi", payeeAccount: "meera.i@okaxis", platformFee: 40, netToSeller: 760,
    reason: "Event is scheduled for tomorrow evening. Task hasn't started yet — funds pre-held per buyer's authorization.",
    timeline: [
      { time: "Jun 5, 9:00am", event: "Payment initiated", detail: "Buyer paid ₹800 via UPI (dev.s@oksbi)" },
      { time: "Jun 5, 9:00am", event: "Funds held in escrow", detail: "Amount held securely until task completion" },
      { time: "Jun 5, 9:15am", event: "Seller accepted task", detail: "Meera Iyer accepted — event is Jun 6 evening" },
    ]},
  { id: "TXN-20260608", taskTitle: "Visit a restaurant, take authentic photos & post a review", buyer: "Meera Iyer", seller: "Priya Nair", amount: 350, cur: "₹", method: "Bank Transfer", date: "Jun 5, 2026", status: "disputed",
    payerAccount: "HDFC ••3421", payeeAccount: "ICICI ••8876", platformFee: 17, netToSeller: 333,
    reason: "Buyer claims photos are low quality and review was copy-pasted, not genuine. Seller says they followed all instructions. Awaiting admin mediation — both parties submitted evidence.",
    timeline: [
      { time: "Jun 3, 12:00pm", event: "Payment initiated", detail: "Buyer paid ₹350 via bank transfer (HDFC ••3421)" },
      { time: "Jun 3, 12:00pm", event: "Funds held in escrow", detail: "Amount held securely" },
      { time: "Jun 4, 2:30pm", event: "Task marked complete", detail: "Seller submitted Google review link + 4 photos" },
      { time: "Jun 4, 3:00pm", event: "Buyer rejected deliverable", detail: "Photos blurry, review appears copy-pasted from template" },
      { time: "Jun 4, 3:15pm", event: "Seller disputed rejection", detail: "Claims photos were taken in low-light café, review is genuine" },
      { time: "Jun 5, 10:00am", event: "Dispute escalated to admin", detail: "Both parties submitted chat screenshots as evidence" },
    ]},
];

const ADMIN_STATS = {
  totalUsers: 12400, pendingVerifications: 2, totalTransactions: 3847, revenue: 284500, revenueCur: "₹",
};

// Payment methods for profile
const MY_PAYMENTS = [
  { id: "pm1", type: "UPI", label: "you@okaxis", primary: true },
  { id: "pm2", type: "Bank", label: "HDFC ••4821", primary: false },
];

const MY_LINKED = [
  { provider: "Google", email: "you.me@gmail.com", connected: true },
  { provider: "Phone", value: "+91 98765 00000", connected: true },
];


// Reviews each person has received (demo) — keyed by PEOPLE handle
const PERSON_REVIEWS = {
  meera: [
    { id: "r1", from: "Dev Sharma",   stars: 5, text: "Clear instructions and quick to respond. Paid the moment I sent the photos.", task: "Apple Store stock check", when: "3d ago" },
    { id: "r2", from: "Priya Nair",   stars: 5, text: "Lovely to work with — fair and friendly throughout.", task: "Restaurant review", when: "1w ago" },
    { id: "r3", from: "Arjun Rao",    stars: 4, text: "Good task. Took a little while to confirm but all sorted.", task: "Metro sign holding", when: "2w ago" },
  ],
  arjun: [
    { id: "r4", from: "Meera Iyer",   stars: 5, text: "Fast and thorough — photographed everything I asked for.", task: "Check iPad Pro availability", when: "2d ago" },
    { id: "r5", from: "Marcus Bell",  stars: 5, text: "Reliable. Visited every coffee shop and wrote honest reviews.", task: "Coffee shop reviews", when: "5d ago" },
    { id: "r6", from: "Dev Sharma",   stars: 4, text: "Solid work, communicates well.", task: "Event coverage", when: "3w ago" },
  ],
  dev: [
    { id: "r7", from: "Meera Iyer",   stars: 5, text: "Top notch. Always delivers on time.", task: "Apple Store stock check", when: "1d ago" },
    { id: "r8", from: "Lena Cruz",    stars: 5, text: "Super dependable — would hire again in a heartbeat.", task: "Product video", when: "1w ago" },
  ],
  lena: [
    { id: "r9",  from: "Marcus Bell", stars: 5, text: "Great camera work and a good eye. Delivered ahead of schedule.", task: "Product review video", when: "4d ago" },
    { id: "r10", from: "Tomi Adeyemi", stars: 5, text: "Professional and warm. The dog loved her!", task: "Dog walking", when: "2w ago" },
  ],
  marcus: [
    { id: "r11", from: "Lena Cruz",   stars: 5, text: "Clear briefs, pays promptly. A pleasure to work with.", task: "Product video", when: "6d ago" },
    { id: "r12", from: "Arjun Rao",   stars: 4, text: "Good communication, fair on the dispute.", task: "Coffee shop reviews", when: "3w ago" },
  ],
  tomi: [
    { id: "r13", from: "Dev Sharma",  stars: 5, text: "Brilliant notes from the meetup — exactly what I needed.", task: "Startup meetup summary", when: "2d ago" },
    { id: "r14", from: "Lena Cruz",   stars: 5, text: "Took great care of my dog and sent a photo every walk.", task: "Dog walking", when: "1w ago" },
  ],
  priya: [
    { id: "r15", from: "Meera Iyer",  stars: 5, text: "Delivered the gift on time and texted ahead. Thank you!", task: "Birthday gift delivery", when: "5d ago" },
  ],
  sana: [
    { id: "r16", from: "Priya Nair",  stars: 4, text: "Did the job well — still building up experience but dependable.", task: "Plant watering", when: "1w ago" },
  ],
};

// Track record per person (demo) — keyed by PEOPLE handle
const PERSON_STATS = {
  meera:  { completionRate: 98, onTime: 96 },
  arjun:  { completionRate: 95, onTime: 92 },
  dev:    { completionRate: 99, onTime: 98 },
  lena:   { completionRate: 97, onTime: 95 },
  marcus: { completionRate: 96, onTime: 90 },
  tomi:   { completionRate: 98, onTime: 97 },
  priya:  { completionRate: 90, onTime: 88 },
  sana:   { completionRate: 85, onTime: 80 },
};

const ADMIN_STRIKES = [];

Object.assign(window, { CATEGORIES, CAT, PEOPLE, ME, TASKS, avatarFor, deadlineInfo, isTaskExpired, inDays, PERSON_REVIEWS, PERSON_STATS, MY_VERIFICATION, ADMIN_VERIFICATIONS, ADMIN_STRIKES, ADMIN_TRANSACTIONS, ADMIN_STATS, MY_PAYMENTS, MY_LINKED });
