export const barcampParticipantsSheetUrl =
  "https://docs.google.com/spreadsheets/d/1CToI4p-h6U6LtBtnUfUB_GG-VUlu7AqG9rKUsFXtDIU/edit?gid=1377061511#gid=1377061511";
export const barcampRegistrationUrl = barcampParticipantsSheetUrl;
export const barcampProposalDocUrl =
  "https://docs.google.com/spreadsheets/d/1CToI4p-h6U6LtBtnUfUB_GG-VUlu7AqG9rKUsFXtDIU/edit?gid=0#gid=0";
export const barcampWhatsappCommunityUrl = "https://chat.whatsapp.com/DVs6YNgDpd41LtkmAwGVfo";

export type BarcampParticipant = {
  name: string;
  themes?: string;
  affiliation?: string;
  status: "Confirmed" | "Likely";
};

export const barcampParticipants: BarcampParticipant[] = [
  {
    name: "Jyothi Krishnan",
    themes: "Games and Math",
    affiliation: "CCL and CSE, IITGN",
    status: "Likely",
  },
  {
    name: "Manoj Gupta",
    themes: "Algorithms, Puzzles",
    affiliation: "CSE, IITGN",
    status: "Confirmed",
  },
  {
    name: "Anirban Dasgupta",
    themes: "Theory of ML, Scaleable ML",
    affiliation: "CSE, IITGN",
    status: "Confirmed",
  },
  {
    name: "Shanmuganathan Raman",
    themes: "Computer Vision, Graphics",
    affiliation: "CSE, IITGN",
    status: "Confirmed",
  },
  {
    name: "Jaison Manjaly",
    themes: "Philosophy, Curiosity, Art",
    affiliation: "HSS, IITGN",
    status: "Confirmed",
  },
  {
    name: "Adithi Iyer",
    themes: "STEM education, hands-on learning",
    affiliation: "CCL, IITGN",
    status: "Confirmed",
  },
  {
    name: "Neha Garg",
    themes: "STEM education, hands-on learning",
    affiliation: "CCL, IITGN",
    status: "Confirmed",
  },
  {
    name: "Neal Apte",
    themes: "Board Games, Puzzles",
    affiliation: "CCL, IITGN",
    status: "Confirmed",
  },
  {
    name: "Rohit Narayanan",
    themes: "Algorithms, Math",
    affiliation: "Grad Student, CSE, IITGN",
    status: "Likely",
  },
  {
    name: "Priyanshi",
    themes: "Math, Algorithms",
    affiliation: "Grad Student, CSE, IITGN",
    status: "Confirmed",
  },
  {
    name: "Ajay Maor",
    themes: "Textiles, personal computing",
    affiliation: "Calico Museum (?)",
    status: "Likely",
  },
  {
    name: "Venkatesh Chopella",
    themes: "PL, Computing Education",
    affiliation: "IIITH",
    status: "Likely",
  },
  {
    name: "Rui Marinheiro",
    themes: "Networks",
    affiliation: "ISCTE Lisbon",
    status: "Likely",
  },
  {
    name: "Olinda Coelho Monteiro",
    themes: "Biochemistry, Materials (?)",
    affiliation: "University of Lisbon",
    status: "Likely",
  },
  {
    name: "Aditya Sengupta",
    status: "Confirmed",
  },
  {
    name: "Sudarshan Iyengar",
    themes: "Computing Education, Agri Tech",
    affiliation: "IIT Ropar",
    status: "Likely",
  },
  {
    name: "Subodh Sharma",
    themes: "Formal Methods, EVMs, Privacy",
    affiliation: "IIT Delhi",
    status: "Likely",
  },
  {
    name: "Aalok Thakkar",
    themes: "Ancient Indian Math, PL, Lean, Education",
    affiliation: "Ashoka University",
    status: "Confirmed",
  },
  {
    name: "Devdas",
    themes: "The internet",
    status: "Confirmed",
  },
  {
    name: "Vinayak Hegde",
    status: "Confirmed",
  },
  {
    name: "Gaurav Chaturvedi",
    status: "Likely",
  },
  {
    name: "Ankit Daftery",
    status: "Likely",
  },
  {
    name: "Guru",
    themes: "Identity, KYC, banking",
    status: "Likely",
  },
];

