{"version":3,"sources":["../src/moment/moment.enums.ts","../src/moment/moment.schemas.ts"],"names":["MomentState","GoLiveMomentRequestSchema","z","GoLiveMomentResponseSchema","HostMomentLivePayloadSchema","ViewerMomentPayloadSchema","StartMomentViewingSessionRequestSchema","StartMomentViewingSessionResponseSchema","EndMomentViewingSessionResponseSchema","MomentViewingSessionHeartbeatAckSchema","MomentViewingSessionEvents"],"mappings":"oBAAO,IAAMA,CAAAA,CAAc,CACzB,IAAA,CAAM,MAAA,CACN,KAAA,CAAO,OACT,ECKO,IAAMC,CAAAA,CAA4BC,EAAE,MAAA,CAAO,CAChD,KAAA,CAAOA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,GAAG,CAAA,CAAE,QAAA,EAC7B,CAAC,CAAA,CASYC,CAAAA,CAA6BD,EAAE,MAAA,CAAO,CACjD,QAAA,CAAUA,CAAAA,CAAE,IAAA,EAAK,CACjB,KAAA,CAAOA,CAAAA,CAAE,OAAA,CAAQF,CAAAA,CAAY,IAAI,CAAA,CACjC,aAAA,CAAeE,CAAAA,CAAE,IAAI,QAAA,EAAS,CAC9B,cAAA,CAAgBA,CAAAA,CAAE,GAAA,EAAI,CACtB,SAAA,CAAWA,CAAAA,CAAE,MAAA,EAAO,CACpB,WAAA,CAAaA,CAAAA,CAAE,GAAA,EACjB,CAAC,CAAA,CAOYE,CAAAA,CAA8BF,CAAAA,CAAE,MAAA,CAAO,CAClD,QAAA,CAAUA,CAAAA,CAAE,IAAA,EAAK,CACjB,KAAA,CAAOA,CAAAA,CAAE,IAAA,CAAKF,CAAW,CAAA,CACzB,cAAeE,CAAAA,CAAE,GAAA,CAAI,QAAA,EAAS,CAC9B,WAAA,CAAaA,CAAAA,CAAE,GAAA,CAAI,QAAA,EAAS,CAAE,QAAA,EAAS,CACvC,OAAA,CAASA,CAAAA,CAAE,MAAA,GAAS,GAAA,EAAI,CAAE,WAAA,EAAY,CACtC,WAAA,CAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,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O,CAC7D,EAAA,CAAIA,CAAAA,CAAE,OAAA,EAAQ,CACd,MAAA,CAAQA,CAAAA,CAAE,IAAA,CAAK,CAAC,cAAA,CAAgB,eAAA,CAAiB,WAAA,CAAa,UAAU,CAAC,CAAA,CAAE,QAAA,EAC7E,CAAC,CAAA,CAGYQ,CAAAA,CAA6B,CACxC,SAAA,CAAW,WACb","file":"chunk-5XBA3DS5.mjs","sourcesContent":["export const MomentState = {\n  LIVE: 'LIVE',\n  ENDED: 'ENDED',\n} as const;\nexport type MomentState = (typeof MomentState)[keyof typeof MomentState];\n","import { z } from 'zod';\nimport { MomentState } from './moment.enums';\n\n/**\n * Host go-live request. All fields optional — a moment can go live\n * untitled. Any additional metadata (cover, tags) is out of scope for\n * MVP; add fields here as the product surface grows.\n */\nexport const GoLiveMomentRequestSchema = z.object({\n  title: z.string().max(120).optional(),\n});\n\n/**\n * Broadcaster payload — everything the phone needs to point its\n * RTMP(S) publisher at the newly-provisioned channel. `streamKey` is\n * plaintext and MUST be treated as secret on the client (never log,\n * never render, never persist). Returned only on go-live and never\n * re-fetched.\n */\nexport const GoLiveMomentResponseSchema = z.object({\n  momentId: z.uuid(),\n  state: z.literal(MomentState.LIVE),\n  liveStartedAt: z.iso.datetime(),\n  ingestEndpoint: z.url(),\n  streamKey: z.string(),\n  playbackUrl: z.url(),\n});\n\n/**\n * Host live-console read for a moment. `playbackUrl` here is the raw\n * (unsigned) URL — hosts don't need a signed ticket to preview their\n * own stream. Viewer playback goes through the viewer endpoint.\n */\nexport const HostMomentLivePayloadSchema = z.object({\n  momentId: z.uuid(),\n  state: z.enum(MomentState),\n  liveStartedAt: z.iso.datetime(),\n  liveEndedAt: z.iso.datetime().nullable(),\n  viewers: z.number().int().nonnegative(),\n  peakViewers: z.number().int().nonnegative(),\n  playbackUrl: z.url().nullable(),\n  serverNow: z.iso.datetime(),\n});\n\n/**\n * Authenticated viewer playback payload. Access is gated on a valid\n * session — no anonymous consumers — but there is NO registration /\n * entitlement check. Any logged-in user with the moment link can watch.\n * On ENDED state the playback fields collapse to null and the FE\n * renders an empty state (rather than 404) so a shared link stays\n * informative after the host ends the stream.\n */\nexport const ViewerMomentPayloadSchema = z.object({\n  momentId: z.uuid(),\n  state: z.enum(MomentState),\n  title: z.string().nullable(),\n  playbackUrl: z.url().nullable(),\n  token: z.string().nullable(),\n  tokenExpiresAt: z.iso.datetime().nullable(),\n  viewers: z.number().int().nonnegative(),\n  liveStartedAt: z.iso.datetime(),\n  liveEndedAt: z.iso.datetime().nullable(),\n});\n\n/**\n * Start a viewing session on a moment. Same shape as the Event\n * flow — the FE POSTs this once when the player mounts, receives a\n * server-issued `sessionId`, then opens the Socket.IO connection at\n * `/moment-viewing-session?sessionId=<id>` and emits `heartbeat` every\n * ~30s. On teardown it calls the `end` endpoint.\n */\nexport const StartMomentViewingSessionRequestSchema = z.object({\n  deviceType: z.string().max(50).optional(),\n});\n\nexport const StartMomentViewingSessionResponseSchema = z.object({\n  sessionId: z.string(),\n});\n\nexport const EndMomentViewingSessionResponseSchema = z.object({\n  durationSec: z.number().int().min(0),\n});\n\n/**\n * WebSocket ACK for a `heartbeat` message. Mirrors the Event flow so\n * FE state machines can share a client. `reason` is set only when\n * `ok === false`; the socket is closed by the server on the same tick.\n */\nexport const MomentViewingSessionHeartbeatAckSchema = z.object({\n  ok: z.boolean(),\n  reason: z.enum(['unauthorized', 'session_ended', 'not_owner', 'internal']).optional(),\n});\n\n/** Client → server frame names on `/moment-viewing-session`. */\nexport const MomentViewingSessionEvents = {\n  Heartbeat: 'heartbeat',\n} as const;\n"]}