🔍 ESC
Lucas Suite
Abril 2026
Olá, Lucas!
00:00:00
--
📖Dicionário
Ex: FBA, SLA, DEA, EAD
TOTAL--
💲 BR IBOV
-- --
US S&P
-- --
⚡ Carregando...
Timeline do dia
Carregando timeline...
🚨LOST · AMZL Ops
`; try { const blob = new Blob([html], { type: 'text/html' }); const { downloadFile } = await Promise.resolve({ downloadFile }); await downloadFile(`${t('myCalendar')}-${tMonth(month)}-${year}.html`, blob); } catch (err) {/* DownloadFileError */} }; // Calendar grid const daysInMonth = getDaysInMonth(year, month); const firstDay = getFirstDayOfMonth(year, month); const prevMonthDays = month === 0 ? getDaysInMonth(year - 1, 11) : getDaysInMonth(year, month - 1); const totalCells = Math.ceil((firstDay + daysInMonth) / 7) * 7; const cells = []; for (let i = 0; i < totalCells; i++) { if (i < firstDay) { const d = prevMonthDays - firstDay + 1 + i; const m = month === 0 ? 11 : month - 1; const y = month === 0 ? year - 1 : year; cells.push({ day: d, month: m, year: y, current: false }); } else if (i >= firstDay + daysInMonth) { const d = i - firstDay - daysInMonth + 1; const m = month === 11 ? 0 : month + 1; const y = month === 11 ? year + 1 : year; cells.push({ day: d, month: m, year: y, current: false }); } else cells.push({ day: i - firstDay + 1, month, year, current: true }); } const brazilianHolidays = useMemo(() => { const all = new Map(); for (const y of [year - 1, year, year + 1]) getBrazilianHolidays(y).forEach((name, date) => all.set(date, name)); return all; }, [year]); const selectedEvents = selectedDate ? eventsForDate(selectedDate) : []; const inputStyle = { width: '100%', padding: '10px 12px', borderRadius: 8, border: `1px solid ${T.inputBorder}`, background: T.inputBg, color: T.inputText, fontSize: 14, boxSizing: 'border-box', outline: 'none' }; const labelStyle = { fontSize: 12, fontWeight: 700, color: T.textFaint, marginBottom: 6, display: 'block', textTransform: 'uppercase', letterSpacing: 0.5 }; const cardStyle = { background: T.surface, borderRadius: 12, border: `1px solid ${T.border}`, overflow: 'hidden', boxShadow: isDark ? 'none' : '0 2px 12px rgba(35,47,62,0.08)' }; const cardHeaderStyle = { background: T.cardHeaderBg, padding: '14px 20px', fontSize: 15, fontWeight: 700, color: T.cardHeaderText, display: 'flex', alignItems: 'center', gap: 8 }; const mobileNavBtn = { background: T.navBtn, border: 'none', borderRadius: 8, padding: '12px 16px', cursor: 'pointer', fontSize: 14, color: T.yellow, fontWeight: 700, width: '100%', textAlign: 'left', display: 'flex', alignItems: 'center', gap: 8 }; return /*#__PURE__*/React.createElement("div", { style: { fontFamily: "'Amazon Ember', 'Segoe UI', -apple-system, sans-serif", minHeight: '100vh', background: T.bg, color: T.text, transition: 'background 0.3s, color 0.3s' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.navBg, padding: isMobile ? '10px 12px' : '14px 24px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: isMobile ? 8 : 12 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: isMobile ? 8 : 12, flex: isMobile ? 1 : undefined, minWidth: 0 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: isMobile ? 22 : 26 } }, "\uD83D\uDCC5"), /*#__PURE__*/React.createElement("div", { style: { minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 15 : 22, fontWeight: 800, color: T.navText, letterSpacing: -0.5, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, isMobile ? lang === 'pt' ? 'Meu Calendário' : 'My Calendar' : t('myCalendar')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.navSub, fontWeight: 500 } }, tMonth(month), " ", year, " \xB7 ", monthEvents.length, " ", monthEvents.length !== 1 ? t('events') : t('event')))), isMobile ? /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 } }, /*#__PURE__*/React.createElement("button", { onClick: () => navigateView(-1), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '8px 12px', cursor: 'pointer', fontSize: 13, color: T.navText, fontWeight: 700 } }, "\u25C0"), /*#__PURE__*/React.createElement("button", { onClick: goToday, style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 8, padding: '8px 14px', cursor: 'pointer', fontSize: 12, fontWeight: 800 } }, t('today')), /*#__PURE__*/React.createElement("button", { onClick: () => navigateView(1), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '8px 12px', cursor: 'pointer', fontSize: 13, color: T.navText, fontWeight: 700 } }, "\u25B6"), /*#__PURE__*/React.createElement("button", { onClick: () => setShowMobileMenu(!showMobileMenu), style: { background: showMobileMenu ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '8px 12px', cursor: 'pointer', fontSize: 18, color: showMobileMenu ? T.accentText : T.yellow, fontWeight: 700 } }, showMobileMenu ? '✕' : '☰')) : /*#__PURE__*/ /* Desktop: full nav */ React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8 } }, /*#__PURE__*/React.createElement("button", { onClick: toggleTheme, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 14px', cursor: 'pointer', fontSize: 16, color: T.yellow, fontWeight: 700 }, title: isDark ? t('lightMode') : t('darkMode') }, isDark ? '☀️' : '🌙'), /*#__PURE__*/React.createElement("button", { onClick: () => switchLang('en'), style: { background: lang === 'en' ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '6px 12px', cursor: 'pointer', fontSize: 13, fontWeight: 700, lineHeight: 1, color: lang === 'en' ? T.accentText : T.yellow, opacity: lang === 'en' ? 1 : 0.6 }, title: "English" }, "ENG"), /*#__PURE__*/React.createElement("button", { onClick: () => switchLang('pt'), style: { background: lang === 'pt' ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '6px 12px', cursor: 'pointer', fontSize: 13, fontWeight: 700, lineHeight: 1, color: lang === 'pt' ? T.accentText : T.yellow, opacity: lang === 'pt' ? 1 : 0.6 }, title: "Portugu\xEAs" }, "BRA"), /*#__PURE__*/React.createElement("button", { onClick: () => setShowAlertsPanel(!showAlertsPanel), style: { background: showAlertsPanel ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: showAlertsPanel ? T.accentText : T.yellow, fontWeight: 700, position: 'relative' }, title: t('reminders') }, "\uD83D\uDD14 ", t('reminders'), reminders.length + activeAlertCount > 0 && /*#__PURE__*/React.createElement("span", { style: { position: 'absolute', top: -4, right: -4, background: T.red, color: '#fff', fontSize: 10, fontWeight: 800, borderRadius: '50%', width: 18, height: 18, display: 'flex', alignItems: 'center', justifyContent: 'center' } }, reminders.length + activeAlertCount)), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowAIModal(true); setAiTitle(''); setAiSuggestions([]); setAiError(''); }, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83E\uDD16 ", t('aiSuggest')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowWeatherModal(true); setWxResult(null); setWxError(''); }, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83C\uDF24\uFE0F ", t('weather')), /*#__PURE__*/React.createElement("button", { onClick: () => setShowDashboard(true), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83D\uDCCA ", t('dashboard')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowNotesPanel(true); openNewNote(); }, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83D\uDCDD ", t('notes')), /*#__PURE__*/React.createElement("button", { onClick: handlePrint, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 }, title: t('print') }, "\uD83D\uDDA8\uFE0F ", t('print')), /*#__PURE__*/React.createElement("button", { onClick: () => setShowImportModal(true), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83D\uDCE5 ", t('import')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowSearch(true); setSearchQuery(''); }, style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 16px', cursor: 'pointer', fontSize: 13, color: T.yellow, fontWeight: 700 } }, "\uD83D\uDD0D ", t('search')), /*#__PURE__*/React.createElement("button", { onClick: () => navigateView(-1), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 15px', cursor: 'pointer', fontSize: 13, color: T.navText, fontWeight: 700 } }, "\u25C0"), /*#__PURE__*/React.createElement("div", { style: { minWidth: 170, textAlign: 'center', fontSize: 16, fontWeight: 700, color: T.navText } }, viewTitle), /*#__PURE__*/React.createElement("button", { onClick: () => navigateView(1), style: { background: T.navBtn, border: 'none', borderRadius: 8, padding: '9px 15px', cursor: 'pointer', fontSize: 13, color: T.navText, fontWeight: 700 } }, "\u25B6"), /*#__PURE__*/React.createElement("button", { onClick: goToday, style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 8, padding: '9px 20px', cursor: 'pointer', fontSize: 13, fontWeight: 800, marginLeft: 4 } }, t('today')))), isMobile && showMobileMenu && /*#__PURE__*/React.createElement("div", { style: { background: T.navBg, padding: '8px 12px 14px', display: 'flex', flexDirection: 'column', gap: 6, borderTop: `1px solid ${T.border}` } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6 } }, /*#__PURE__*/React.createElement("button", { onClick: toggleTheme, style: { ...mobileNavBtn, flex: 1 } }, isDark ? '☀️' : '🌙', " ", isDark ? t('lightMode') : t('darkMode'))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6 } }, /*#__PURE__*/React.createElement("button", { onClick: () => { switchLang('en'); }, style: { ...mobileNavBtn, flex: 1, background: lang === 'en' ? T.accent : T.navBtn, color: lang === 'en' ? T.accentText : T.yellow } }, "ENG"), /*#__PURE__*/React.createElement("button", { onClick: () => { switchLang('pt'); }, style: { ...mobileNavBtn, flex: 1, background: lang === 'pt' ? T.accent : T.navBtn, color: lang === 'pt' ? T.accentText : T.yellow } }, "BRA")), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowAlertsPanel(!showAlertsPanel); setShowMobileMenu(false); }, style: { ...mobileNavBtn, position: 'relative' } }, "\uD83D\uDD14 ", t('reminders'), reminders.length + activeAlertCount > 0 && /*#__PURE__*/React.createElement("span", { style: { background: T.red, color: '#fff', fontSize: 10, fontWeight: 800, borderRadius: '50%', width: 18, height: 18, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', marginLeft: 6 } }, reminders.length + activeAlertCount)), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowAIModal(true); setAiTitle(''); setAiSuggestions([]); setAiError(''); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83E\uDD16 ", t('aiSuggest')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowWeatherModal(true); setWxResult(null); setWxError(''); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83C\uDF24\uFE0F ", t('weather')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowDashboard(true); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83D\uDCCA ", t('dashboard')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowNotesPanel(true); openNewNote(); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83D\uDCDD ", t('notes')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowSearch(true); setSearchQuery(''); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83D\uDD0D ", t('search')), /*#__PURE__*/React.createElement("button", { onClick: () => { handlePrint(); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83D\uDDA8\uFE0F ", t('print')), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowImportModal(true); setShowMobileMenu(false); }, style: mobileNavBtn }, "\uD83D\uDCE5 ", t('import'))), /*#__PURE__*/React.createElement("div", { style: { height: 3, background: `linear-gradient(90deg, ${T.accent}, ${T.yellow}, ${T.accent})` } }), !eventsLoaded && /*#__PURE__*/React.createElement("div", { style: { padding: '16px 24px', textAlign: 'center', background: T.yellowLight, color: T.text, fontSize: 14, fontWeight: 600 } }, "\u23F3 ", lang === 'pt' ? 'Carregando seus eventos...' : 'Loading your events...'), storageError && /*#__PURE__*/React.createElement("div", { style: { padding: '10px 24px', background: T.errorBg, color: T.red, fontSize: 13, fontWeight: 600, borderBottom: `1px solid ${T.errorBorder}` } }, storageError), /*#__PURE__*/React.createElement("div", { style: { background: T.surface, borderBottom: `1px solid ${T.border}`, padding: isMobile ? '8px 12px' : '10px 24px', display: 'flex', alignItems: 'center', gap: isMobile ? 6 : 10, flexWrap: 'wrap', transition: 'background 0.3s', justifyContent: 'space-between' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: isMobile ? 4 : 10, flexWrap: 'wrap', flex: 1 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 12, fontWeight: 700, color: T.textMuted, textTransform: 'uppercase', letterSpacing: 0.5 } }, t('filter'), ":"), TAGS.map(tag => { const active = activeFilters.has(tag); const cfg = TAG_CONFIG[tag]; return /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => toggleFilter(tag), style: { display: 'flex', alignItems: 'center', gap: isMobile ? 3 : 5, padding: isMobile ? '5px 8px' : '5px 12px', borderRadius: 20, border: active ? `2px solid ${cfg.color}` : `2px solid ${T.border}`, background: active ? `${cfg.color}20` : T.surface, color: active ? cfg.color : T.textMuted, fontSize: isMobile ? 11 : 12, fontWeight: 700, cursor: 'pointer', transition: 'all 0.15s' } }, /*#__PURE__*/React.createElement("span", null, cfg.emoji), !isMobile && ` ${tTag(tag)}`); })), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 2, background: T.barBg, borderRadius: 8, padding: 2 } }, ['month', 'week', 'day'].map(mode => /*#__PURE__*/React.createElement("button", { key: mode, onClick: () => { setViewMode(mode); if (mode !== 'month' && !viewDate) setViewDate(selectedDate || todayStr); if (mode === 'day' && selectedDate) setViewDate(selectedDate); }, style: { padding: isMobile ? '6px 10px' : '6px 16px', borderRadius: 6, fontSize: 12, fontWeight: 700, cursor: 'pointer', border: 'none', transition: 'all 0.15s', background: viewMode === mode ? T.accent : 'transparent', color: viewMode === mode ? T.accentText : T.textMuted } }, mode === 'month' ? `📅 ${t('month')}` : mode === 'week' ? `📋 ${t('week')}` : `📝 ${t('day')}`)))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'stretch', minHeight: 0 } }, !isMobile && /*#__PURE__*/React.createElement(SidePanel, { events: allEventsWithRecurring, T: T, isDark: isDark, isMobile: false, lang: lang, tTag: tTag, notes: notes, onNotesChange: setNotes }), /*#__PURE__*/React.createElement("div", { style: { maxWidth: 1200, margin: '0 auto', padding: isMobile ? '12px 8px' : '16px 20px 20px', flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { marginBottom: isMobile ? 12 : 12 } }, /*#__PURE__*/React.createElement(SmartInfoWidget, { lang: lang, isDark: isDark })), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: isMobile ? 10 : 12, marginBottom: isMobile ? 12 : 12, flexWrap: isMobile ? 'wrap' : 'nowrap' } }, /*#__PURE__*/React.createElement("div", { style: { ...cardStyle, flex: '1 1 0', minWidth: isMobile ? 280 : 0, display: 'flex', flexDirection: 'column', maxHeight: isMobile ? undefined : 260 } }, /*#__PURE__*/React.createElement("div", { style: { ...cardHeaderStyle, justifyContent: 'space-between', padding: '10px 14px', fontSize: 13, flexShrink: 0 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 6 } }, "\uD83D\uDCCA ", t('monthlySummary')), /*#__PURE__*/React.createElement("button", { onClick: () => setSummaryCollapsed(c => !c), title: summaryCollapsed ? t('maximize') : t('minimize'), style: { background: summaryCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: summaryCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, summaryCollapsed ? '⬜' : '🗕')), !summaryCollapsed && /*#__PURE__*/React.createElement("div", { style: { padding: '10px 14px', overflowY: 'auto', flex: 1, minHeight: 0 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8, flexWrap: 'wrap', marginBottom: 10 } }, /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', flex: 1, minWidth: 50 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 22, fontWeight: 800, color: T.accent } }, monthEvents.length), /*#__PURE__*/React.createElement("div", { style: { fontSize: 9, color: T.textMuted, fontWeight: 600 } }, t('eventsLabel'))), /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', flex: 1, minWidth: 50 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 22, fontWeight: 800, color: '#146EB4' } }, busiestDay?.count || 0), /*#__PURE__*/React.createElement("div", { style: { fontSize: 9, color: T.textMuted, fontWeight: 600 } }, t('busiestDayLabel'))), /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', flex: 1, minWidth: 50 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 22, fontWeight: 800, color: '#067D62' } }, Object.keys(tagBreakdown).length), /*#__PURE__*/React.createElement("div", { style: { fontSize: 9, color: T.textMuted, fontWeight: 600 } }, t('categoriesLabel')))), busiestDay && /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textFaint, background: T.surfaceAlt, borderRadius: 6, padding: '5px 8px', marginBottom: 8 } }, "\uD83D\uDD25 ", t('busiest'), ": ", /*#__PURE__*/React.createElement("strong", null, formatDateDisplayL(busiestDay.date)), " (", busiestDay.count, ")"), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 4 } }, TAGS.map(tag => { const count = tagBreakdown[tag] || 0; if (count === 0) return null; const pct = monthEvents.length > 0 ? count / monthEvents.length * 100 : 0; const cfg = TAG_CONFIG[tag]; return /*#__PURE__*/React.createElement("div", { key: tag, style: { display: 'flex', alignItems: 'center', gap: 6 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 10, minWidth: 60, fontWeight: 600, color: T.textFaint } }, cfg.emoji, " ", tTag(tag)), /*#__PURE__*/React.createElement("div", { style: { flex: 1, height: 6, borderRadius: 3, background: T.barBg, overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { width: `${pct}%`, height: '100%', borderRadius: 3, background: cfg.color, transition: 'width 0.3s' } })), /*#__PURE__*/React.createElement("span", { style: { fontSize: 10, fontWeight: 700, color: cfg.color, minWidth: 16, textAlign: 'right' } }, count)); })))), /*#__PURE__*/React.createElement("div", { style: { ...cardStyle, flex: '1 1 0', minWidth: isMobile ? 280 : 0, display: 'flex', flexDirection: 'column', maxHeight: isMobile ? undefined : 260 } }, /*#__PURE__*/React.createElement("div", { style: { ...cardHeaderStyle, justifyContent: 'space-between', padding: '10px 14px', fontSize: 13, flexShrink: 0 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 6 } }, "\u23F0 ", t('upcomingEvents')), /*#__PURE__*/React.createElement("button", { onClick: () => setUpcomingCollapsed(c => !c), title: upcomingCollapsed ? t('maximize') : t('minimize'), style: { background: upcomingCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: upcomingCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, upcomingCollapsed ? '⬜' : '🗕')), !upcomingCollapsed && /*#__PURE__*/React.createElement("div", { style: { padding: '8px 14px', overflowY: 'auto', flex: 1, minHeight: 0 } }, upcomingEvents.length === 0 && /*#__PURE__*/React.createElement("div", { style: { color: T.textMuted, fontSize: 12, padding: '20px 0', textAlign: 'center' } }, t('noUpcoming')), upcomingEvents.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, onClick: () => { setSelectedDate(ev.date); const [ey, em] = ev.date.split('-').map(Number); setYear(ey); setMonth(em - 1); }, style: { display: 'flex', alignItems: 'center', gap: 8, padding: '7px 0', borderBottom: `1px solid ${T.borderLight}`, cursor: 'pointer' } }, /*#__PURE__*/React.createElement("div", { style: { width: 3, height: 30, borderRadius: 2, background: TAG_CONFIG[ev.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 12, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, ev.title), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted } }, formatDateDisplayL(ev.date), " \xB7 ", ev.time)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, fontWeight: 700, color: TAG_CONFIG[ev.tag].color, background: `${TAG_CONFIG[ev.tag].color}20`, padding: '2px 6px', borderRadius: 8, whiteSpace: 'nowrap', flexShrink: 0 } }, getRelativeTime(ev)))))), !isMobile && viewMode === 'month' && /*#__PURE__*/React.createElement("div", { style: { ...cardStyle, flex: '1 1 0', minWidth: 0, display: 'flex', flexDirection: 'column', maxHeight: 260 } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '10px 14px', flexShrink: 0 } }, selectedDate ? /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, fontWeight: 700, color: T.cardHeaderText } }, formatDateDisplayL(selectedDate)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.yellow, marginTop: 1 } }, selectedEvents.length, " ", selectedEvents.length !== 1 ? t('events') : t('event'))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 4, alignItems: 'center' } }, !detailsCollapsed && /*#__PURE__*/React.createElement("button", { onClick: () => openAddModal(selectedDate), style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 6, padding: '5px 10px', cursor: 'pointer', fontSize: 11, fontWeight: 800 } }, "+ ", t('add')), /*#__PURE__*/React.createElement("button", { onClick: () => setDetailsCollapsed(c => !c), title: detailsCollapsed ? t('maximize') : t('minimize'), style: { background: detailsCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: detailsCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, detailsCollapsed ? '⬜' : '🗕'))) : /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, fontWeight: 700, color: T.cardHeaderText } }, "\uD83D\uDCCB ", t('eventDetails')), /*#__PURE__*/React.createElement("button", { onClick: () => setDetailsCollapsed(c => !c), title: detailsCollapsed ? t('maximize') : t('minimize'), style: { background: detailsCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: detailsCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, detailsCollapsed ? '⬜' : '🗕'))), !detailsCollapsed && /*#__PURE__*/React.createElement("div", { style: { padding: '8px 14px', overflowY: 'auto', flex: 1, minHeight: 0 } }, !selectedDate && /*#__PURE__*/React.createElement("div", { style: { color: T.textMuted, fontSize: 12, padding: '24px 0', textAlign: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 28, marginBottom: 6 } }, "\uD83D\uDCC5"), t('selectDate'), /*#__PURE__*/React.createElement("br", null), t('orManage')), selectedDate && selectedEvents.length === 0 && /*#__PURE__*/React.createElement("div", { style: { color: T.textMuted, fontSize: 12, padding: '20px 0', textAlign: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 24, marginBottom: 6 } }, "\u2600\uFE0F"), t('noEvents')), selectedEvents.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, onClick: () => openEditModal(ev), style: { display: 'flex', alignItems: 'stretch', gap: 8, padding: '8px 10px', borderRadius: 8, background: T.surfaceAlt, marginBottom: 6, cursor: 'pointer', border: `1px solid ${T.border}` } }, /*#__PURE__*/React.createElement("div", { style: { width: 3, borderRadius: 3, background: TAG_CONFIG[ev.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 12, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, ev.title, ev.recurrence && ev.recurrence !== 'none' ? ' 🔁' : ''), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted, marginTop: 1 } }, "\u23F0 ", ev.time, " \xB7 ", /*#__PURE__*/React.createElement("span", { style: { color: TAG_CONFIG[ev.tag].color, fontWeight: 600 } }, TAG_CONFIG[ev.tag].emoji, " ", tTag(ev.tag))), ev.location && /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textFaint, marginTop: 2 } }, "\uD83D\uDCCD ", ev.location), ev.description && /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textFaint, marginTop: 2, lineHeight: 1.3, display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical', overflow: 'hidden' } }, ev.description)), /*#__PURE__*/React.createElement("button", { onClick: e => { e.stopPropagation(); deleteEvent(ev.id); }, style: { background: 'transparent', border: 'none', color: T.red, fontSize: 13, cursor: 'pointer', padding: '0 2px', alignSelf: 'flex-start', fontWeight: 700 } }, "\u2715")))))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 0, alignItems: 'flex-start', flexWrap: isMobile ? 'wrap' : 'nowrap', flexDirection: isMobile ? 'column' : 'row' } }, viewMode === 'month' && /*#__PURE__*/React.createElement("div", { style: { flex: '1 1 100%', minWidth: 0, width: '100%', transition: 'flex 0.3s' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, borderRadius: calendarCollapsed ? 12 : '12px 12px 0 0', padding: '10px 20px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8, fontSize: 15, fontWeight: 700, color: T.cardHeaderText } }, "\uD83D\uDCC5", /*#__PURE__*/React.createElement("button", { onClick: prevMonth, style: { background: T.navBtn, border: 'none', borderRadius: 6, padding: '4px 10px', cursor: 'pointer', fontSize: 14, fontWeight: 800, color: T.yellow, lineHeight: 1, display: 'flex', alignItems: 'center' } }, "\u25C0"), /*#__PURE__*/React.createElement("span", null, viewTitle), /*#__PURE__*/React.createElement("button", { onClick: nextMonth, style: { background: T.navBtn, border: 'none', borderRadius: 6, padding: '4px 10px', cursor: 'pointer', fontSize: 14, fontWeight: 800, color: T.yellow, lineHeight: 1, display: 'flex', alignItems: 'center' } }, "\u25B6")), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 6 } }, !calendarCollapsed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", { onClick: zoomOut, disabled: calendarZoom === 0, title: t('zoomOut'), style: { background: calendarZoom === 0 ? 'transparent' : T.navBtn, border: 'none', borderRadius: 6, padding: '4px 8px', cursor: calendarZoom === 0 ? 'not-allowed' : 'pointer', fontSize: 12, fontWeight: 800, color: calendarZoom === 0 ? T.textMuted : T.yellow, display: 'flex', alignItems: 'center' } }, "\uD83D\uDD0D\u2796"), /*#__PURE__*/React.createElement("span", { style: { fontSize: 10, fontWeight: 700, color: T.yellow, minWidth: 28, textAlign: 'center' } }, calendarZoom === 0 ? '1×' : `${(1 + calendarZoom * 0.3).toFixed(1)}×`), /*#__PURE__*/React.createElement("button", { onClick: zoomIn, disabled: calendarZoom === 5, title: t('zoomIn'), style: { background: calendarZoom === 5 ? 'transparent' : T.navBtn, border: 'none', borderRadius: 6, padding: '4px 8px', cursor: calendarZoom === 5 ? 'not-allowed' : 'pointer', fontSize: 12, fontWeight: 800, color: calendarZoom === 5 ? T.textMuted : T.yellow, display: 'flex', alignItems: 'center' } }, "\uD83D\uDD0D\u2795"), /*#__PURE__*/React.createElement("div", { style: { width: 1, height: 20, background: T.navBtn, margin: '0 4px' } })), /*#__PURE__*/React.createElement("button", { onClick: () => setCalendarCollapsed(c => !c), title: calendarCollapsed ? t('maximize') : t('minimize'), style: { background: calendarCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '5px 9px', cursor: 'pointer', fontSize: 13, color: calendarCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, calendarCollapsed ? '⬜' : '🗕'))), !calendarCollapsed && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { style: { overflowX: calendarZoom > 0 ? 'auto' : 'hidden', borderRadius: '0 0 12px 12px', border: `1px solid ${T.border}`, borderTop: 'none' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'grid', gridTemplateColumns: `repeat(7, minmax(${calendarZoom > 0 ? 90 + calendarZoom * 30 : 0}px, 1fr))`, gap: 1, background: T.border, overflow: 'hidden', boxShadow: isDark ? 'none' : '0 2px 12px rgba(35,47,62,0.08)', minWidth: calendarZoom > 0 ? (90 + calendarZoom * 30) * 7 + 6 : undefined } }, DAYS.map((d, di) => /*#__PURE__*/React.createElement("div", { key: d, style: { background: T.cardHeaderBg, color: T.yellow, padding: isMobile ? '8px 2px' : '11px 4px', textAlign: 'center', fontSize: isMobile ? 10 : 12, fontWeight: 700, textTransform: 'uppercase', letterSpacing: isMobile ? 0 : 1 } }, isMobile ? tDay(di).slice(0, 2) : tDay(di))), cells.map((cell, i) => { const dateStr = toDateStr(cell.year, cell.month, cell.day); const isToday = dateStr === todayStr; const isSelected = dateStr === selectedDate; const dayEvents = eventsForDate(dateStr); const isWeekend = i % 7 === 0 || i % 7 === 6; const isDragOver = dragOverDate === dateStr; const isPast = cell.current && dateStr < todayStr; const isHoliday = brazilianHolidays.has(dateStr); const holidayName = brazilianHolidays.get(dateStr); const isRedDay = isWeekend || isHoliday; return /*#__PURE__*/React.createElement("div", { key: i, onClick: () => setSelectedDate(dateStr), onDoubleClick: () => { setSelectedDate(dateStr); openAddModal(dateStr); }, onDragOver: e => { e.preventDefault(); setDragOverDate(dateStr); }, onDragLeave: () => { if (dragOverDate === dateStr) setDragOverDate(null); }, onDrop: e => { e.preventDefault(); handleDrop(dateStr); }, style: { background: isDragOver ? T.yellowLight : isSelected ? T.cellSelectedBg : isPast ? isDark ? '#1a1d24' : '#f0f0f0' : T.cellBg, padding: isMobile ? 4 : 8, minHeight: isMobile ? 70 : 110, cursor: 'pointer', opacity: cell.current ? 1 : 0.35, borderLeft: isSelected ? `3px solid ${T.accent}` : '3px solid transparent', transition: 'all 0.15s ease', outline: isDragOver ? `2px dashed ${T.accent}` : 'none' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 12 : 13, fontWeight: isToday ? 800 : 500, color: isToday ? T.accentText : isRedDay && cell.current ? T.red : isPast && cell.current ? T.textMuted : T.text, background: isToday ? T.accent : 'transparent', borderRadius: '50%', width: isMobile ? 24 : 28, height: isMobile ? 24 : 28, display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: 2 } }, cell.day), isHoliday && cell.current && holidayName && /*#__PURE__*/React.createElement("div", { onClick: e => { e.stopPropagation(); openHolidayDetail(holidayName, dateStr); }, style: { fontSize: isMobile ? 7 : 9, fontWeight: 800, color: '#FFFFFF', background: '#CC0C39', borderRadius: 10, padding: isMobile ? '1px 3px' : '2px 6px', marginBottom: isMobile ? 1 : 3, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', textAlign: 'center', lineHeight: 1.3, letterSpacing: 0.2, cursor: 'pointer', border: '1px solid rgba(204,12,57,0.4)', boxShadow: '0 1px 3px rgba(204,12,57,0.25)' }, title: holidayName }, isMobile ? holidayName.slice(0, 6) : `🎉 ${holidayName}`), dayEvents.slice(0, isMobile ? 1 : 3).map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, draggable: true, onDragStart: e => { e.stopPropagation(); setDragEvent(ev); }, onDragEnd: () => { setDragEvent(null); setDragOverDate(null); }, style: { fontSize: isMobile ? 9 : 10, color: tagTextColor(ev.tag), background: TAG_CONFIG[ev.tag].color, borderRadius: 4, padding: isMobile ? '1px 4px' : '2px 6px', marginBottom: 2, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', fontWeight: 600, cursor: 'grab' } }, isMobile ? ev.title.slice(0, 6) : `${TAG_CONFIG[ev.tag].emoji} ${ev.title}`, !isMobile && ev.recurrence && ev.recurrence !== 'none' ? ' 🔁' : '', !isMobile && ev.attachments && ev.attachments.length > 0 ? ' 📎' : '')), dayEvents.length > (isMobile ? 1 : 3) && /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 9 : 10, color: T.textMuted, fontWeight: 600 } }, "+", dayEvents.length - (isMobile ? 1 : 3), " ", t('more'))); }))))), viewMode === 'week' && /*#__PURE__*/React.createElement("div", { style: { flex: '1 1 640px', minWidth: 0, ...cardStyle, overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'grid', gridTemplateColumns: '60px repeat(7, 1fr)', background: T.cardHeaderBg } }, /*#__PURE__*/React.createElement("div", { style: { padding: '10px 4px', fontSize: 10, fontWeight: 700, color: T.textMuted, textAlign: 'center' } }), weekDates.map((ds, i) => { const d = new Date(ds + 'T00:00:00'); const isToday = ds === todayStr; return /*#__PURE__*/React.createElement("div", { key: ds, onClick: () => { setViewDate(ds); setViewMode('day'); setSelectedDate(ds); }, style: { padding: '10px 4px', textAlign: 'center', cursor: 'pointer', background: isToday ? `${T.accent}20` : 'transparent' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, fontWeight: 700, color: T.yellow, textTransform: 'uppercase', letterSpacing: 1 } }, tDay(i)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 18, fontWeight: 800, marginTop: 2, color: isToday ? T.accentText : T.navText, background: isToday ? T.accent : 'transparent', borderRadius: '50%', width: 30, height: 30, display: 'inline-flex', alignItems: 'center', justifyContent: 'center' } }, d.getDate())); })), /*#__PURE__*/React.createElement("div", { style: { maxHeight: 600, overflowY: 'auto' } }, HOURS.map(h => /*#__PURE__*/React.createElement("div", { key: h, style: { display: 'grid', gridTemplateColumns: '60px repeat(7, 1fr)', borderBottom: `1px solid ${T.borderLight}`, minHeight: 48 } }, /*#__PURE__*/React.createElement("div", { style: { padding: '4px 8px', fontSize: 10, fontWeight: 600, color: T.textMuted, textAlign: 'right', borderRight: `1px solid ${T.borderLight}` } }, formatHour(h)), weekDates.map(ds => { const hourEvents = eventsForDate(ds).filter(ev => parseInt(ev.time.split(':')[0]) === h); return /*#__PURE__*/React.createElement("div", { key: ds, onClick: () => { setSelectedDate(ds); openAddModal(ds); }, style: { padding: 2, borderRight: `1px solid ${T.borderLight}`, cursor: 'pointer', background: ds === todayStr ? `${T.accent}08` : T.cellBg, minHeight: 48 } }, hourEvents.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, onClick: e => { e.stopPropagation(); openEditModal(ev); }, style: { fontSize: 10, color: tagTextColor(ev.tag), background: TAG_CONFIG[ev.tag].color, borderRadius: 4, padding: '3px 5px', marginBottom: 1, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', fontWeight: 600, cursor: 'pointer' } }, ev.time.slice(0, 5), " ", ev.title))); }))))), viewMode === 'day' && /*#__PURE__*/React.createElement("div", { style: { flex: '1 1 640px', minWidth: 0, ...cardStyle, overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '16px 20px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' } }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 18, fontWeight: 800, color: T.cardHeaderText } }, formatDateDisplayL(viewDate)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.yellow, marginTop: 2 } }, tDay(new Date(viewDate + 'T00:00:00').getDay()), " \xB7 ", eventsForDate(viewDate).length, " ", eventsForDate(viewDate).length !== 1 ? t('events') : t('event'))), /*#__PURE__*/React.createElement("button", { onClick: () => openAddModal(viewDate), style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 8, padding: '8px 16px', cursor: 'pointer', fontSize: 13, fontWeight: 800 } }, "+ ", t('addEvent'))), /*#__PURE__*/React.createElement("div", { style: { maxHeight: 600, overflowY: 'auto' } }, HOURS.map(h => { const hourEvents = eventsForDate(viewDate).filter(ev => parseInt(ev.time.split(':')[0]) === h); const nowH = today.getHours(); const isCurrentHour = viewDate === todayStr && h === nowH; return /*#__PURE__*/React.createElement("div", { key: h, onClick: () => { setFormTime(`${String(h).padStart(2, '0')}:00`); openAddModal(viewDate); }, style: { display: 'flex', borderBottom: `1px solid ${T.borderLight}`, minHeight: 56, cursor: 'pointer', background: isCurrentHour ? `${T.accent}12` : T.cellBg, position: 'relative' } }, isCurrentHour && /*#__PURE__*/React.createElement("div", { style: { position: 'absolute', left: 58, right: 0, top: `${today.getMinutes() / 60 * 100}%`, height: 2, background: T.red, zIndex: 2 } }, /*#__PURE__*/React.createElement("div", { style: { width: 8, height: 8, borderRadius: '50%', background: T.red, position: 'absolute', left: -4, top: -3 } })), /*#__PURE__*/React.createElement("div", { style: { width: 60, padding: '8px 10px', fontSize: 12, fontWeight: 600, color: isCurrentHour ? T.accent : T.textMuted, textAlign: 'right', borderRight: `1px solid ${T.borderLight}`, flexShrink: 0 } }, formatHour(h)), /*#__PURE__*/React.createElement("div", { style: { flex: 1, padding: '4px 12px', display: 'flex', flexDirection: 'column', gap: 4, justifyContent: 'center' } }, hourEvents.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, onClick: e => { e.stopPropagation(); openEditModal(ev); }, style: { display: 'flex', alignItems: 'center', gap: 10, padding: '10px 14px', borderRadius: 10, background: `${TAG_CONFIG[ev.tag].color}18`, border: `1px solid ${TAG_CONFIG[ev.tag].color}40`, cursor: 'pointer' } }, /*#__PURE__*/React.createElement("div", { style: { width: 4, height: 36, borderRadius: 3, background: TAG_CONFIG[ev.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 14, color: T.text } }, ev.title), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.textMuted, marginTop: 2 } }, "\u23F0 ", ev.time, " \xB7 ", /*#__PURE__*/React.createElement("span", { style: { color: TAG_CONFIG[ev.tag].color, fontWeight: 600 } }, TAG_CONFIG[ev.tag].emoji, " ", tTag(ev.tag))), ev.location && /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textFaint, marginTop: 2 } }, "\uD83D\uDCCD ", ev.location), ev.attendees && /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textFaint, marginTop: 2 } }, "\uD83D\uDC65 ", ev.attendees), ev.description && /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textFaint, marginTop: 3, lineHeight: 1.4 } }, ev.description), ev.attachments && ev.attachments.length > 0 && /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexWrap: 'wrap', gap: 4, marginTop: 4 } }, ev.attachments.map(att => { const cat = getFileCategory(att.name, att.type); return /*#__PURE__*/React.createElement("span", { key: att.id, onClick: e => { e.stopPropagation(); downloadAttachment(att); }, style: { fontSize: 10, fontWeight: 600, color: T.accent, background: `${T.accent}15`, borderRadius: 6, padding: '2px 7px', cursor: 'pointer', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', maxWidth: 130, display: 'inline-flex', alignItems: 'center', gap: 3 } }, cat.emoji, " ", att.name.length > 12 ? att.name.slice(0, 10) + '…' : att.name); }))), /*#__PURE__*/React.createElement("button", { onClick: e => { e.stopPropagation(); deleteEvent(ev.id); }, style: { background: 'transparent', border: 'none', color: T.red, fontSize: 14, cursor: 'pointer', fontWeight: 700 } }, "\u2715"))))); }))), viewMode === 'month' && isMobile && /*#__PURE__*/React.createElement("div", { style: { flex: '1 1 100%', width: '100%', display: 'flex', flexDirection: 'column', gap: 12 } }, /*#__PURE__*/React.createElement("div", { style: cardStyle }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '10px 14px' } }, selectedDate ? /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 14, fontWeight: 700, color: T.cardHeaderText } }, formatDateDisplayL(selectedDate)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.yellow, marginTop: 1 } }, selectedEvents.length, " ", selectedEvents.length !== 1 ? t('events') : t('event'))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 4, alignItems: 'center' } }, !detailsCollapsed && /*#__PURE__*/React.createElement("button", { onClick: () => openAddModal(selectedDate), style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 6, padding: '5px 10px', cursor: 'pointer', fontSize: 11, fontWeight: 800 } }, "+ ", t('add')), /*#__PURE__*/React.createElement("button", { onClick: () => setDetailsCollapsed(c => !c), style: { background: detailsCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: detailsCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, detailsCollapsed ? '⬜' : '🗕'))) : /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 14, fontWeight: 700, color: T.cardHeaderText } }, "\uD83D\uDCCB ", t('eventDetails')), /*#__PURE__*/React.createElement("button", { onClick: () => setDetailsCollapsed(c => !c), style: { background: detailsCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 6, padding: '3px 7px', cursor: 'pointer', fontSize: 11, color: detailsCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, detailsCollapsed ? '⬜' : '🗕'))), !detailsCollapsed && /*#__PURE__*/React.createElement("div", { style: { padding: '10px 14px', minHeight: 120 } }, !selectedDate && /*#__PURE__*/React.createElement("div", { style: { color: T.textMuted, fontSize: 12, padding: '20px 0', textAlign: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 28, marginBottom: 6 } }, "\uD83D\uDCC5"), t('selectDate'), /*#__PURE__*/React.createElement("br", null), t('orManage')), selectedDate && selectedEvents.length === 0 && /*#__PURE__*/React.createElement("div", { style: { color: T.textMuted, fontSize: 12, padding: '16px 0', textAlign: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 24, marginBottom: 6 } }, "\u2600\uFE0F"), t('noEvents')), selectedEvents.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id, onClick: () => openEditModal(ev), style: { display: 'flex', alignItems: 'stretch', gap: 8, padding: '8px 10px', borderRadius: 8, background: T.surfaceAlt, marginBottom: 6, cursor: 'pointer', border: `1px solid ${T.border}` } }, /*#__PURE__*/React.createElement("div", { style: { width: 3, borderRadius: 3, background: TAG_CONFIG[ev.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 12, color: T.text } }, ev.title, ev.recurrence && ev.recurrence !== 'none' ? ' 🔁' : ''), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted, marginTop: 1 } }, "\u23F0 ", ev.time, " \xB7 ", /*#__PURE__*/React.createElement("span", { style: { color: TAG_CONFIG[ev.tag].color, fontWeight: 600 } }, TAG_CONFIG[ev.tag].emoji, " ", tTag(ev.tag))), ev.location && /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textFaint, marginTop: 2 } }, "\uD83D\uDCCD ", ev.location), ev.description && /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textFaint, marginTop: 2, lineHeight: 1.3 } }, ev.description)), /*#__PURE__*/React.createElement("button", { onClick: e => { e.stopPropagation(); deleteEvent(ev.id); }, style: { background: 'transparent', border: 'none', color: T.red, fontSize: 13, cursor: 'pointer', padding: '0 2px', alignSelf: 'flex-start', fontWeight: 700 } }, "\u2715")))))), viewMode === 'month' && showAlertsPanel && !isMobile && /*#__PURE__*/React.createElement("div", { style: { flex: '0 0 330px', minWidth: 280, display: 'flex', flexDirection: 'column', gap: 16, transition: 'all 0.3s' } }, /*#__PURE__*/React.createElement("div", { style: cardStyle }, /*#__PURE__*/React.createElement("div", { style: { ...cardHeaderStyle, justifyContent: 'space-between' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8 } }, "\uD83D\uDD14 ", t('customAlerts')), /*#__PURE__*/React.createElement("button", { onClick: () => setShowAlertsPanel(false), style: { background: 'transparent', border: 'none', color: T.cardHeaderText, fontSize: 16, cursor: 'pointer', fontWeight: 700 } }, "\u2715")), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}` } }), /*#__PURE__*/React.createElement("div", { style: { padding: '16px 20px' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.surfaceAlt, borderRadius: 10, padding: 14, border: `1px solid ${T.border}`, marginBottom: 14 } }, /*#__PURE__*/React.createElement("input", { value: alertTitle, onChange: e => setAlertTitle(e.target.value), placeholder: t('alertPlaceholder'), style: { ...inputStyle, fontSize: 13, padding: '8px 10px', marginBottom: 8 } }), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8, marginBottom: 8 } }, /*#__PURE__*/React.createElement("input", { type: "date", value: alertDate, onChange: e => setAlertDate(e.target.value), style: { ...inputStyle, fontSize: 12, padding: '7px 8px', flex: 1 } }), /*#__PURE__*/React.createElement("input", { type: "time", value: alertTime, onChange: e => setAlertTime(e.target.value), style: { ...inputStyle, fontSize: 12, padding: '7px 8px', flex: 1 } })), /*#__PURE__*/React.createElement("input", { value: alertPlace, onChange: e => setAlertPlace(e.target.value), placeholder: `📍 ${t('alertPlacePlaceholder')}`, style: { ...inputStyle, fontSize: 13, padding: '8px 10px', marginBottom: 8 } }), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 5, marginBottom: 10, flexWrap: 'wrap' } }, TAGS.map(tag => /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => setAlertTag(tag), style: { padding: '4px 10px', borderRadius: 14, fontSize: 10, fontWeight: 700, cursor: 'pointer', border: alertTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `1px solid ${T.border}`, background: alertTag === tag ? `${TAG_CONFIG[tag].color}20` : 'transparent', color: alertTag === tag ? TAG_CONFIG[tag].color : T.textMuted } }, TAG_CONFIG[tag].emoji, " ", tTag(tag)))), /*#__PURE__*/React.createElement("button", { onClick: addCustomAlert, disabled: !alertTitle.trim(), style: { width: '100%', padding: '9px 0', borderRadius: 8, border: 'none', fontSize: 13, fontWeight: 800, cursor: alertTitle.trim() ? 'pointer' : 'not-allowed', background: alertTitle.trim() ? T.accent : T.border, color: alertTitle.trim() ? T.accentText : T.textMuted } }, "\uD83D\uDD14 ", t('createAlert'))), activeAlerts.length > 0 && /*#__PURE__*/React.createElement("div", { style: { marginBottom: 14 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, fontWeight: 800, color: T.text, textTransform: 'uppercase', letterSpacing: 0.5 } }, t('activeAlerts'), " (", activeAlerts.length, ")"), /*#__PURE__*/React.createElement("button", { onClick: clearAllAlerts, style: { background: T.errorBg, border: `1px solid ${T.errorBorder}`, borderRadius: 4, padding: '3px 8px', fontSize: 10, fontWeight: 700, color: T.red, cursor: 'pointer' } }, t('alertDeleteAll'))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 8 } }, activeAlerts.map(a => { const status = getAlertStatus(a); return /*#__PURE__*/React.createElement("div", { key: a.id, style: { display: 'flex', alignItems: 'stretch', gap: 10, padding: '10px 12px', borderRadius: 8, background: status.urgent ? `${status.color}10` : T.surfaceAlt, border: `1px solid ${status.urgent ? status.color : T.border}` } }, /*#__PURE__*/React.createElement("div", { style: { width: 3, borderRadius: 3, background: TAG_CONFIG[a.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 13, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, a.title), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted, marginTop: 2 } }, formatDateDisplayL(a.date), " \xB7 ", a.time), a.place && /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.textFaint, marginTop: 1 } }, "\uD83D\uDCCD ", a.place), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 5, marginTop: 4 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 9, fontWeight: 700, color: TAG_CONFIG[a.tag].color, background: `${TAG_CONFIG[a.tag].color}20`, padding: '1px 7px', borderRadius: 8 } }, TAG_CONFIG[a.tag].emoji, " ", tTag(a.tag)), /*#__PURE__*/React.createElement("span", { style: { fontSize: 9, fontWeight: 800, color: status.color, background: `${status.color}18`, padding: '1px 7px', borderRadius: 8 } }, "\u23F0 ", status.label))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 4, flexShrink: 0, justifyContent: 'center' } }, /*#__PURE__*/React.createElement("button", { onClick: () => dismissAlert(a.id), style: { background: T.surface, border: `1px solid ${T.border}`, borderRadius: 4, padding: '3px 8px', fontSize: 9, fontWeight: 700, color: T.textMuted, cursor: 'pointer' } }, "\u2713"), /*#__PURE__*/React.createElement("button", { onClick: () => deleteAlert(a.id), style: { background: 'transparent', border: 'none', color: T.red, fontSize: 12, cursor: 'pointer', padding: 0, fontWeight: 700 } }, "\u2715"))); }))), customAlerts.length === 0 && /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', padding: '20px 0', color: T.textMuted, fontSize: 13 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 32, marginBottom: 6 } }, "\uD83D\uDD14"), t('noAlerts')))))), /*#__PURE__*/React.createElement("div", { style: { ...cardStyle, marginTop: isMobile ? 12 : 12 } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, borderRadius: metricsPanelCollapsed ? 12 : '12px 12px 0 0', padding: '10px 20px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 8, fontSize: 15, fontWeight: 700, color: T.cardHeaderText } }, "\uD83D\uDCCA ", lang === 'pt' ? 'Painel de Produtividade' : 'Productivity Dashboard'), /*#__PURE__*/React.createElement("button", { onClick: () => setMetricsPanelCollapsed(c => !c), style: { background: metricsPanelCollapsed ? T.accent : T.navBtn, border: 'none', borderRadius: 8, padding: '5px 9px', cursor: 'pointer', fontSize: 13, color: metricsPanelCollapsed ? T.accentText : T.yellow, lineHeight: 1 } }, metricsPanelCollapsed ? '⬜' : '🗕')), !metricsPanelCollapsed && /*#__PURE__*/React.createElement("div", { style: { padding: isMobile ? '14px 12px 16px' : '18px 20px 22px' } }, /*#__PURE__*/React.createElement(ProductivityDashboard, { events: allEventsWithRecurring, T: T, isDark: isDark, isMobile: isMobile, lang: lang, tTag: tTag, year: year, month: month }))))), isMobile && /*#__PURE__*/React.createElement(SidePanel, { events: allEventsWithRecurring, T: T, isDark: isDark, isMobile: true, lang: lang, tTag: tTag, notes: notes, onNotesChange: setNotes }), showModal && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 8 : 0 }, onClick: () => setShowModal(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 440, maxHeight: isMobile ? '95vh' : '90vh', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', display: 'flex', flexDirection: 'column', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: isMobile ? '14px 16px' : '18px 24px', display: 'flex', alignItems: 'center', gap: 10, flexShrink: 0 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, editingEvent ? '✏️' : '✨'), /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 17 : 20, fontWeight: 800, color: T.cardHeaderText } }, editingEvent ? t('editEvent') : t('newEvent'))), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}`, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { padding: isMobile ? '16px 16px' : '22px 24px', overflowY: 'auto', flex: 1, WebkitOverflowScrolling: 'touch' } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('titleLabel'), " *"), /*#__PURE__*/React.createElement("input", { value: formTitle, onChange: e => setFormTitle(e.target.value), placeholder: t('titlePlaceholder'), autoFocus: true, style: { ...inputStyle, marginBottom: 16 } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('category')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6, marginBottom: 16, flexWrap: 'wrap' } }, TAGS.map(tag => /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => setFormTag(tag), style: { padding: isMobile ? '8px 12px' : '6px 14px', borderRadius: 20, fontSize: 12, fontWeight: 700, cursor: 'pointer', border: formTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `2px solid ${T.border}`, background: formTag === tag ? `${TAG_CONFIG[tag].color}20` : T.surface, color: formTag === tag ? TAG_CONFIG[tag].color : T.textMuted, flexShrink: 0 } }, TAG_CONFIG[tag].emoji, " ", tTag(tag)))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 12, marginBottom: 16 } }, /*#__PURE__*/React.createElement("div", { style: { flex: 1 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('date')), /*#__PURE__*/React.createElement("input", { type: "date", value: formDate, onChange: e => setFormDate(e.target.value), style: inputStyle })), /*#__PURE__*/React.createElement("div", { style: { flex: 1 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('time')), /*#__PURE__*/React.createElement("input", { type: "time", value: formTime, onChange: e => setFormTime(e.target.value), style: inputStyle }))), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('description')), /*#__PURE__*/React.createElement("textarea", { value: formDesc, onChange: e => setFormDesc(e.target.value), placeholder: t('descPlaceholder'), style: { ...inputStyle, minHeight: 70, resize: 'vertical', marginBottom: 16 } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, "\uD83D\uDCCD ", t('location')), /*#__PURE__*/React.createElement("input", { value: formLocation, onChange: e => setFormLocation(e.target.value), placeholder: t('locationPlaceholder'), style: { ...inputStyle, marginBottom: 16 } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, "\uD83D\uDC65 ", t('attendees')), /*#__PURE__*/React.createElement("input", { value: formAttendees, onChange: e => setFormAttendees(e.target.value), placeholder: t('attendeesPlaceholder'), style: { ...inputStyle, marginBottom: 16 } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, "\uD83D\uDCCE ", t('attachments')), /*#__PURE__*/React.createElement("input", { ref: attachRef, type: "file", accept: ACCEPTED_EXTENSIONS, multiple: true, style: { display: 'none' }, onChange: e => { handleAttachFiles(e.target.files); e.target.value = ''; } }), formAttachments.length < MAX_ATTACHMENTS && /*#__PURE__*/React.createElement("div", { onClick: () => attachRef.current?.click(), style: { border: `2px dashed ${T.border}`, borderRadius: 10, padding: '16px 14px', textAlign: 'center', cursor: 'pointer', background: T.surfaceAlt, marginBottom: 10 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 22, marginBottom: 4 } }, "\uD83D\uDCC2"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, fontWeight: 700, color: T.text } }, t('dropFiles')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted, marginTop: 3 } }, t('fileLimit'))), attachError && /*#__PURE__*/React.createElement("div", { style: { padding: '8px 12px', borderRadius: 8, marginBottom: 8, fontSize: 12, background: T.errorBg, color: T.red, border: `1px solid ${T.errorBorder}`, fontWeight: 600 } }, attachError), formAttachments.length > 0 && /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 6, marginBottom: 16 } }, formAttachments.map(att => { const cat = getFileCategory(att.name, att.type); return /*#__PURE__*/React.createElement("div", { key: att.id, style: { display: 'flex', alignItems: 'center', gap: 10, padding: '8px 12px', borderRadius: 8, background: T.surfaceAlt, border: `1px solid ${T.border}` } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20, flexShrink: 0 } }, cat.emoji), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, fontWeight: 700, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, att.name), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted } }, formatFileSize(att.size), " \xB7 ", cat.label)), /*#__PURE__*/React.createElement("button", { onClick: () => downloadAttachment(att), style: { background: 'transparent', border: 'none', fontSize: 14, cursor: 'pointer', padding: '2px 4px', color: T.accent, flexShrink: 0 } }, "\u2B07\uFE0F"), /*#__PURE__*/React.createElement("button", { onClick: () => removeAttachment(att.id), style: { background: 'transparent', border: 'none', fontSize: 14, cursor: 'pointer', padding: '2px 4px', color: T.red, flexShrink: 0 } }, "\u2715")); }), /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, color: T.textMuted, textAlign: 'right' } }, formAttachments.length, "/", MAX_ATTACHMENTS)), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('recurrence')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6, marginBottom: 12, flexWrap: 'wrap' } }, ['none', 'daily', 'weekly', 'monthly', 'yearly'].map(r => /*#__PURE__*/React.createElement("button", { key: r, onClick: () => setFormRecurrence(r), style: { padding: '6px 12px', borderRadius: 8, fontSize: 12, fontWeight: 700, cursor: 'pointer', border: formRecurrence === r ? `2px solid ${T.accent}` : `2px solid ${T.border}`, background: formRecurrence === r ? `${T.accent}20` : T.surface, color: formRecurrence === r ? T.accent : T.textMuted } }, r === 'none' ? '—' : '🔁', " ", t(r)))), formRecurrence !== 'none' && /*#__PURE__*/React.createElement("div", { style: { marginBottom: 20, background: T.surfaceAlt, borderRadius: 10, padding: 14, border: `1px solid ${T.border}` } }, (formRecurrence === 'weekly' || formRecurrence === 'daily') && /*#__PURE__*/React.createElement("div", { style: { marginBottom: 14 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, "\uD83D\uDCC5 ", t('repeatOnDays')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } }, DAYS.map((_, di) => { const active = formRecurrenceDays.includes(di); return /*#__PURE__*/React.createElement("button", { key: di, onClick: () => setFormRecurrenceDays(prev => prev.includes(di) ? prev.filter(d => d !== di) : [...prev, di].sort()), style: { width: 42, height: 42, borderRadius: '50%', fontSize: 11, fontWeight: 800, cursor: 'pointer', border: active ? `2px solid ${T.accent}` : `2px solid ${T.border}`, background: active ? T.accent : T.surface, color: active ? T.accentText : T.textMuted, display: 'flex', alignItems: 'center', justifyContent: 'center' } }, tDay(di)); }))), /*#__PURE__*/React.createElement("label", { style: labelStyle }, "\u23F1\uFE0F ", t('repeatDuration')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6, flexWrap: 'wrap', marginBottom: 10 } }, [{ key: 'dur1w', days: 7 }, { key: 'dur2w', days: 14 }, { key: 'dur1m', days: 30 }, { key: 'dur3m', days: 90 }, { key: 'dur6m', days: 180 }, { key: 'dur1y', days: 365 }].map(preset => { const presetDate = (() => { const d = new Date(formDate + 'T00:00:00'); d.setDate(d.getDate() + preset.days); return toDateStr(d.getFullYear(), d.getMonth(), d.getDate()); })(); const isActive = formRecurrenceEnd === presetDate; return /*#__PURE__*/React.createElement("button", { key: preset.key, onClick: () => setFormRecurrenceEnd(presetDate), style: { padding: '6px 12px', borderRadius: 8, fontSize: 11, fontWeight: 700, cursor: 'pointer', border: isActive ? `2px solid ${T.accent}` : `2px solid ${T.border}`, background: isActive ? `${T.accent}20` : T.surface, color: isActive ? T.accent : T.textMuted } }, t(preset.key)); })), /*#__PURE__*/React.createElement("label", { style: { ...labelStyle, marginTop: 4 } }, t('recurrenceEnd')), /*#__PURE__*/React.createElement("input", { type: "date", value: formRecurrenceEnd, onChange: e => setFormRecurrenceEnd(e.target.value), style: inputStyle })), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 10 } }, /*#__PURE__*/React.createElement("button", { onClick: () => setShowModal(false), style: { flex: 1, background: T.surface, color: T.text, border: `1px solid ${T.border}`, borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('cancel')), editingEvent && /*#__PURE__*/React.createElement("button", { onClick: () => deleteEvent(editingEvent.id), style: { background: T.errorBg, color: T.red, border: `1px solid ${T.errorBorder}`, borderRadius: 8, padding: '11px 18px', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('delete')), /*#__PURE__*/React.createElement("button", { onClick: saveEvent, style: { flex: 1, background: T.accent, color: T.accentText, border: 'none', borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 800, cursor: 'pointer' } }, editingEvent ? t('saveChanges') : t('createEvent')))))), showImportModal && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center' }, onClick: () => { setShowImportModal(false); setImportMsg(''); } }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 460, maxHeight: '90vh', overflowY: 'auto', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '18px 24px', display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, "\uD83D\uDCE5"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 20, fontWeight: 800, color: T.cardHeaderText } }, t('importEvents'))), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}` } }), /*#__PURE__*/React.createElement("div", { style: { padding: '22px 24px' } }, /*#__PURE__*/React.createElement("p", { style: { fontSize: 13, color: T.textFaint, lineHeight: 1.6, marginTop: 0 }, dangerouslySetInnerHTML: { __html: t('importDesc') } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('tagAs')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8, marginBottom: 20, flexWrap: 'wrap' } }, TAGS.map(tag => /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => setImportTag(tag), style: { padding: '6px 14px', borderRadius: 20, fontSize: 12, fontWeight: 700, cursor: 'pointer', border: importTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `2px solid ${T.border}`, background: importTag === tag ? `${TAG_CONFIG[tag].color}20` : T.surface, color: importTag === tag ? TAG_CONFIG[tag].color : T.textMuted } }, TAG_CONFIG[tag].emoji, " ", tTag(tag)))), /*#__PURE__*/React.createElement("input", { ref: fileRef, type: "file", accept: ".csv,.ics,.ical", style: { display: 'none' }, onChange: e => { const f = e.target.files?.[0]; if (f) handleFileImport(f); e.target.value = ''; } }), /*#__PURE__*/React.createElement("div", { onClick: () => fileRef.current?.click(), style: { border: `2px dashed ${T.border}`, borderRadius: 12, padding: '30px 20px', textAlign: 'center', cursor: 'pointer', background: T.surfaceAlt, marginBottom: 16 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 36, marginBottom: 8 } }, "\uD83D\uDCC2"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 14, fontWeight: 700, color: T.text } }, t('chooseFile')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textMuted, marginTop: 4 } }, t('fileFormats'))), importMsg && /*#__PURE__*/React.createElement("div", { style: { padding: '12px 16px', borderRadius: 8, marginBottom: 16, fontSize: 13, fontWeight: 600, background: importMsg.startsWith('✅') ? T.successBg : T.errorBg, color: importMsg.startsWith('✅') ? T.successText : T.red, border: `1px solid ${importMsg.startsWith('✅') ? T.successBorder : T.errorBorder}` } }, importMsg), /*#__PURE__*/React.createElement("button", { onClick: () => { setShowImportModal(false); setImportMsg(''); }, style: { flex: 1, width: '100%', background: T.surface, color: T.text, border: `1px solid ${T.border}`, borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('close'))))), reminders.length > 0 && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', top: isMobile ? 56 : 70, right: isMobile ? 8 : 20, left: isMobile ? 8 : undefined, zIndex: 200, display: 'flex', flexDirection: 'column', gap: 10, maxWidth: isMobile ? undefined : 360 } }, reminders.length > 1 && /*#__PURE__*/React.createElement("button", { onClick: () => setReminders([]), style: { alignSelf: 'flex-end', background: T.surface, border: `1px solid ${T.border}`, borderRadius: 8, padding: '5px 12px', fontSize: 11, fontWeight: 700, color: T.textMuted, cursor: 'pointer' } }, t('dismissAll')), reminders.slice(0, 5).map(r => /*#__PURE__*/React.createElement("div", { key: r.id, style: { background: T.modalBg, borderRadius: 12, padding: '14px 16px', border: `2px solid ${TAG_CONFIG[r.tag].color}`, boxShadow: '0 8px 30px rgba(0,0,0,0.2)', display: 'flex', alignItems: 'flex-start', gap: 10, animation: 'slideIn 0.3s ease-out' } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 22, flexShrink: 0 } }, "\uD83D\uDD14"), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 13, color: T.text, marginBottom: 3 } }, r.message), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.textMuted } }, formatDateDisplayL(r.eventDate), " ", t('at'), " ", r.eventTime)), /*#__PURE__*/React.createElement("div", { style: { width: 6, height: 6, borderRadius: '50%', background: TAG_CONFIG[r.tag].color, flexShrink: 0, marginTop: 4 } }), /*#__PURE__*/React.createElement("button", { onClick: () => dismissReminder(r.id), style: { background: 'transparent', border: 'none', color: T.textMuted, fontSize: 16, cursor: 'pointer', padding: 0, fontWeight: 700, flexShrink: 0 } }, "\u2715")))), showAIModal && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center' }, onClick: () => setShowAIModal(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 500, maxHeight: '90vh', overflowY: 'auto', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '18px 24px', display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, "\uD83E\uDD16"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 20, fontWeight: 800, color: T.cardHeaderText } }, t('aiSmartScheduler')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.navSub } }, t('aiDesc')))), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}` } }), /*#__PURE__*/React.createElement("div", { style: { padding: '22px 24px' } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('eventTitle'), " *"), /*#__PURE__*/React.createElement("input", { value: aiTitle, onChange: e => setAiTitle(e.target.value), placeholder: t('aiPlaceholder'), style: { ...inputStyle, marginBottom: 16 } }), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('category')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8, marginBottom: 16, flexWrap: 'wrap' } }, TAGS.map(tag => /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => setAiTag(tag), style: { padding: '6px 14px', borderRadius: 20, fontSize: 12, fontWeight: 700, cursor: 'pointer', border: aiTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `2px solid ${T.border}`, background: aiTag === tag ? `${TAG_CONFIG[tag].color}20` : T.surface, color: aiTag === tag ? TAG_CONFIG[tag].color : T.textMuted } }, TAG_CONFIG[tag].emoji, " ", tTag(tag)))), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('duration')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8, marginBottom: 20 } }, [30, 60, 90, 120].map(d => /*#__PURE__*/React.createElement("button", { key: d, onClick: () => setAiDuration(d), style: { padding: '7px 16px', borderRadius: 8, fontSize: 13, fontWeight: 700, cursor: 'pointer', border: aiDuration === d ? `2px solid ${T.accent}` : `2px solid ${T.border}`, background: aiDuration === d ? `${T.accent}20` : T.surface, color: aiDuration === d ? T.accent : T.textMuted } }, d, "m"))), /*#__PURE__*/React.createElement("button", { onClick: getAISuggestions, disabled: !aiTitle.trim() || aiLoading, style: { width: '100%', padding: '12px 0', borderRadius: 8, border: 'none', fontSize: 14, fontWeight: 800, cursor: aiTitle.trim() && !aiLoading ? 'pointer' : 'not-allowed', background: aiTitle.trim() && !aiLoading ? T.accent : T.border, color: aiTitle.trim() && !aiLoading ? T.accentText : T.textMuted, marginBottom: 16 } }, aiLoading ? t('analyzing') : t('findBest')), aiError && /*#__PURE__*/React.createElement("div", { style: { padding: '12px 16px', borderRadius: 8, marginBottom: 16, fontSize: 13, background: T.errorBg, color: T.red, border: `1px solid ${T.errorBorder}` } }, aiError), aiSuggestions.length > 0 && /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 } }, aiSuggestions.map((s, i) => /*#__PURE__*/React.createElement("div", { key: i, onClick: () => applySuggestion(s), style: { display: 'flex', alignItems: 'center', gap: 12, padding: '14px 16px', borderRadius: 10, background: T.surfaceAlt, border: `1px solid ${T.border}`, cursor: 'pointer' } }, /*#__PURE__*/React.createElement("div", { style: { width: 28, height: 28, borderRadius: '50%', background: T.accent, color: T.accentText, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 13, fontWeight: 800, flexShrink: 0 } }, i + 1), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 14, color: T.text } }, formatDateDisplayL(s.date), " ", t('at'), " ", s.time), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textFaint, marginTop: 2 } }, s.reasoning)), /*#__PURE__*/React.createElement("button", { onClick: e => { e.stopPropagation(); applySuggestion(s); }, style: { background: T.accent, color: T.accentText, border: 'none', borderRadius: 8, padding: '6px 14px', fontSize: 12, fontWeight: 800, cursor: 'pointer', flexShrink: 0 } }, t('book'))))), /*#__PURE__*/React.createElement("button", { onClick: () => setShowAIModal(false), style: { width: '100%', marginTop: 16, background: T.surface, color: T.text, border: `1px solid ${T.border}`, borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('close'))))), showWeatherModal && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center' }, onClick: () => setShowWeatherModal(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 500, maxHeight: '90vh', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', display: 'flex', flexDirection: 'column', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '18px 24px', display: 'flex', alignItems: 'center', gap: 10, flexShrink: 0 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, "\uD83C\uDF24\uFE0F"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 20, fontWeight: 800, color: T.cardHeaderText } }, t('weatherForecast')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.navSub } }, t('weatherDesc')))), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}`, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { padding: '22px 24px', overflowY: 'auto', flex: 1 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 12, marginBottom: 16 } }, /*#__PURE__*/React.createElement("div", { style: { flex: 1 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('city'), " *"), /*#__PURE__*/React.createElement("input", { value: wxCity, onChange: e => setWxCity(e.target.value), placeholder: t('cityPlaceholder'), style: inputStyle })), /*#__PURE__*/React.createElement("div", { style: { flex: 1 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('state'), " *"), /*#__PURE__*/React.createElement("input", { value: wxState, onChange: e => setWxState(e.target.value), placeholder: t('statePlaceholder'), style: inputStyle }))), /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('date')), /*#__PURE__*/React.createElement("input", { type: "date", value: wxDate, onChange: e => setWxDate(e.target.value), style: { ...inputStyle, marginBottom: 16 } }), /*#__PURE__*/React.createElement("div", { onClick: () => setWxTravel(!wxTravel), style: { display: 'flex', alignItems: 'center', gap: 10, padding: '12px 14px', borderRadius: 10, background: wxTravel ? `${T.accent}15` : T.surfaceAlt, border: `1px solid ${wxTravel ? T.accent : T.border}`, cursor: 'pointer', marginBottom: 16 } }, /*#__PURE__*/React.createElement("div", { style: { width: 20, height: 20, borderRadius: 4, border: `2px solid ${wxTravel ? T.accent : T.border}`, background: wxTravel ? T.accent : 'transparent', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0 } }, wxTravel && /*#__PURE__*/React.createElement("span", { style: { color: T.accentText, fontSize: 13, fontWeight: 800 } }, "\u2713")), /*#__PURE__*/React.createElement("span", { style: { fontSize: 18 } }, "\u2708\uFE0F"), /*#__PURE__*/React.createElement("span", { style: { fontSize: 13, fontWeight: 700, color: T.text } }, t('travelCheck'))), wxTravel && /*#__PURE__*/React.createElement("div", { style: { marginBottom: 16 } }, /*#__PURE__*/React.createElement("label", { style: labelStyle }, t('travelTime')), /*#__PURE__*/React.createElement("input", { type: "time", value: wxTravelTime, onChange: e => setWxTravelTime(e.target.value), style: inputStyle })), /*#__PURE__*/React.createElement("button", { onClick: getWeatherForecast, disabled: !wxCity.trim() || !wxState.trim() || wxLoading, style: { width: '100%', padding: '12px 0', borderRadius: 8, border: 'none', fontSize: 14, fontWeight: 800, cursor: wxCity.trim() && wxState.trim() && !wxLoading ? 'pointer' : 'not-allowed', background: wxCity.trim() && wxState.trim() && !wxLoading ? T.accent : T.border, color: wxCity.trim() && wxState.trim() && !wxLoading ? T.accentText : T.textMuted, marginBottom: 16 } }, wxLoading ? t('loadingWeather') : t('getWeather')), wxError && /*#__PURE__*/React.createElement("div", { style: { padding: '12px 16px', borderRadius: 8, marginBottom: 16, fontSize: 13, background: T.errorBg, color: T.red, border: `1px solid ${T.errorBorder}` } }, wxError), wxResult && /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 12 } }, /*#__PURE__*/React.createElement("div", { style: { borderRadius: 12, padding: '20px', background: T.surfaceAlt, border: `1px solid ${T.border}`, textAlign: 'center' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 56, marginBottom: 6 } }, wxResult.icon), /*#__PURE__*/React.createElement("div", { style: { fontSize: 18, fontWeight: 800, color: T.text, marginBottom: 4 } }, wxCity, ", ", wxState), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textMuted, marginBottom: 10 } }, formatDateDisplayL(wxDate)), /*#__PURE__*/React.createElement("div", { style: { fontSize: 20, fontWeight: 800, color: T.accent, marginBottom: 4 } }, wxResult.temperature), /*#__PURE__*/React.createElement("div", { style: { fontSize: 14, fontWeight: 600, color: T.textFaint, marginBottom: 12 } }, wxResult.conditions), /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, color: T.text, lineHeight: 1.6, background: T.surface, borderRadius: 8, padding: '10px 14px' } }, wxResult.summary)), wxResult.travelTips && wxResult.travelTips.length > 0 && /*#__PURE__*/React.createElement("div", { style: { borderRadius: 12, padding: '16px', background: wxTravel ? `${T.accent}10` : T.surfaceAlt, border: `1px solid ${wxTravel ? T.accent : T.border}` } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 14, fontWeight: 800, color: T.text, marginBottom: 10, display: 'flex', alignItems: 'center', gap: 6 } }, wxTravel ? '✈️' : '💡', " ", t('travelTips')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 8 } }, wxResult.travelTips.map((tip, i) => /*#__PURE__*/React.createElement("div", { key: i, style: { fontSize: 13, fontWeight: 700, color: T.text, padding: '10px 14px', background: T.surface, borderRadius: 8, borderLeft: `4px solid ${T.accent}` } }, tip))))), /*#__PURE__*/React.createElement("button", { onClick: () => setShowWeatherModal(false), style: { width: '100%', marginTop: 16, background: T.surface, color: T.text, border: `1px solid ${T.border}`, borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('close'))))), showDashboard && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 8 : 0 }, onClick: () => setShowDashboard(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '95%', maxWidth: 780, maxHeight: isMobile ? '95vh' : '90vh', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', display: 'flex', flexDirection: 'column', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: isMobile ? '14px 16px' : '18px 24px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexShrink: 0 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 22 } }, "\uD83D\uDCCA"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 17 : 20, fontWeight: 800, color: T.cardHeaderText } }, lang === 'pt' ? 'Painel de Produtividade' : 'Productivity Dashboard'), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.navSub } }, lang === 'pt' ? 'Analise sua produtividade com gráficos e insights IA' : 'Analyze your productivity with charts and AI insights'))), /*#__PURE__*/React.createElement("button", { onClick: () => setShowDashboard(false), style: { background: 'transparent', border: 'none', color: T.cardHeaderText, fontSize: 18, cursor: 'pointer', fontWeight: 700 } }, "\u2715")), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}`, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { padding: isMobile ? '14px 16px 20px' : '18px 24px 24px', overflowY: 'auto', flex: 1 } }, /*#__PURE__*/React.createElement(ProductivityDashboard, { events: allEventsWithRecurring, T: T, isDark: isDark, isMobile: isMobile, lang: lang, tTag: tTag, year: year, month: month })))), showSearch && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'flex-start', justifyContent: 'center', paddingTop: 80 }, onClick: () => setShowSearch(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 520, maxHeight: '70vh', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', overflow: 'hidden', display: 'flex', flexDirection: 'column' } }, /*#__PURE__*/React.createElement("div", { style: { padding: '16px 20px', borderBottom: `1px solid ${T.border}`, display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, "\uD83D\uDD0D"), /*#__PURE__*/React.createElement("input", { value: searchQuery, onChange: e => setSearchQuery(e.target.value), placeholder: t('searchPlaceholder'), autoFocus: true, style: { ...inputStyle, border: 'none', background: 'transparent', padding: '8px 0', fontSize: 16 } }), /*#__PURE__*/React.createElement("button", { onClick: () => setShowSearch(false), style: { background: 'transparent', border: 'none', color: T.textMuted, fontSize: 18, cursor: 'pointer', fontWeight: 700, flexShrink: 0 } }, "\u2715")), /*#__PURE__*/React.createElement("div", { style: { overflowY: 'auto', flex: 1, padding: '8px 0' } }, searchQuery.trim() && searchResults.length === 0 && /*#__PURE__*/React.createElement("div", { style: { padding: '30px 20px', textAlign: 'center', color: T.textMuted, fontSize: 13 } }, t('noResults')), searchResults.map(ev => /*#__PURE__*/React.createElement("div", { key: ev.id + ev.date, onClick: () => jumpToEvent(ev), style: { display: 'flex', alignItems: 'center', gap: 12, padding: '12px 20px', cursor: 'pointer', borderBottom: `1px solid ${T.borderLight}` } }, /*#__PURE__*/React.createElement("div", { style: { width: 4, height: 36, borderRadius: 3, background: TAG_CONFIG[ev.tag].color, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 14, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, ev.title, ev.recurrence && ev.recurrence !== 'none' ? ' 🔁' : '', ev.attachments && ev.attachments.length > 0 ? ' 📎' : ''), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.textMuted, marginTop: 2 } }, formatDateDisplayL(ev.date), " \xB7 ", ev.time, " \xB7 ", /*#__PURE__*/React.createElement("span", { style: { color: TAG_CONFIG[ev.tag].color, fontWeight: 600 } }, TAG_CONFIG[ev.tag].emoji, " ", tTag(ev.tag)))), /*#__PURE__*/React.createElement("span", { style: { fontSize: 16, color: T.textMuted } }, "\u2197")))))), showNotesPanel && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 100, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 8 : 0 }, onClick: () => setShowNotesPanel(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '95%', maxWidth: 700, maxHeight: isMobile ? '95vh' : '90vh', boxShadow: '0 20px 60px rgba(0,0,0,0.3)', display: 'flex', flexDirection: 'column', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: isMobile ? '14px 16px' : '18px 24px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexShrink: 0 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 22 } }, "\uD83D\uDCDD"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 17 : 20, fontWeight: 800, color: T.cardHeaderText } }, t('notesTitle')), /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.navSub } }, t('notesDesc')))), /*#__PURE__*/React.createElement("button", { onClick: () => setShowNotesPanel(false), style: { background: 'transparent', border: 'none', color: T.cardHeaderText, fontSize: 18, cursor: 'pointer', fontWeight: 700 } }, "\u2715")), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}`, flexShrink: 0 } }), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flex: 1, minHeight: 0, flexDirection: isMobile ? 'column' : 'row' } }, /*#__PURE__*/React.createElement("div", { style: { flex: '0 0 auto', width: isMobile ? '100%' : 280, padding: isMobile ? '14px 16px' : '18px 20px', borderRight: isMobile ? 'none' : `1px solid ${T.border}`, borderBottom: isMobile ? `1px solid ${T.border}` : 'none', display: 'flex', flexDirection: 'column', gap: 10, flexShrink: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, fontWeight: 800, color: T.text, textTransform: 'uppercase', letterSpacing: 0.5 } }, editingNote ? `✏️ ${t('editNote')}` : `✨ ${t('newNote')}`), /*#__PURE__*/React.createElement("input", { value: noteTitle, onChange: e => setNoteTitle(e.target.value), placeholder: t('noteTitlePlaceholder'), style: { ...inputStyle, fontSize: 13, padding: '8px 10px' } }), /*#__PURE__*/React.createElement("textarea", { value: noteContent, onChange: e => setNoteContent(e.target.value), placeholder: t('noteContentPlaceholder'), style: { ...inputStyle, minHeight: isMobile ? 80 : 100, resize: 'vertical', fontSize: 13, padding: '8px 10px', flex: isMobile ? undefined : 1 } }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, fontWeight: 700, color: T.textMuted, marginBottom: 5, textTransform: 'uppercase' } }, t('category')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 4, flexWrap: 'wrap' } }, TAGS.map(tag => /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => { setNoteTag(tag); setNoteColor(TAG_CONFIG[tag].color); }, style: { padding: '4px 10px', borderRadius: 14, fontSize: 10, fontWeight: 700, cursor: 'pointer', border: noteTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `1px solid ${T.border}`, background: noteTag === tag ? `${TAG_CONFIG[tag].color}20` : 'transparent', color: noteTag === tag ? TAG_CONFIG[tag].color : T.textMuted } }, TAG_CONFIG[tag].emoji, " ", tTag(tag))))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 10, fontWeight: 700, color: T.textMuted, marginBottom: 5, textTransform: 'uppercase' } }, t('noteColor')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } }, NOTE_COLORS.map(c => /*#__PURE__*/React.createElement("button", { key: c, onClick: () => setNoteColor(c), style: { width: 22, height: 22, borderRadius: '50%', border: noteColor === c ? `3px solid ${T.text}` : `2px solid ${T.border}`, background: c, cursor: 'pointer' } })))), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', gap: 8 } }, editingNote && /*#__PURE__*/React.createElement("button", { onClick: openNewNote, style: { flex: 1, padding: '9px 0', borderRadius: 8, border: `1px solid ${T.border}`, background: T.surface, color: T.textMuted, fontSize: 12, fontWeight: 700, cursor: 'pointer' } }, t('cancel')), /*#__PURE__*/React.createElement("button", { onClick: saveNote, disabled: !noteTitle.trim() && !noteContent.trim(), style: { flex: 1, padding: '9px 0', borderRadius: 8, border: 'none', fontSize: 12, fontWeight: 800, cursor: noteTitle.trim() || noteContent.trim() ? 'pointer' : 'not-allowed', background: noteTitle.trim() || noteContent.trim() ? T.accent : T.border, color: noteTitle.trim() || noteContent.trim() ? T.accentText : T.textMuted } }, editingNote ? t('saveChanges') : t('saveNote')))), /*#__PURE__*/React.createElement("div", { style: { flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0 } }, /*#__PURE__*/React.createElement("div", { style: { padding: isMobile ? '10px 16px 0' : '14px 20px 0', display: 'flex', gap: 4, flexWrap: 'wrap', flexShrink: 0 } }, /*#__PURE__*/React.createElement("button", { onClick: () => setNoteFilterTag('all'), style: { padding: '4px 12px', borderRadius: 14, fontSize: 10, fontWeight: 700, cursor: 'pointer', border: noteFilterTag === 'all' ? `2px solid ${T.accent}` : `1px solid ${T.border}`, background: noteFilterTag === 'all' ? `${T.accent}20` : 'transparent', color: noteFilterTag === 'all' ? T.accent : T.textMuted } }, "\uD83D\uDCCB ", lang === 'pt' ? 'Todas' : 'All', " (", notes.length, ")"), TAGS.map(tag => { const count = notes.filter(n => (n.tag || 'Personal') === tag).length; return /*#__PURE__*/React.createElement("button", { key: tag, onClick: () => setNoteFilterTag(tag), style: { padding: '4px 10px', borderRadius: 14, fontSize: 10, fontWeight: 700, cursor: 'pointer', border: noteFilterTag === tag ? `2px solid ${TAG_CONFIG[tag].color}` : `1px solid ${T.border}`, background: noteFilterTag === tag ? `${TAG_CONFIG[tag].color}20` : 'transparent', color: noteFilterTag === tag ? TAG_CONFIG[tag].color : T.textMuted } }, TAG_CONFIG[tag].emoji, " ", count); })), /*#__PURE__*/React.createElement("div", { style: { flex: 1, overflowY: 'auto', padding: isMobile ? '10px 16px 14px' : '14px 20px 18px', minHeight: 0 } }, notes.length === 0 ? /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', padding: '40px 20px', color: T.textMuted } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 40, marginBottom: 10 } }, "\uD83D\uDCDD"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 13 } }, t('noNotes'))) : (() => { const filtered = noteFilterTag === 'all' ? notes : notes.filter(n => (n.tag || 'Personal') === noteFilterTag); if (filtered.length === 0) return /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', padding: '30px 20px', color: T.textMuted } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 32, marginBottom: 8 } }, TAG_CONFIG[noteFilterTag]?.emoji || '📋'), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12 } }, lang === 'pt' ? 'Nenhuma nota nesta categoria.' : 'No notes in this category.')); return /*#__PURE__*/React.createElement("div", { style: { display: 'grid', gridTemplateColumns: isMobile ? '1fr' : 'repeat(2, 1fr)', gap: 10 } }, filtered.map(n => { const isEditing = editingNote?.id === n.id; const nTag = n.tag || 'Personal'; const updDate = new Date(n.updatedAt); const updStr = `${updDate.getDate()}/${updDate.getMonth() + 1}/${updDate.getFullYear()} ${String(updDate.getHours()).padStart(2, '0')}:${String(updDate.getMinutes()).padStart(2, '0')}`; return /*#__PURE__*/React.createElement("div", { key: n.id, onClick: () => openEditNote(n), style: { borderRadius: 10, padding: '12px 14px', cursor: 'pointer', background: isEditing ? `${n.color}25` : T.surfaceAlt, border: isEditing ? `2px solid ${n.color}` : `1px solid ${T.border}`, borderLeft: `4px solid ${n.color}` } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 6 } }, /*#__PURE__*/React.createElement("div", { style: { fontWeight: 700, fontSize: 13, color: T.text, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', flex: 1 } }, n.title || (lang === 'pt' ? 'Sem título' : 'Untitled')), /*#__PURE__*/React.createElement("button", { onClick: e => { e.stopPropagation(); deleteNote(n.id); }, style: { background: 'transparent', border: 'none', color: T.red, fontSize: 12, cursor: 'pointer', padding: 0, fontWeight: 700, flexShrink: 0 } }, "\u2715")), n.content && /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, color: T.textFaint, marginTop: 4, lineHeight: 1.4, display: '-webkit-box', WebkitLineClamp: 3, WebkitBoxOrient: 'vertical', overflow: 'hidden', whiteSpace: 'pre-wrap', wordBreak: 'break-word' } }, n.content), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginTop: 6 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 4 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 9, fontWeight: 700, color: TAG_CONFIG[nTag].color, background: `${TAG_CONFIG[nTag].color}20`, padding: '1px 7px', borderRadius: 8 } }, TAG_CONFIG[nTag].emoji, " ", tTag(nTag)), /*#__PURE__*/React.createElement("span", { style: { fontSize: 9, opacity: 0.6 } }, n.origin === 'sidepanel' ? '📌' : '🔝')), /*#__PURE__*/React.createElement("span", { style: { fontSize: 9, color: T.textMuted } }, updStr))); })); })()))))), showSeriesPrompt && pendingSeriesEvent && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 110, display: 'flex', alignItems: 'center', justifyContent: 'center' }, onClick: () => setShowSeriesPrompt(false) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 380, boxShadow: '0 20px 60px rgba(0,0,0,0.3)', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: T.cardHeaderBg, padding: '18px 24px', display: 'flex', alignItems: 'center', gap: 10 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20 } }, "\uD83D\uDD01"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 18, fontWeight: 800, color: T.cardHeaderText } }, pendingSeriesEvent.title)), /*#__PURE__*/React.createElement("div", { style: { borderTop: `3px solid ${T.accent}` } }), /*#__PURE__*/React.createElement("div", { style: { padding: '22px 24px' } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, color: T.textFaint, marginBottom: 18 } }, t('seriesPrompt')), /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 8 } }, /*#__PURE__*/React.createElement("button", { onClick: () => handleSeriesAction('editThis'), style: { width: '100%', padding: '11px 0', borderRadius: 8, border: `1px solid ${T.border}`, background: T.surface, color: T.text, fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, "\u270F\uFE0F ", t('editThis')), /*#__PURE__*/React.createElement("button", { onClick: () => handleSeriesAction('editSeries'), style: { width: '100%', padding: '11px 0', borderRadius: 8, border: 'none', background: T.accent, color: T.accentText, fontSize: 14, fontWeight: 800, cursor: 'pointer' } }, "\uD83D\uDCDD ", t('editSeries')), /*#__PURE__*/React.createElement("button", { onClick: () => handleSeriesAction('deleteThis'), style: { width: '100%', padding: '11px 0', borderRadius: 8, border: `1px solid ${T.errorBorder}`, background: T.errorBg, color: T.red, fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, "\uD83D\uDDD1\uFE0F ", t('deleteThis')), /*#__PURE__*/React.createElement("button", { onClick: () => handleSeriesAction('deleteSeries'), style: { width: '100%', padding: '11px 0', borderRadius: 8, border: `1px solid ${T.red}`, background: 'transparent', color: T.red, fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, "\uD83D\uDDD1\uFE0F ", t('deleteSeries')), /*#__PURE__*/React.createElement("button", { onClick: () => setShowSeriesPrompt(false), style: { width: '100%', padding: '11px 0', borderRadius: 8, border: `1px solid ${T.border}`, background: T.surface, color: T.textMuted, fontSize: 14, fontWeight: 700, cursor: 'pointer', marginTop: 4 } }, t('cancel')))))), holidayModal && /*#__PURE__*/React.createElement("div", { style: { position: 'fixed', inset: 0, background: T.overlayBg, backdropFilter: 'blur(3px)', zIndex: 110, display: 'flex', alignItems: 'center', justifyContent: 'center', padding: isMobile ? 12 : 0 }, onClick: () => setHolidayModal(null) }, /*#__PURE__*/React.createElement("div", { onClick: e => e.stopPropagation(), style: { background: T.modalBg, borderRadius: 14, width: '93%', maxWidth: 460, boxShadow: '0 20px 60px rgba(0,0,0,0.3)', overflow: 'hidden' } }, /*#__PURE__*/React.createElement("div", { style: { background: '#CC0C39', padding: isMobile ? '16px 18px' : '20px 24px', display: 'flex', alignItems: 'center', gap: 12 } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 28 } }, "\uD83C\uDF89"), /*#__PURE__*/React.createElement("div", { style: { flex: 1, minWidth: 0 } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: isMobile ? 17 : 20, fontWeight: 800, color: '#FFFFFF', lineHeight: 1.2 } }, holidayModal.name), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: 'rgba(255,255,255,0.8)', marginTop: 3 } }, formatDateDisplayL(holidayModal.date))), /*#__PURE__*/React.createElement("button", { onClick: () => setHolidayModal(null), style: { background: 'rgba(255,255,255,0.15)', border: 'none', borderRadius: 8, width: 32, height: 32, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', color: '#FFFFFF', fontSize: 16, fontWeight: 700, flexShrink: 0 } }, "\u2715")), /*#__PURE__*/React.createElement("div", { style: { padding: isMobile ? '18px 18px 20px' : '22px 24px 24px' } }, holidayDescLoading && /*#__PURE__*/React.createElement("div", { style: { textAlign: 'center', padding: '30px 0', color: T.textMuted } }, /*#__PURE__*/React.createElement("div", { style: { fontSize: 28, marginBottom: 8 } }, "\u23F3"), /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, fontWeight: 600 } }, lang === 'pt' ? 'Carregando detalhes do feriado...' : 'Loading holiday details...')), holidayDescError && /*#__PURE__*/React.createElement("div", { style: { padding: '14px 16px', borderRadius: 8, fontSize: 13, background: T.errorBg, color: T.red, border: `1px solid ${T.errorBorder}`, fontWeight: 600 } }, holidayDescError), holidayDesc && !holidayDescLoading && (() => { try { const info = JSON.parse(holidayDesc); return /*#__PURE__*/React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: 14 } }, /*#__PURE__*/React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: 10, padding: '12px 14px', borderRadius: 10, background: `rgba(204,12,57,0.08)`, border: `1px solid rgba(204,12,57,0.15)` } }, /*#__PURE__*/React.createElement("span", { style: { fontSize: 20, flexShrink: 0 } }, "\uD83D\uDCC5"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 15, fontWeight: 800, color: T.text } }, info.fullName), /*#__PURE__*/React.createElement("div", { style: { fontSize: 12, color: T.textMuted, marginTop: 2 } }, info.date))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, fontWeight: 800, color: '#CC0C39', textTransform: 'uppercase', letterSpacing: 0.5, marginBottom: 6 } }, "\uD83D\uDCDC ", lang === 'pt' ? 'Significado Histórico' : 'Historical Significance'), /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, color: T.text, lineHeight: 1.6, padding: '10px 14px', borderRadius: 8, background: T.surfaceAlt, border: `1px solid ${T.border}` } }, info.history)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", { style: { fontSize: 11, fontWeight: 800, color: '#CC0C39', textTransform: 'uppercase', letterSpacing: 0.5, marginBottom: 6 } }, "\uD83C\uDF8A ", lang === 'pt' ? 'O que Representa' : 'What it Represents'), /*#__PURE__*/React.createElement("div", { style: { fontSize: 13, color: T.text, lineHeight: 1.6, padding: '10px 14px', borderRadius: 8, background: T.surfaceAlt, border: `1px solid ${T.border}` } }, info.meaning))); } catch { return null; } })(), /*#__PURE__*/React.createElement("button", { onClick: () => setHolidayModal(null), style: { width: '100%', marginTop: 18, background: T.surface, color: T.text, border: `1px solid ${T.border}`, borderRadius: 8, padding: '11px 0', fontSize: 14, fontWeight: 700, cursor: 'pointer' } }, t('close'))))), /*#__PURE__*/React.createElement("style", null, ` @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } } * { -webkit-tap-highlight-color: transparent; box-sizing: border-box; } body { margin: 0; padding: 0; overflow-x: hidden; } div::-webkit-scrollbar { width: 6px; } div::-webkit-scrollbar-track { background: transparent; } div::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.4); border-radius: 3px; } div::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.6); } input, textarea, button { font-family: inherit; } @media (max-width: 767px) { input[type="date"], input[type="time"] { font-size: 16px !important; } } `)); }; // ==================================================================== // Mount // ==================================================================== const mount = document.getElementById('cal-root'); mount.innerHTML = ''; ReactDOM.createRoot(mount).render(/*#__PURE__*/React.createElement(App, null)); })(); /* --- DASHBOARD (vanilla JS, not wrapped in IIFE) --- */ // ===== STATE ===== var dashLang='pt', noteCat='process', noteColor='#f5a623', noteFilter='all', baseFilterVal='all'; var notes=[ {id:1,title:'SOP Inbound',content:'Revisar processo de inbound para reduzir tempo de dock-to-buffer em 15%.',category:'process',color:'#3b82f6',date:'2026-04-28'}, {id:2,title:'Alerta Aging',content:'Aging 6+ dias acima do threshold em 3 estações. Escalar para gerência.',category:'warning',color:'#ef4444',date:'2026-04-27'}, {id:3,title:'Hiring Wave Q2',content:'Contratar 45 DAs para cobrir expansão de rotas em SP e MG.',category:'hire',color:'#10b981',date:'2026-04-26'}, {id:4,title:'Safety Stand-Down',content:'Programar safety stand-down semanal. Foco em ergonomia e direção defensiva.',category:'safety',color:'#f5a623',date:'2026-04-25'}, {id:5,title:'Peak Prep',content:'Iniciar planejamento para Prime Day 2026. Revisar capacidade e headcount.',category:'ops',color:'#8b5cf6',date:'2026-04-24'}, {id:6,title:'DSP Scorecard',content:'Atualizar scorecard de DSPs. Implementar nova métrica de fantástico+.',category:'process',color:'#14b8a6',date:'2026-04-23'} ]; var bases=[ ['GRU5','FC','Cajamar','SP','fc'],['GRU7','FC','Cajamar','SP','fc'],['GRU8','FC','Cajamar','SP','fc'], ['QGR1','FC','Cajamar','SP','fc'],['QSP2','FC','Cajamar','SP','fc'],['QSP3','FC','Cajamar','SP','fc'], ['CNF1','FC','Betim','MG','fc'],['GIG1','FC','Rio de Janeiro','RJ','fc'], ['REC1','FC','Cabo de S. Agostinho','PE','fc'],['REC7','FC','Cabo de S. Agostinho','PE','fc'], ['POA1','FC','Nova Santa Rita','RS','fc'],['FOR1','FC','Fortaleza','CE','fc'], ['BSB1','FC','Brasília','DF','fc'],['SSA1','FC','Salvador','BA','fc'], ['CWB1','FC','São José dos Pinhais','PR','fc'],['VIX1','FC','Serra','ES','fc'], ['CGH1','FC','Guarulhos','SP','fc'],['NAT1','FC','Parnamirim','RN','fc'], ['GYN1','FC','Aparecida de Goiânia','GO','fc'], ['DBZ1','DS','Barueri','SP','ds'],['DSP2','DS','São Paulo','SP','ds'], ['DSP3','DS','Guarulhos','SP','ds'],['DSP4','DS','São Paulo','SP','ds'], ['DSP6','DS','Campinas','SP','ds'],['DMG1','DS','Contagem','MG','ds'], ['DRJ1','DS','Duque de Caxias','RJ','ds'],['DPR2','DS','São José dos Pinhais','PR','ds'], ['DPE1','DS','Cabo de S. Agostinho','PE','ds'],['DPB1','DS','João Pessoa','PB','ds'], ['DCE1','DS','Maracanaú','CE','ds'],['DGO1','DS','Aparecida de Goiânia','GO','ds'], ['DBA1','DS','Lauro de Freitas','BA','ds'],['DES1','DS','Serra','ES','ds'], ['DRS1','DS','Canoas','RS','ds'],['DDF1','DS','Brasília','DF','ds'], ['DSP7','DS','Ribeirão Preto','SP','ds'],['DRN1','DS','Parnamirim','RN','ds'], ['SBA9','EDSP','São Paulo (ZS)','SP','edsp'],['SCO9','EDSP','São Paulo (ZL)','SP','edsp'], ['SLO9','EDSP','São Paulo (ZO)','SP','edsp'],['SOL9','EDSP','São Paulo (ZN)','SP','edsp'], ['SPN9','EDSP','São Paulo (Centro)','SP','edsp'],['SOS9','EDSP','Osasco','SP','edsp'], ['SGU9','EDSP','Guarulhos','SP','edsp'],['SSB9','EDSP','S. Bernardo do Campo','SP','edsp'], ['SCA9','EDSP','Campinas','SP','edsp'],['SRB9','EDSP','Ribeirão Preto','SP','edsp'], ['SSJ9','EDSP','São José dos Campos','SP','edsp'],['SSO9','EDSP','Sorocaba','SP','edsp'], ['SSD9','EDSP','Santo André','SP','edsp'],['SJD9','EDSP','Jundiaí','SP','edsp'], ['SPI9','EDSP','Piracicaba','SP','edsp'],['SMG1','EDSP','Belo Horizonte','MG','edsp'], ['SMG2','EDSP','Contagem','MG','edsp'],['SMG3','EDSP','Uberlândia','MG','edsp'], ['SMG4','EDSP','Juiz de Fora','MG','edsp'],['SRJ1','EDSP','Rio de Janeiro','RJ','edsp'], ['SRJ2','EDSP','Niterói','RJ','edsp'],['SRJ3','EDSP','Nova Iguaçu','RJ','edsp'], ['SPE1','EDSP','Recife','PE','edsp'],['SPR1','EDSP','Curitiba','PR','edsp'], ['SPR2','EDSP','Londrina','PR','edsp'],['SPR3','EDSP','Maringá','PR','edsp'], ['SCE1','EDSP','Fortaleza','CE','edsp'],['SBA1','EDSP','Salvador','BA','edsp'], ['SRS1','EDSP','Porto Alegre','RS','edsp'],['SDF1','EDSP','Brasília','DF','edsp'], ['SGO1','EDSP','Goiânia','GO','edsp'],['SES1','EDSP','Vitória','ES','edsp'], ['SMA1','EDSP','São Luís','MA','edsp'],['SPA1','EDSP','Belém','PA','edsp'], ['SSC1','EDSP','Florianópolis','SC','edsp'], ['XSP1','XPT','São Paulo','SP','xpt'],['XSP2','XPT','Campinas','SP','xpt'], ['XMG1','XPT','Belo Horizonte','MG','xpt'],['XRJ1','XPT','Rio de Janeiro','RJ','xpt'], ['XPR1','XPT','Curitiba','PR','xpt'],['XPE1','XPT','Recife','PE','xpt'], ['XCE1','XPT','Fortaleza','CE','xpt'],['XBA1','XPT','Salvador','BA','xpt'], ['XRS1','XPT','Porto Alegre','RS','xpt'],['XDF1','XPT','Brasília','DF','xpt'], ['XGO1','XPT','Goiânia','GO','xpt'], ['SCS1','SC','São Paulo','SP','sc'],['SCS2','SC','Cajamar','SP','sc'], ['SCR1','SC','Rio de Janeiro','RJ','sc'],['SCM1','SC','Belo Horizonte','MG','sc'], ['SCP1','SC','Recife','PE','sc'], ['SSA2','FC','Salvador','BA','new'],['CWB2','FC','Curitiba','PR','new'], ['VIX2','FC','Vitória','ES','new'],['GIG2','FC','Rio de Janeiro','RJ','new'], ['CNF2','FC','Belo Horizonte','MG','new'],['FOR2','FC','Fortaleza','CE','new'], ['GRU9','FC','Cajamar','SP','new'],['JOI1','FC','Joinville','SC','new'], ['SSA3','FC','Camaçari','BA','new'],['DCE2','DS','Fortaleza','CE','new'], ['DDF2','DS','Brasília','DF','new'],['DSP8','DS','São Paulo','SP','new'] ]; var metrics=[ ['Manifested','Manifestados','Total shipments manifested','Total de embarques manifestados','vol','vol'], ['AMZL Dispatched','Despachados AMZL','Packages dispatched by AMZL','Pacotes despachados pela AMZL','vol','vol'], ['Delivered','Entregues','Successfully delivered packages','Pacotes entregues com sucesso','vol','vol'], ['DAs On Road','DAs na Rua','Delivery associates currently delivering','Motoristas em rota','prod','prod'], ['DEA %','DEA %','Delivery Estimate Accuracy','Precisão da Estimativa de Entrega','cx','qual'], ['EAD %','EAD %','Expected Arrival Date accuracy','Precisão da data prevista de chegada','cx','qual'], ['Completion Rate','Taxa de Conclusão','Routes fully completed %','Percentual de rotas concluídas','perf','perf'], ['RTS Rate','Taxa RTS','Return to Station rate','Taxa de retorno à estação','qual','qual'], ['First Attempt %','1ª Tentativa %','First attempt delivery success','Sucesso na 1ª tentativa','qual','qual'], ['First Day %','1º Dia %','Delivery on first attempt day','Entrega no 1º dia','qual','qual'], ['DNR DPMO','DNR DPMO','Delivery Not Received defects/million','Defeitos DNR por milhão','qual','crit'], ['DNR Packages','Pacotes DNR','Absolute count of DNR packages','Contagem de pacotes DNR','qual','crit'], ['NOV','NOV','Not on Van — packages not loaded','Pacotes não carregados na van','load','crit'], ['NOV DPMO','NOV DPMO','Not on Van defects/million','Defeitos NOV por milhão','load','crit'], ['Lost Packages','Pacotes Perdidos','Packages declared lost','Pacotes perdidos em trânsito','load','crit'], ['Lost DPMO','Lost DPMO','Lost package defects/million','Defeitos de perda por milhão','load','crit'], ['Aging 3 Days','Aging 3 Dias','Packages at station 3 days','Pacotes na estação por 3 dias','aging','vol'], ['Aging 4 Days','Aging 4 Dias','Packages at station 4 days','Pacotes na estação por 4 dias','aging','vol'], ['Aging 5 Days','Aging 5 Dias','Packages at station 5 days','Pacotes na estação por 5 dias','aging','vol'], ['Aging 6+ Days','Aging 6+ Dias','Critical packages 6+ days','Pacotes críticos 6+ dias','aging','crit'], ['DPPH','DPPH','Deliveries per planned hour','Entregas por hora planejada','prod','prod'], ['Last Mile Failures','Falhas Last Mile','Failures at last mile','Falhas na última milha','fail','crit'], ['FC Pre-SLAM','FC Pré-SLAM','Failures before SLAM','Falhas antes do SLAM','fail','crit'], ['FC Post-SLAM','FC Pós-SLAM','Failures after SLAM','Falhas após SLAM','fail','crit'], ['Sort Center Fail','Falha Sort Center','Sort center failures','Falhas no centro de triagem','fail','crit'], ['Linehaul Fail','Falha Linehaul','Linehaul failures','Falhas no linehaul','fail','crit'], ['TOM Failures','Falhas TOM','Transport mgmt failures','Falhas gestão de transporte','fail','crit'], ['Route Count','Qtd Rotas','Total active routes','Rotas ativas','prod','prod'], ['Avg Stops/Route','Paradas/Rota','Average stops per route','Média de paradas por rota','prod','prod'], ['Pkg/DA','Pac/DA','Packages per delivery associate','Pacotes por motorista','prod','prod'], ['Concession Rate','Taxa de Concessão','Concessions granted','Concessões a clientes','cx','qual'], ['Contact Rate','Taxa de Contato','Customer contacts/delivery','Contatos do cliente','cx','qual'], ['SLA Compliance','Conformidade SLA','SLA compliance %','Conformidade com SLA','perf','perf'], ['Cycle Time','Tempo de Ciclo','Avg cycle time/package','Tempo médio de ciclo','perf','perf'], ['Utilization %','Utilização %','Vehicle utilization','Utilização do veículo','perf','perf'], ['POD Compliance','Conformidade POD','Proof of delivery compliance','Conformidade POD','qual','qual'], ['Photo on Delivery %','Foto na Entrega %','Deliveries with photo','Entregas com foto','qual','qual'] ]; var tagColors={vol:['rgba(245,166,35,.15)','#f5a623'],qual:['rgba(59,130,246,.15)','#3b82f6'],crit:['rgba(239,68,68,.15)','#ef4444'],perf:['rgba(16,185,129,.15)','#10b981'],prod:['rgba(139,92,246,.15)','#8b5cf6']}; var typeCol={FC:['rgba(245,166,35,.2)','#f5a623'],DS:['rgba(59,130,246,.2)','#3b82f6'],EDSP:['rgba(20,184,166,.2)','#14b8a6'],XPT:['rgba(139,92,246,.2)','#8b5cf6'],SC:['rgba(236,72,153,.2)','#ec4899']}; var catIcons={process:'⚙️',warning:'⚠️',hire:'👥',safety:'🦺',ops:'🔧',all:'📋'}; var catNames={process:['Processo','Process'],warning:['Alerta','Warning'],hire:['Contratação','Hiring'],safety:['Segurança','Safety'],ops:['Operações','Operations'],all:['Todas','All']}; // ===== CLOCK ===== function dashUpdateClock(){ var n=new Date(); var d=n.toLocaleDateString('pt-BR',{day:'2-digit',month:'2-digit',year:'numeric'}); var t=n.toLocaleTimeString('pt-BR',{hour:'2-digit',minute:'2-digit'}); document.getElementById('clock').textContent='📅 '+d+' · ⏰ '+t; } dashUpdateClock(); setInterval(dashUpdateClock,30000); // ===== THEME ===== function toggleTheme(){ document.body.classList.toggle('light'); var isLight=document.body.classList.contains('light'); document.getElementById('themeIcon').textContent=isLight?'☀️ Light':'🌙 Dark'; } // ===== LANGUAGE ===== function toggleLang(){ dashLang=dashLang==='pt'?'en':'pt'; document.getElementById('langIcon').textContent=dashLang==='pt'?'🇧🇷 PT':'🇺🇸 EN'; document.querySelectorAll('.lp').forEach(function(e){e.classList.toggle('hidden',dashLang==='en');}); document.querySelectorAll('.le').forEach(function(e){e.classList.toggle('hidden',dashLang==='pt');}); renderBases(); renderMetrics(); renderNotes(); } // ===== PAGES ===== function showPage(id,el){ document.querySelectorAll('.pg').forEach(function(p){p.classList.add('hidden');}); document.getElementById('pg-'+id).classList.remove('hidden'); document.querySelectorAll('.nbar .nb').forEach(function(n){n.classList.remove('act');}); el.classList.add('act'); } // ===== BASES ===== function renderBases(){ var h=''; bases.forEach(function(b){ if(baseFilterVal!=='all'&&b[4]!==baseFilterVal)return; var tc=typeCol[b[1]]||typeCol.FC; h+=''+b[0]+''+b[1]+''+b[2]+''+b[3]+''; }); document.getElementById('basesBody').innerHTML=h; } function filterBases(f,el){ baseFilterVal=f; document.querySelectorAll('#baseFilters .fbtn').forEach(function(b){b.classList.remove('act');}); el.classList.add('act'); renderBases(); } // ===== METRICS ===== var metricFilterVal='all'; function renderMetrics(){ var h=''; metrics.forEach(function(m){ if(metricFilterVal!=='all'&&m[4]!==metricFilterVal)return; var tc=tagColors[m[5]]||tagColors.vol; h+='
'+(dashLang==='pt'?m[1]:m[0])+'
'+(dashLang==='pt'?m[3]:m[2])+'
'+m[5].toUpperCase()+'
'; }); document.getElementById('metricsGrid').innerHTML=h; } function filterMetrics(f,el){ metricFilterVal=f; document.querySelectorAll('#metricFilters .fbtn').forEach(function(b){b.classList.remove('act');}); el.classList.add('act'); renderMetrics(); } // ===== NOTES ===== function renderNotes(){ var h=''; notes.forEach(function(n){ if(noteFilter!=='all'&&n.category!==noteFilter)return; var cn=catNames[n.category]||catNames.process; var ci=catIcons[n.category]||'📋'; h+='
'+n.title+'
'+n.content+'
'+ci+' '+(dashLang==='pt'?cn[0]:cn[1])+''+n.date+'
'; }); document.getElementById('notesGrid').innerHTML=h; } function filterNotes(f,el){ noteFilter=f; document.querySelectorAll('#noteFilters .nfb').forEach(function(b){b.classList.remove('act');}); el.classList.add('act'); renderNotes(); } function toggleNotePanel(){ var p=document.getElementById('notePanel'); var t=document.getElementById('noteToggle'); var l=document.getElementById('notesLayout'); p.classList.toggle('hidden'); t.classList.toggle('act'); l.style.gridTemplateColumns=p.classList.contains('hidden')?'1fr':'320px 1fr'; } function selectCat(c,el){ noteCat=c; document.querySelectorAll('#catChoices .cc').forEach(function(b){b.classList.remove('act');}); el.classList.add('act'); } function selectColor(c,el){ noteColor=c; document.querySelectorAll('#colorDots .cd').forEach(function(b){b.classList.remove('act');}); el.classList.add('act'); } function saveNote(){ var t=document.getElementById('noteTitle').value.trim(); if(!t)return; var c=document.getElementById('noteContent').value; notes.unshift({id:Date.now(),title:t,content:c,category:noteCat,color:noteColor,date:new Date().toISOString().split('T')[0]}); document.getElementById('noteTitle').value=''; document.getElementById('noteContent').value=''; renderNotes(); } // ===== INIT ===== renderBases(); renderMetrics(); renderNotes(); /* ============ POST-INIT ============ */ // Set dict stats + tip of the day from real acronym data (function(){ setTimeout(() => { const D = window.__D; const count = window.__dict_count || 0; document.getElementById('dict-stat').textContent = count + ' acrônimos'; if (!D) return; // Deterministic daily pick: seed by day const keys = Object.keys(D); const daysSinceEpoch = Math.floor(Date.now() / (1000*60*60*24)); const tipKey = keys[daysSinceEpoch % keys.length]; const e = D[tipKey]; if (!e) return; document.getElementById('tip-acronym').textContent = tipKey; document.getElementById('tip-meaning').textContent = e.p || e.f; document.getElementById('tip-descr').textContent = e.dp || e.d || ''; if (e.t) { const tr = document.getElementById('tip-trivia'); tr.textContent = '💭 ' + e.t; tr.hidden = false; } }, 500); })(); /* Bottom nav binding */ document.querySelectorAll('.bottom-nav button[data-view]').forEach(b => { b.onclick = () => SuiteRouter.go(b.dataset.view); }); /* Initial route */ (function(){ const h = location.hash.slice(1); const valid = ['home','calendario','dashboard','dicionario']; SuiteRouter.go(valid.includes(h) ? h : 'home'); })(); window.addEventListener('hashchange', () => { const h = location.hash.slice(1); const valid = ['home','calendario','dashboard','dicionario']; if (valid.includes(h)) SuiteRouter.go(h); }); /* Firebase sync handles pull automatically via onSnapshot */ suiteUpdateStats(); /* ========== BENTO HOME ENHANCERS ========== */ (function(){ function pad(n){ return String(n).padStart(2,'0'); } var DIAS_ABR = ['D','S','T','Q','Q','S','S']; // single-letter for compact mini-week function timeToMin(hhmm){ if (!hhmm || typeof hhmm !== 'string') return null; var m = hhmm.match(/^(\d{1,2}):(\d{2})/); if (!m) return null; return parseInt(m[1],10)*60 + parseInt(m[2],10); } function loadEvents(){ try { return JSON.parse(localStorage.getItem('personal-calendar-events-v2') || '[]'); } catch(e){ return []; } } function todayStr(d){ d = d || new Date(); return d.getFullYear() + '-' + pad(d.getMonth()+1) + '-' + pad(d.getDate()); } function renderNextEvent(){ var evs = loadEvents(); var today = todayStr(); var now = new Date(); var nowMin = now.getHours()*60 + now.getMinutes(); var todayEvents = evs.filter(function(e){ return e.date === today; }); todayEvents.sort(function(a,b){ return (timeToMin(a.startTime||a.time||'00:00') || 0) - (timeToMin(b.startTime||b.time||'00:00') || 0); }); var upcoming = todayEvents.filter(function(e){ var t = timeToMin(e.startTime || e.time); return t === null || t >= nowMin; }); var next = upcoming[0] || todayEvents[todayEvents.length-1]; var elT = document.getElementById('next-ev-time'); var elW = document.getElementById('next-ev-what'); var elWhen = document.getElementById('next-ev-when'); if (elT && elW && elWhen) { if (!next) { elT.textContent = '--:--'; elW.textContent = todayEvents.length ? 'Sem próximos eventos' : 'Nenhum evento hoje'; elWhen.innerHTML = ' '; } else { var tm = next.startTime || next.time || ''; elT.textContent = tm || '--:--'; elW.textContent = next.title || next.name || 'Sem título'; var mn = timeToMin(tm); if (mn !== null){ var diff = mn - nowMin; if (diff > 0) { var h = Math.floor(diff/60), mm = diff%60; elWhen.textContent = 'Daqui a ' + (h ? h + 'h ' : '') + mm + 'min'; } else if (diff === 0) { elWhen.textContent = 'Agora'; } else { elWhen.textContent = 'Já passou'; } } else { elWhen.innerHTML = ' '; } } } var listEl = document.getElementById('next-ev-list'); if (listEl) { var items = upcoming.slice(0, 3); if (items.length === 0) { if (todayEvents.length > 0) { items = todayEvents.slice(-3); listEl.innerHTML = items.map(function(e){ var tm = (e.startTime || e.time || '--:--'); var tt = (e.title || e.name || 'Sem título'); return '
' + tm + '' + tt.replace(/
'; }).join(''); } else { listEl.innerHTML = '
Nenhum evento hoje · clique para adicionar
'; } } else { listEl.innerHTML = items.map(function(e){ var tm = (e.startTime || e.time || '--:--'); var tt = (e.title || e.name || 'Sem título'); return '
' + tm + '' + tt.replace(/
'; }).join(''); } } } function renderMiniWeek(){ var el = document.getElementById('mini-week'); if (!el) return; var today = new Date(); today.setHours(0,0,0,0); var dow = today.getDay(); var start = new Date(today); start.setDate(today.getDate() - dow); var evs = loadEvents(); var datesWithEv = {}; evs.forEach(function(e){ if (e.date) datesWithEv[e.date] = true; }); var html = ''; for (var i = 0; i < 7; i++) { var d = new Date(start); d.setDate(start.getDate() + i); var ds = d.getFullYear() + '-' + pad(d.getMonth()+1) + '-' + pad(d.getDate()); var isToday = d.getTime() === today.getTime(); var has = !!datesWithEv[ds] || isToday; var cls = 'bc-day' + (isToday ? ' today' : '') + (has ? ' has' : ''); html += '
' + d.getDate() + '
'; } el.innerHTML = html; } function renderTimelineV17(){ var host = document.getElementById('bt-scroll'); if (!host) return; var evs = loadEvents(); var today = todayStr(); var now = new Date(); var nowMin = now.getHours()*60 + now.getMinutes(); var todayEvs = evs.filter(function(e){ return e.date === today; }); todayEvs.sort(function(a,b){ return (timeToMin(a.startTime||a.time||'00:00') || 0) - (timeToMin(b.startTime||b.time||'00:00') || 0); }); var TAG_COLORS = { 'Personal':'#FEBD69','Work':'#232F3E','Health':'#067D62', 'Social':'#FF9900','Other':'#546E7A','Elizia':'#CC7700' }; if (todayEvs.length === 0) { host.innerHTML = '
Nenhum evento hoje. Adicione pelo calendário.
'; return; } var html = ''; var prevEndMin = null; for (var i=0; i 30min from previous if (prevEndMin !== null && st !== null && (st - prevEndMin) >= 30) { var gap = st - prevEndMin; var gh = Math.floor(gap/60), gm = gap%60; var gLabel = (gh ? gh+'h ' : '') + (gm ? gm+'min' : ''); html += '
' + '
' + String(Math.floor(prevEndMin/60)).padStart(2,'0') + ':' + String(prevEndMin%60).padStart(2,'0') + '
' + '
✨ ' + gLabel + ' livre
' + '
'; } var color = TAG_COLORS[e.tag] || TAG_COLORS['Other']; var borderStyle = 'style="border-left-color:' + color + '"'; var isPast = (en !== null && en < nowMin); var isCurrent = (st !== null && en !== null && st <= nowMin && nowMin < en); var cls = 'bt-slot' + (isPast ? ' past' : '') + (isCurrent ? ' current' : ''); var tm = e.startTime || e.time || '--:--'; var tt = (e.title || e.name || 'Sem título').replace(/' + '
' + tm + '
' + '
' + '
' + tt + '
' + '
' + tag + '' + (e.location ? ' · ' + String(e.location).replace(/' + '
' + '
'; if (en !== null) prevEndMin = en; } host.innerHTML = html; } // ─── LOST widget ───────────────────────────────────────────────────────── function parseCsvLost(text){ var lines = text.split(/\r?\n/).filter(function(l){ return l.trim().length > 0; }); if (lines.length < 2) return { nodes: {}, total: 0, header: [] }; var sep = lines[0].indexOf(';') > -1 ? ';' : (lines[0].indexOf('\t') > -1 ? '\t' : ','); var header = lines[0].split(sep).map(function(s){ return s.trim().toLowerCase(); }); // Find loss_node_id column (prefer exact match) var idx = header.indexOf('loss_node_id'); if (idx === -1) idx = header.findIndex(function(h){ return h.indexOf('loss_node') > -1 || h.indexOf('node_id') > -1; }); if (idx === -1) idx = 3; // default col D var nodes = {}; var total = 0; for (var i=1; i perdas em ' + entries.length + ' nodes'; html += top.map(function(r, i){ var pct = Math.round((r[1]/max)*100); return '
' + '#' + (i+1) + '' + '' + r[0] + '' + '' + '' + r[1] + '' + '
'; }).join(''); pane.innerHTML = html; // Persist try { localStorage.setItem('suite-lost-snapshot', JSON.stringify({ top: top, total: parsed.total, totalNodes: entries.length, ts: Date.now() })); } catch(e){} } function restoreLostSnapshot(){ var pane = document.getElementById('bl-results-pane'); if (!pane) return; try { var raw = localStorage.getItem('suite-lost-snapshot'); if (!raw) { pane.innerHTML = '
Cole o CSV e clique em Processar.
'; return; } var d = JSON.parse(raw); var max = d.top[0] ? d.top[0][1] : 1; var age = Math.floor((Date.now() - d.ts) / (1000*60*60*24)); var ageLabel = age === 0 ? 'hoje' : age === 1 ? 'ontem' : age + 'd atrás'; var html = '
' + d.total + ' perdas em ' + d.totalNodes + ' nodes · ' + ageLabel + '
'; html += d.top.map(function(r, i){ var pct = Math.round((r[1]/max)*100); return '
' + '#' + (i+1) + '' + '' + r[0] + '' + '' + '' + r[1] + '' + '
'; }).join(''); pane.innerHTML = html; } catch(e){ pane.innerHTML = '
Cole o CSV e clique em Processar.
'; } } function initLostWidget(){ var input = document.getElementById('bl-input'); var btnProc = document.getElementById('bl-process'); var btnClear = document.getElementById('bl-clear'); var meta = document.getElementById('bl-meta'); var tabs = document.querySelectorAll('.bl-tab'); var pastePane = document.getElementById('bl-paste-pane'); var resultsPane = document.getElementById('bl-results-pane'); if (!input || !btnProc) return; restoreLostSnapshot(); tabs.forEach(function(t){ t.addEventListener('click', function(){ tabs.forEach(function(o){ o.classList.remove('active'); }); t.classList.add('active'); var tab = t.getAttribute('data-tab'); if (tab === 'paste') { pastePane.style.display = 'flex'; resultsPane.style.display = 'none'; } else { pastePane.style.display = 'none'; resultsPane.style.display = 'flex'; restoreLostSnapshot(); } }); }); btnProc.addEventListener('click', function(){ var txt = input.value.trim(); if (!txt) { meta.textContent = 'CSV vazio'; return; } var parsed = parseCsvLost(txt); meta.textContent = parsed.total + ' linhas'; renderLostResults(parsed); // Switch to results tab tabs[0].classList.remove('active'); tabs[1].classList.add('active'); pastePane.style.display = 'none'; resultsPane.style.display = 'flex'; }); btnClear.addEventListener('click', function(){ input.value = ''; meta.textContent = ''; try { localStorage.removeItem('suite-lost-snapshot'); } catch(e){} resultsPane.innerHTML = '
Cole o CSV e clique em Processar.
'; }); } function mirrorTip(){ var kw = document.getElementById('tip-acronym'); var mean = document.getElementById('tip-meaning'); var descr = document.getElementById('tip-descr'); var trivia = document.getElementById('tip-trivia'); var echoKw = document.getElementById('dict-kw-echo'); var echoMean = document.getElementById('dict-meaning-echo'); if (echoKw && kw) echoKw.textContent = kw.textContent; if (echoMean && mean) echoMean.textContent = mean.textContent; if (descr && (!descr.textContent || descr.textContent === '--') && trivia) { descr.textContent = trivia.textContent || ''; } } function renderFavPreview(){ var el = document.getElementById('fav-preview-list'); if (!el) return; var favs = []; try { favs = JSON.parse(localStorage.getItem('acr-favorites') || '[]'); } catch(e){} if (!favs.length) { el.innerHTML = '
Marque termos favoritos no dicionário
'; return; } var slice = favs.slice(-3).reverse(); el.innerHTML = slice.map(function(f){ return '
' + String(f).replace(/'; }).join(''); } function renderNotePreview(){ var el = document.getElementById('note-preview'); if (!el) return; var todos = []; var dictNotes = {}; var calNotes = []; try { todos = JSON.parse(localStorage.getItem('sidepanel-todos') || '[]'); } catch(e){} try { dictNotes = JSON.parse(localStorage.getItem('acr-notes') || '{}'); } catch(e){} try { calNotes = JSON.parse(localStorage.getItem('calendar-notes') || '[]'); } catch(e){} if (!Array.isArray(calNotes)) calNotes = []; var pending = todos.filter(function(t){ return !t.done; }); var items = []; // Notas do calendar primeiro (mais recentes) if (calNotes.length) { var sortedCal = calNotes.slice().sort(function(a,b){ return (b.updatedAt||b.createdAt||'').localeCompare(a.updatedAt||a.createdAt||''); }); sortedCal.slice(0,2).forEach(function(n){ var title = n.title || '(sem título)'; var content = n.content || ''; var snippet = content ? (title + ': ' + content.slice(0,60)) : title; items.push({k:'calnote', t: snippet}); }); } if (pending.length) items.push({k:'task', t: (pending[0].text || pending[0].title || 'Tarefa')}); var noteKeys = Object.keys(dictNotes); if (noteKeys.length) { var k = noteKeys[noteKeys.length-1]; var v = dictNotes[k]; var tx = typeof v === 'string' ? v : (v && v.text) || ''; if (tx) items.push({k:'note', t: k + ': ' + tx}); } if (!items.length && todos.length) items.push({k:'task', t: (todos[0].text || todos[0].title || 'Tarefa')}); if (!items.length) { el.innerHTML = '
Sem notas ou tarefas · clique para criar
'; // Atualiza contador var counter = document.querySelector('[data-bc-counter="panel-items"]'); if (counter) counter.textContent = '0'; return; } el.innerHTML = items.slice(0,3).map(function(i){ var cls = 'np'; if (i.k === 'task') cls += ' task'; else if (i.k === 'calnote') cls += ' calnote'; return '
' + String(i.t).replace(/'; }).join(''); // Atualiza contador (tasks pendentes + cal notes + dict notes) var counter = document.querySelector('[data-bc-counter="panel-items"]'); if (counter) counter.textContent = String(pending.length + calNotes.length + Object.keys(dictNotes).length); } function initDictSearch(){ var dl = document.getElementById('dict-search-dl'); if (dl && !dl.dataset.loaded && window.__D) { var keys = Object.keys(window.__D).sort(); dl.innerHTML = keys.map(function(k){ return '