// marketplace-data.jsx — fake-but-real-feeling marketplace dataset.
// Shared between the marketplace browse and the publisher dashboard.

const MARKETPLACE_APPS = [
  {
    id: 'reorder-hero', name: 'Reorder Hero', initial: 'R',
    color: 'oklch(0.72 0.10 280)',
    dev: 'Northbeam', devVerified: true, devShops: 12,
    tagline: 'One-tap reorder cards that lift repeat revenue.',
    description:
      'Reorder Hero turns a customer\'s order history into a single-tap reorder surface. Shows up in account pages, post-purchase emails, and as a cart slot. Built-in cooldown logic prevents nagging — only nudges customers when they\'re statistically due to repurchase.',
    category: 'Retention', tags: ['Repeat customers', 'AI suggestions', 'Email'],
    price: 'paid', priceLabel: '$19/mo', trialDays: 7,
    rating: 4.8, reviews: 412, installs: 12480,
    surfaces: ['admin', 'storefront'],
    badge: 'Staff pick',
    screens: ['Customer account · Reorder card', 'Cart upsell tile', 'Admin · Repeat cohort'],
  },
  {
    id: 'inkwell-reviews', name: 'Inkwell Reviews', initial: 'I',
    color: 'oklch(0.74 0.10 60)',
    dev: 'Paper Lantern Studio', devVerified: true, devShops: 6,
    tagline: 'Photo reviews that look like they were art-directed.',
    description: 'A reviews app that doesn\'t look like a reviews app. Editorial layout, photo-first cards, configurable typography. Plays nicely with your theme.',
    category: 'Social proof', tags: ['Reviews', 'Photo', 'Theme-aware'],
    price: 'freemium', priceLabel: 'Free · paid plans from $14',
    rating: 4.9, reviews: 1280, installs: 38240,
    surfaces: ['storefront', 'admin'],
    badge: 'Trending',
    screens: ['Product page · Photo wall', 'Email request', 'Admin · Moderation queue'],
  },
  {
    id: 'tideline', name: 'Tideline Loyalty', initial: 'T',
    color: 'oklch(0.72 0.09 200)',
    dev: 'Harbor Co.', devVerified: true, devShops: 22,
    tagline: 'Tier-based loyalty with on-brand storefront cards.',
    description: 'Tides give your top customers escalating perks. Set tier thresholds, automate emails, and drop a beautifully-styled status card onto your storefront.',
    category: 'Retention', tags: ['Loyalty', 'Tiers', 'Email'],
    price: 'paid', priceLabel: '$29/mo',
    rating: 4.6, reviews: 248, installs: 6210,
    surfaces: ['admin', 'storefront'],
    screens: ['Customer status card', 'Admin · Tier rules', 'Email · Promotion'],
  },
  {
    id: 'shopline-ai', name: 'Shopline Concierge', initial: 'S',
    color: 'oklch(0.70 0.12 295)',
    dev: 'Helio Labs', devVerified: true, devShops: 4,
    tagline: 'AI concierge that answers from your real catalog.',
    description: 'Drop-in chat agent that learns your catalog, policies, and tone. Hands off cleanly to a human inbox.',
    category: 'AI agents', tags: ['AI', 'Chat', 'Support'],
    price: 'paid', priceLabel: '$49/mo · usage-based',
    rating: 4.7, reviews: 92, installs: 1820,
    surfaces: ['storefront', 'admin'],
    badge: 'New',
    screens: ['Storefront · Chat widget', 'Admin · Conversations', 'Admin · Tone & guardrails'],
  },
  {
    id: 'curtain-call', name: 'Curtain Call', initial: 'C',
    color: 'oklch(0.74 0.08 30)',
    dev: 'Sarah Nguyễn', devVerified: false, devShops: 1, devOwn: true,
    tagline: 'Exit-intent pop-up that doesn\'t feel like one.',
    description: 'A quieter, type-led exit-intent surface. No spinning wheels. Captures emails with a single-field form and an honest line of copy.',
    category: 'Marketing', tags: ['Email capture', 'Exit intent'],
    price: 'free', priceLabel: 'Free',
    rating: 4.5, reviews: 38, installs: 612,
    surfaces: ['storefront'],
    screens: ['Storefront · Pop-up', 'Admin · Triggers'],
  },
  {
    id: 'rowboat', name: 'Rowboat', initial: 'R',
    color: 'oklch(0.72 0.10 145)',
    dev: 'Quiet Shoreline', devVerified: true, devShops: 9,
    tagline: 'Subscription manager that puts customers in control.',
    description: 'Self-serve subscription portal: skip, swap, pause. Reduces support load by ~40%.',
    category: 'Subscriptions', tags: ['Recurring', 'Self-serve'],
    price: 'paid', priceLabel: '1% + $0.10/charge',
    rating: 4.4, reviews: 612, installs: 18920,
    surfaces: ['storefront', 'admin'],
    screens: ['Customer · Manage plan', 'Admin · Plans', 'Admin · Churn radar'],
  },
  {
    id: 'mailroom', name: 'Mailroom', initial: 'M',
    color: 'oklch(0.72 0.10 20)',
    dev: 'Cabinet & Co', devVerified: true, devShops: 18,
    tagline: 'Transactional emails that match your brand.',
    description: 'Replace the default order emails with editable, brand-matched templates. Live preview as you edit.',
    category: 'Marketing', tags: ['Email', 'Branding', 'Transactional'],
    price: 'paid', priceLabel: '$12/mo',
    rating: 4.7, reviews: 824, installs: 24180,
    surfaces: ['admin'],
    screens: ['Admin · Template editor', 'Email preview', 'Brand kit'],
  },
  {
    id: 'lighthouse', name: 'Lighthouse Analytics', initial: 'L',
    color: 'oklch(0.70 0.12 250)',
    dev: 'North Light', devVerified: true, devShops: 35,
    tagline: 'Cohort-first analytics for repeat-purchase brands.',
    description: 'Plain-English answers about your retention, LTV, and product affinity.',
    category: 'Analytics', tags: ['Cohorts', 'LTV', 'Retention'],
    price: 'paid', priceLabel: '$99/mo',
    rating: 4.6, reviews: 142, installs: 2480,
    surfaces: ['admin'],
    badge: 'Staff pick',
    screens: ['Cohort matrix', 'LTV trend', 'Question composer'],
  },
  {
    id: 'frostline', name: 'Frostline Wishlist', initial: 'F',
    color: 'oklch(0.76 0.08 220)',
    dev: 'Sarah Nguyễn', devVerified: false, devShops: 1, devOwn: true,
    tagline: 'A wishlist drawer that doesn\'t scream "app".',
    description: 'Built originally for Sarah\'s Linen as Wishlist Drawer. Re-packaged for the marketplace — quieter visuals, less chrome.',
    category: 'Conversion', tags: ['Wishlist', 'Drawer', 'Customer account'],
    price: 'free', priceLabel: 'Free · in review',
    rating: null, reviews: 0, installs: 0,
    surfaces: ['storefront', 'admin'],
    badge: 'Pending review',
    pending: true,
    screens: ['Storefront · Drawer', 'Account page · Saved items'],
  },
  {
    id: 'birch', name: 'Birch Bundles', initial: 'B',
    color: 'oklch(0.74 0.08 90)',
    dev: 'Greenhouse Group', devVerified: true, devShops: 14,
    tagline: 'Bundle builder with collection-level controls.',
    description: 'Let customers compose bundles, with per-tier discounts and inventory-aware constraints.',
    category: 'Cross-sell', tags: ['Bundles', 'Cross-sell'],
    price: 'paid', priceLabel: '$25/mo',
    rating: 4.5, reviews: 308, installs: 8120,
    surfaces: ['storefront', 'admin'],
    screens: ['Storefront · Bundle builder', 'Admin · Bundle config'],
  },
  {
    id: 'sundial', name: 'Sundial Schedules', initial: 'S',
    color: 'oklch(0.74 0.08 70)',
    dev: 'Cabinet & Co', devVerified: true, devShops: 18,
    tagline: 'Schedule any app or banner — once, recurring, or rules-based.',
    description: 'Time-windowed visibility for any app or storefront block. Daylight savings handled.',
    category: 'Productivity', tags: ['Scheduling', 'Automation'],
    price: 'free', priceLabel: 'Free',
    rating: 4.6, reviews: 412, installs: 11240,
    surfaces: ['admin'],
    screens: ['Calendar', 'Rule builder'],
  },
  {
    id: 'flightplan', name: 'Flightplan', initial: 'F',
    color: 'oklch(0.72 0.10 320)',
    dev: 'Helio Labs', devVerified: true, devShops: 4,
    tagline: 'AI agent that runs your weekly ops review.',
    description: 'Plug Flightplan into your Slack. Mondays at 9am you get a one-page brief: anomalies, wins, and what needs your attention.',
    category: 'AI agents', tags: ['AI', 'Slack', 'Ops'],
    price: 'paid', priceLabel: '$59/mo',
    rating: 4.9, reviews: 64, installs: 982,
    surfaces: ['admin'],
    badge: 'New',
    screens: ['Slack brief', 'Anomaly inbox', 'Tuning'],
  },
];

