// data.jsx — products, states, categories
// Exposed on window so other Babel scripts can access.
//
// 2026-05-14: all product rows scrubbed to placeholder strings so
// nobody who stumbles onto the page mistakes any name, strain,
// potency, or price as real inventory. Real data lands when the
// KPI-app "Top Secret Module" feed goes live (phase 2). Until then
// every cell reads "Placeholder NN" / "xxx" / "—".

const STATES = [
  { code:'MT', name:'Montana',    status:'live',     statusLabel:'Live menu',         note:'Primary inventory · placeholder', rooted:'placeholder',     since:'—' },
  { code:'CA', name:'California', status:'soon',     statusLabel:'Onboarding',        note:'Buyer access waitlist · TBD',     rooted:'placeholder',     since:'—' },
  { code:'OR', name:'Oregon',     status:'soon',     statusLabel:'Onboarding',        note:'Compliance review',               rooted:'placeholder',     since:'—' },
  { code:'MD', name:'Maryland',   status:'soon',     statusLabel:'Coming online',     note:'East-coast launch · TBD',         rooted:'placeholder',     since:'—' },
  { code:'OH', name:'Ohio',       status:'soon',     statusLabel:'Onboarding',        note:'Midwest expansion · pending',     rooted:'placeholder',     since:'—' },
  { code:'NV', name:'Nevada',     status:'waitlist', statusLabel:'Waitlist',          note:'Distributor pending',             rooted:'placeholder',     since:'—' },
  { code:'AZ', name:'Arizona',    status:'waitlist', statusLabel:'Waitlist',          note:'Sales rep intro stage',           rooted:'placeholder',     since:'—' },
  { code:'FL', name:'Florida',    status:'waitlist', statusLabel:'Waitlist',          note:'Request access · review',         rooted:'placeholder',     since:'—' },
];

const CATEGORIES = [
  { id:'aio',             name:'All-in-One',       short:'Ready-to-sell disposables.',    icon:'◆', accent:'#ff3a3a' },
  { id:'510',             name:'510 Cartridges',   short:'Threaded cart menu.',           icon:'◈', accent:'#ff7a3a' },
  { id:'sauce',           name:'Sauce',            short:'Terp-forward jars.',            icon:'●', accent:'#3acaff' },
  { id:'batter',          name:'Batter',           short:'Whipped batter/badder.',        icon:'▰', accent:'#9b6aff' },
  { id:'diamonds-terps',  name:'Diamonds + Terps', short:'THCA diamonds, terp bundles.',  icon:'✦', accent:'#ffcf3a' },
  { id:'sugar',           name:'Sugar',            short:'Granular sugar SKUs.',          icon:'✺', accent:'#3ade8a' },
];

const STRAIN_TYPES = ['Indica', 'Sativa', 'Hybrid'];

// Placeholder MT inventory — Diamond 2026-05-14: every cell scrubbed so
// no one mistakes a fake row for real product. Status mix kept so the
// "available / low / out / soon" chip variants + hero stat counts still
// render naturally. Restocked flags retained on a couple rows so the
// live-ticker pulse animation still has something to highlight.
//
// [cat, name, status, format, thc, raw, total, terps, cbd, strain, price, unit, moq, notes, restockedAt?]
const MT_ROWS = [
  ['aio','Placeholder 01','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','unit','xxx','Placeholder copy', null],
  ['aio','Placeholder 02','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','unit','xxx','Placeholder copy', 'restocked'],
  ['aio','Placeholder 03','low','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','unit','xxx','Placeholder copy', null],
  ['aio','Placeholder 04','soon','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','unit','xxx','Placeholder copy', null],

  ['510','Placeholder 05','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','cart','xxx','Placeholder copy', null],
  ['510','Placeholder 06','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','cart','xxx','Placeholder copy', null],
  ['510','Placeholder 07','out','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','cart','xxx','Placeholder copy', null],
  ['510','Placeholder 08','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','cart','xxx','Placeholder copy', 'restocked'],

  ['sauce','Placeholder 09','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['sauce','Placeholder 10','low','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['sauce','Placeholder 11','soon','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],

  ['batter','Placeholder 12','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['batter','Placeholder 13','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['batter','Placeholder 14','soon','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],

  ['diamonds-terps','Placeholder 15','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['diamonds-terps','Placeholder 16','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['diamonds-terps','Placeholder 17','out','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],

  ['sugar','Placeholder 18','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
  ['sugar','Placeholder 19','available','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', 'restocked'],
  ['sugar','Placeholder 20','soon','placeholder','xxx','xxx','xxx','xxx','xxx','—','xxx','g','xxx','Placeholder copy', null],
];

const slug = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/(^-|-$)/g,'');

const PRODUCTS = MT_ROWS.map((r, i) => ({
  id: slug(`mt-${r[0]}-${r[1]}`),
  state: 'MT',
  cat: r[0],
  name: r[1],
  status: r[2],        // available | low | out | soon
  format: r[3],
  thc: r[4],
  raw: r[5],
  total: r[6],
  terps: r[7],
  cbd: r[8],
  strain: r[9],
  price: r[10],
  unit: r[11],
  moq: r[12],
  notes: r[13],
  flag: r[14],         // 'restocked' | null
  batch: `MT-${r[0].toUpperCase()}-${String(i+1).padStart(3,'0')}`,
  description: `Placeholder ${r[0]} SKU. Detail page reserves slots for finished photography, COA, QR, and buyer terms once real inventory loads from the KPI-app feed.`,
}));

const STATUS_META = {
  available: { label:'In stock',   tone:'#3ade8a', bg:'rgba(58,222,138,.10)', bd:'rgba(58,222,138,.35)' },
  low:       { label:'Low stock',  tone:'#ffb24a', bg:'rgba(255,178,74,.10)', bd:'rgba(255,178,74,.40)' },
  soon:      { label:'Coming soon',tone:'#ffe17a', bg:'rgba(255,225,122,.08)',bd:'rgba(255,225,122,.30)'},
  out:       { label:'Out',        tone:'#ff6a6a', bg:'rgba(255,106,106,.10)',bd:'rgba(255,106,106,.35)'},
  restocked: { label:'Just restocked', tone:'#7ad4ff', bg:'rgba(122,212,255,.10)', bd:'rgba(122,212,255,.40)' },
};

const VALID_TOKENS = new Set(['DIAMOND','TSWBUYER','MONTANA']);

Object.assign(window, { STATES, CATEGORIES, STRAIN_TYPES, PRODUCTS, STATUS_META, VALID_TOKENS, slug });