export type BarcampTrackId = "track-a" | "track-b" | "workshops";

export type BarcampTrack = {
  id: BarcampTrackId;
  label: string;
  description: string;
  room: string;
};

export const barcampTracks: BarcampTrack[] = [
  {
    id: "track-a",
    label: "Track A",
    description: "Session slots for short talks, demos, provocations, and questions.",
    room: "7/102",
  },
  {
    id: "track-b",
    label: "Track B",
    description: "A parallel track with the same timing pattern as Track A.",
    room: "7/103",
  },
  {
    id: "workshops",
    label: "Workshops",
    description: "Hands-on and birds-of-a-feather sessions will be added closer to the event.",
    room: "7/101",
  },
];

export type BarcampScheduleItem =
  | {
      kind: "fixed";
      id: string;
      time: string;
      title: string;
      note?: string;
    }
  | {
      kind: "slot";
      id: string;
      time: string;
      title: string;
    };

export type BarcampScheduleGroup = {
  id: string;
  label: string;
  note?: string;
  items: BarcampScheduleItem[];
};

const talkBlocks = [
  ["10:00-10:30", "Open session slot"],
  ["10:30-11:00", "Open session slot"],
  ["11:00-11:30", "Open session slot"],
  ["11:30-12:00", "Open session slot"],
  ["12:00-12:30", "Open session slot"],
  ["12:30-13:00", "Open session slot"],
  ["14:30-15:00", "Open session slot"],
  ["15:00-15:30", "Open session slot"],
  ["15:30-16:00", "Open session slot"],
  ["16:30-17:00", "Open session slot"],
  ["17:00-17:30", "Open session slot"],
  ["17:30-18:00", "Open session slot"],
] as const;

export function getBarcampTrackScheduleGroups(
  trackId: Exclude<BarcampTrackId, "workshops">,
) {
  const withTrackId = (slotId: string) => `${trackId}-${slotId}`;

  return [
    {
      id: "arrival",
      label: "Arrival",
      note: "09:30-10:00",
      items: [
        {
          kind: "fixed",
          id: withTrackId("registration"),
          time: "09:30-10:00",
          title: "Registration",
          note: "Check in, collect your badge, and find the session board.",
        },
      ],
    },
    {
      id: "morning",
      label: "Early Bird sessions",
      note: "10:00-11:30",
      items: talkBlocks.slice(0, 3).map(([time, title], index) => ({
        kind: "slot" as const,
        id: withTrackId(`talk-${index + 1}`),
        time,
        title,
      })),
    },
    {
      id: "midday",
      label: "Morning sessions",
      note: "11:30-13:00",
      items: [
        {
          kind: "fixed",
          id: withTrackId("morning-break"),
          time: "11:30",
          title: "Break and room reset",
        },
        ...talkBlocks.slice(3, 6).map(([time, title], index) => ({
          kind: "slot" as const,
          id: withTrackId(`talk-${index + 4}`),
          time,
          title,
        })),
      ],
    },
    {
      id: "lunch",
      label: "Lunch and CCL tour",
      note: "13:00-14:30",
      items: [
        {
          kind: "fixed",
          id: withTrackId("lunch"),
          time: "13:00-14:30",
          title: "Lunch and CCL tour",
        },
      ],
    },
    {
      id: "afternoon",
      label: "Afternoon sessions",
      note: "14:30-16:00",
      items: talkBlocks.slice(6, 9).map(([time, title], index) => ({
        kind: "slot" as const,
        id: withTrackId(`talk-${index + 7}`),
        time,
        title,
      })),
    },
    {
      id: "evening",
      label: "Evening sessions",
      note: "16:00-18:00",
      items: [
        {
          kind: "fixed",
          id: withTrackId("tea-break"),
          time: "16:00-16:30",
          title: "Break",
        },
        ...talkBlocks.slice(9).map(([time, title], index) => ({
          kind: "slot" as const,
          id: withTrackId(`talk-${index + 10}`),
          time,
          title,
        })),
      ],
    },
  ] satisfies BarcampScheduleGroup[];
}
