/* ========================================================================
   mockApi.jsx
   Phase 2 swap-in seam. Today these are stubs that just return the script.
   In production these calls become real Wonderful inference + Emirates BE.
   ======================================================================== */

window.mockApi = {
  // Pull the next chat turn (would be SSE stream in prod)
  getChatTurn: (channel, idx) => {
    const arr = window.DEMO_SCRIPT[channel] || [];
    return arr[idx];
  },
  // Identity check, would call Skywards profile lookup
  verifyIdentity: ({ booking_ref, email }) => ({
    ok: booking_ref === "K7RJ4X" && email.toLowerCase().includes("lukas.weber"),
    skywards_tier: "Silver",
    member_since: 2019,
  }),
  // Flight options, would call ResConnect / Sabre
  getRebookOptions: () => window.DEMO_SCRIPT.options,
};
