/* global React */
// OfferRoom Events, sample data. Normalized provider-agnostic Event shape:
// the UI binds to these fields, never to a provider payload.
// authority: first_party | aggregator | inferred. Only "inferred" carries a verify chip.

const EV_CATEGORIES = [
  { key: "all", label: "All types" },
  { key: "career_fair", label: "Career fair" },
  { key: "info_session", label: "Info session" },
  { key: "conference", label: "Conference" },
  { key: "meetup", label: "Meetup" },
  { key: "hackathon", label: "Hackathon" },
];

const EV_STATUS_META = {
  interested: { label: "Interested", tone: "neutral" },
  registered: { label: "Registered", tone: "slate" },
  attending:  { label: "Attending",  tone: "sage" },
  attended:   { label: "Attended",   tone: "sage" },
  skipped:    { label: "Skipped",    tone: "neutral" },
};

// group: "company" (A1/A2, tied to a shortlisted job/company) or "profile" (A3).
const EVENTS = [
  {
    id: "ev1", group: "company", kind: "A1",
    title: "Stripe Product Info Session", category: "info_session", categoryLabel: "Info session",
    mode: "online", cost: { free: true },
    when: "Tue Jul 14 · 11:00 AM PDT", duration: "90 min", registerBy: "Register by Mon Jul 13",
    venue: "Virtual · hosted on Stripe.com",
    relevance: { company: "Stripe", job: "Senior PM, Payments", reason: "Hosted by a company on your shortlist" },
    networking: { insiders: "2 Stripe recruiters hosting", known: 1, knownNote: "Dana Whitfield is attending" },
    source: { provider: "stripe.com/events", authority: "first_party", confidence: "high" },
    status: "registered",
    detail: "A 90 minute session with the Payments product org: roadmap overview, then open Q&A with two recruiters. Past sessions ran a resume drop at the end.",
  },
  {
    id: "ev2", group: "company", kind: "A2",
    title: "NYC Fintech Career Fair, Fall Edition", category: "career_fair", categoryLabel: "Career fair",
    mode: "offline", cost: { free: false, price: "$25" },
    when: "Thu Jul 23 · 10:00 AM EDT", duration: "All day", registerBy: "Register by Fri Jul 17",
    venue: "Javits Center · New York, US",
    relevance: { company: "Ramp", job: "Group PM, Payments", reason: "Ramp has a booth, per the exhibitor list" },
    networking: { insiders: "Ramp recruiting team at booth 41", known: 2, knownNote: "2 people you know are going" },
    source: { provider: "exhibitor list", authority: "inferred", confidence: "medium", verifyUrl: "nycfintechfair.com" },
    status: "interested",
    detail: "A large fair, 120+ exhibitors. Ramp appears on the published exhibitor list. Booth details come from an agenda page read, so verify on the source before you travel.",
  },
  {
    id: "ev3", group: "company", kind: "A2",
    title: "Payments Forward 2026", category: "conference", categoryLabel: "Conference",
    mode: "offline", cost: { free: false, price: "$349" },
    when: "Aug 4 to 5 · San Francisco, US", duration: "2 days", registerBy: "Early bird ends Jul 20",
    venue: "Moscone West · San Francisco, US",
    relevance: { company: "Stripe", job: "Senior PM, Payments", reason: "A Stripe director is on the speaker list" },
    networking: { insiders: "Priya Raman (Director of Product, Stripe) speaking Day 1", known: 0 },
    source: { provider: "agenda page", authority: "inferred", confidence: "medium", verifyUrl: "paymentsforward.io" },
    status: null,
    detail: "Industry conference on money movement. The speaker agenda lists a Stripe payments director; agenda data is inferred from the event site, so confirm before buying a ticket.",
  },
  {
    id: "ev4", group: "company", kind: "A1",
    title: "Brex Virtual Open House, Product & Design", category: "info_session", categoryLabel: "Info session",
    mode: "online", cost: { free: true },
    when: "Wed Jul 29 · 4:00 PM PDT", duration: "60 min", registerBy: null,
    venue: "Virtual · LinkedIn Live",
    relevance: { company: "Brex", job: "Senior PM, Growth", reason: "Hosted by a company on your shortlist" },
    networking: { insiders: "Hiring managers from the Spend team", known: 0 },
    source: { provider: "LinkedIn Events", authority: "first_party", confidence: "high" },
    status: null,
    detail: "Brex runs these monthly on their LinkedIn company page. Product and design leads walk through open roles, then breakout Q&A.",
  },
  {
    id: "ev5", group: "profile", kind: "A3",
    title: "SF Product Managers Monthly Mixer", category: "meetup", categoryLabel: "Meetup",
    mode: "offline", cost: { free: true },
    when: "Thu Jul 16 · 6:30 PM PDT", duration: "2 hrs", registerBy: null,
    venue: "SoMa · San Francisco, US",
    relevance: { reason: "Matches your Product Manager focus" },
    networking: { insiders: null, known: 3, knownNote: "3 people you know are going" },
    source: { provider: "Meetup", authority: "aggregator", confidence: "high" },
    status: "interested",
    detail: "Recurring PM meetup, usually 80 to 120 attendees, heavy fintech crowd. Good warm ground before the fall hiring cycle.",
  },
  {
    id: "ev6", group: "profile", kind: "A3",
    title: "Fintech DevCon Europe", category: "conference", categoryLabel: "Conference",
    mode: "online", cost: { free: false, price: "€90" },
    when: "Fri Jul 24 · 6:00 AM PDT", tz: "3:00 PM CEST in Amsterdam", duration: "1 day", registerBy: "Register by Jul 22",
    venue: "Virtual · streamed from Amsterdam, NL",
    relevance: { reason: "Fintech, your target sector" },
    networking: { insiders: null, known: 0 },
    source: { provider: "PredictHQ", authority: "aggregator", confidence: "high" },
    status: null,
    detail: "European fintech developer and product conference with a virtual track. Times shown in your timezone; sessions start early Pacific.",
  },
  {
    id: "ev7", group: "profile", kind: "A3",
    title: "Payments Product Hackathon", category: "hackathon", categoryLabel: "Hackathon",
    mode: "offline", cost: { free: true },
    when: "Sat Jul 11 · 9:00 AM PDT", duration: "1 day", registerBy: "Closed Jul 8",
    venue: "Mission Bay · San Francisco, US",
    relevance: { reason: "Matches your payments background" },
    networking: { insiders: null, known: 0 },
    source: { provider: "Meetup", authority: "aggregator", confidence: "high" },
    status: null, closed: true,
    detail: "Registration closed. Similar hackathons run quarterly; we will flag the next one.",
  },
];

// Tracked view: the user's saved events on the interested -> attended pipeline.
const EV_PIPELINE = ["interested", "registered", "attending", "attended"];
const EV_TRACKED = [
  { id: "ev1", status: "registered", next: "Starts Tue Jul 14 · on your calendar" },
  { id: "ev2", status: "interested", next: "Register by Fri Jul 17 · deadline on calendar" },
  { id: "ev5", status: "interested", next: "Thu Jul 16 · no registration needed" },
  { id: "evx", status: "attended", title: "Figma Config Meetup SF", co: "Figma",
    next: "Attended Jun 12 · 2 intro targets added to Network", done: true },
];

Object.assign(window, { EVENTS, EV_CATEGORIES, EV_STATUS_META, EV_PIPELINE, EV_TRACKED });
