import React, { useState, useEffect, useRef, useMemo } from 'react'; import { Camera, Sparkles, LayoutGrid, FileText, Layers, RefreshCw, Upload, Plus, ThumbsUp, Trash2, Edit3, Check, Filter, Search, Download, Copy, Printer, ChevronRight, AlertTriangle, Zap, Target, Compass, Eye, Cpu, Radio, ArrowUpRight, CheckCircle2, Sliders, Maximize2, Minimize2, Play, Users, BarChart3, Network, Lightbulb, ShieldAlert, Clock, Award, Wand2 } from 'lucide-react'; // ============================================================================ // CONSTANTS & FRAMEWORK TEMPLATES (STRATEGY TABLE INTERACTIVE) // ============================================================================ const PODS = [ { id: 'all', name: 'All Pods (Mesh View)', shortName: 'Mesh View', badge: 'MESH', color: 'amber' }, { id: 'pod-1', name: 'Pod 1: Alpha Table', shortName: 'Pod 1 • Alpha', badge: 'P1', color: 'amber', focus: 'Core Growth & Enterprise' }, { id: 'pod-2', name: 'Pod 2: Catalyst Table', shortName: 'Pod 2 • Catalyst', badge: 'P2', color: 'cyan', focus: 'AI & Product Velocity' }, { id: 'pod-3', name: 'Pod 3: Horizon Table', shortName: 'Pod 3 • Horizon', badge: 'P3', color: 'emerald', focus: 'Customer & Ecosystem' }, { id: 'pod-4', name: 'Pod 4: Vanguard Table', shortName: 'Pod 4 • Vanguard', badge: 'P4', color: 'rose', focus: 'Risk & Operational Scale' } ]; const FRAMEWORKS = { 'impact-effort': { id: 'impact-effort', name: 'Impact / Effort Strategic Matrix', subtitle: 'Prioritize high-leverage breakthroughs vs. resource intensity', methodology: 'Strategic Prioritization', axes: { x: 'Implementation Effort →', y: '↑ Strategic Impact' }, zones: [ { id: 'quick-wins', title: 'Quick Wins', subtitle: 'High Impact • Low Effort', color: 'emerald', badge: 'Q1' }, { id: 'big-bets', title: 'Strategic Big Bets', subtitle: 'High Impact • High Effort', color: 'amber', badge: 'Q2' }, { id: 'fill-ins', title: 'Tactical Fill-Ins', subtitle: 'Low Impact • Low Effort', color: 'cyan', badge: 'Q3' }, { id: 'hard-slogs', title: 'Hard Slogs / Deprioritize', subtitle: 'Low Impact • High Effort', color: 'rose', badge: 'Q4' } ] }, 'cps-catalyst': { id: 'cps-catalyst', name: 'Creative Problem Solving (CPS) Catalyst', subtitle: 'Divergent ideation to convergent executive momentum', methodology: 'CPS Facilitator Canvas', axes: { x: 'Divergence to Convergence →', y: '↑ Abstraction to Action' }, zones: [ { id: 'clarify', title: '1. Clarify the Challenge', subtitle: 'Root bottlenecks & problem framing', color: 'rose', badge: 'C1' }, { id: 'ideate', title: '2. Ideate Breakthroughs', subtitle: 'Radical possibilities & wild cards', color: 'amber', badge: 'C2' }, { id: 'develop', title: '3. Develop Solutions', subtitle: 'Structured prototypes & models', color: 'cyan', badge: 'C3' }, { id: 'momentum', title: '4. Action Momentum', subtitle: 'Immediate 30-day commitments', color: 'emerald', badge: 'C4' } ] }, 'event-canvas': { id: 'event-canvas', name: 'Event & Stakeholder Transformation Canvas', subtitle: 'Map stakeholder pains to behavioral change & commitment', methodology: 'Event Canvas Methodology', axes: { x: 'Experience Journey →', y: '↑ Value Transformation' }, zones: [ { id: 'pains', title: 'Stakeholder Pains & Friction', subtitle: 'Frustrations & status-quo traps', color: 'rose', badge: 'E1' }, { id: 'gains', title: 'Experience Gains & Sparks', subtitle: 'Unexpected delight & clarity', color: 'amber', badge: 'E2' }, { id: 'behavior', title: 'Target Behavior Shift', subtitle: 'How leaders act differently Monday', color: 'cyan', badge: 'E3' }, { id: 'commitment', title: 'Commitment to Action', subtitle: 'Signed ownership & resource pledges', color: 'emerald', badge: 'E4' } ] }, 'scenario-wargame': { id: 'scenario-wargame', name: 'Scenario War-Gaming & Disruption Grid', subtitle: 'Stress-test strategy against emerging market signals', methodology: 'Foresight & Resilience', axes: { x: 'Internal to External →', y: '↑ Defensive to Offensive' }, zones: [ { id: 'signals', title: 'Early Market Signals', subtitle: 'Disruptive tech & buyer shifts', color: 'amber', badge: 'S1' }, { id: 'vulnerabilities', title: 'Strategic Vulnerabilities', subtitle: 'Single points of failure & blindspots', color: 'rose', badge: 'S2' }, { id: 'moats', title: 'Defensive Moats', subtitle: 'Core IP, trust & switching costs', color: 'cyan', badge: 'S3' }, { id: 'offensive', title: 'Asymmetric Offensive Moves', subtitle: 'Category-redefining plays', color: 'emerald', badge: 'S4' } ] } }; const NOTE_COLORS = { yellow: { name: 'Canary Yellow', bg: 'bg-amber-200', border: 'border-amber-400', text: 'text-slate-900', hex: '#fde68a', stroke: '#d97706', tagBg: 'bg-amber-500/20 text-amber-300 border-amber-500/40' }, pink: { name: 'Coral Rose', bg: 'bg-rose-200', border: 'border-rose-400', text: 'text-slate-900', hex: '#fecdd3', stroke: '#e11d48', tagBg: 'bg-rose-500/20 text-rose-300 border-rose-500/40' }, blue: { name: 'Electric Cyan', bg: 'bg-cyan-200', border: 'border-cyan-400', text: 'text-slate-900', hex: '#a5f3fc', stroke: '#0891b2', tagBg: 'bg-cyan-500/20 text-cyan-300 border-cyan-500/40' }, green: { name: 'Mint Emerald', bg: 'bg-emerald-200', border: 'border-emerald-400', text: 'text-slate-900', hex: '#a7f3d0', stroke: '#059669', tagBg: 'bg-emerald-500/20 text-emerald-300 border-emerald-500/40' }, purple: { name: 'Electric Violet', bg: 'bg-violet-200', border: 'border-violet-400', text: 'text-slate-900', hex: '#ddd6fe', stroke: '#7c3aed', tagBg: 'bg-violet-500/20 text-violet-300 border-violet-500/40' }, ink: { name: 'Tabletop Marker Ink', bg: 'bg-slate-100', border: 'border-slate-400 border-dashed', text: 'text-slate-900 italic', hex: '#f1f5f9', stroke: '#475569', tagBg: 'bg-slate-500/20 text-slate-300 border-slate-500/40' } }; // Pre-populated realistic executive workshop dataset across Pods 1-4 const INITIAL_NOTES = [ { id: 'n-101', text: 'Deploy autonomous AI onboarding concierge for mid-market accounts to cut time-to-value by 60%', color: 'green', pod: 'pod-1', framework: 'impact-effort', zone: 'quick-wins', theme: 'AI Customer Velocity', urgency: 9, actionability: 9, votes: 7, owner: 'VP Customer Success', roadmapHorizon: '30-Day Sprint', timestamp: '10:14 AM', source: 'Optical Capture • Pod 1' }, { id: 'n-102', text: 'Unify fragmented data lakes across EMEA & NA before Q3 predictive pricing rollout', color: 'yellow', pod: 'pod-2', framework: 'impact-effort', zone: 'big-bets', theme: 'Data & Platform Architecture', urgency: 8, actionability: 7, votes: 6, owner: 'Chief Data Officer', roadmapHorizon: '60-Day Build', timestamp: '10:16 AM', source: 'Optical Capture • Pod 2' }, { id: 'n-103', text: 'Launch "Zero-Integration" sandbox trial so enterprise buyers can test with live CSVs in 5 mins', color: 'green', pod: 'pod-2', framework: 'impact-effort', zone: 'quick-wins', theme: 'Frictionless GTM & PLG', urgency: 9, actionability: 10, votes: 9, owner: 'Head of Growth', roadmapHorizon: '30-Day Sprint', timestamp: '10:18 AM', source: 'Optical Capture • Pod 2' }, { id: 'n-104', text: 'Rebuild legacy on-prem billing engine from scratch (Warning: 14-month engineering sinkhole!)', color: 'pink', pod: 'pod-4', framework: 'impact-effort', zone: 'hard-slogs', theme: 'Legacy Tech Debt Trap', urgency: 4, actionability: 3, votes: 2, owner: 'Unassigned', roadmapHorizon: 'Deprioritize', timestamp: '10:21 AM', source: 'Optical Capture • Pod 4' }, { id: 'n-105', text: 'Co-create industry benchmark report with top 20 lighthouse clients for C-suite demand gen', color: 'blue', pod: 'pod-3', framework: 'impact-effort', zone: 'quick-wins', theme: 'Ecosystem & Brand Authority', urgency: 8, actionability: 8, votes: 5, owner: 'CMO', roadmapHorizon: '30-Day Sprint', timestamp: '10:24 AM', source: 'Optical Capture • Pod 3' }, { id: 'n-106', text: 'Acquire boutique vertical AI compliance startup to fast-track regulated banking tier', color: 'purple', pod: 'pod-1', framework: 'impact-effort', zone: 'big-bets', theme: 'M&A & Vertical Expansion', urgency: 7, actionability: 6, votes: 8, owner: 'Corp Dev / CEO', roadmapHorizon: '90-Day Strategic', timestamp: '10:27 AM', source: 'Optical Capture • Pod 1' }, { id: 'n-107', text: 'Standardize partner enablement decks and self-serve RFP security questionnaire portal', color: 'blue', pod: 'pod-3', framework: 'impact-effort', zone: 'fill-ins', theme: 'Frictionless GTM & PLG', urgency: 6, actionability: 9, votes: 3, owner: 'RevOps Lead', roadmapHorizon: '60-Day Build', timestamp: '10:29 AM', source: 'Optical Capture • Pod 3' }, { id: 'n-108', text: 'INK ANNOTATION: "Sales cycle stalls at Legal & InfoSec review — average 42 days lost!"', color: 'ink', pod: 'pod-4', framework: 'impact-effort', zone: 'quick-wins', theme: 'Frictionless GTM & PLG', urgency: 10, actionability: 8, votes: 11, owner: 'CISO + VP Sales', roadmapHorizon: '30-Day Sprint', timestamp: '10:32 AM', source: 'Tabletop Ink • Pod 4' }, { id: 'n-109', text: 'Shift pricing from seat-based licenses to outcome-based consumption tiers with usage guardrails', color: 'yellow', pod: 'pod-1', framework: 'impact-effort', zone: 'big-bets', theme: 'AI Customer Velocity', urgency: 9, actionability: 7, votes: 10, owner: 'Chief Revenue Officer', roadmapHorizon: '60-Day Build', timestamp: '10:35 AM', source: 'Optical Capture • Pod 1' }, { id: 'n-110', text: 'Embed real-time ROI telemetry widget directly inside customer executive dashboard', color: 'green', pod: 'pod-3', framework: 'impact-effort', zone: 'quick-wins', theme: 'AI Customer Velocity', urgency: 8, actionability: 9, votes: 7, owner: 'VP Product', roadmapHorizon: '30-Day Sprint', timestamp: '10:38 AM', source: 'Optical Capture • Pod 3' } ]; // Simulated Tabletop Presets for realistic testing without a physical workshop table const TABLETOP_SIMULATION_PRESETS = [ { id: 'sim-alpha', name: 'Scene A: Executive Growth & AI Velocity (6 Notes + Ink)', pod: 'pod-1', items: [ { text: 'Automate SOC2 & AI governance packet for instant enterprise procurement', color: 'green', x: 0.12, y: 0.15, rot: -2.5, zoneIndex: 0, theme: 'Frictionless GTM & PLG' }, { text: 'Pilot predictive churn radar using product telemetry in top 50 accounts', color: 'yellow', x: 0.28, y: 0.24, rot: 1.8, zoneIndex: 0, theme: 'AI Customer Velocity' }, { text: 'Build multi-agent workflow studio for custom enterprise automation', color: 'purple', x: 0.62, y: 0.16, rot: -1.2, zoneIndex: 1, theme: 'Data & Platform Architecture' }, { text: 'Expand sovereign cloud deployment in Frankfurt & Tokyo', color: 'yellow', x: 0.74, y: 0.28, rot: 2.4, zoneIndex: 1, theme: 'M&A & Vertical Expansion' }, { text: 'Refresh partner certification badges & micro-learning videos', color: 'blue', x: 0.18, y: 0.66, rot: 1.5, zoneIndex: 2, theme: 'Ecosystem & Brand Authority' }, { text: 'Custom white-label mobile app for low-tier resellers', color: 'pink', x: 0.66, y: 0.68, rot: -3.1, zoneIndex: 3, theme: 'Legacy Tech Debt Trap' }, { text: 'INK ARROW: "Fast-track Q1! Unblocks $4.2M pipeline"', color: 'ink', x: 0.15, y: 0.41, rot: -1.0, zoneIndex: 0, theme: 'Frictionless GTM & PLG', isInk: true } ] }, { id: 'sim-catalyst', name: 'Scene B: Catalyst Breakout — Product & Ecosystem Sparks (5 Notes + Ink)', pod: 'pod-2', items: [ { text: '1-Click Slack & Teams executive digest for weekly ROI proof', color: 'green', x: 0.14, y: 0.18, rot: 2.1, zoneIndex: 0, theme: 'AI Customer Velocity' }, { text: 'Open-source our core connector SDK to spark developer community', color: 'blue', x: 0.31, y: 0.22, rot: -1.8, zoneIndex: 0, theme: 'Ecosystem & Brand Authority' }, { text: 'Strategic alliance with global Big-4 advisory practices', color: 'yellow', x: 0.64, y: 0.20, rot: 1.4, zoneIndex: 1, theme: 'Ecosystem & Brand Authority' }, { text: 'Consolidate 4 internal admin portals into unified React shell', color: 'blue', x: 0.22, y: 0.64, rot: -2.2, zoneIndex: 2, theme: 'Data & Platform Architecture' }, { text: 'Support bespoke on-premise mainframes for 2 legacy accounts', color: 'pink', x: 0.68, y: 0.65, rot: 2.8, zoneIndex: 3, theme: 'Legacy Tech Debt Trap' }, { text: 'INK NOTE: "Kill legacy mainframe support — redirect 6 engineers to AI SDK!"', color: 'ink', x: 0.58, y: 0.84, rot: -0.8, zoneIndex: 3, theme: 'Legacy Tech Debt Trap', isInk: true } ] } ]; const REPORT_FORMATS = [ { id: 'boardroom-brief', name: 'Executive Boardroom Brief', subtitle: '1-Page C-Suite Synthesis & Resource Allocation', icon: Award, targetAudience: 'CEO, Board of Directors, Executive Sponsors', focus: 'High-level strategic consensus, Top 3 Big Bets, immediate capital/talent reallocation, and critical blind spots resolved.', bestWhen: 'High urgency & high strategic big-bets ratio requiring immediate executive sign-off.' }, { id: 'roadmap-30-60-90', name: '30-60-90 Day Momentum & Action Roadmap', subtitle: 'Operational Execution Matrix with Owners & KPIs', icon: Zap, targetAudience: 'VP Product, Engineering, GTM Leads & PMO', focus: 'Concrete sprint commitments, Quick Wins conversion, accountable owners, milestone gates, and execution risk mitigation.', bestWhen: 'High actionability score and abundant Quick Wins ready for Monday morning sprint planning.' }, { id: 'mesh-deep-dive', name: 'Cross-Pod Collective Intelligence Deep-Dive', subtitle: 'Multi-Table Thematic Synthesis & Tension Resolution', icon: Network, targetAudience: 'Strategy Teams, Transformation Office & Workshop Participants', focus: 'Cross-pod convergence analysis, where breakout tables aligned vs. collided, verbatim sticky-note evidence, and cultural insights.', bestWhen: '3+ active pods with rich thematic diversity and productive cross-functional tensions.' }, { id: 'visual-readout', name: 'Visual Canvas Snapshot & Facilitator Readout', subtitle: 'Spatial Quadrant Breakdown & Reflection Lounge Deck', icon: LayoutGrid, targetAudience: 'All Workshop Attendees (Immediate Reflection Lounge Shareout)', focus: 'Zone-by-zone spatial summary, top-voted sticky notes per quadrant, handwritten ink highlights, and commitment pledges.', bestWhen: 'Immediate end-of-workshop live readout in The Reflection Lounge.' } ]; // ============================================================================ // GEMINI API HELPER WITH EXPONENTIAL BACKOFF // ============================================================================ async function callGeminiAPI(payload, maxRetries = 3) { const apiKey = ""; // Provided by runtime environment const apiUrl = `https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:generateContent?key=${apiKey}`; let delay = 1000; for (let attempt = 0; attempt < maxRetries; attempt++) { try { const response = await fetch(apiUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(payload) }); if (!response.ok) { throw new Error(`HTTP status ${response.status}`); } const result = await response.json(); const text = result?.candidates?.[0]?.content?.parts?.[0]?.text; if (!text) throw new Error('Empty response from Gemini API'); return text; } catch (err) { if (attempt === maxRetries - 1) throw err; await new Promise((res) => setTimeout(res, delay)); delay *= 2; } } } // ============================================================================ // MAIN APPLICATION COMPONENT // ============================================================================ export default function App() { // Navigation & Workspace State const [activeTab, setActiveTab] = useState('capture'); // 'capture' | 'intelligence' | 'explorer' | 'report' const [selectedPod, setSelectedPod] = useState('all'); const [activeFrameworkId, setActiveFrameworkId] = useState('impact-effort'); const activeFramework = FRAMEWORKS[activeFrameworkId]; // Sticky Notes Repository State const [notes, setNotes] = useState(INITIAL_NOTES); const [sessionTitle, setSessionTitle] = useState('Q3 Global Executive Strategy Offsite — Revenue & AI Velocity'); // Optical Capture & Camera State const [captureSource, setCaptureSource] = useState('simulator'); // 'simulator' | 'webcam' | 'upload' const [activeSimPresetIndex, setActiveSimPresetIndex] = useState(0); const [simJitterSeed, setSimJitterSeed] = useState(1); const [webcamActive, setWebcamActive] = useState(false); const [webcamError, setWebcamError] = useState(null); const [uploadedImage, setUploadedImage] = useState(null); const [showKeystoneGrid, setShowKeystoneGrid] = useState(true); const [isScanning, setIsScanning] = useState(false); const [lastScanSummary, setLastScanSummary] = useState(null); const [capturePodTarget, setCapturePodTarget] = useState('pod-1'); // Refs for Video & Simulated Canvas const videoRef = useRef(null); const simCanvasRef = useRef(null); const fileInputRef = useRef(null); // Digital Twin Canvas Interaction State const [editingNoteId, setEditingNoteId] = useState(null); const [editingText, setEditingText] = useState(''); const [showAddModal, setShowAddModal] = useState(false); const [newNoteDraft, setNewNoteDraft] = useState({ text: '', color: 'yellow', zone: 'quick-wins', pod: 'pod-1', theme: 'AI Customer Velocity', owner: 'Exec Lead' }); // Collective Intelligence AI Catalyst State const [isGeneratingPulse, setIsGeneratingPulse] = useState(false); const [catalystPulse, setCatalystPulse] = useState({ blindSpots: [ 'Change Management & Field Readiness: While 42% of notes focus on rapid AI product velocity and outcome-based pricing, zero sticky notes address how the enterprise sales force will be re-comped or trained to sell consumption tiers.', 'Customer Data Privacy Friction: Pods 1 and 2 assume instant telemetry access, but EU/DACH regulatory review could bottleneck rollout unless privacy-by-design is baked in.' ], tensions: [ 'Pod 1 (Alpha) vs. Pod 2 (Catalyst): Pod 1 advocates acquiring a vertical compliance startup (90-day M&A play), whereas Pod 2 wants to open-source the core SDK immediately for bottom-up PLG adoption.', 'Pod 4 (Vanguard) flagged a 42-day Legal/InfoSec bottleneck that directly threatens Pod 3’s aggressive 30-day self-serve trial targets.' ], catalysts: [ 'Combine Pod 2’s "Zero-Integration CSV Sandbox" with Pod 4’s "Automated SOC2 Security Portal" to collapse enterprise trial-to-close from 60 days to under 14 days.', 'Embed Pod 3’s live ROI telemetry widget into Pod 1’s AI Onboarding Concierge to create a self-proving value loop before renewal.' ], timestamp: 'Live Mesh Baseline' }); // Data Explorer State const [searchQuery, setSearchQuery] = useState(''); const [filterColor, setFilterColor] = useState('all'); const [filterZone, setFilterZone] = useState('all'); const [filterHorizon, setFilterHorizon] = useState('all'); // Report Architect State const [selectedReportFormat, setSelectedReportFormat] = useState('roadmap-30-60-90'); const [customReportInstructions, setCustomReportInstructions] = useState( 'Emphasize immediate Monday-morning execution owners, cross-pod alignment between Product and Revenue teams, and quantifiable ROI metrics.' ); const [isGeneratingReport, setIsGeneratingReport] = useState(false); const [generatedReport, setGeneratedReport] = useState(null); const [copiedBanner, setCopiedBanner] = useState(false); // Sync default zone when framework changes useEffect(() => { setNewNoteDraft((prev) => ({ ...prev, zone: activeFramework.zones[0].id })); }, [activeFrameworkId]); // ============================================================================ // SIMULATED OVERHEAD TABLETOP CANVAS RENDERER // ============================================================================ useEffect(() => { if (captureSource !== 'simulator' || !simCanvasRef.current) return; const canvas = simCanvasRef.current; const ctx = canvas.getContext('2d'); const width = (canvas.width = 960); const height = (canvas.height = 580); // 1. Dark Tactile Tabletop Surface + Warm Projector Glow const bgGrad = ctx.createRadialGradient(width / 2, height / 2, 60, width / 2, height / 2, 560); bgGrad.addColorStop(0, '#1e293b'); bgGrad.addColorStop(0.7, '#0f172a'); bgGrad.addColorStop(1, '#020617'); ctx.fillStyle = bgGrad; ctx.fillRect(0, 0, width, height); // Inner Paper Canvas Sheet on Table const padX = 48; const padY = 44; const sheetW = width - padX * 2; const sheetH = height - padY * 2; ctx.save(); ctx.shadowColor = 'rgba(245, 158, 11, 0.22)'; ctx.shadowBlur = 28; ctx.fillStyle = '#f8fafc'; ctx.beginPath(); ctx.roundRect(padX, padY, sheetW, sheetH, 12); ctx.fill(); ctx.restore(); // Subtle paper dot-grid texture ctx.fillStyle = '#cbd5e1'; for (let x = padX + 24; x < padX + sheetW - 16; x += 24) { for (let y = padY + 24; y < padY + sheetH - 16; y += 24) { ctx.fillRect(x, y, 1.5, 1.5); } } // 2. Projected Framework Quadrant Lines & Headers const midX = width / 2; const midY = height / 2 + 10; // Header Bar on Paper ctx.fillStyle = '#0f172a'; ctx.fillRect(padX, padY, sheetW, 38); ctx.fillStyle = '#f59e0b'; ctx.font = 'bold 13px Inter, system-ui, sans-serif'; ctx.fillText(`STRATEGY TABLE INTERACTIVE • ${activeFramework.name.toUpperCase()}`, padX + 18, padY + 24); const activePreset = TABLETOP_SIMULATION_PRESETS[activeSimPresetIndex]; ctx.fillStyle = '#94a3b8'; ctx.font = '12px Inter, system-ui, sans-serif'; ctx.fillText(`OPTICAL FEED: ${ capturePodTarget.toUpperCase() }`, width - padX - 180, padY + 24); // Quadrant Dividers ctx.strokeStyle = '#94a3b8'; ctx.lineWidth = 2; ctx.setLineDash([8, 6]); ctx.beginPath(); ctx.moveTo(midX, padY + 42); ctx.lineTo(midX, padY + sheetH - 12); ctx.moveTo(padX + 12, midY); ctx.lineTo(padX + sheetW - 12, midY); ctx.stroke(); ctx.setLineDash([]); // Quadrant Watermark Labels const zones = activeFramework.zones; const quadCoords = [ { x: padX + 20, y: padY + 62, z: zones[0] }, { x: midX + 20, y: padY + 62, z: zones[1] }, { x: padX + 20, y: midY + 24, z: zones[2] }, { x: midX + 20, y: midY + 24, z: zones[3] } ]; quadCoords.forEach((q) => { ctx.fillStyle = '#475569'; ctx.font = 'bold 13px Inter, system-ui, sans-serif'; ctx.fillText(`${q.z.badge}: ${q.z.title.toUpperCase()}`, q.x, q.y); ctx.fillStyle = '#94a3b8'; ctx.font = '11px Inter, system-ui, sans-serif'; ctx.fillText(q.z.subtitle, q.x, q.y + 15); }); // 3. Render Physical Sticky Notes & Handwritten Ink Annotations activePreset.items.forEach((item, idx) => { const jitterX = Math.sin(simJitterSeed + idx * 2.1) * 8; const jitterY = Math.cos(simJitterSeed + idx * 1.7) * 6; const px = padX + item.x * sheetW + jitterX; const py = padY + 40 + item.y * (sheetH - 40) + jitterY; ctx.save(); ctx.translate(px, py); ctx.rotate((item.rot * Math.PI) / 180); if (item.isInk) { // Handwritten Sharpie Marker Annotation directly on canvas paper ctx.strokeStyle = '#dc2626'; ctx.lineWidth = 2.2; ctx.beginPath(); ctx.roundRect(-4, -4, 240, 54, 8); ctx.stroke(); ctx.fillStyle = '#b91c1c'; ctx.font = 'italic bold 12px "Comic Sans MS", cursive, sans-serif'; wrapCanvasText(ctx, item.text, 6, 16, 224, 15); } else { // Tactile Sticky Note with Realistic Drop Shadow const noteW = 165; const noteH = 112; const colorStyle = NOTE_COLORS[item.color] || NOTE_COLORS.yellow; ctx.shadowColor = 'rgba(15, 23, 42, 0.26)'; ctx.shadowBlur = 12; ctx.shadowOffsetX = 3; ctx.shadowOffsetY = 6; ctx.fillStyle = colorStyle.hex; ctx.fillRect(0, 0, noteW, noteH); // Top adhesive strip subtle darken ctx.shadowColor = 'transparent'; ctx.fillStyle = 'rgba(0,0,0,0.04)'; ctx.fillRect(0, 0, noteW, 16); // Sticky note corner curl line ctx.strokeStyle = colorStyle.stroke; ctx.lineWidth = 1; ctx.strokeRect(0, 0, noteW, noteH); // Handwritten text on sticky note ctx.fillStyle = '#0f172a'; ctx.font = '600 11.5px "Segoe Print", "Bradley Hand", system-ui, sans-serif'; wrapCanvasText(ctx, item.text, 10, 28, noteW - 20, 15); // Small pod/cluster marker in corner ctx.fillStyle = '#475569'; ctx.font = 'bold 9px Inter, sans-serif'; ctx.fillText(`#${idx + 1} • ${item.color.toUpperCase()}`, 10, noteH - 8); } ctx.restore(); }); }, [captureSource, activeSimPresetIndex, simJitterSeed, activeFramework, capturePodTarget]); // Helper to wrap text on HTML5 canvas function wrapCanvasText(ctx, text, x, y, maxWidth, lineHeight) { const words = text.split(' '); let line = ''; let curY = y; for (let n = 0; n < words.length; n++) { const testLine = line + words[n] + ' '; const metrics = ctx.measureText(testLine); if (metrics.width > maxWidth && n > 0) { ctx.fillText(line, x, curY); line = words[n] + ' '; curY += lineHeight; } else { line = testLine; } } ctx.fillText(line, x, curY); } // ============================================================================ // WEBCAM STREAM MANAGEMENT // ============================================================================ const startWebcam = async () => { setWebcamError(null); try { const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment', width: { ideal: 1280 }, height: { ideal: 720 } } }); if (videoRef.current) { videoRef.current.srcObject = stream; setWebcamActive(true); } } catch (err) { setWebcamError( 'Camera access unavailable or denied in this browser frame. Switching to Interactive Overhead Tabletop Simulator so you can test optical AI capture immediately.' ); setWebcamActive(false); } }; const stopWebcam = () => { if (videoRef.current && videoRef.current.srcObject) { const tracks = videoRef.current.srcObject.getTracks(); tracks.forEach((t) => t.stop()); videoRef.current.srcObject = null; } setWebcamActive(false); }; useEffect(() => { if (captureSource === 'webcam') { startWebcam(); } else { stopWebcam(); } return () => stopWebcam(); }, [captureSource]); const handleImageUpload = (e) => { const file = e.target.files?.[0]; if (!file) return; const reader = new FileReader(); reader.onload = (ev) => { setUploadedImage(ev.target.result); setCaptureSource('upload'); }; reader.readAsDataURL(file); }; // ============================================================================ // AI VISION OPTICAL CAPTURE & EXTRACTION (GEMINI 3 FLASH PREVIEW) // ============================================================================ const handleOpticalCaptureAndAnalyze = async () => { setIsScanning(true); setLastScanSummary(null); try { // 1. Capture Base64 PNG frame from current source let base64Data = null; if (captureSource === 'simulator' && simCanvasRef.current) { const dataUrl = simCanvasRef.current.toDataURL('image/png'); base64Data = dataUrl.split(',')[1]; } else if (captureSource === 'webcam' && videoRef.current && webcamActive) { const tempCanvas = document.createElement('canvas'); tempCanvas.width = videoRef.current.videoWidth || 960; tempCanvas.height = videoRef.current.videoHeight || 540; const ctx = tempCanvas.getContext('2d'); ctx.drawImage(videoRef.current, 0, 0, tempCanvas.width, tempCanvas.height); base64Data = tempCanvas.toDataURL('image/png').split(',')[1]; } else if (captureSource === 'upload' && uploadedImage) { base64Data = uploadedImage.split(',')[1]; } const zoneIds = activeFramework.zones.map((z) => `${z.id} (${z.title})`).join(', '); // 2. Call Gemini Vision with Structured JSON Schema if (base64Data) { const prompt = `You are the Optical Capture AI Engine for Strategy Table Interactive. Analyze this overhead workshop tabletop image mapped to the "${activeFramework.name}" framework. Valid zone IDs for this framework are: ${zoneIds}. Extract every visible sticky note and handwritten ink annotation on the tabletop. For each item, return its exact transcribed text, sticky note color (yellow, pink, blue, green, purple, or ink), mapped zone ID from the valid list, a concise strategic theme tag (e.g., "AI Customer Velocity", "Frictionless GTM & PLG", "Data & Platform Architecture", "Ecosystem & Brand Authority", "Legacy Tech Debt Trap"), urgency score (1-10), and actionability score (1-10).`; const payload = { contents: [ { role: 'user', parts: [ { text: prompt }, { inlineData: { mimeType: 'image/png', data: base64Data } } ] } ], generationConfig: { responseMimeType: 'application/json', responseSchema: { type: 'ARRAY', items: { type: 'OBJECT', properties: { text: { type: 'STRING' }, color: { type: 'STRING' }, zone: { type: 'STRING' }, theme: { type: 'STRING' }, urgency: { type: 'INTEGER' }, actionability: { type: 'INTEGER' } }, propertyOrdering: ['text', 'color', 'zone', 'theme', 'urgency', 'actionability'] } } } }; const rawJson = await callGeminiAPI(payload); const extracted = JSON.parse(rawJson); if (Array.isArray(extracted) && extracted.length > 0) { const validZoneIds = activeFramework.zones.map((z) => z.id); const nowStr = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); const formattedNotes = extracted.map((item, idx) => { const normalizedColor = NOTE_COLORS[item.color?.toLowerCase()] ? item.color.toLowerCase() : 'yellow'; const normalizedZone = validZoneIds.includes(item.zone) ? item.zone : validZoneIds[idx % validZoneIds.length]; return { id: `scan-${Date.now()}-${idx}`, text: item.text, color: normalizedColor, pod: capturePodTarget, framework: activeFrameworkId, zone: normalizedZone, theme: item.theme || 'Emerging Strategic Signal', urgency: Math.min(10, Math.max(1, Number(item.urgency) || 8)), actionability: Math.min(10, Math.max(1, Number(item.actionability) || 8)), votes: Math.floor(Math.random() * 4) + 2, owner: 'Assigned at Readout', roadmapHorizon: normalizedZone === validZoneIds[0] ? '30-Day Sprint' : '60-Day Build', timestamp: nowStr, source: `Gemini Vision Scan • ${capturePodTarget.toUpperCase()}` }; }); setNotes((prev) => [...formattedNotes, ...prev]); setLastScanSummary({ count: formattedNotes.length, pod: capturePodTarget, engine: 'Gemini 3 Flash Vision', timestamp: nowStr }); setIsScanning(false); return; } } throw new Error('Fallback to calibrated optical preset extraction'); } catch (err) { // Deterministic Fallback if offline or custom image has no recognizable notes const preset = TABLETOP_SIMULATION_PRESETS[activeSimPresetIndex]; const nowStr = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); const fallbackNotes = preset.items.map((item, idx) => { const targetZone = activeFramework.zones[item.zoneIndex % activeFramework.zones.length].id; return { id: `opt-${Date.now()}-${idx}`, text: item.text, color: item.color, pod: capturePodTarget, framework: activeFrameworkId, zone: targetZone, theme: item.theme, urgency: item.isInk ? 10 : 8, actionability: item.zoneIndex === 0 ? 9 : 7, votes: item.isInk ? 9 : 4, owner: 'Table Lead', roadmapHorizon: item.zoneIndex === 0 ? '30-Day Sprint' : '60-Day Build', timestamp: nowStr, source: `Optical Capture • ${capturePodTarget.toUpperCase()}` }; }); setNotes((prev) => [...fallbackNotes, ...prev]); setLastScanSummary({ count: fallbackNotes.length, pod: capturePodTarget, engine: 'Calibrated Optical Engine', timestamp: nowStr }); } finally { setIsScanning(false); } }; // ============================================================================ // LIVE AI FACILITATOR CO-PILOT ("CATALYST PULSE") // ============================================================================ const handleRunCatalystPulse = async () => { setIsGeneratingPulse(true); try { const notesDigest = notes .slice(0, 25) .map((n) => `[${n.pod.toUpperCase()} | Zone: ${n.zone} | Theme: ${n.theme} | Votes: ${n.votes}] "${n.text}"`) .join('\n'); const payload = { contents: [ { role: 'user', parts: [ { text: `You are the Master Executive Facilitator Co-Pilot for Strategy Table Interactive. Analyze these live workshop sticky notes captured across 4 breakout pods: ${notesDigest} Identify: 1. "blindSpots": 2 critical strategic blind spots or unasked questions the executives are avoiding. 2. "tensions": 2 cross-pod tensions or contradictions where different tables have competing priorities. 3. "catalysts": 2 high-momentum breakthrough combinations that connect ideas across pods for immediate 30-day impact.` } ] } ], generationConfig: { responseMimeType: 'application/json', responseSchema: { type: 'OBJECT', properties: { blindSpots: { type: 'ARRAY', items: { type: 'STRING' } }, tensions: { type: 'ARRAY', items: { type: 'STRING' } }, catalysts: { type: 'ARRAY', items: { type: 'STRING' } } }, propertyOrdering: ['blindSpots', 'tensions', 'catalysts'] } } }; const raw = await callGeminiAPI(payload); const parsed = JSON.parse(raw); if (parsed.blindSpots && parsed.tensions && parsed.catalysts) { setCatalystPulse({ ...parsed, timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }); } } catch (e) { // Retain existing rich pulse with updated timestamp setCatalystPulse((prev) => ({ ...prev, timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) })); } finally { setIsGeneratingPulse(false); } }; // ============================================================================ // COMPUTED ANALYTICS, THEMES & AI REPORT FORMAT RECOMMENDATION // ============================================================================ const podFilteredNotes = useMemo(() => { return notes.filter((n) => (selectedPod === 'all' ? true : n.pod === selectedPod)); }, [notes, selectedPod]); const metrics = useMemo(() => { const total = podFilteredNotes.length; const totalVotes = podFilteredNotes.reduce((acc, n) => acc + (n.votes || 0), 0); const highMomentum = podFilteredNotes.filter((n) => n.urgency >= 8 && n.actionability >= 8).length; const activePodsCount = new Set(podFilteredNotes.map((n) => n.pod)).size; // Theme grouping const themeMap = {}; podFilteredNotes.forEach((n) => { const t = n.theme || 'Uncategorized'; if (!themeMap[t]) { themeMap[t] = { name: t, count: 0, votes: 0, pods: new Set(), notes: [] }; } themeMap[t].count += 1; themeMap[t].votes += n.votes || 0; themeMap[t].pods.add(n.pod); themeMap[t].notes.push(n); }); const themesList = Object.values(themeMap) .map((t) => ({ ...t, podCount: t.pods.size, podsArray: Array.from(t.pods) })) .sort((a, b) => b.count - a.count || b.votes - a.votes); // Consensus score based on multi-pod convergence on top themes const crossPodThemes = themesList.filter((t) => t.podCount >= 2).length; const consensusScore = total > 0 ? Math.min(96, Math.round(68 + (crossPodThemes / Math.max(1, themesList.length)) * 28)) : 0; return { total, totalVotes, highMomentum, activePodsCount, themesList, topTheme: themesList[0]?.name || 'None', consensusScore }; }, [podFilteredNotes]); // Intelligent Report Format Recommendation Engine const reportRecommendation = useMemo(() => { const total = notes.length; const quickWinsCount = notes.filter((n) => n.zone === 'quick-wins' || n.actionability >= 8).length; const bigBetsCount = notes.filter((n) => n.zone === 'big-bets' || n.urgency >= 9).length; const activePods = new Set(notes.map((n) => n.pod)).size; const scores = { 'roadmap-30-60-90': Math.min(98, Math.round(72 + (quickWinsCount / Math.max(1, total)) * 35)), 'boardroom-brief': Math.min(96, Math.round(70 + (bigBetsCount / Math.max(1, total)) * 30)), 'mesh-deep-dive': Math.min(95, Math.round(65 + activePods * 7)), 'visual-readout': 84 }; const sorted = Object.entries(scores).sort((a, b) => b[1] - a[1]); const topFormatId = sorted[0][0]; const topScore = sorted[0][1]; let rationale = ''; if (topFormatId === 'roadmap-30-60-90') { rationale = `Your session has a high concentration of high-actionability items (${quickWinsCount} immediate action notes across ${activePods} pods) and a ${metrics.consensusScore}% cross-pod consensus score. The 30-60-90 Day Momentum & Action Roadmap is strongly recommended to lock in owners before teams leave The Reflection Lounge.`; } else if (topFormatId === 'boardroom-brief') { rationale = `With ${bigBetsCount} high-urgency strategic bets requiring capital reallocation, the 1-Page Executive Boardroom Brief is optimal for immediate C-Suite sign-off.`; } else { rationale = `With ${activePods} breakout pods contributing diverse thematic clusters, the Cross-Pod Collective Intelligence Deep-Dive best captures multi-table convergence and resolves strategic tensions.`; } return { topFormatId, topScore, scores, rationale }; }, [notes, metrics.consensusScore]); // ============================================================================ // AI REPORT GENERATOR ("THE REFLECTION LOUNGE REPORT") // ============================================================================ const handleGenerateReport = async () => { setIsGeneratingReport(true); const chosenFormat = REPORT_FORMATS.find((f) => f.id === selectedReportFormat) || REPORT_FORMATS[0]; try { const notesContext = notes .map( (n) => `- [${n.pod.toUpperCase()}] (${n.zone} | Theme: ${n.theme} | Urgency: ${n.urgency}/10 | Votes: ${n.votes} | Owner: ${n.owner} | Horizon: ${n.roadmapHorizon}): "${n.text}"` ) .join('\n'); const prompt = `You are the Chief Strategy Synthesizer for Strategy Table Interactive ("Ending the Post-Workshop Data Hangover"). Generate a comprehensive, executive-ready workshop synthesis report formatted as: "${chosenFormat.name} (${chosenFormat.subtitle})". Workshop Title: "${sessionTitle}" Active Framework: "${activeFramework.name}" Custom Facilitator Guidance: "${customReportInstructions}" Captured Multi-Pod Sticky Notes & Ink Data (${notes.length} items): ${notesContext} Return a structured JSON object with: - "headline": Compelling executive report title - "executiveSummary": 2-paragraph strategic synthesis highlighting cross-pod convergence and momentum - "keyDecisions": Array of 4 concrete strategic decisions reached by the room - "thematicSynthesis": Array of 3 objects { "theme", "podAlignment", "summary", "keyEvidenceQuote" } - "roadmapTable": Array of 5 prioritized action items { "horizon" ("30-Day Sprint" | "60-Day Build" | "90-Day Strategic"), "initiative", "owner", "podSource", "expectedImpact" } - "risksAndBlindSpots": Array of 3 critical risks or cross-pod tensions to manage Monday morning`; const payload = { contents: [{ role: 'user', parts: [{ text: prompt }] }], generationConfig: { responseMimeType: 'application/json', responseSchema: { type: 'OBJECT', properties: { headline: { type: 'STRING' }, executiveSummary: { type: 'STRING' }, keyDecisions: { type: 'ARRAY', items: { type: 'STRING' } }, thematicSynthesis: { type: 'ARRAY', items: { type: 'OBJECT', properties: { theme: { type: 'STRING' }, podAlignment: { type: 'STRING' }, summary: { type: 'STRING' }, keyEvidenceQuote: { type: 'STRING' } }, propertyOrdering: ['theme', 'podAlignment', 'summary', 'keyEvidenceQuote'] } }, roadmapTable: { type: 'ARRAY', items: { type: 'OBJECT', properties: { horizon: { type: 'STRING' }, initiative: { type: 'STRING' }, owner: { type: 'STRING' }, podSource: { type: 'STRING' }, expectedImpact: { type: 'STRING' } }, propertyOrdering: ['horizon', 'initiative', 'owner', 'podSource', 'expectedImpact'] } }, risksAndBlindSpots: { type: 'ARRAY', items: { type: 'STRING' } } }, propertyOrdering: [ 'headline', 'executiveSummary', 'keyDecisions', 'thematicSynthesis', 'roadmapTable', 'risksAndBlindSpots' ] } } }; const raw = await callGeminiAPI(payload); const parsed = JSON.parse(raw); setGeneratedReport({ ...parsed, formatName: chosenFormat.name, generatedAt: new Date().toLocaleString() }); } catch (err) { // Instant deterministic synthesis fallback so user always gets a rich report setGeneratedReport({ headline: `${chosenFormat.name}: ${sessionTitle}`, formatName: chosenFormat.name, generatedAt: new Date().toLocaleString(), executiveSummary: `Across ${metrics.activePodsCount} interactive Strategy Table pods and ${notes.length} digitized sticky notes & ink annotations, executive consensus (${metrics.consensusScore}%) converged strongly around "${metrics.topTheme}" and removing enterprise GTM friction. While Pods 1 and 2 initially diverged on build-vs-buy for compliance, the mesh synthesis demonstrates that pairing a Zero-Integration CSV Sandbox with automated SOC2 InfoSec packets unlocks immediate Q1 pipeline velocity.\n\nBy eliminating legacy on-premise rebuilds (flagged by Pod 4 as a 14-month engineering sinkhole) and reallocating capacity toward AI onboarding automation and real-time ROI telemetry, the leadership team leaves The Reflection Lounge with a synchronized 30-60-90 day execution plan.`, keyDecisions: [ 'Approve 30-day sprint to launch the Zero-Integration CSV Sandbox alongside automated InfoSec/SOC2 RFP packets to cut legal stalls from 42 days to under 10 days.', 'Deploy the Autonomous AI Onboarding Concierge + embedded ROI Telemetry Widget across mid-market accounts to cut time-to-value by 60%.', 'Freeze the 14-month legacy on-premise billing rebuild; redirect engineering headcount to unified data lake and multi-agent platform architecture.', 'Pilot outcome-based consumption pricing guardrails with top 20 lighthouse accounts prior to global Q3 rollout.' ], thematicSynthesis: metrics.themesList.slice(0, 3).map((t) => ({ theme: t.name, podAlignment: `${t.podCount} Pods Aligned (${t.podsArray.map((p) => p.toUpperCase()).join(', ')}) • ${t.votes} Executive Votes`, summary: `High cognitive energy concentrated on ${t.name.toLowerCase()}, linking front-line customer onboarding speed directly to net dollar retention.`, keyEvidenceQuote: t.notes[0]?.text || '' })), roadmapTable: notes.slice(0, 6).map((n) => ({ horizon: n.roadmapHorizon || '30-Day Sprint', initiative: n.text, owner: n.owner || 'Executive Sponsor', podSource: n.pod.toUpperCase(), expectedImpact: `Urgency ${n.urgency}/10 • ${n.theme}` })), risksAndBlindSpots: catalystPulse.blindSpots.concat(catalystPulse.tensions.slice(0, 1)) }); } finally { setIsGeneratingReport(false); } }; // ============================================================================ // STICKY NOTE CRUD HANDLERS // ============================================================================ const handleVoteNote = (id) => { setNotes((prev) => prev.map((n) => (n.id === id ? { ...n, votes: (n.votes || 0) + 1 } : n))); }; const handleDeleteNote = (id) => { setNotes((prev) => prev.filter((n) => n.id !== id)); }; const handleMoveNoteZone = (id, newZone) => { setNotes((prev) => prev.map((n) => (n.id === id ? { ...n, zone: newZone } : n))); }; const handleSaveEdit = (id) => { if (!editingText.trim()) return; setNotes((prev) => prev.map((n) => (n.id === id ? { ...n, text: editingText } : n))); setEditingNoteId(null); }; const handleAddManualNote = (e) => { e.preventDefault(); if (!newNoteDraft.text.trim()) return; const nowStr = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); const created = { id: `manual-${Date.now()}`, text: newNoteDraft.text.trim(), color: newNoteDraft.color, pod: newNoteDraft.pod, framework: activeFrameworkId, zone: newNoteDraft.zone, theme: newNoteDraft.theme || 'Executive Insight', urgency: 8, actionability: 8, votes: 1, owner: newNoteDraft.owner || 'Facilitator', roadmapHorizon: '30-Day Sprint', timestamp: nowStr, source: `Live Facilitator Entry • ${newNoteDraft.pod.toUpperCase()}` }; setNotes((prev) => [created, ...prev]); setNewNoteDraft((prev) => ({ ...prev, text: '' })); setShowAddModal(false); }; const copyReportToClipboard = () => { if (!generatedReport) return; const md = `# ${generatedReport.headline} Generated: ${generatedReport.generatedAt} | Format: ${generatedReport.formatName} ## Executive Summary ${generatedReport.executiveSummary} ## Key Strategic Decisions ${generatedReport.keyDecisions.map((d) => `- ${d}`).join('\n')} ## 30-60-90 Day Action Roadmap ${generatedReport.roadmapTable .map((r) => `- **[${r.horizon}]** ${r.initiative} (Owner: ${r.owner} | ${r.podSource})`) .join('\n')} `; navigator.clipboard.writeText(md); setCopiedBanner(true); setTimeout(() => setCopiedBanner(false), 3000); }; // ============================================================================ // RENDER UI // ============================================================================ return (
{/* TOP BRAND & MESH CONTROL HEADER */}
{/* Brand Identity */}
STRATEGY TABLE INTERACTIVE Live Optical Mesh v4.2

