/* global React */
// Tweaks: editable defaults, persisted by the host between the markers below.

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "concept": "plant",
  "theme": "light",
  "animationSpeed": 1,
  "ctaHeadline": "Let's plant a seed.",
  "ctaSubhead": "Tap to begin. Takes about 30 seconds.",
  "incentiveCopy": "Let's connect and stay in touch.",
  "emailButton": "Send my seed",
  "eventLine": "Startup Grind · 2026",
  "industries": "Coffee shop,Online store,Yoga studio,Law firm,Consultant,Restaurant,Creator,Bakery,Dentist,Real estate"
}/*EDITMODE-END*/;

// Palette of possible values (for Tweaks panel)
const TWEAK_OPTIONS = {
  concept: [
    { id: "plant", label: "Plant a Seed (main)", hint: "Tactile growing vine → app bloom" },
    { id: "fortune", label: "Halo Fortune", hint: "Ask a question, Halo answers" },
    { id: "matchmaker", label: "AI Matchmaker", hint: "4 questions → your platform" }
  ],
  theme: [
    { id: "light", label: "Light" },
    { id: "dark", label: "Dark" }
  ]
};

function useTweaks() {
  const [tweaks, setTweaks] = React.useState(TWEAK_DEFAULTS);
  const setTweak = React.useCallback((key, value) => {
    setTweaks(prev => ({ ...prev, [key]: value }));
    try { window.parent.postMessage({ type: '__edit_mode_set_keys', edits: { [key]: value } }, '*'); } catch {}
  }, []);
  return [tweaks, setTweak];
}

Object.assign(window, { TWEAK_DEFAULTS, TWEAK_OPTIONS, useTweaks });
