/* global window */
// Newsfeed events restructured into a uniform shape.
// Every event has:
//   id, type, account, publication, discovered, sourceUrl
//   eyebrow_kind   — optional sub-type label (only on news)
//   anchor         — the typed anchor (news/person/role) the card renders
//   angle          — { why, fits? } Trayo's analysis
//   stakeholders   — [{ id, name, title, tone }]
//   case_studies   — bool

const TYPES = {
  news:          { label: "News",          short: "News" },
  job_listing:   { label: "Job listing",   short: "Job listing" },
  career_change: { label: "Career change", short: "Career" },
};

const favicon = (host) => `https://www.google.com/s2/favicons?domain=${host}&sz=128`;

const EVENTS = [
  {
    id: "ev-snyk",
    signals: ["AI supply chain", "Security governance"],
    type: "news",
    eyebrow_kind: "Launch",
    account: { name: "Snyk", host: "snyk.io", initials: "Sn" },
    publication: "TechSpective",
    discovered: "1d",
    sourceUrl: "#",
    anchor: {
      date: "Mar 23, 2026",
      headline: "Snyk launches Evo AI-SPM to enforce AI coding agent policies at RSAC 2026",
    },
    angle: {
      why: "Enterprises face untracked AI components and unchecked agentic code risks, creating urgent demand for real-time <em>AI supply chain visibility</em> and policy enforcement.",
      fits: { name: "Security", body: "delivers management features for enforcing security policies across AI-driven workflows." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p1", name: "Ricardo Alves", photo: "https://randomuser.me/api/portraits/men/32.jpg", title: "Director of Product Management", tone: "amber" },
      { id: "p2", name: "Krzysztof Huszcza", photo: "https://randomuser.me/api/portraits/men/46.jpg", title: "Director of AI Incubations", tone: "violet" },
      { id: "p3", name: "Joshua Ford", photo: "https://randomuser.me/api/portraits/men/52.jpg", title: "Director of IT", tone: "rose" },
    ],
  },
  {
    id: "ev-zoominfo",
    signals: ["Operations owner"],
    type: "career_change",
    account: { name: "ZoomInfo", host: "zoominfo.com", initials: "Zi" },
    publication: "LinkedIn",
    discovered: "1d",
    sourceUrl: "#",
    anchor: {
      moveVerb: "Promoted", moveDate: "April 2026", prev: "Previously Chief of Staff · In previous role since May 2019",
      person: { name: "Jennifer Creticos", photo: "https://randomuser.me/api/portraits/women/68.jpg", initials: "JC", tone: "violet" },
      verb: "Promoted",
      from: "Chief of Staff",
      to: "Chief Business Officer",
      meta: "In role since May 2019",
    },
    angle: {
      why: "This <em>promotion</em> places a senior leader in a key operations role, impacting strategic program execution. Her IBM background in business operations signals a focus on operational excellence and cross-platform initiatives at ZoomInfo.",
    },
    case_studies: false,
    // Career-change cards always reach out to the person themselves
    stakeholders: [
      { id: "p-jc", name: "Jennifer Creticos", photo: "https://randomuser.me/api/portraits/women/68.jpg", title: "Chief Business Officer", tone: "violet" },
    ],
  },
  {
    id: "ev-cresta",
    signals: ["Operations owner"],
    type: "career_change",
    account: { name: "Cresta", host: "cresta.com", initials: "Cr" },
    publication: "LinkedIn",
    discovered: "2d",
    sourceUrl: "#",
    anchor: {
      moveVerb: "Joined", moveDate: "March 2026", prev: "Previously at Tropic",
      person: { name: "Nicole Erickson", photo: "https://randomuser.me/api/portraits/women/44.jpg", initials: "NE", tone: "teal" },
      verb: "New hire",
      from: "Tropic",
      to: "Product Operations Manager",
      meta: "Joined March 2026",
    },
    angle: {
      why: "Brings expertise in product operations from Tropic. Cresta must integrate new operational workflows and align product processes rapidly, opening a window for <em>operational tooling</em> conversations.",
    },
    case_studies: false,
    stakeholders: [
      { id: "p-ne", name: "Nicole Erickson", photo: "https://randomuser.me/api/portraits/women/44.jpg", title: "Product Operations Manager", tone: "teal" },
    ],
  },
  {
    id: "ev-personio",
    signals: ["BizOps hiring", "Payroll growth"],
    type: "job_listing",
    account: { name: "Personio", host: "personio.com", initials: "Pe" },
    publication: "Greenhouse",
    discovered: "2d",
    sourceUrl: "#",
    anchor: {
      date: "May 16, 2026",
      summary: "Personio is hiring a Senior Business Operations Manager to optimize payroll operations across Europe.",
      title: "Senior Business Operations Manager",
      sub: "Payroll · Munich, Germany · Senior",
    },
    angle: {
      why: "Personio's Payroll <em>business operations</em> team needs robust tools to manage cross-team workflows and track OKRs — payroll is their #1 growth driver in Europe. The role demands enhanced operational visibility across Product, Sales, and Marketing.",
      fits: { name: "Agents", body: "automate repetitive tasks and streamline cross-functional workflows in payroll operations." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p4", name: "Natascha Moore", photo: "https://randomuser.me/api/portraits/women/12.jpg", title: "Sr. Director of Payroll Experience", tone: "amber" },
      { id: "p5", name: "Ricardo Guasch", photo: "https://randomuser.me/api/portraits/men/41.jpg", title: "Head of BizOps, Payroll", tone: "violet" },
      { id: "p6", name: "James Kitching", photo: "https://randomuser.me/api/portraits/men/22.jpg", title: "Head of Payroll Operations", tone: "rose" },
    ],
  },
  {
    id: "ev-ramp",
    signals: ["Payments hiring", "Team build-out"],
    type: "job_listing",
    account: { name: "Ramp", host: "ramp.com", initials: "Ra" },
    publication: "Greenhouse",
    discovered: "6h",
    sourceUrl: "#",
    anchor: {
      date: "May 22, 2026",
      summary: "Ramp is hiring a Head of Payment Partnerships to expand beyond card issuing into network economics.",
      title: "Head of Payment Partnerships",
      sub: "Payments · New York, NY · Director",
    },
    angle: {
      why: "Ramp is building a <em>payments partnerships</em> team beyond issuing — the JD calls for card-network economics experience. Their issuing contract is likely up for expansion or scrutiny, a clear opening for partnership tooling.",
      fits: { name: "Partner Ops", body: "tracks partner pipeline and contract milestones across the payments org." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p20", name: "Diego Ramirez", photo: "https://randomuser.me/api/portraits/men/36.jpg", title: "VP Payments", tone: "amber" },
      { id: "p21", name: "Hannah Webb", photo: "https://randomuser.me/api/portraits/women/50.jpg", title: "Head of Partnerships", tone: "violet" },
    ],
  },
  {
    id: "ev-rippling",
    signals: ["RevOps hiring", "GTM scale"],
    type: "job_listing",
    account: { name: "Rippling", host: "rippling.com", initials: "Ri" },
    publication: "Ashby",
    discovered: "1d",
    sourceUrl: "#",
    anchor: {
      date: "May 20, 2026",
      summary: "Rippling is hiring a Senior Revenue Operations Manager to support rapid GTM scaling.",
      title: "Senior Revenue Operations Manager",
      sub: "Revenue Operations · San Francisco, CA · Senior",
    },
    angle: {
      why: "Rippling opened <em>4 RevOps roles in two weeks</em> — a signal of GTM scaling. New RevOps leadership typically re-evaluates the tooling stack within the first quarter.",
      fits: { name: "RevOps Stack", body: "consolidates pipeline, forecasting, and territory planning for fast-scaling GTM teams." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p22", name: "Olivia Park", title: "Director, Revenue Operations", tone: "teal", photo: "https://randomuser.me/api/portraits/women/9.jpg" },
      { id: "p23", name: "Sam Carter", title: "RevOps Lead", tone: "violet", photo: "https://randomuser.me/api/portraits/men/14.jpg" },
      { id: "p24", name: "Jade Wong", title: "Sales Operations Manager", tone: "amber", photo: "https://randomuser.me/api/portraits/women/40.jpg" },
    ],
  },
  {
    id: "ev-scaleai",
    signals: ["Late-stage funding", "GTM expansion"],
    type: "news",
    eyebrow_kind: "Funding",
    account: { name: "Scale AI", host: "scale.com", initials: "Sc" },
    publication: "TechCrunch",
    discovered: "5h",
    sourceUrl: "#",
    featured: true,
    anchor: {
      date: "May 12, 2026",
      headline: "Scale AI closes $1B Series F at $25B valuation, led by Sequoia",
      sub: "Series F · $25B post-money · Sequoia lead, with a16z and Founders Fund",
    },
    angle: {
      why: "The raise funds aggressive enterprise hiring over the next 18 months. Their prospectus mentions doubling the GTM team and standing up dedicated <em>RevOps</em> and <em>Sales Ops</em> functions — a clear window to engage on tooling.",
      fits: { name: "RevOps Stack", body: "consolidates revenue operations across pipeline, forecasting, and account planning." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p7", name: "Maya Bhakti", title: "VP, Revenue Operations", tone: "violet", photo: "https://randomuser.me/api/portraits/women/30.jpg" },
      { id: "p7b", name: "Tom Mendez", title: "Head of Sales Operations", tone: "amber", photo: "https://randomuser.me/api/portraits/men/60.jpg" },
      { id: "p7c", name: "Priya Nair", title: "Director, GTM Strategy", tone: "rose", photo: "https://randomuser.me/api/portraits/women/16.jpg" },
    ],
  },
  {
    id: "ev-datadog",
    signals: ["New security leader"],
    type: "career_change",
    account: { name: "Datadog", host: "datadoghq.com", initials: "Dd" },
    publication: "Press release",
    discovered: "3d",
    sourceUrl: "#",
    anchor: {
      moveVerb: "Joined", moveDate: "May 2026", prev: "Previously VP Security at Stripe",
      person: { name: "Sarah Cortez", photo: "https://randomuser.me/api/portraits/women/65.jpg", initials: "SC", tone: "rose" },
      verb: "New hire",
      from: "VP Security, Stripe",
      to: "Chief Information Security Officer",
      meta: "Joined May 2026",
    },
    angle: {
      why: "A new <em>CISO</em> almost always triggers a top-down security tooling review in the first 90 days. Sarah's tenure at Stripe shows preference for consolidated platforms over point solutions — frame outreach around platform consolidation, not feature parity.",
    },
    case_studies: true,
    stakeholders: [
      { id: "p-sc", name: "Sarah Cortez", photo: "https://randomuser.me/api/portraits/women/65.jpg", title: "Chief Information Security Officer", tone: "rose" },
    ],
  },
  {
    id: "ev-anthropic",
    signals: ["AI platform partnership"],
    type: "news",
    eyebrow_kind: "Partnership",
    account: { name: "Anthropic", host: "anthropic.com", initials: "An" },
    publication: "The Information",
    discovered: "8h",
    sourceUrl: "#",
    anchor: {
      date: "May 14, 2026",
      headline: "Anthropic and Snowflake announce native Claude integration",
      sub: "Available in private preview · Q3 2026 GA",
    },
    angle: {
      why: "Anthropic's Snowflake integration expands Claude into the data warehouse layer, where most enterprise <em>analytics governance</em> conversations happen. Joint customers will need data-residency and audit controls.",
    },
    case_studies: false,
    stakeholders: [
      { id: "p10", name: "Riley Chen", title: "Head of Platform Partnerships", tone: "violet", photo: "https://randomuser.me/api/portraits/men/15.jpg" },
      { id: "p10b", name: "Marcus Webb", title: "Data Platform Lead", tone: "teal", photo: "https://randomuser.me/api/portraits/men/77.jpg" },
      { id: "p10c", name: "Elena Fischer", title: "Security Architect", tone: "rose", photo: "https://randomuser.me/api/portraits/women/23.jpg" },
    ],
  },
  {
    id: "ev-figma",
    signals: ["AI productivity"],
    type: "news",
    eyebrow_kind: "Release",
    account: { name: "Figma", host: "figma.com", initials: "Fi" },
    publication: "Figma Blog",
    discovered: "1d",
    sourceUrl: "#",
    anchor: {
      date: "May 13, 2026",
      headline: "Figma ships AI-powered design-to-code in Dev Mode 2.0",
      sub: "GA · Enterprise + Org plans",
    },
    angle: {
      why: "Figma's expanded <em>AI tooling</em> rollout signals broader enterprise AI investment. The Dev Mode 2.0 launch creates a natural opening for governance and review tooling conversations with their Design Systems and Platform teams.",
      fits: { name: "AI Governance", body: "audits AI-generated code and enforces review policies before merge." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p14", name: "Tom Lawson", title: "Design Systems Lead", tone: "violet", photo: "https://randomuser.me/api/portraits/men/85.jpg" },
      { id: "p15", name: "Grace Liu", title: "Platform PM", tone: "teal", photo: "https://randomuser.me/api/portraits/women/57.jpg" },
      { id: "p16", name: "Ravi Anand", title: "Engineering Manager", tone: "amber", photo: "https://randomuser.me/api/portraits/men/91.jpg" },
    ],
  },
  {
    id: "ev-otter",
    signals: ["Enterprise search", "AI productivity"],
    type: "news",
    eyebrow_kind: "Launch",
    account: { name: "Otter.ai", host: "otter.ai", initials: "Ot" },
    publication: "The Tech Buzz",
    discovered: "1d",
    sourceUrl: "#",
    anchor: {
      date: "Apr 27, 2026",
      headline: "Otter.ai launches cross-platform enterprise search and a Windows app",
    },
    angle: {
      why: "Enterprises face urgent demand for unified, context-rich search across diverse tools. Otter's Windows app closes a platform gap and leverages <em>conversational AI</em> for deeper insights.",
      fits: { name: "Enterprise Search", body: "delivers cross-platform retrieval that surfaces context across the tools your teams already use." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p11", name: "Dana West", photo: "https://randomuser.me/api/portraits/women/22.jpg", title: "VP Product", tone: "teal" },
      { id: "p12", name: "Anish Kumar", photo: "https://randomuser.me/api/portraits/men/4.jpg", title: "Head of Eng Productivity", tone: "violet" },
      { id: "p13", name: "Mira Sato", photo: "https://randomuser.me/api/portraits/women/79.jpg", title: "IT Director", tone: "amber" },
    ],
  },
  {
    id: "ev-salesforce",
    signals: ["Earnings beat", "RevOps spend"],
    type: "news",
    eyebrow_kind: "Earnings",
    account: { name: "Salesforce", host: "salesforce.com", initials: "Sf" },
    publication: "Q1 Earnings Call",
    discovered: "4d",
    sourceUrl: "#",
    anchor: {
      date: "May 8, 2026",
      headline: "Salesforce reports Q1 revenue of $9.4B, up 11% YoY, raises FY27 guidance",
      sub: "Op. margin 31.6% (vs 28.0% PY) · RPO $57.4B",
    },
    angle: {
      why: "<em>Raised guidance</em> and 11% growth indicate aggressive Q2 spend on revenue tooling. Marc mentioned <em>Agentforce</em> seven times on the call — clear product priority. Now is the window to pitch into RevOps and Sales Strategy.",
      fits: { name: "RevOps Stack", body: "consolidates revenue operations across pipeline, forecasting, and account planning." },
    },
    case_studies: true,
    stakeholders: [
      { id: "p17", name: "Karen Wells", title: "VP, Revenue Operations", tone: "violet", photo: "https://randomuser.me/api/portraits/women/89.jpg" },
      { id: "p18", name: "Dan Brooks", title: "Director, Sales Strategy", tone: "amber", photo: "https://randomuser.me/api/portraits/men/12.jpg" },
      { id: "p19", name: "Nina Petrova", title: "Sales Operations Lead", tone: "rose", photo: "https://randomuser.me/api/portraits/women/33.jpg" },
    ],
  },
];

window.NF_TYPES = TYPES;
window.NF_EVENTS = EVENTS;
window.NF_FAVICON = favicon;