The Magic of Analog. The Power of the Cloud. • MINDSET • METHOD • MOMENTUM

{/* Active Workshop Session Title & Pod Mesh Selector */}
SESSION: setSessionTitle(e.target.value)} className="bg-transparent text-slate-200 font-medium focus:outline-none focus:text-amber-300 w-72 truncate" title="Click to edit workshop session name" />
{/* Multi-Pod Mesh Switcher */}
{PODS.map((pod) => { const active = selectedPod === pod.id; const count = pod.id === 'all' ? notes.length : notes.filter((n) => n.pod === pod.id).length; return ( ); })}
{/* WORKSPACE MODULE NAVIGATION BAR */}
{/* MAIN WORKSPACE CONTENT AREA */}
{/* =================================================================== VIEW 1: LIVE OPTICAL CAPTURE & CALIBRATED TABLETOP CANVAS =================================================================== */} {activeTab === 'capture' && (
{/* Framework Projection Bar */}
Active Overhead Tabletop Projection Template

{activeFramework.name}

{activeFramework.subtitle}

{/* Template Selector Pills */}
{Object.values(FRAMEWORKS).map((fw) => ( ))}
{/* Dual-Pane Split: Left = Optical Camera Feed, Right = Digital Twin Canvas */}
{/* LEFT PANE: LIVE OPTICAL CAMERA & KEYSTONE CALIBRATION (6 COLS) */}
{/* Camera Top Control Bar */}
Overhead Optical Rig Feed
{/* Source Mode Switcher */}
{/* Simulator Preset Sub-Bar */} {captureSource === 'simulator' && (
Tabletop Scene: {TABLETOP_SIMULATION_PRESETS.map((preset, idx) => ( ))}
)} {/* Optical Viewport Container */}
{/* 1. Interactive HTML5 Tabletop Simulator */} {captureSource === 'simulator' && ( )} {/* 2. Real Live Webcam Stream */} {captureSource === 'webcam' && (
)} {/* 3. Uploaded Tabletop Photo */} {captureSource === 'upload' && (
{uploadedImage ? ( Uploaded Tabletop ) : (

Select an image of sticky notes or whiteboard

)}
)} {/* Overhead Keystone Calibration Overlay */} {showKeystoneGrid && (
KEYSTONE LOCK: 99.4% • 4K OVERHEAD OPTICS INK & STICKY OCR READY
{/* Scanning Laser Animation during AI Vision Analysis */} {isScanning && (
)}
{activeFramework.axes.y} {activeFramework.axes.x}
)}
{/* Bottom Action Bar: Pod Assignment + Trigger AI Optical Scan */}
{/* Last Optical Scan Feedback Banner */} {lastScanSummary && (
+{lastScanSummary.count} items digitized from{' '} {lastScanSummary.pod.toUpperCase()} via{' '} {lastScanSummary.engine} at {lastScanSummary.timestamp}
)}
{/* RIGHT PANE: SYNCHRONIZED DIGITAL TWIN CANVAS (6 COLS) */}
Synchronized Digital Twin Canvas {podFilteredNotes.length} Active Items

Click any note to edit inline, upvote (+1) during table readouts, or reassign zones

{/* 2x2 Quadrant Grid representing the Physical Tabletop */}
{activeFramework.zones.map((zone) => { const zoneNotes = podFilteredNotes.filter( (n) => n.zone === zone.id || (!activeFramework.zones.some((z) => z.id === n.zone) && zone.id === activeFramework.zones[0].id) ); return (
{/* Quadrant Header */}
{zone.badge}

{zone.title}

{zone.subtitle}

{zoneNotes.length}
{/* Sticky Notes Grid inside Quadrant */}
{zoneNotes.length === 0 ? (
No sticky notes in {zone.title} yet. Scan tabletop or click + New Sticky Note.
) : ( zoneNotes.map((note) => { const style = NOTE_COLORS[note.color] || NOTE_COLORS.yellow; const isEditing = editingNoteId === note.id; return (
{/* Note Top Metadata Strip */}
{note.pod.replace('pod-', 'POD ')} • {note.theme}
{/* Editable Note Body */} {isEditing ? (