import { z } from "zod";
const partykitRoom = "epic-web-presence";
const partykitBaseUrl = `https://epic-web-presence.kentcdodds.partykit.dev/parties/main/${partykitRoom}`;
const UserSchema = z.object({
  id: z.string(),
  avatarUrl: z.string().nullable().optional(),
  name: z.string().nullable().optional(),
  location: z.object({
    workshopTitle: z.string().nullable().optional(),
    exercise: z.object({
      type: z.union([z.literal("problem"), z.literal("solution")]).nullable().optional(),
      exerciseNumber: z.number().nullable().optional(),
      stepNumber: z.number().nullable().optional()
    }).nullable().optional()
  }).nullable().optional()
});
const MessageSchema = z.object({
  type: z.literal("remove-user"),
  payload: z.object({ id: z.string() })
}).or(z.object({ type: z.literal("add-user"), payload: UserSchema })).or(
  z.object({
    type: z.literal("presence"),
    payload: z.object({ users: z.array(UserSchema) })
  })
);
const PresenceSchema = z.object({ users: z.array(UserSchema) });
export {
  MessageSchema,
  PresenceSchema,
  UserSchema,
  partykitBaseUrl,
  partykitRoom
};
