/* ============================================================ app.jsx — root component, theming, live state, routing ============================================================ */ const PAGE_LABELS = { today:'Today', employees:'Employees', pto:'Requests', monthly:'Summary', reports:'Reports', tasks:'Tasks', support:'Support', oncall:'On-call', messages:'Messages', audit:'Audit log', ml:'Neural', teams:'Teams', rooms:'Rooms', bots:'Bots', 'bot-behavior':'Bot Behavior', providers:'Integrations', server:'Server', captures:'Captures', collections:'Collections', help:'Help / API', }; const CRUMBS = { today:'Activity', employees:'Activity', pto:'Activity', monthly:'Activity', reports:'Activity', tasks:'Activity', support:'Activity', oncall:'Activity', messages:'Insight', audit:'Insight', ml:'Insight', teams:'Configure', rooms:'Configure', bots:'Configure', 'bot-behavior':'Configure', providers:'Configure', server:'Configure', collections:'Configure', help:'Configure', }; // Canonical page ids (the renderPage switch is the source of truth — includes // `oncall`/`captures`, which are real pages). Used to bind the SPA page to the // browser URL so navigation, refresh, deep-links and back/forward all work. const ALL_PAGE_IDS = [ 'today','employees','pto','monthly','reports','tasks','support','oncall', 'messages','audit','ml','teams','rooms','bots','bot-behavior','providers','server','help','captures','collections', ]; const pageFromPath = () => { try { const seg = (window.location.pathname || '/').replace(/^\/+/, '').split('/')[0]; return ALL_PAGE_IDS.includes(seg) ? seg : 'today'; } catch (_) { return 'today'; } }; const pathForPage = (id) => (id === 'today' ? '/' : '/' + id); // shell.jsx defines these and exports them via `window.X = X`. Babel-in-browser // transpiles each