const MARKETPLACE_CATEGORIES = [
  { id: 'all', label: 'All apps', icon: 'apps' },
  { id: 'AI agents', label: 'AI agents', icon: 'sparkle' },
  { id: 'Retention', label: 'Retention' },
  { id: 'Social proof', label: 'Social proof' },
  { id: 'Marketing', label: 'Marketing' },
  { id: 'Subscriptions', label: 'Subscriptions' },
  { id: 'Analytics', label: 'Analytics' },
  { id: 'Conversion', label: 'Conversion' },
  { id: 'Cross-sell', label: 'Cross-sell' },
  { id: 'Productivity', label: 'Productivity' },
];

// Drafts for the current user — wired into Library + Draft Detail flow.
const MY_DRAFTS = [
  {
    id: 'discount-stacker', name: 'Discount Stacker', initial: 'D',
    color: 'oklch(0.74 0.10 30)',
    prompt: 'Stack multiple discount codes at checkout with rules I can set (max 2 stacks, no sale items).',
    direction: 'Pro',
    summary:
      'A discount-stacking engine plus admin UI. Customers see eligible-to-combine codes at checkout; you set rules per code (max stack count, exclusions, expiry).',
    createdBy: 'AI · Discount Stacker template',
    lastEdit: '12m ago',
    versions: 2, prompts: 4, screens: 3, files: 11,
    installable: true,
  },
  {
    id: 'flash-vip', name: 'Flash for VIP', initial: 'F',
    color: 'oklch(0.74 0.10 350)',
    prompt: '1-hour flash sale for VIP customers with a countdown banner on the storefront.',
    direction: 'Lite',
    summary:
      'A scheduled flash-sale rule + storefront countdown. Eligibility is gated by customer tag.',
    createdBy: 'AI · scaffolded',
    lastEdit: '2h ago',
    versions: 1, prompts: 2, screens: 2, files: 7,
    installable: false, blocker: 'Needs storefront block placement',
  },
  {
    id: 'wishlist-drawer', name: 'Wishlist Drawer', initial: 'W',
    color: 'oklch(0.74 0.08 220)',
    prompt: 'A quiet wishlist drawer that customers can open from any page.',
    direction: 'Custom',
    summary:
      'Wishlist drawer with persistence in customer account. Empty state is intentionally understated.',
    createdBy: 'AI · scaffolded · refined 3×',
    lastEdit: '3d ago',
    versions: 4, prompts: 9, screens: 5, files: 18,
    installable: true,
    publishable: true,
  },
];

