nothumanallowed 14.1.80 → 14.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.81",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/constants.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
7
|
|
|
8
|
-
export const VERSION = '14.1.
|
|
8
|
+
export const VERSION = '14.1.81';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -381,6 +381,26 @@ const SkillStore = {
|
|
|
381
381
|
if (fs.existsSync(abs)) fs.unlinkSync(abs);
|
|
382
382
|
},
|
|
383
383
|
|
|
384
|
+
/** Ensure memory.md, skills.md, and provider.md always exist for a project. */
|
|
385
|
+
ensureDefaults(projectName, config) {
|
|
386
|
+
const dir = ensureDir(this.dir(projectName));
|
|
387
|
+
const provider = config?.llm?.provider || 'nha';
|
|
388
|
+
const model = config?.llm?.model || '';
|
|
389
|
+
|
|
390
|
+
const memFile = path.join(dir, 'memory.md');
|
|
391
|
+
if (!fs.existsSync(memFile)) {
|
|
392
|
+
fs.writeFileSync(memFile, `# ${projectName} — Project Memory\n\n_Architectural decisions, preferences, and notes._\n`, 'utf-8');
|
|
393
|
+
}
|
|
394
|
+
const skillsFile = path.join(dir, 'skills.md');
|
|
395
|
+
if (!fs.existsSync(skillsFile)) {
|
|
396
|
+
fs.writeFileSync(skillsFile, `# ${projectName} — Skills\n\n_Coding patterns, best practices, and conventions for this project._\n`, 'utf-8');
|
|
397
|
+
}
|
|
398
|
+
const providerFile = path.join(dir, `${provider}.md`);
|
|
399
|
+
if (!fs.existsSync(providerFile)) {
|
|
400
|
+
fs.writeFileSync(providerFile, `# ${provider.toUpperCase()} — ${model || 'Default'}\n\n_Model-specific notes, prompt tips, and configuration._\n`, 'utf-8');
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
|
|
384
404
|
context(projectName) {
|
|
385
405
|
const skills = this.list(projectName);
|
|
386
406
|
if (skills.length === 0) return '';
|
|
@@ -458,6 +478,9 @@ async function runWebCraftAgent(config, projectName, message, attachments, emit)
|
|
|
458
478
|
const dir = ProjectStore.dir(projectName);
|
|
459
479
|
if (!fs.existsSync(dir)) { emit({ type: 'error', msg: 'Project not found' }); return; }
|
|
460
480
|
|
|
481
|
+
// Ensure context files always exist
|
|
482
|
+
SkillStore.ensureDefaults(projectName, config);
|
|
483
|
+
|
|
461
484
|
const files = _listProjectFiles(dir);
|
|
462
485
|
const skillCtx = SkillStore.context(projectName);
|
|
463
486
|
|
|
@@ -970,17 +993,15 @@ Continue from here:`;
|
|
|
970
993
|
};
|
|
971
994
|
fs.writeFileSync(ProjectStore.metaPath(projectName), JSON.stringify(meta, null, 2), 'utf-8');
|
|
972
995
|
|
|
973
|
-
// Initialize skill context files
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
if (!fs.existsSync(memFile)) {
|
|
977
|
-
fs.writeFileSync(memFile, `# ${projectName} — Project Memory\n\n_Add architectural decisions, preferences, and notes here._\n`, 'utf-8');
|
|
978
|
-
}
|
|
996
|
+
// Initialize skill context files (memory.md, skills.md, provider.md)
|
|
997
|
+
SkillStore.ensureDefaults(projectName, config);
|
|
998
|
+
const ctxDir = SkillStore.dir(projectName);
|
|
979
999
|
|
|
980
|
-
// Generate skills.md with project context knowledge structure
|
|
1000
|
+
// Generate detailed skills.md with project context knowledge structure (first time only)
|
|
981
1001
|
const skillsFile = path.join(ctxDir, 'skills.md');
|
|
982
|
-
|
|
983
|
-
|
|
1002
|
+
const skillsContent = fs.existsSync(skillsFile) ? fs.readFileSync(skillsFile, 'utf-8') : '';
|
|
1003
|
+
if (skillsContent.length < 100) {
|
|
1004
|
+
const detailedSkills = `# ${projectName} — Skills & Knowledge Structure
|
|
984
1005
|
|
|
985
1006
|
## Context Discovery Strategy
|
|
986
1007
|
|
|
@@ -1018,36 +1039,11 @@ Agents score context relevance based on:
|
|
|
1018
1039
|
|
|
1019
1040
|
This approach ensures agents have the right context without being overwhelmed by irrelevant information.
|
|
1020
1041
|
`;
|
|
1021
|
-
fs.writeFileSync(skillsFile,
|
|
1042
|
+
fs.writeFileSync(skillsFile, detailedSkills, 'utf-8');
|
|
1022
1043
|
}
|
|
1023
|
-
|
|
1044
|
+
|
|
1024
1045
|
const provider = config.llm?.provider || 'nha';
|
|
1025
1046
|
const model = config.llm?.model || '';
|
|
1026
|
-
const providerFile = path.join(ctxDir, `${provider}.md`);
|
|
1027
|
-
if (!fs.existsSync(providerFile)) {
|
|
1028
|
-
const providerContent = `# ${provider.toUpperCase()} Model Configuration
|
|
1029
|
-
|
|
1030
|
-
## Current Model: ${model || 'Default'}
|
|
1031
|
-
|
|
1032
|
-
### Model Characteristics
|
|
1033
|
-
- **Provider**: ${provider}
|
|
1034
|
-
- **Model**: ${model || 'Default model for this provider'}
|
|
1035
|
-
- **Context Window**: Varies by model
|
|
1036
|
-
- **Strengths**: Add specific strengths of this model
|
|
1037
|
-
- **Limitations**: Add specific limitations to be aware of
|
|
1038
|
-
|
|
1039
|
-
### Best Practices for This Model
|
|
1040
|
-
- Write specific coding patterns this model excels at
|
|
1041
|
-
- Note any formatting preferences
|
|
1042
|
-
- Document prompt engineering tips that work well
|
|
1043
|
-
|
|
1044
|
-
### Configuration Notes
|
|
1045
|
-
- Add any specific configuration notes for this provider
|
|
1046
|
-
- Document any rate limits or special considerations
|
|
1047
|
-
`;
|
|
1048
|
-
fs.writeFileSync(providerFile, providerContent, 'utf-8');
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
1047
|
const logFile = path.join(ctxDir, 'changes.log.md');
|
|
1052
1048
|
const logEntry = `## ${new Date().toISOString().slice(0, 10)} — Initial generation\n- Generated ${generatedFiles.length} files\n- Tokens in: ${totalTokensIn} / out: ${totalTokensOut}\n- Description: ${description}\n- Provider: ${provider} (${model || 'default'})\n`;
|
|
1053
1049
|
fs.writeFileSync(logFile, (fs.existsSync(logFile) ? fs.readFileSync(logFile, 'utf-8') : '') + logEntry, 'utf-8');
|
|
@@ -1160,6 +1156,8 @@ export function register(router) {
|
|
|
1160
1156
|
// ── Skills get ────────────────────────────────────────────────────────────
|
|
1161
1157
|
router.get(/^\/api\/studio\/webcraft\/skills\/(?<name>[^/?]+)(?:\?|$)/, (req, res) => {
|
|
1162
1158
|
const projectName = decodeURIComponent(req.params.name ?? '');
|
|
1159
|
+
// Always ensure defaults exist when loading skills
|
|
1160
|
+
SkillStore.ensureDefaults(projectName, loadConfig());
|
|
1163
1161
|
sendJSON(res, 200, { skills: SkillStore.list(projectName) });
|
|
1164
1162
|
});
|
|
1165
1163
|
|
|
@@ -698,4 +698,4 @@ Errore: `+e.msg,pe(!1))}catch{}}}}catch(e){le(t=>[...t,{role:`agent`,text:`Error
|
|
|
698
698
|
`).map((e,t)=>(0,j.jsxs)(`div`,{className:Z.diffAddLine,children:[`+ `,e]},`a${t}`))]},t)),e.tools&&e.tools.length>0&&(0,j.jsx)(`div`,{className:Z.chatToolBadges,children:e.tools.map((e,t)=>(0,j.jsxs)(`span`,{className:`${Z.toolBadge} ${e.result===`ok`?Z.toolBadgeOk:Z.toolBadgeErr}`,children:[e.op===`edit`?`✏`:e.op===`write`?`+`:`👁`,` `,e.path]},t))})]})]},t)),fe&&(0,j.jsxs)(`div`,{className:Z.chatAgentCard,children:[(0,j.jsxs)(`div`,{className:Z.chatAgentHeader,children:[(0,j.jsx)(`span`,{className:Z.chatAgentRobotAnim,children:`🤖`}),(0,j.jsx)(`span`,{className:Z.chatAgentLabel,children:`WebCraft Agent`}),(0,j.jsxs)(`span`,{className:Z.chatRunningDots,children:[(0,j.jsx)(`span`,{className:`${Z.dot} ${Z.dot1}`}),(0,j.jsx)(`span`,{className:`${Z.dot} ${Z.dot2}`}),(0,j.jsx)(`span`,{className:`${Z.dot} ${Z.dot3}`})]})]}),(0,j.jsx)(`div`,{className:Z.chatAgentText,children:(0,j.jsx)(`span`,{className:Z.cursor,children:``})})]})]}),me.length>0&&(0,j.jsx)(`div`,{className:Z.attachPreviews,children:me.map((e,t)=>(0,j.jsxs)(`span`,{className:Z.attachBadge,children:[`📎 `,e.name,(0,j.jsx)(`button`,{className:Z.removeAttachBtn,onClick:()=>he(e=>e.filter((e,n)=>n!==t)),children:`×`})]},t))}),Et?(0,j.jsxs)(`div`,{className:Z.projActiveRow,children:[`📄 `,(0,j.jsx)(`strong`,{className:Z.projActiveName,children:a}),` — scrivi per modificare o migliorare il progetto`]}):(0,j.jsxs)(`div`,{className:Z.projNameRow,children:[(0,j.jsx)(`span`,{className:Z.projNameLabel,children:`Nome progetto:`}),(0,j.jsx)(`input`,{className:Z.projNameInput,value:a,onChange:e=>o(e.target.value),placeholder:`MioProgetto`})]}),(0,j.jsxs)(`div`,{className:Z.chatInputRow,children:[(0,j.jsxs)(`label`,{className:Z.attachLabel,title:`Allega immagine o PDF`,children:[`📎`,(0,j.jsx)(`input`,{ref:Ze,type:`file`,multiple:!0,accept:`image/*,.pdf`,style:{display:`none`},onChange:e=>Tt(e.target.files)})]}),(0,j.jsx)(`textarea`,{className:Z.chatTextarea,value:ue,onChange:e=>de(e.target.value),placeholder:Et?`Parla con il tuo agente: chiedi correzioni, migliorie, nuove funzionalità...`:`Descrivi il progetto da creare, poi premi Genera...`,disabled:Ot,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),it())},rows:4}),(0,j.jsxs)(`div`,{className:Z.chatSendCol,children:[(0,j.jsx)(`button`,{className:Z.chatSendBtn,onClick:it,disabled:Ot,children:w?`⏳`:Et?`▶`:`▶ Genera`}),Ot&&(0,j.jsx)(`button`,{className:Z.chatStopBtn,onClick:st,children:`⏹ Stop`})]})]})]}),xe&&(0,j.jsx)(gn,{modal:xe,skills:ve,projectName:a,onClose:()=>Se(null),onSave:(e,t,n)=>yt(xe,e,t,n)})]})}function hn({before:e,after:t}){let n=e.split(`
|
|
699
699
|
`),r=t.split(`
|
|
700
700
|
`),i=[],a=0,o=0;for(;(a<n.length||o<r.length)&&(a>=n.length?i.push({type:`add`,text:r[o++]??``}):o>=r.length?i.push({type:`rem`,text:n[a++]??``}):n[a]===r[o]?(i.push({type:`same`,text:n[a++]??``}),o++):(i.push({type:`rem`,text:n[a++]??``}),i.push({type:`add`,text:r[o++]??``})),!(i.length>2e3)););return(0,j.jsx)(`div`,{style:{fontFamily:`var(--mono)`,fontSize:10},children:i.map((e,t)=>(0,j.jsxs)(`div`,{style:{padding:`1px 8px`,background:e.type===`add`?`#0a3a1a`:e.type===`rem`?`#3a0a0a`:`transparent`,color:e.type===`add`?`#4ade80`:e.type===`rem`?`#f87171`:`var(--dim)`,whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:[e.type===`add`?`+`:e.type===`rem`?`-`:` `,e.text]},t))})}function gn({modal:e,skills:t,projectName:n,onClose:r,onSave:i}){let[a,o]=(0,_.useState)(e.name),[s,c]=(0,_.useState)(e.content),[l,u]=(0,_.useState)(e.type),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),h=l===`skill`?6e3:4e3,g=s.length>h;async function v(){if(!d.trim())return;m(!0);let e={skill:`Sei un esperto di sviluppo web fullstack. Genera un file Markdown "skill" per il WebCraft Agent. Deve contenere istruzioni, pattern di codice, best practice e snippet pronti all uso come contesto persistente. Scrivi SOLO il contenuto Markdown, niente altro.`,memory:`Sei un assistente tecnico. Genera un file Markdown "memory" per il WebCraft Agent. Deve riassumere decisioni architetturali, preferenze dello sviluppatore e contesto generale del progetto. Scrivi SOLO il Markdown.`,provider:`Sei un esperto di prompt engineering. Genera un file Markdown con istruzioni specifiche per calibrare il comportamento del modello AI. Scrivi SOLO il Markdown.`},t=await k(`/api/studio/webcraft`,{system:e[l]??e.skill,user:`Progetto: ${n}\n\n${d}`,max_tokens:2048});t?.text&&(c(t.text),a||o(l===`memory`?`memory.md`:l===`provider`?`liara.md`:d.toLowerCase().replace(/[^a-z0-9]+/g,`-`).slice(0,30)+`.md`)),m(!1)}function y(){if(!a.trim()){alert(`Inserisci un nome per il file.`);return}let n=a.endsWith(`.md`)?a:a+`.md`;if((l===`memory`||l===`provider`)&&e.mode===`new`&&t.findIndex(e=>e.type===l)>=0){alert(`Esiste già un file di tipo "${l}". Modificalo direttamente.`);return}i(n,s,l)}return(0,j.jsx)(`div`,{className:Z.modalOverlay,onClick:e=>{e.target===e.currentTarget&&r()},children:(0,j.jsxs)(`div`,{className:Z.modal,children:[(0,j.jsxs)(`div`,{className:Z.modalHeader,children:[(0,j.jsxs)(`span`,{className:Z.modalTitle,children:[pn(l),` `,e.mode===`new`?`Nuovo file di contesto`:`Modifica ${e.name}`]}),(0,j.jsx)(`button`,{className:Z.modalClose,onClick:r,children:`×`})]}),(0,j.jsx)(`div`,{className:Z.modalBody,children:e.mode===`view`?(0,j.jsx)(`pre`,{className:Z.logView,children:s}):(0,j.jsxs)(j.Fragment,{children:[e.mode===`new`&&(0,j.jsxs)(`div`,{className:Z.modalRow,children:[(0,j.jsxs)(`div`,{className:Z.modalField,children:[(0,j.jsx)(`div`,{className:Z.modalLabel,children:`TIPO`}),(0,j.jsx)(`select`,{value:l,onChange:e=>{let t=e.target.value;u(t),t===`memory`?o(`memory.md`):t===`provider`&&o(`liara.md`)},className:Z.modalSelect,children:[`skill`,`memory`,`provider`].map(e=>{let n=(e===`memory`||e===`provider`)&&t.some(t=>t.type===e);return(0,j.jsxs)(`option`,{value:e,disabled:n,children:[e,n?` (esiste già)`:``]},e)})})]}),(0,j.jsxs)(`div`,{className:Z.modalField,style:{flex:2},children:[(0,j.jsx)(`div`,{className:Z.modalLabel,children:`NOME FILE`}),(0,j.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:l===`memory`?`memory.md`:l===`provider`?`liara.md`:`nome-skill.md`,className:Z.modalInput})]})]}),(0,j.jsxs)(`div`,{className:Z.modalHint,children:[`💡 `,l===`skill`?`Istruzioni tecniche, snippet, pattern di codice specifici. Max ~6000 caratteri.`:l===`memory`?`Note persistenti sul progetto: decisioni architetturali, preferenze. Solo UN file. Max ~4000 caratteri.`:`Istruzioni specifiche per il modello AI (tono, formato, vincoli). Solo UN file. Max ~4000 caratteri.`]}),(0,j.jsxs)(`div`,{className:Z.modalAiBox,children:[(0,j.jsx)(`div`,{className:Z.modalLabel,children:`🤖 GENERA CON AI`}),(0,j.jsxs)(`div`,{className:Z.modalAiRow,children:[(0,j.jsx)(`textarea`,{value:d,onChange:e=>f(e.target.value),rows:2,placeholder:`Descrivi cosa deve contenere questo file...`,className:Z.modalAiDesc}),(0,j.jsx)(`button`,{onClick:v,disabled:p,className:Z.modalAiBtn,children:p?`⏳ ...`:`▶ Genera`})]})]}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`div`,{className:Z.modalLabelRow,children:[(0,j.jsx)(`span`,{children:`CONTENUTO (markdown)`}),(0,j.jsxs)(`span`,{style:{color:g?`#e05050`:`var(--dim)`},children:[s.length,` car.`,g?` ⚠ Troppo lungo`:``]})]}),(0,j.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:14,placeholder:`# Titolo
|
|
701
|
-
Scrivi le istruzioni in Markdown...`,className:Z.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,j.jsxs)(`div`,{className:Z.modalFooter,children:[(0,j.jsx)(`button`,{onClick:r,className:Z.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,j.jsx)(`button`,{onClick:y,className:Z.modalSaveBtn,children:`✓ Salva`})]})]})})}var _n={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function vn(){let e=P(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),O(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await k(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,j.jsxs)(`div`,{className:_n.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),(0,j.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,j.jsxs)(`div`,{className:_n.empty,children:[(0,j.jsx)(`div`,{className:_n.emptyIcon,children:`🗓️`}),(0,j.jsxs)(`div`,{className:_n.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,j.jsx)(`div`,{className:_n.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,j.jsx)(`button`,{className:_n.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,j.jsxs)(`div`,{className:_n.root,children:[t.executive_summary&&(0,j.jsx)(`div`,{className:_n.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.actionCard,children:[e.time&&(0,j.jsx)(`span`,{className:_n.actionTime,children:e.time}),(0,j.jsx)(`span`,{className:_n.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.schedCard,children:[(0,j.jsxs)(`span`,{className:_n.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,j.jsx)(`span`,{className:_n.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`${_n.sectionTitle} ${_n.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.alertCard,children:[(0,j.jsxs)(`span`,{className:_n.alertSev,children:[`!`,f(e)]}),(0,j.jsx)(`span`,{children:d(e)}),p(e)&&(0,j.jsxs)(`div`,{className:_n.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.insight,children:[`→ `,m(e)]},t))]}),(0,j.jsx)(`div`,{className:_n.regenRow,children:(0,j.jsx)(`button`,{className:_n.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function yn(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function bn(){let e=P(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),O(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,j.jsx)(`div`,{className:J.error,children:a});let u=t?.files??[],d=t?.quota;return(0,j.jsxs)(`div`,{className:J.root,children:[d&&(0,j.jsxs)(`div`,{className:J.quotaBar,children:[(0,j.jsxs)(`div`,{className:J.quotaText,children:[(0,j.jsxs)(`span`,{className:J.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,j.jsxs)(`span`,{className:J.quotaPct,children:[d.percentUsed,`%`]})]}),(0,j.jsx)(`div`,{className:J.quotaTrack,children:(0,j.jsx)(`div`,{className:J.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,j.jsxs)(`div`,{className:J.searchRow,children:[(0,j.jsx)(`input`,{className:J.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,j.jsx)(`button`,{className:J.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,j.jsxs)(`div`,{className:J.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,j.jsx)(`div`,{className:J.empty,children:e(`drive.noFiles`)}),(0,j.jsx)(`div`,{className:J.fileList,children:u.map(e=>(0,j.jsxs)(`div`,{className:J.fileRow,children:[(0,j.jsx)(`span`,{className:J.fileIcon,children:yn(e.type)}),(0,j.jsxs)(`div`,{className:J.fileInfo,children:[(0,j.jsx)(`div`,{className:J.fileName,children:e.name}),(0,j.jsxs)(`div`,{className:J.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,j.jsx)(`div`,{className:J.fileBtns,children:e.webViewLink&&(0,j.jsx)(`a`,{className:J.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var xn={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function Sn(){let e=P(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{O(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),k(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{k(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,j.jsxs)(`div`,{className:xn.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,j.jsx)(`div`,{className:xn.error,children:a}):(0,j.jsxs)(`div`,{className:xn.root,children:[(0,j.jsxs)(`div`,{className:xn.addRow,children:[(0,j.jsx)(`input`,{className:xn.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,j.jsx)(`button`,{className:xn.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,j.jsx)(`div`,{className:xn.empty,children:`No active tasks`}),(0,j.jsx)(`div`,{className:xn.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,j.jsxs)(`div`,{className:xn.taskRow,children:[(0,j.jsx)(`button`,{className:xn.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,j.jsxs)(`div`,{className:xn.taskInfo,children:[(0,j.jsx)(`div`,{className:xn.taskTitle,children:e.title}),e.dueDate&&(0,j.jsxs)(`div`,{className:xn.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,j.jsx)(`span`,{className:xn.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var Cn={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},wn=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function Tn(){let e=P(),t=ee(e=>e.setView),n=ee(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await k(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await k(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,j.jsxs)(`div`,{className:Cn.root,children:[(0,j.jsx)(`div`,{className:Cn.header,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:Cn.title,children:`🖥️ Screen Capture`}),(0,j.jsxs)(`div`,{className:Cn.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,j.jsxs)(`div`,{className:Cn.controls,children:[(0,j.jsxs)(`div`,{className:Cn.monitorRow,children:[(0,j.jsx)(`label`,{className:Cn.label,children:`Monitor`}),[1,2,3].map(e=>(0,j.jsxs)(`button`,{className:`${Cn.monitorBtn} ${d===e?Cn.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,j.jsx)(`button`,{className:Cn.captureBtn,onClick:h,disabled:r||a,children:r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,j.jsxs)(`div`,{className:Cn.analyzeSection,children:[(0,j.jsx)(`div`,{className:Cn.sectionTitle,children:`Capture + Analyze`}),(0,j.jsx)(`div`,{className:Cn.presets,children:wn.map(e=>(0,j.jsxs)(`button`,{className:`${Cn.preset} ${l===e?Cn.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,j.jsxs)(`div`,{className:Cn.questionRow,children:[(0,j.jsx)(`input`,{className:Cn.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,j.jsx)(`button`,{className:Cn.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,j.jsx)(`div`,{className:Cn.error,children:s.error}),y&&(0,j.jsxs)(`div`,{className:Cn.screenshotContainer,children:[(0,j.jsx)(`img`,{src:y,className:Cn.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,j.jsxs)(`div`,{className:Cn.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,j.jsxs)(`div`,{className:Cn.analysis,children:[(0,j.jsx)(`div`,{className:Cn.analysisTitle,children:`AI Analysis`}),(0,j.jsx)(`div`,{className:Cn.analysisText,children:s.analysis}),(0,j.jsx)(`button`,{className:Cn.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,j.jsxs)(`div`,{className:Cn.history,children:[(0,j.jsx)(`div`,{className:Cn.sectionTitle,children:`Recent Captures`}),(0,j.jsx)(`div`,{className:Cn.historyGrid,children:p.map((e,t)=>(0,j.jsxs)(`div`,{className:Cn.historyItem,children:[e.src&&(0,j.jsx)(`img`,{src:e.src,className:Cn.historyThumb,alt:e.question}),(0,j.jsxs)(`div`,{className:Cn.historyMeta,children:[(0,j.jsx)(`div`,{className:Cn.historyTs,children:e.ts}),(0,j.jsx)(`div`,{className:Cn.historyQ,children:e.question}),e.analysis&&(0,j.jsxs)(`div`,{className:Cn.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var Q={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},En=[`driving`,`walking`,`bicycling`,`transit`],Dn={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},On=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function kn(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function An(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function jn(){let e=P(),t=ee(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(An),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await O(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(kn(n.trim(),i.trim()),p(An())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),kn(n.trim(),i.trim()),p(An())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,j.jsxs)(`div`,{className:Q.root,children:[(0,j.jsx)(`div`,{className:Q.header,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:Q.title,children:`🗺️ Maps & Directions`}),(0,j.jsx)(`div`,{className:Q.subtitle,children:e(`maps.directions`)})]})}),(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:e(`common.search`)}),(0,j.jsx)(`div`,{className:Q.quickBtns,children:On.map(e=>(0,j.jsx)(`button`,{className:Q.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,j.jsxs)(`div`,{className:Q.searchRow,children:[(0,j.jsx)(`input`,{className:Q.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,j.jsx)(`button`,{className:Q.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:`Directions`}),(0,j.jsx)(`div`,{className:Q.modeRow,children:En.map(e=>(0,j.jsxs)(`button`,{className:`${Q.modeBtn} ${o===e?Q.modeActive:``}`,onClick:()=>s(e),title:e,children:[Dn[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,j.jsxs)(`div`,{className:Q.routeInputs,children:[(0,j.jsxs)(`div`,{className:Q.inputWrapper,children:[(0,j.jsx)(`span`,{className:Q.inputIcon,children:`A`}),(0,j.jsx)(`input`,{className:Q.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,j.jsx)(`button`,{className:Q.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,j.jsxs)(`div`,{className:Q.inputWrapper,children:[(0,j.jsx)(`span`,{className:Q.inputIcon,children:`B`}),(0,j.jsx)(`input`,{className:Q.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,j.jsxs)(`div`,{className:Q.dirBtns,children:[(0,j.jsx)(`button`,{className:Q.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,j.jsx)(`a`,{className:Q.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,j.jsx)(`div`,{className:Q.error,children:u.error}),u&&!u.error&&(0,j.jsxs)(`div`,{className:Q.resultCard,children:[(u.distance||u.duration)&&(0,j.jsxs)(`div`,{className:Q.routeSummary,children:[u.distance&&(0,j.jsxs)(`span`,{className:Q.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,j.jsxs)(`span`,{className:Q.routeDuration,children:[`⏱ `,u.duration]}),(0,j.jsxs)(`span`,{className:Q.routeMode,children:[Dn[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,j.jsx)(`div`,{className:Q.steps,children:u.steps.map((e,t)=>(0,j.jsxs)(`div`,{className:Q.step,children:[(0,j.jsx)(`span`,{className:Q.stepNum,children:t+1}),(0,j.jsx)(`span`,{className:Q.stepText,children:e})]},t))}),u.url&&(0,j.jsx)(`a`,{className:Q.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,j.jsx)(`button`,{className:Q.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,j.jsxs)(`div`,{className:Q.savedRoute,onClick:()=>b(e),children:[(0,j.jsx)(`span`,{className:Q.savedFrom,children:e.from}),(0,j.jsx)(`span`,{className:Q.savedArrow,children:`→`}),(0,j.jsx)(`span`,{className:Q.savedTo,children:e.to}),(0,j.jsx)(`span`,{className:Q.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var $={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},Mn=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],Nn=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function Pn(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function Fn(){let e=P(),t=ee(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),O(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await k(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&k(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,j.jsxs)(`div`,{className:$.root,children:[(0,j.jsxs)(`div`,{className:$.header,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:$.title,children:`🔔 Reminders`}),(0,j.jsx)(`div`,{className:$.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,j.jsx)(`button`,{className:$.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,j.jsxs)(`div`,{className:$.quickAdd,children:[(0,j.jsx)(`div`,{className:$.quickLabel,children:`Quick reminder for now:`}),(0,j.jsx)(`div`,{className:$.quickPresets,children:Mn.map(e=>(0,j.jsx)(`button`,{className:$.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,j.jsxs)(`div`,{className:$.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsxs)(`div`,{className:$.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,j.jsx)(`div`,{className:$.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,j.jsxs)(`div`,{className:$.card,children:[(0,j.jsxs)(`div`,{className:$.cardLeft,children:[(0,j.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,j.jsxs)(`div`,{className:$.reminderTime,children:[(0,j.jsx)(`span`,{className:$.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,j.jsx)(`span`,{className:$.countdown,children:Pn(e.minutesUntil)})]})]}),(0,j.jsx)(`button`,{className:$.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsxs)(`div`,{className:$.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,j.jsxs)(`div`,{className:`${$.card} ${$.cardPast}`,children:[(0,j.jsxs)(`div`,{className:$.cardLeft,children:[(0,j.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,j.jsxs)(`div`,{className:$.reminderTime,children:[(0,j.jsx)(`span`,{className:e.status===`sent`?$.sentBadge:$.cancelledBadge,children:e.status}),(0,j.jsx)(`span`,{className:$.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,j.jsx)(`button`,{className:$.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsx)(`div`,{className:$.sectionTitle,children:`AI-Powered Reminders`}),(0,j.jsxs)(`div`,{className:$.aiButtons,children:[(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,j.jsx)(`div`,{className:$.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,j.jsxs)(`div`,{className:$.modal,children:[(0,j.jsx)(`div`,{className:$.modalTitle,children:e(`reminders.new`)}),(0,j.jsx)(`div`,{className:$.label,children:`Message *`}),(0,j.jsx)(`div`,{className:$.msgTemplates,children:Nn.map(e=>(0,j.jsx)(`button`,{className:`${$.msgTemplate} ${o.message===e?$.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,j.jsx)(`input`,{className:$.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,j.jsx)(`div`,{className:$.label,children:`When *`}),(0,j.jsxs)(`div`,{className:$.typeTabs,children:[(0,j.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`relative`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,j.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`absolute`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,j.jsxs)(`div`,{className:$.relRow,children:[(0,j.jsx)(`span`,{className:$.inLabel,children:`in`}),(0,j.jsx)(`input`,{className:$.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,j.jsxs)(`select`,{className:$.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,j.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,j.jsx)(`option`,{value:`hours`,children:`hours`}),(0,j.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,j.jsx)(`input`,{className:$.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,j.jsx)(`div`,{className:$.formErr,children:u}),f&&(0,j.jsx)(`div`,{className:$.formOk,children:f}),(0,j.jsxs)(`div`,{className:$.modalBtns,children:[(0,j.jsx)(`button`,{className:$.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,j.jsx)(`button`,{className:$.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var In={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},Ln={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function Rn({view:e}){let t=P();return(0,j.jsxs)(`div`,{className:In.root,children:[(0,j.jsx)(`div`,{className:In.icon,children:Ln[e]??`🔧`}),(0,j.jsx)(`div`,{className:In.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,j.jsx)(`div`,{className:In.sub,children:t(`common.comingSoon`)})]})}function zn(){let{activeView:e}=ee();switch(e){case`dashboard`:return(0,j.jsx)(mt,{});case`chat`:return(0,j.jsx)(Ce,{});case`studio`:return(0,j.jsx)(lt,{});case`email`:return(0,j.jsx)(Ht,{});case`calendar`:return(0,j.jsx)(Kt,{});case`tasks`:return(0,j.jsx)(gt,{});case`notes`:return(0,j.jsx)(Dt,{});case`contacts`:return(0,j.jsx)(At,{});case`birthdays`:return(0,j.jsx)(xt,{});case`cron`:return(0,j.jsx)(Tt,{});case`connectors`:return(0,j.jsx)(Lt,{});case`agents`:return(0,j.jsx)(Xt,{});case`drive`:return(0,j.jsx)($t,{});case`onedrive`:return(0,j.jsx)(bn,{});case`mstodo`:return(0,j.jsx)(Sn,{});case`github`:return(0,j.jsx)(en,{});case`slack`:return(0,j.jsx)(nn,{});case`notion`:return(0,j.jsx)(rn,{});case`collab`:return(0,j.jsx)(sn,{});case`webcraft`:return(0,j.jsx)(mn,{});case`plan`:return(0,j.jsx)(vn,{});case`screen`:return(0,j.jsx)(Tn,{});case`maps`:return(0,j.jsx)(jn,{});case`reminders`:return(0,j.jsx)(Fn,{});case`settings`:return(0,j.jsx)(yt,{});default:return(0,j.jsx)(Rn,{view:e})}}(0,v.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(_.StrictMode,{children:(0,j.jsx)(de,{children:(0,j.jsx)(zn,{})})}));
|
|
701
|
+
Scrivi le istruzioni in Markdown...`,className:Z.modalContentArea,style:{borderColor:g?`#e05050`:`var(--border2)`}})]})]})}),(0,j.jsxs)(`div`,{className:Z.modalFooter,children:[(0,j.jsx)(`button`,{onClick:r,className:Z.modalCancelBtn,children:`Annulla`}),e.mode!==`view`&&(0,j.jsx)(`button`,{onClick:y,className:Z.modalSaveBtn,children:`✓ Salva`})]})]})})}var _n={root:`_root_x9yvu_1`,loading:`_loading_x9yvu_7`,empty:`_empty_x9yvu_18`,emptyIcon:`_emptyIcon_x9yvu_29`,emptyTitle:`_emptyTitle_x9yvu_30`,emptySub:`_emptySub_x9yvu_31`,generateBtn:`_generateBtn_x9yvu_33`,summary:`_summary_x9yvu_46`,sectionTitle:`_sectionTitle_x9yvu_57`,alertTitle:`_alertTitle_x9yvu_68`,actionCard:`_actionCard_x9yvu_70`,actionTime:`_actionTime_x9yvu_81`,actionText:`_actionText_x9yvu_89`,schedCard:`_schedCard_x9yvu_95`,schedTime:`_schedTime_x9yvu_106`,schedTitle:`_schedTitle_x9yvu_114`,alertCard:`_alertCard_x9yvu_119`,alertSev:`_alertSev_x9yvu_129`,alertAction:`_alertAction_x9yvu_135`,insight:`_insight_x9yvu_141`,regenRow:`_regenRow_x9yvu_148`,regenBtn:`_regenBtn_x9yvu_153`};function vn(){let e=P(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),l=()=>{i(!0),c(!1),O(`/api/plan`).then(e=>{e?.plan?(n(e.plan),c(!1)):(n(null),c(!0)),i(!1)}).catch(()=>{i(!1),c(!0)})},u=async()=>{o(!0),i(!0),n(null);try{await k(`/api/plan/refresh`,{}),l()}catch{i(!1)}finally{o(!1)}};if((0,_.useEffect)(()=>{l()},[]),r)return(0,j.jsxs)(`div`,{className:_n.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),(0,j.jsx)(`div`,{children:a?`Generating plan with 5 agents...`:`Loading plan...`})]});if(s||!t)return(0,j.jsxs)(`div`,{className:_n.empty,children:[(0,j.jsx)(`div`,{className:_n.emptyIcon,children:`🗓️`}),(0,j.jsxs)(`div`,{className:_n.emptyTitle,children:[e(`plan.noplan`),` generated yet`]}),(0,j.jsx)(`div`,{className:_n.emptySub,children:`Generate a daily plan using your calendar, tasks, and emails.`}),(0,j.jsx)(`button`,{className:_n.generateBtn,onClick:u,children:e(`plan.generate`)})]});let d=e=>typeof e==`string`?e:e.description??e.message??e.action_required??`Alert`,f=e=>typeof e==`object`&&e.severity?` [${e.severity.toUpperCase()}]`:``,p=e=>typeof e==`object`&&e.action_required&&e.action_required!==d(e)?e.action_required:``,m=e=>typeof e==`string`?e:e.message??e.insight??``;return(0,j.jsxs)(`div`,{className:_n.root,children:[t.executive_summary&&(0,j.jsx)(`div`,{className:_n.summary,children:t.executive_summary}),t.priority_actions&&t.priority_actions.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Priority Actions`}),t.priority_actions.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.actionCard,children:[e.time&&(0,j.jsx)(`span`,{className:_n.actionTime,children:e.time}),(0,j.jsx)(`span`,{className:_n.actionText,children:e.action})]},t))]}),t.schedule&&t.schedule.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Schedule`}),t.schedule.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.schedCard,children:[(0,j.jsxs)(`span`,{className:_n.schedTime,children:[e.time_start,`–`,e.time_end]}),(0,j.jsx)(`span`,{className:_n.schedTitle,children:e.title})]},t))]}),t.security_alerts&&t.security_alerts.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`${_n.sectionTitle} ${_n.alertTitle}`,children:`Security Alerts`}),t.security_alerts.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.alertCard,children:[(0,j.jsxs)(`span`,{className:_n.alertSev,children:[`!`,f(e)]}),(0,j.jsx)(`span`,{children:d(e)}),p(e)&&(0,j.jsxs)(`div`,{className:_n.alertAction,children:[`Action: `,p(e)]})]},t))]}),t.insights&&t.insights.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:_n.sectionTitle,children:`Insights`}),t.insights.map((e,t)=>(0,j.jsxs)(`div`,{className:_n.insight,children:[`→ `,m(e)]},t))]}),(0,j.jsx)(`div`,{className:_n.regenRow,children:(0,j.jsx)(`button`,{className:_n.regenBtn,onClick:u,disabled:a,children:a?`Regenerating…`:`↺ Regenerate`})})]})}function yn(e){return e===`folder`?`📁`:e===`image`?`🖼`:e===`pdf`?`📕`:e===`video`?`🎬`:e===`audio`?`🎵`:e===`sheet`?`📊`:e===`slides`?`📽`:`📄`}function bn(){let e=P(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=(e=``)=>{i(!0),O(e?`/api/onedrive?q=${encodeURIComponent(e)}`:`/api/onedrive`).then(e=>{n(e??{files:[]}),i(!1)}).catch(()=>{o(`Could not load OneDrive. Run nha microsoft auth in the terminal to connect.`),i(!1)})};if((0,_.useEffect)(()=>{l()},[]),a)return(0,j.jsx)(`div`,{className:J.error,children:a});let u=t?.files??[],d=t?.quota;return(0,j.jsxs)(`div`,{className:J.root,children:[d&&(0,j.jsxs)(`div`,{className:J.quotaBar,children:[(0,j.jsxs)(`div`,{className:J.quotaText,children:[(0,j.jsxs)(`span`,{className:J.quotaUsed,children:[d.usage,` of `,d.limit,` used`]}),(0,j.jsxs)(`span`,{className:J.quotaPct,children:[d.percentUsed,`%`]})]}),(0,j.jsx)(`div`,{className:J.quotaTrack,children:(0,j.jsx)(`div`,{className:J.quotaFill,style:{width:`${Math.min(d.percentUsed,100)}%`,background:d.percentUsed>90?`var(--red)`:d.percentUsed>70?`var(--amber)`:`var(--cyan)`}})})]}),(0,j.jsxs)(`div`,{className:J.searchRow,children:[(0,j.jsx)(`input`,{className:J.searchInput,value:s,onChange:e=>c(e.target.value),placeholder:`Search OneDrive files…`,onKeyDown:e=>e.key===`Enter`&&l(s)}),(0,j.jsx)(`button`,{className:J.searchBtn,onClick:()=>l(s),children:`Search`})]}),r&&(0,j.jsxs)(`div`,{className:J.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!r&&u.length===0&&(0,j.jsx)(`div`,{className:J.empty,children:e(`drive.noFiles`)}),(0,j.jsx)(`div`,{className:J.fileList,children:u.map(e=>(0,j.jsxs)(`div`,{className:J.fileRow,children:[(0,j.jsx)(`span`,{className:J.fileIcon,children:yn(e.type)}),(0,j.jsxs)(`div`,{className:J.fileInfo,children:[(0,j.jsx)(`div`,{className:J.fileName,children:e.name}),(0,j.jsxs)(`div`,{className:J.fileMeta,children:[e.modifiedTime?new Date(e.modifiedTime).toLocaleDateString():``,e.size?` · ${e.size}`:``]})]}),(0,j.jsx)(`div`,{className:J.fileBtns,children:e.webViewLink&&(0,j.jsx)(`a`,{className:J.openBtn,href:e.webViewLink,target:`_blank`,rel:`noreferrer`,children:`Open`})})]},e.id))})]})}var xn={root:`_root_1vbmp_1`,loading:`_loading_1vbmp_2`,error:`_error_1vbmp_3`,empty:`_empty_1vbmp_4`,addRow:`_addRow_1vbmp_6`,addInput:`_addInput_1vbmp_7`,addBtn:`_addBtn_1vbmp_8`,list:`_list_1vbmp_10`,taskRow:`_taskRow_1vbmp_11`,checkBtn:`_checkBtn_1vbmp_12`,taskInfo:`_taskInfo_1vbmp_14`,taskTitle:`_taskTitle_1vbmp_15`,taskDue:`_taskDue_1vbmp_16`,taskImp:`_taskImp_1vbmp_17`};function Sn(){let e=P(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),l=()=>{O(`/api/mstodo`).then(e=>{n(e?.tasks??[]),i(!1)}).catch(()=>{o(`Microsoft To Do requires Microsoft authentication. Run nha microsoft auth in the terminal.`),i(!1)})};(0,_.useEffect)(()=>{l()},[]);let u=()=>{let e=s.trim();e&&(c(``),k(`/api/mstodo`,{title:e}).then(e=>{e?.task&&l()}))},d=(e,t)=>{k(`/api/mstodo/${e}/complete`,{listId:t}).then(()=>l())};return r?(0,j.jsxs)(`div`,{className:xn.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}):a?(0,j.jsx)(`div`,{className:xn.error,children:a}):(0,j.jsxs)(`div`,{className:xn.root,children:[(0,j.jsxs)(`div`,{className:xn.addRow,children:[(0,j.jsx)(`input`,{className:xn.addInput,value:s,onChange:e=>c(e.target.value),placeholder:`Add a new task…`,onKeyDown:e=>e.key===`Enter`&&u()}),(0,j.jsx)(`button`,{className:xn.addBtn,onClick:u,children:`+ Add`})]}),t.length===0&&(0,j.jsx)(`div`,{className:xn.empty,children:`No active tasks`}),(0,j.jsx)(`div`,{className:xn.list,children:t.map(e=>{let t=e.importance===`high`?`var(--red)`:e.importance===`low`?`var(--dim)`:`var(--amber)`;return(0,j.jsxs)(`div`,{className:xn.taskRow,children:[(0,j.jsx)(`button`,{className:xn.checkBtn,onClick:()=>d(e.id,e.listId)}),(0,j.jsxs)(`div`,{className:xn.taskInfo,children:[(0,j.jsx)(`div`,{className:xn.taskTitle,children:e.title}),e.dueDate&&(0,j.jsxs)(`div`,{className:xn.taskDue,children:[`Due: `,e.dueDate.split(`T`)[0]]})]}),e.importance&&(0,j.jsx)(`span`,{className:xn.taskImp,style:{color:t},children:e.importance})]},e.id)})})]})}var Cn={root:`_root_1ag4s_1`,header:`_header_1ag4s_3`,title:`_title_1ag4s_4`,subtitle:`_subtitle_1ag4s_5`,controls:`_controls_1ag4s_7`,monitorRow:`_monitorRow_1ag4s_8`,label:`_label_1ag4s_9`,monitorBtn:`_monitorBtn_1ag4s_10`,monitorActive:`_monitorActive_1ag4s_11`,captureBtn:`_captureBtn_1ag4s_12`,analyzeSection:`_analyzeSection_1ag4s_15`,sectionTitle:`_sectionTitle_1ag4s_16`,presets:`_presets_1ag4s_17`,preset:`_preset_1ag4s_17`,presetActive:`_presetActive_1ag4s_20`,questionRow:`_questionRow_1ag4s_21`,questionInput:`_questionInput_1ag4s_22`,analyzeBtn:`_analyzeBtn_1ag4s_23`,error:`_error_1ag4s_26`,screenshotContainer:`_screenshotContainer_1ag4s_28`,screenshot:`_screenshot_1ag4s_28`,screenshotMeta:`_screenshotMeta_1ag4s_30`,analysis:`_analysis_1ag4s_32`,analysisTitle:`_analysisTitle_1ag4s_33`,analysisText:`_analysisText_1ag4s_34`,continueInChat:`_continueInChat_1ag4s_35`,history:`_history_1ag4s_37`,historyGrid:`_historyGrid_1ag4s_38`,historyItem:`_historyItem_1ag4s_39`,historyThumb:`_historyThumb_1ag4s_40`,historyMeta:`_historyMeta_1ag4s_41`,historyTs:`_historyTs_1ag4s_42`,historyQ:`_historyQ_1ag4s_43`,historyA:`_historyA_1ag4s_44`},wn=[`Describe exactly what you see on the screen`,`Identify any errors, warnings, or issues visible`,`What application is open and what is the user doing?`,`Summarize the content visible on screen and suggest next actions`,`Read and extract all visible text from the screen`,`Analyze the code visible on screen and identify bugs or improvements`,`What financial data or charts are visible? Summarize key numbers`,`Is there anything sensitive or that should be kept private?`];function Tn(){let e=P(),t=ee(e=>e.setView),n=ee(e=>e.apiBase),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)([]),h=async()=>{i(!0),c(null);try{let e=await k(`/api/screen/capture`,{monitor:d});c(e),(e?.base64||e?.file)&&m(t=>[{ts:new Date().toLocaleTimeString(),question:`Screenshot`,analysis:``,src:e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:`${n}/api/screenshots/${e.file}`},...t.slice(0,9)])}catch(e){c({error:e.message})}i(!1)},g=async()=>{if(l.trim()){o(!0);try{let e=await k(`/api/screen/analyze`,{question:l.trim(),monitor:d});if(c(e),e?.analysis){let t=e.base64?`data:image/${e.format??`jpeg`};base64,${e.base64}`:e.file?`${n}/api/screenshots/${e.file}`:``;m(n=>[{ts:new Date().toLocaleTimeString(),question:l.trim(),analysis:e.analysis??``,src:t},...n.slice(0,9)])}}catch(e){c({error:e.message})}o(!1)}},v=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},y=s?.base64?`data:image/${s.format??`jpeg`};base64,${s.base64}`:s?.file?`${n}/api/screenshots/${s.file}`:null;return(0,j.jsxs)(`div`,{className:Cn.root,children:[(0,j.jsx)(`div`,{className:Cn.header,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:Cn.title,children:`🖥️ Screen Capture`}),(0,j.jsxs)(`div`,{className:Cn.subtitle,children:[e(`screen.capture`),` and analyze your desktop screen with AI vision`]})]})}),(0,j.jsxs)(`div`,{className:Cn.controls,children:[(0,j.jsxs)(`div`,{className:Cn.monitorRow,children:[(0,j.jsx)(`label`,{className:Cn.label,children:`Monitor`}),[1,2,3].map(e=>(0,j.jsxs)(`button`,{className:`${Cn.monitorBtn} ${d===e?Cn.monitorActive:``}`,onClick:()=>f(e),children:[`Monitor `,e]},e))]}),(0,j.jsx)(`button`,{className:Cn.captureBtn,onClick:h,disabled:r||a,children:r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Capturing…`]}):`📷 Capture Screen`})]}),(0,j.jsxs)(`div`,{className:Cn.analyzeSection,children:[(0,j.jsx)(`div`,{className:Cn.sectionTitle,children:`Capture + Analyze`}),(0,j.jsx)(`div`,{className:Cn.presets,children:wn.map(e=>(0,j.jsxs)(`button`,{className:`${Cn.preset} ${l===e?Cn.presetActive:``}`,onClick:()=>u(e),children:[e.slice(0,50),e.length>50?`…`:``]},e))}),(0,j.jsxs)(`div`,{className:Cn.questionRow,children:[(0,j.jsx)(`input`,{className:Cn.questionInput,value:l,onChange:e=>u(e.target.value),placeholder:`Ask something about your screen…`,onKeyDown:e=>e.key===`Enter`&&g()}),(0,j.jsx)(`button`,{className:Cn.analyzeBtn,onClick:g,disabled:!l.trim()||r||a,children:a?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Analyzing…`]}):`🔍 Analyze`})]})]}),s?.error&&(0,j.jsx)(`div`,{className:Cn.error,children:s.error}),y&&(0,j.jsxs)(`div`,{className:Cn.screenshotContainer,children:[(0,j.jsx)(`img`,{src:y,className:Cn.screenshot,alt:`Screen capture`}),s?.width&&s?.height&&(0,j.jsxs)(`div`,{className:Cn.screenshotMeta,children:[s.width,` × `,s.height,`px`]})]}),s?.analysis&&(0,j.jsxs)(`div`,{className:Cn.analysis,children:[(0,j.jsx)(`div`,{className:Cn.analysisTitle,children:`AI Analysis`}),(0,j.jsx)(`div`,{className:Cn.analysisText,children:s.analysis}),(0,j.jsx)(`button`,{className:Cn.continueInChat,onClick:()=>v(`I captured my screen. Here's what the AI saw:\n\n${s.analysis}\n\nCan you help me with this?`),children:`Continue in Chat →`})]}),p.length>0&&(0,j.jsxs)(`div`,{className:Cn.history,children:[(0,j.jsx)(`div`,{className:Cn.sectionTitle,children:`Recent Captures`}),(0,j.jsx)(`div`,{className:Cn.historyGrid,children:p.map((e,t)=>(0,j.jsxs)(`div`,{className:Cn.historyItem,children:[e.src&&(0,j.jsx)(`img`,{src:e.src,className:Cn.historyThumb,alt:e.question}),(0,j.jsxs)(`div`,{className:Cn.historyMeta,children:[(0,j.jsx)(`div`,{className:Cn.historyTs,children:e.ts}),(0,j.jsx)(`div`,{className:Cn.historyQ,children:e.question}),e.analysis&&(0,j.jsxs)(`div`,{className:Cn.historyA,children:[e.analysis.slice(0,120),`…`]})]})]},t))})]})]})}var Q={root:`_root_v12qq_1`,header:`_header_v12qq_3`,title:`_title_v12qq_4`,subtitle:`_subtitle_v12qq_5`,section:`_section_v12qq_7`,sectionTitle:`_sectionTitle_v12qq_8`,quickBtns:`_quickBtns_v12qq_10`,quickBtn:`_quickBtn_v12qq_10`,searchRow:`_searchRow_v12qq_14`,searchInput:`_searchInput_v12qq_15`,searchBtn:`_searchBtn_v12qq_16`,modeRow:`_modeRow_v12qq_19`,modeBtn:`_modeBtn_v12qq_20`,modeActive:`_modeActive_v12qq_21`,routeInputs:`_routeInputs_v12qq_23`,inputWrapper:`_inputWrapper_v12qq_24`,inputIcon:`_inputIcon_v12qq_25`,routeInput:`_routeInput_v12qq_23`,swapBtn:`_swapBtn_v12qq_27`,dirBtns:`_dirBtns_v12qq_29`,dirBtn:`_dirBtn_v12qq_29`,openMapsBtn:`_openMapsBtn_v12qq_32`,error:`_error_v12qq_34`,resultCard:`_resultCard_v12qq_36`,routeSummary:`_routeSummary_v12qq_37`,routeDistance:`_routeDistance_v12qq_38`,routeDuration:`_routeDuration_v12qq_39`,routeMode:`_routeMode_v12qq_40`,steps:`_steps_v12qq_41`,step:`_step_v12qq_41`,stepNum:`_stepNum_v12qq_43`,stepText:`_stepText_v12qq_44`,mapLink:`_mapLink_v12qq_45`,askChatBtn:`_askChatBtn_v12qq_47`,savedRoute:`_savedRoute_v12qq_49`,savedFrom:`_savedFrom_v12qq_51`,savedArrow:`_savedArrow_v12qq_52`,savedTo:`_savedTo_v12qq_53`,savedTs:`_savedTs_v12qq_54`},En=[`driving`,`walking`,`bicycling`,`transit`],Dn={driving:`🚗`,walking:`🚶`,bicycling:`🚲`,transit:`🚌`},On=[{label:`🏥 Nearest Hospital`,query:`nearest hospital`},{label:`⛽ Gas Station`,query:`gas station near me`},{label:`🛒 Supermarket`,query:`supermarket near me`},{label:`☕ Coffee Shop`,query:`coffee shop near me`},{label:`🏧 ATM`,query:`ATM near me`},{label:`🍕 Pizza`,query:`pizza restaurant near me`}];function kn(e,t,n){try{let r=JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`),i=[{from:e,to:t,label:n,ts:new Date().toISOString()},...r.filter(n=>!(n.from===e&&n.to===t))].slice(0,10);localStorage.setItem(`nha_maps_routes`,JSON.stringify(i))}catch{}}function An(){try{return JSON.parse(localStorage.getItem(`nha_maps_routes`)??`[]`)}catch{return[]}}function jn(){let e=P(),t=ee(e=>e.setView),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`driving`),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(An),[m,h]=(0,_.useState)(``),g=async()=>{if(!(!n.trim()||!i.trim())){l(!0),d(null);try{let e=await O(`/api/maps/directions?from=${encodeURIComponent(n.trim())}&to=${encodeURIComponent(i.trim())}&mode=${o}`);e&&(d(e),e.error||(kn(n.trim(),i.trim()),p(An())))}catch{d({url:`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`}),kn(n.trim(),i.trim()),p(An())}l(!1)}},v=e=>{let t=`https://www.google.com/maps/search/${encodeURIComponent(e)}`;window.open(t,`_blank`)},y=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},b=e=>{r(e.from),a(e.to)},x=n.trim()&&i.trim()?`https://www.google.com/maps/dir/${encodeURIComponent(n.trim())}/${encodeURIComponent(i.trim())}/?travelmode=${o}`:null;return(0,j.jsxs)(`div`,{className:Q.root,children:[(0,j.jsx)(`div`,{className:Q.header,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:Q.title,children:`🗺️ Maps & Directions`}),(0,j.jsx)(`div`,{className:Q.subtitle,children:e(`maps.directions`)})]})}),(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:e(`common.search`)}),(0,j.jsx)(`div`,{className:Q.quickBtns,children:On.map(e=>(0,j.jsx)(`button`,{className:Q.quickBtn,onClick:()=>v(e.query),children:e.label},e.label))}),(0,j.jsxs)(`div`,{className:Q.searchRow,children:[(0,j.jsx)(`input`,{className:Q.searchInput,value:m,onChange:e=>h(e.target.value),placeholder:`Search for a place, address, or business…`,onKeyDown:e=>e.key===`Enter`&&v(m)}),(0,j.jsx)(`button`,{className:Q.searchBtn,onClick:()=>v(m),disabled:!m.trim(),children:`Search ↗`})]})]}),(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:`Directions`}),(0,j.jsx)(`div`,{className:Q.modeRow,children:En.map(e=>(0,j.jsxs)(`button`,{className:`${Q.modeBtn} ${o===e?Q.modeActive:``}`,onClick:()=>s(e),title:e,children:[Dn[e],` `,e.charAt(0).toUpperCase()+e.slice(1)]},e))}),(0,j.jsxs)(`div`,{className:Q.routeInputs,children:[(0,j.jsxs)(`div`,{className:Q.inputWrapper,children:[(0,j.jsx)(`span`,{className:Q.inputIcon,children:`A`}),(0,j.jsx)(`input`,{className:Q.routeInput,value:n,onChange:e=>r(e.target.value),placeholder:`From (address, city, or 'my location')`,onKeyDown:e=>e.key===`Enter`&&g()})]}),(0,j.jsx)(`button`,{className:Q.swapBtn,onClick:()=>{r(i),a(n)},title:`Swap`,children:`⇅`}),(0,j.jsxs)(`div`,{className:Q.inputWrapper,children:[(0,j.jsx)(`span`,{className:Q.inputIcon,children:`B`}),(0,j.jsx)(`input`,{className:Q.routeInput,value:i,onChange:e=>a(e.target.value),placeholder:`To (address, city, or landmark)`,onKeyDown:e=>e.key===`Enter`&&g()})]})]}),(0,j.jsxs)(`div`,{className:Q.dirBtns,children:[(0,j.jsx)(`button`,{className:Q.dirBtn,onClick:g,disabled:c||!n.trim()||!i.trim(),children:c?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`spinner`}),` Getting route…`]}):`🗺️ Get Directions`}),x&&(0,j.jsx)(`a`,{className:Q.openMapsBtn,href:x,target:`_blank`,rel:`noreferrer`,children:`Open in Google Maps ↗`})]})]}),u?.error&&(0,j.jsx)(`div`,{className:Q.error,children:u.error}),u&&!u.error&&(0,j.jsxs)(`div`,{className:Q.resultCard,children:[(u.distance||u.duration)&&(0,j.jsxs)(`div`,{className:Q.routeSummary,children:[u.distance&&(0,j.jsxs)(`span`,{className:Q.routeDistance,children:[`📏 `,u.distance]}),u.duration&&(0,j.jsxs)(`span`,{className:Q.routeDuration,children:[`⏱ `,u.duration]}),(0,j.jsxs)(`span`,{className:Q.routeMode,children:[Dn[o],` `,o]})]}),u.steps&&u.steps.length>0&&(0,j.jsx)(`div`,{className:Q.steps,children:u.steps.map((e,t)=>(0,j.jsxs)(`div`,{className:Q.step,children:[(0,j.jsx)(`span`,{className:Q.stepNum,children:t+1}),(0,j.jsx)(`span`,{className:Q.stepText,children:e})]},t))}),u.url&&(0,j.jsx)(`a`,{className:Q.mapLink,href:u.url,target:`_blank`,rel:`noreferrer`,children:`View full route on Google Maps ↗`}),(0,j.jsx)(`button`,{className:Q.askChatBtn,onClick:()=>y(`Give me directions from "${n}" to "${i}" by ${o}. Include estimated time, distance, and any traffic alerts or alternative routes.`),children:`Ask AI for detailed route advice →`})]}),f.length>0&&(0,j.jsxs)(`div`,{className:Q.section,children:[(0,j.jsx)(`div`,{className:Q.sectionTitle,children:`Recent Routes`}),f.map((e,t)=>(0,j.jsxs)(`div`,{className:Q.savedRoute,onClick:()=>b(e),children:[(0,j.jsx)(`span`,{className:Q.savedFrom,children:e.from}),(0,j.jsx)(`span`,{className:Q.savedArrow,children:`→`}),(0,j.jsx)(`span`,{className:Q.savedTo,children:e.to}),(0,j.jsx)(`span`,{className:Q.savedTs,children:new Date(e.ts).toLocaleDateString()})]},t))]})]})}var $={root:`_root_esnjz_1`,header:`_header_esnjz_3`,title:`_title_esnjz_4`,subtitle:`_subtitle_esnjz_5`,addBtn:`_addBtn_esnjz_6`,quickAdd:`_quickAdd_esnjz_8`,quickLabel:`_quickLabel_esnjz_9`,quickPresets:`_quickPresets_esnjz_10`,quickPreset:`_quickPreset_esnjz_10`,section:`_section_esnjz_14`,sectionTitle:`_sectionTitle_esnjz_15`,loading:`_loading_esnjz_17`,empty:`_empty_esnjz_18`,card:`_card_esnjz_20`,cardPast:`_cardPast_esnjz_21`,cardLeft:`_cardLeft_esnjz_22`,reminderMsg:`_reminderMsg_esnjz_23`,reminderTime:`_reminderTime_esnjz_24`,timeBadge:`_timeBadge_esnjz_25`,countdown:`_countdown_esnjz_26`,timePast:`_timePast_esnjz_27`,sentBadge:`_sentBadge_esnjz_28`,cancelledBadge:`_cancelledBadge_esnjz_29`,cancelBtn:`_cancelBtn_esnjz_30`,repeatBtn:`_repeatBtn_esnjz_31`,aiButtons:`_aiButtons_esnjz_33`,aiBtn:`_aiBtn_esnjz_34`,overlay:`_overlay_esnjz_38`,modal:`_modal_esnjz_39`,modalTitle:`_modalTitle_esnjz_40`,label:`_label_esnjz_41`,input:`_input_esnjz_42`,msgTemplates:`_msgTemplates_esnjz_44`,msgTemplate:`_msgTemplate_esnjz_44`,msgTemplateActive:`_msgTemplateActive_esnjz_47`,typeTabs:`_typeTabs_esnjz_49`,typeTab:`_typeTab_esnjz_49`,typeTabActive:`_typeTabActive_esnjz_51`,relRow:`_relRow_esnjz_53`,inLabel:`_inLabel_esnjz_54`,relInput:`_relInput_esnjz_55`,relSelect:`_relSelect_esnjz_56`,formErr:`_formErr_esnjz_58`,formOk:`_formOk_esnjz_59`,modalBtns:`_modalBtns_esnjz_60`,cancelModalBtn:`_cancelModalBtn_esnjz_61`,saveBtn:`_saveBtn_esnjz_62`},Mn=[{label:`In 5 min`,value:`in 5 minutes`},{label:`In 15 min`,value:`in 15 minutes`},{label:`In 30 min`,value:`in 30 minutes`},{label:`In 1 hour`,value:`in 1 hour`},{label:`In 2 hours`,value:`in 2 hours`},{label:`In 3 hours`,value:`in 3 hours`},{label:`Tomorrow 9am`,value:`tomorrow at 09:00`},{label:`Tomorrow noon`,value:`tomorrow at 12:00`}],Nn=[`Take a break and stretch`,`Check emails`,`Join the standup call`,`Review and respond to messages`,`Take your medication`,`Drink water`,`Focus review — what did you accomplish in the last hour?`,`Follow up on pending tasks`,`End of work day — log your achievements`,`Weekly review — prepare for next week`];function Pn(e){if(e<1)return`now`;if(e<60)return`in ${e}m`;let t=Math.floor(e/60),n=e%60;return n>0?`in ${t}h ${n}m`:`in ${t}h`}function Fn(){let e=P(),t=ee(e=>e.setView),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)({message:``,atTime:``,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`}),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),g=()=>{a(!0),O(`/api/reminders`).then(e=>{r(e?.reminders??[]),a(!1)}).catch(()=>{r([]),a(!1)})};(0,_.useEffect)(()=>{g()},[]);let v=async()=>{if(!o.message.trim()){d(`Message is required`);return}let e=``;if(o.atTimeType===`relative`)e=`in ${o.relValue} ${o.relUnit}`;else{if(!o.atTime){d(`Time is required`);return}e=o.atTime}l(!0),d(``);try{await k(`/api/reminders`,{message:o.message.trim(),atTime:e}),p(`Reminder set!`),setTimeout(()=>{p(``),h(!1)},1500),g()}catch(e){d(e.message??`Failed to set reminder`)}l(!1)},y=e=>{confirm(`Cancel this reminder?`)&&k(`/api/reminders/cancel`,{id:e}).then(g)},b=e=>{try{sessionStorage.setItem(`nha_chat_prefill`,e)}catch{}t(`chat`)},x=n.filter(e=>e.status===`pending`),S=n.filter(e=>e.status!==`pending`);return(0,j.jsxs)(`div`,{className:$.root,children:[(0,j.jsxs)(`div`,{className:$.header,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:$.title,children:`🔔 Reminders`}),(0,j.jsx)(`div`,{className:$.subtitle,children:`Set one-time notifications via the NHA daemon`})]}),(0,j.jsx)(`button`,{className:$.addBtn,onClick:()=>{h(!0),d(``),p(``)},children:`+ New Reminder`})]}),(0,j.jsxs)(`div`,{className:$.quickAdd,children:[(0,j.jsx)(`div`,{className:$.quickLabel,children:`Quick reminder for now:`}),(0,j.jsx)(`div`,{className:$.quickPresets,children:Mn.map(e=>(0,j.jsx)(`button`,{className:$.quickPreset,onClick:()=>{s(e=>({...e,atTimeType:`relative`,atTime:``,message:e.message||`Reminder`})),h(!0),d(``),p(``)},children:e.label},e.value))})]}),i&&(0,j.jsxs)(`div`,{className:$.loading,children:[(0,j.jsx)(`div`,{className:`spinner`}),e(`common.loading`)]}),!i&&(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsxs)(`div`,{className:$.sectionTitle,children:[`Pending (`,x.length,`)`]}),x.length===0&&(0,j.jsx)(`div`,{className:$.empty,children:`No pending reminders. Set one to get notified.`}),x.map(e=>(0,j.jsxs)(`div`,{className:$.card,children:[(0,j.jsxs)(`div`,{className:$.cardLeft,children:[(0,j.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,j.jsxs)(`div`,{className:$.reminderTime,children:[(0,j.jsx)(`span`,{className:$.timeBadge,children:new Date(e.atTime).toLocaleString()}),e.minutesUntil!==void 0&&(0,j.jsx)(`span`,{className:$.countdown,children:Pn(e.minutesUntil)})]})]}),(0,j.jsx)(`button`,{className:$.cancelBtn,onClick:()=>y(e.id),children:`Cancel`})]},e.id))]}),S.length>0&&(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsxs)(`div`,{className:$.sectionTitle,children:[`Recent (`,S.length,`)`]}),S.slice(0,10).map(e=>(0,j.jsxs)(`div`,{className:`${$.card} ${$.cardPast}`,children:[(0,j.jsxs)(`div`,{className:$.cardLeft,children:[(0,j.jsx)(`div`,{className:$.reminderMsg,children:e.message}),(0,j.jsxs)(`div`,{className:$.reminderTime,children:[(0,j.jsx)(`span`,{className:e.status===`sent`?$.sentBadge:$.cancelledBadge,children:e.status}),(0,j.jsx)(`span`,{className:$.timePast,children:new Date(e.atTime).toLocaleString()})]})]}),(0,j.jsx)(`button`,{className:$.repeatBtn,onClick:()=>{s(t=>({...t,message:e.message,atTimeType:`relative`,relValue:`30`,relUnit:`minutes`})),h(!0)},children:`Repeat`})]},e.id))]}),(0,j.jsxs)(`div`,{className:$.section,children:[(0,j.jsx)(`div`,{className:$.sectionTitle,children:`AI-Powered Reminders`}),(0,j.jsxs)(`div`,{className:$.aiButtons,children:[(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder to check my emails in 30 minutes`),children:`📧 Email check in 30min`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder every hour to take a break and drink water`),children:`💧 Hourly water break`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Set a reminder at the end of the work day (6pm) to do an evening review of my tasks and prepare tomorrow's plan`),children:`🌆 Evening review 6pm`}),(0,j.jsx)(`button`,{className:$.aiBtn,onClick:()=>b(`Look at my calendar and set reminders for all events today`),children:`📅 Remind me of today's events`})]})]}),m&&(0,j.jsx)(`div`,{className:$.overlay,onClick:e=>{e.target===e.currentTarget&&h(!1)},children:(0,j.jsxs)(`div`,{className:$.modal,children:[(0,j.jsx)(`div`,{className:$.modalTitle,children:e(`reminders.new`)}),(0,j.jsx)(`div`,{className:$.label,children:`Message *`}),(0,j.jsx)(`div`,{className:$.msgTemplates,children:Nn.map(e=>(0,j.jsx)(`button`,{className:`${$.msgTemplate} ${o.message===e?$.msgTemplateActive:``}`,onClick:()=>s(t=>({...t,message:e})),children:e},e))}),(0,j.jsx)(`input`,{className:$.input,value:o.message,onChange:e=>s(t=>({...t,message:e.target.value})),placeholder:`Reminder message (e.g. Call John)`}),(0,j.jsx)(`div`,{className:$.label,children:`When *`}),(0,j.jsxs)(`div`,{className:$.typeTabs,children:[(0,j.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`relative`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`relative`})),children:`Relative`}),(0,j.jsx)(`button`,{className:`${$.typeTab} ${o.atTimeType===`absolute`?$.typeTabActive:``}`,onClick:()=>s(e=>({...e,atTimeType:`absolute`})),children:`Exact time`})]}),o.atTimeType===`relative`?(0,j.jsxs)(`div`,{className:$.relRow,children:[(0,j.jsx)(`span`,{className:$.inLabel,children:`in`}),(0,j.jsx)(`input`,{className:$.relInput,type:`number`,min:`1`,value:o.relValue,onChange:e=>s(t=>({...t,relValue:e.target.value}))}),(0,j.jsxs)(`select`,{className:$.relSelect,value:o.relUnit,onChange:e=>s(t=>({...t,relUnit:e.target.value})),children:[(0,j.jsx)(`option`,{value:`minutes`,children:`minutes`}),(0,j.jsx)(`option`,{value:`hours`,children:`hours`}),(0,j.jsx)(`option`,{value:`days`,children:`days`})]})]}):(0,j.jsx)(`input`,{className:$.input,type:`datetime-local`,value:o.atTime,onChange:e=>s(t=>({...t,atTime:e.target.value}))}),u&&(0,j.jsx)(`div`,{className:$.formErr,children:u}),f&&(0,j.jsx)(`div`,{className:$.formOk,children:f}),(0,j.jsxs)(`div`,{className:$.modalBtns,children:[(0,j.jsx)(`button`,{className:$.cancelModalBtn,onClick:()=>h(!1),children:`Cancel`}),(0,j.jsx)(`button`,{className:$.saveBtn,onClick:v,disabled:c,children:c?`Setting…`:`🔔 Set Reminder`})]})]})})]})}var In={root:`_root_atgeb_1`,icon:`_icon_atgeb_10`,title:`_title_atgeb_11`,sub:`_sub_atgeb_12`},Ln={dashboard:`⚡`,email:`📧`,calendar:`📅`,tasks:`✅`,contacts:`👤`,notes:`📝`,drive:`💾`,onedrive:`☁️`,mstodo:`📋`,github:`🐙`,slack:`💬`,notion:`📋`,collab:`🏛️`,maps:`🗺️`,cron:`⏰`,screen:`🖥️`,reminders:`🔔`,birthdays:`🎂`,settings:`⚙️`,agents:`🤖`,plan:`🗓️`,webcraft:`🔨`,connectors:`🔗`};function Rn({view:e}){let t=P();return(0,j.jsxs)(`div`,{className:In.root,children:[(0,j.jsx)(`div`,{className:In.icon,children:Ln[e]??`🔧`}),(0,j.jsx)(`div`,{className:In.title,children:e.charAt(0).toUpperCase()+e.slice(1)}),(0,j.jsx)(`div`,{className:In.sub,children:t(`common.comingSoon`)})]})}function zn({activeView:e}){switch(e){case`dashboard`:return(0,j.jsx)(mt,{});case`chat`:return(0,j.jsx)(Ce,{});case`email`:return(0,j.jsx)(Ht,{});case`calendar`:return(0,j.jsx)(Kt,{});case`tasks`:return(0,j.jsx)(gt,{});case`notes`:return(0,j.jsx)(Dt,{});case`contacts`:return(0,j.jsx)(At,{});case`birthdays`:return(0,j.jsx)(xt,{});case`cron`:return(0,j.jsx)(Tt,{});case`connectors`:return(0,j.jsx)(Lt,{});case`agents`:return(0,j.jsx)(Xt,{});case`drive`:return(0,j.jsx)($t,{});case`onedrive`:return(0,j.jsx)(bn,{});case`mstodo`:return(0,j.jsx)(Sn,{});case`github`:return(0,j.jsx)(en,{});case`slack`:return(0,j.jsx)(nn,{});case`notion`:return(0,j.jsx)(rn,{});case`collab`:return(0,j.jsx)(sn,{});case`plan`:return(0,j.jsx)(vn,{});case`screen`:return(0,j.jsx)(Tn,{});case`maps`:return(0,j.jsx)(jn,{});case`reminders`:return(0,j.jsx)(Fn,{});case`settings`:return(0,j.jsx)(yt,{});default:return(0,j.jsx)(Rn,{view:e})}}function Bn(){let{activeView:e}=ee();return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{style:{display:e===`studio`?`contents`:`none`},children:(0,j.jsx)(lt,{})}),(0,j.jsx)(`div`,{style:{display:e===`webcraft`?`contents`:`none`},children:(0,j.jsx)(mn,{})}),e!==`studio`&&e!==`webcraft`&&(0,j.jsx)(zn,{activeView:e})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(_.StrictMode,{children:(0,j.jsx)(de,{children:(0,j.jsx)(Bn,{})})}));
|
package/src/ui-dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
10
10
|
<title>NHA — NotHumanAllowed</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-BPc0ZESP.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-UUUprsdb.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|