// User's published apps (or pending publication) — drives the Dashboard view.
const MY_PUBLISHED = [
  {
    id: 'curtain-call', name: 'Curtain Call',
    status: 'live', publishedAt: 'Feb 12, 2026',
    installs: 612, installsTrend: '+34 / 30d',
    earnings: 0, earningsLabel: 'Free app',
    rating: 4.5, reviews: 38,
    price: 'Free',
    sparkline: [4,6,5,8,7,9,7,11,9,12,10,14,12,15],
  },
  {
    id: 'frostline', name: 'Frostline Wishlist',
    status: 'in-review', publishedAt: 'Submitted 2d ago',
    installs: 0, installsTrend: 'Awaiting approval',
    earnings: 0, earningsLabel: 'Free',
    rating: null, reviews: 0,
    price: 'Free',
    sparkline: null,
    note: 'Reviewers expect a verdict within 3 business days.',
  },
];

// Recent activity feed shown on the publisher dashboard.
const PUBLISHER_ACTIVITY = [
  { type: 'install', icon: 'plus', who: 'Bread & Burrow', when: '4m ago', app: 'Curtain Call', tone: 'success' },
  { type: 'review', icon: 'sparkle', who: 'Sundae Vintage', when: '1h ago', app: 'Curtain Call', detail: '5 ★ · "Finally, an exit popup I don\'t hate."', tone: 'magic' },
  { type: 'install', icon: 'plus', who: 'Manaaki Wools', when: '3h ago', app: 'Curtain Call', tone: 'success' },
  { type: 'review-status', icon: 'spinner', who: 'Ecommos review team', when: 'Yesterday', app: 'Frostline Wishlist', detail: 'Build passed automated checks · queued for human review', tone: 'info' },
  { type: 'install', icon: 'plus', who: 'Pinewater Coffee', when: 'Yesterday', app: 'Curtain Call', tone: 'success' },
  { type: 'payout', icon: 'check', who: 'Stripe', when: '3d ago', app: '—', detail: '$0.00 payout (free apps only) · next on Jun 1', tone: 'neutral' },
];

// Reviews used in marketplace detail dialog + dashboard.
const SAMPLE_REVIEWS = [
  { who: 'Sundae Vintage', initials: 'SV', rating: 5, when: '2d ago', text: 'Finally, an exit popup I don\'t hate. Drop-in install, no developer needed, and the copy actually matches our voice.' },
  { who: 'Bread & Burrow', initials: 'BB', rating: 4, when: '1w ago', text: 'Works as advertised. Wish it had a Klaviyo handoff out of the box — easy to wire up yourself though.' },
  { who: 'Lumen Studio', initials: 'LS', rating: 5, when: '3w ago', text: 'Quietest, most tasteful "wait, don\'t leave" app on the marketplace.' },
];

Object.assign(window, {
  MARKETPLACE_APPS, MARKETPLACE_CATEGORIES,
  MY_DRAFTS, MY_PUBLISHED, PUBLISHER_ACTIVITY, SAMPLE_REVIEWS,
});
