@johpaz/hive-agents 1.1.5 → 1.1.11
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/README.md +4 -10
- package/dist/hive.js +218257 -148718
- package/dist/tool-worker.js +68422 -1622
- package/dist/ui/assets/{A2UIPage-Dr3p75oE.js → A2UIPage-v-VggXW3.js} +4 -4
- package/dist/ui/assets/{AgentCreateForm-DqYhH_gm.js → AgentCreateForm-Dr1l4Cvg.js} +1 -1
- package/dist/ui/assets/AgentDetailPage-Dsh_grrr.js +1 -0
- package/dist/ui/assets/{AgentNewPage-BRpFxJIT.js → AgentNewPage-D7557C0J.js} +1 -1
- package/dist/ui/assets/AgentsPage-C_Z56LL1.js +10 -0
- package/dist/ui/assets/{ApiClientPage-R9UDWfR2.js → ApiClientPage-uuBnrh0y.js} +1 -1
- package/dist/ui/assets/ChannelsPage-BI4mAgRU.js +8 -0
- package/dist/ui/assets/DashboardPage-BjAxvzYP.js +6 -0
- package/dist/ui/assets/LoginPage-D7IZKON0.js +1 -0
- package/dist/ui/assets/{LogsPage-DICMU_7m.js → LogsPage-mcqOYvGw.js} +1 -1
- package/dist/ui/assets/MeetingPage-qPJ1z5HA.js +1 -0
- package/dist/ui/assets/ModelSelector-njfNhkng.js +1 -0
- package/dist/ui/assets/{NotFound-D4ZlDVg9.js → NotFound-DY8e1RKh.js} +1 -1
- package/dist/ui/assets/{Office3DPage-31AMJ-LN.css → Office3DPage-C3SIzd2H.css} +1 -1
- package/dist/ui/assets/Office3DPage-Du42LRwi.js +319 -0
- package/dist/ui/assets/ProvidersPage-GDCJs8Zb.js +1 -0
- package/dist/ui/assets/{RecoverPage-Blms3NBa.js → RecoverPage-B6qvBBIl.js} +1 -1
- package/dist/ui/assets/SettingsPage-Br4PfWuc.js +9 -0
- package/dist/ui/assets/{SetupPage-CAjLseE_.js → SetupPage-OaouFLGD.js} +1 -1
- package/dist/ui/assets/{Vignette-DrI2yK2m.js → Vignette-GSZ-owcN.js} +17 -17
- package/dist/ui/assets/VoicePage-DRQZBl3j.js +307 -0
- package/dist/ui/assets/WebChatPage-Cypq-SYi.js +29 -0
- package/dist/ui/assets/{agentCapabilities-CDSfJWhw.js → agentCapabilities-Bf71Gir4.js} +1 -1
- package/dist/ui/assets/{alert-CjiX20jI.js → alert-Dn604uVs.js} +1 -1
- package/dist/ui/assets/{badge-B5AKge1b.js → badge-C6H33ePv.js} +1 -1
- package/dist/ui/assets/{card-mTJ4oZbL.js → card-D0qneq1i.js} +1 -1
- package/dist/ui/assets/{conversationsStore-DhM07qYi.js → conversationsStore-D6XgjMr1.js} +1 -1
- package/dist/ui/assets/{dialog-BP3GTCPn.js → dialog-DO1fQCF7.js} +1 -1
- package/dist/ui/assets/dist-js-C2MfmbEW.js +1 -0
- package/dist/ui/assets/{dist-js-CkNhvsFc.js → dist-js-Djxbxbst.js} +1 -1
- package/dist/ui/assets/google-external-e9lvWjy4.js +1 -0
- package/dist/ui/assets/index-BKNFH2al.css +2 -0
- package/dist/ui/assets/index-U0e4e5mL.js +156 -0
- package/dist/ui/assets/{key-DPkOY-J0.js → key-round-Ca0Ns34v.js} +1 -1
- package/dist/ui/assets/{label-D_fvqJyD.js → label-CvAtVE-v.js} +1 -1
- package/dist/ui/assets/{scroll-area-CbH8FOo8.js → scroll-area-CYMu7sU0.js} +1 -1
- package/dist/ui/assets/select-BjBXxyxL.js +1 -0
- package/dist/ui/assets/{slider-DXS4h1LB.js → slider-DR31eN3r.js} +1 -1
- package/dist/ui/assets/{switch-ndx8VCpm.js → switch-B5dAwb54.js} +1 -1
- package/dist/ui/assets/{tabs-epu-3Tl4.js → tabs-Ct92cLXr.js} +1 -1
- package/dist/ui/assets/{earth-BJRGJbVn.js → terminal-CpBDERBE.js} +1 -1
- package/dist/ui/assets/{textarea-BgZJFZTX.js → textarea-xtFAVuPf.js} +1 -1
- package/dist/ui/assets/{useAudioDevices-zj0fuGwZ.js → useAudioDevices-wZArmV3m.js} +1 -1
- package/dist/ui/assets/{useHiveAgentsModelLoad-Cd9p-bjs.js → useHiveAgentsModelLoad-CqJkzTOT.js} +1 -1
- package/dist/ui/assets/useOfficeModel-DZvwZRCw.js +1 -0
- package/dist/ui/assets/{useProviders-Dj1k5PCk.js → useProviders-CeSzDnx-.js} +1 -1
- package/dist/ui/assets/vendor-router-DxU0Uf4R.js +3 -0
- package/dist/ui/index.html +5 -5
- package/package.json +1 -3
- package/packages/cli/src/commands/onboard.ts +3 -2
- package/packages/core/src/agent/agent-catalog.ts +98 -1
- package/packages/core/src/agent/agent-loop.ts +5 -44
- package/packages/core/src/agent/context-compiler.ts +6 -94
- package/packages/core/src/agent/conversation-store.ts +23 -1
- package/packages/core/src/agent/llm-providers/openai-compat-base.ts +1 -1
- package/packages/core/src/agent/minimal-loadout.ts +1 -0
- package/packages/core/src/agent/prompt-builder.ts +17 -1
- package/packages/core/src/agent/tool-selector.ts +12 -0
- package/packages/core/src/artifacts/store.ts +73 -9
- package/packages/core/src/canvas/emitter.ts +0 -19
- package/packages/core/src/channels/base.ts +26 -0
- package/packages/core/src/channels/discord.ts +18 -2
- package/packages/core/src/channels/slack.ts +37 -7
- package/packages/core/src/channels/telegram.ts +39 -11
- package/packages/core/src/channels/whatsapp.ts +16 -1
- package/packages/core/src/gateway/channel-notify.ts +42 -0
- package/packages/core/src/gateway/google-host.ts +228 -0
- package/packages/core/src/gateway/initializer.ts +8 -0
- package/packages/core/src/gateway/routes/agents.ts +14 -0
- package/packages/core/src/gateway/routes/artifacts.ts +4 -0
- package/packages/core/src/gateway/routes/auth.ts +25 -3
- package/packages/core/src/gateway/routes/chat.ts +14 -1
- package/packages/core/src/gateway/routes/google.ts +252 -0
- package/packages/core/src/gateway/routes/meeting.ts +11 -3
- package/packages/core/src/gateway/routes/models.ts +27 -11
- package/packages/core/src/gateway/routes/multimodal.ts +38 -0
- package/packages/core/src/gateway/routes/providers.ts +19 -18
- package/packages/core/src/gateway/routes/system.ts +1 -3
- package/packages/core/src/gateway/routes/tts-local.ts +20 -374
- package/packages/core/src/gateway/routes/voice.ts +29 -35
- package/packages/core/src/gateway/server.ts +97 -48
- package/packages/core/src/gateway/tts/README.md +7 -86
- package/packages/core/src/gateway/tts/build.py +105 -0
- package/packages/core/src/gateway/tts/kitten.ts +282 -0
- package/packages/core/src/gateway/tts/python.d.ts +4 -0
- package/packages/core/src/gateway/tts/src/detect.ts +33 -39
- package/packages/core/src/gateway/tts/worker.py +80 -0
- package/packages/core/src/gateway/webchat-turn.ts +15 -13
- package/packages/core/src/google/client.ts +123 -0
- package/packages/core/src/google/config.ts +60 -0
- package/packages/core/src/google/google.test.ts +287 -0
- package/packages/core/src/google/index.ts +5 -0
- package/packages/core/src/google/oauth.ts +144 -0
- package/packages/core/src/google/scopes.ts +41 -0
- package/packages/core/src/google/token-store.ts +33 -0
- package/packages/core/src/multimodal/attachment-ingest.ts +190 -0
- package/packages/core/src/multimodal/image-generation.ts +244 -0
- package/packages/core/src/multimodal/vision-analyzer.ts +94 -0
- package/packages/core/src/multimodal/vision-service.ts +25 -0
- package/packages/core/src/storage/collections.ts +8 -8
- package/packages/core/src/storage/google-capabilities.ts +91 -0
- package/packages/core/src/storage/model-activation.ts +18 -0
- package/packages/core/src/storage/model-sync.ts +66 -14
- package/packages/core/src/storage/onboarding.ts +10 -2
- package/packages/core/src/storage/seed.ts +107 -24
- package/packages/core/src/storage/usage.ts +0 -52
- package/packages/core/src/tool-runtime/index.ts +2 -0
- package/packages/core/src/tools/agents/get-available-models.ts +1 -3
- package/packages/core/src/tools/core/index.ts +80 -2
- package/packages/core/src/tools/google/calendar.ts +204 -0
- package/packages/core/src/tools/google/drive.ts +160 -0
- package/packages/core/src/tools/google/gmail.ts +579 -0
- package/packages/core/src/tools/google/index.ts +18 -0
- package/packages/core/src/tools/google/shared.ts +80 -0
- package/packages/core/src/tools/image/image-generate.ts +90 -0
- package/packages/core/src/tools/image/index.ts +13 -0
- package/packages/core/src/tools/image/office-leer-imagenes.ts +198 -0
- package/packages/core/src/tools/index.ts +27 -0
- package/packages/core/src/tools/office/index.ts +9 -0
- package/packages/core/src/tools/office/office-editar-docx.ts +184 -0
- package/packages/core/src/tools/office/office-editar-pptx.ts +126 -0
- package/packages/core/src/tools/office/office-editar-xlsx.ts +122 -0
- package/packages/core/src/tools/office/office-escribir-docx.ts +3 -2
- package/packages/core/src/tools/office/office-escribir-pdf.ts +3 -2
- package/packages/core/src/tools/office/office-escribir-pptx.ts +3 -2
- package/packages/core/src/tools/office/office-escribir-xlsx.ts +3 -2
- package/packages/core/src/tools/office/office-images.ts +137 -0
- package/packages/core/src/tools/office/office-leer-docx.ts +16 -3
- package/packages/core/src/tools/office/office-leer-pdf.ts +41 -57
- package/packages/core/src/tools/office/office-leer-pptx.ts +54 -88
- package/packages/core/src/tools/office/office-leer-xlsx.ts +6 -2
- package/packages/core/src/tools/office/office-pdf-images.ts +225 -0
- package/packages/core/src/tools/office/pdf-text.ts +186 -0
- package/packages/core/src/tools/office/pptx-slides.ts +83 -0
- package/packages/core/src/tools/office/resolve-input.ts +49 -0
- package/packages/core/src/tools/web/browser-screenshot.ts +7 -0
- package/packages/core/src/voice/index.ts +123 -155
- package/packages/core/src/voice/local-model.ts +8 -0
- package/packages/core/src/voice/stt-models.ts +39 -0
- package/packages/skills/src/bundled/google/google_calendar/SKILL.md +51 -0
- package/packages/skills/src/bundled/google/google_drive/SKILL.md +50 -0
- package/packages/skills/src/bundled/google/google_gmail/SKILL.md +61 -0
- package/packages/skills/src/bundled-data.generated.ts +45 -0
- package/dist/ui/assets/AgentDetailPage-BVtE88U5.js +0 -1
- package/dist/ui/assets/AgentsPage-BOIJ55cj.js +0 -10
- package/dist/ui/assets/ChannelsPage-C5V2BmjL.js +0 -8
- package/dist/ui/assets/DashboardPage-B18gMzNj.js +0 -6
- package/dist/ui/assets/LoginPage-nrsYF9AY.js +0 -1
- package/dist/ui/assets/MeetingPage-xslJGfIz.js +0 -1
- package/dist/ui/assets/ModelSelector-BX4IvuYY.js +0 -1
- package/dist/ui/assets/Office3DPage-a6cuzt5X.js +0 -727
- package/dist/ui/assets/ProvidersPage-C8-xGoeh.js +0 -1
- package/dist/ui/assets/SettingsPage-BBeeq_QS.js +0 -9
- package/dist/ui/assets/VoicePage-BeSSYstD.js +0 -307
- package/dist/ui/assets/WebChatPage-Bat7uUfd.js +0 -29
- package/dist/ui/assets/dist-js-jWCEHSkB.js +0 -1
- package/dist/ui/assets/index-BG3nUPKq.js +0 -156
- package/dist/ui/assets/index-DmFPF9xQ.css +0 -2
- package/dist/ui/assets/lock-open-v0EphssG.js +0 -1
- package/dist/ui/assets/select-v_3QBYrD.js +0 -1
- package/dist/ui/assets/terminal-BEcTK780.js +0 -1
- package/dist/ui/assets/useOfficeModel-BaDn7U-X.js +0 -1
- package/dist/ui/assets/vendor-router-DSMCk-Ka.js +0 -3
- package/packages/core/src/agent/jev-decisions.ts +0 -242
- package/packages/core/src/agent/jev-planner.ts +0 -293
- package/packages/core/src/gateway/tts/package.json +0 -25
- package/packages/core/src/gateway/tts/src/client.ts +0 -59
- package/packages/core/src/gateway/tts/src/index.ts +0 -15
- package/packages/core/src/gateway/tts/src/install.ts +0 -137
- package/packages/core/src/gateway/tts/src/models.ts +0 -50
- package/packages/core/src/gateway/tts/src/server.ts +0 -253
- /package/dist/ui/assets/{core-p4c5dns5.js → core-npANj14X.js} +0 -0
- /package/dist/ui/assets/{download-BQXrpH0m.js → download-D0aDV8Y_.js} +0 -0
- /package/dist/ui/assets/{ellipsis-vertical-D7uFJLGh.js → ellipsis-vertical-BOW_iEOO.js} +0 -0
- /package/dist/ui/assets/{external-link-6oTH9pUM.js → external-link-DNJH7epD.js} +0 -0
- /package/dist/ui/assets/{eye-CxvxtQT5.js → eye-BVfTWOME.js} +0 -0
- /package/dist/ui/assets/{file-text-D5ZJEx3E.js → file-text-ByqNMpXm.js} +0 -0
- /package/dist/ui/assets/{gateway-url-BALS_wVh.js → gateway-url-BzQV75Ig.js} +0 -0
- /package/dist/ui/assets/{gauge-CEu7PhTW.js → gauge-CB4np0Vz.js} +0 -0
- /package/dist/ui/assets/{history-DLK5rTlP.js → history-CbhJX41s.js} +0 -0
- /package/dist/ui/assets/{info-8ReWzubE.js → info-BCD3-QX9.js} +0 -0
- /package/dist/ui/assets/{lock-3IApZyVy.js → lock-DpBean4K.js} +0 -0
- /package/dist/ui/assets/{mail-vwCEHyhQ.js → mail-Biwn8WrV.js} +0 -0
- /package/dist/ui/assets/{mic-CpDU_2as.js → mic-Rq4BxU1R.js} +0 -0
- /package/dist/ui/assets/{pause-BAMsNQkh.js → pause-87NGXbsz.js} +0 -0
- /package/dist/ui/assets/{pencil-CKritjT_.js → pencil-BG8EFaS3.js} +0 -0
- /package/dist/ui/assets/{play-Cwpe4tp6.js → play-D3De6YsQ.js} +0 -0
- /package/dist/ui/assets/{plus-RD44ce15.js → plus-Bp8-V68t.js} +0 -0
- /package/dist/ui/assets/{radio-lFPMHi6-.js → radio-m7rzuDKK.js} +0 -0
- /package/dist/ui/assets/{refresh-cw-DtJMHRHO.js → refresh-cw-D6F1zoC6.js} +0 -0
- /package/dist/ui/assets/{rotate-ccw-b3E_4PoX.js → rotate-ccw-DUlEC1_D.js} +0 -0
- /package/dist/ui/assets/{search-z2oZt00P.js → search-CfNwwpMW.js} +0 -0
- /package/dist/ui/assets/{send-CpoY_2F-.js → send-CI868CBV.js} +0 -0
- /package/dist/ui/assets/{settings-qV3kVkeG.js → settings-AEM2uWiD.js} +0 -0
- /package/dist/ui/assets/{shield-CIarwBvx.js → shield-DvVIcbzd.js} +0 -0
- /package/dist/ui/assets/{sparkles-DVvY6jDT.js → sparkles-DRe4GbSH.js} +0 -0
- /package/dist/ui/assets/{square-D5zdNkAY.js → square-DTWkjTT3.js} +0 -0
- /package/dist/ui/assets/{trash-2-D6oziYAK.js → trash-2-BZsMCfso.js} +0 -0
- /package/dist/ui/assets/{utils-DEmd_M8c.js → utils-lc8H6VGT.js} +0 -0
- /package/dist/ui/assets/{volume-2-EaA0JRvD.js → volume-2-CBMYsuF3.js} +0 -0
- /package/dist/ui/assets/{volume-x-CROXNMGT.js → volume-x-vNFf2e4-.js} +0 -0
- /package/dist/ui/assets/{wifi-BUJuOcgP.js → wifi-DNv53AfN.js} +0 -0
- /package/dist/ui/assets/{zap-DSoX9NDk.js → zap-Yed86Sh8.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./arrow-left-WyDPYZXU.js";import{t as o}from"./arrow-right-BuNjN-bk.js";import{t as s}from"./calendar-B6x9cw-q.js";import{t as c}from"./check-C8pw-7Fx.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./download-
|
|
2
|
-
`?(0,J.jsx)(`br`,{},t):e}function De(e,t,n,r){let i=[];for(let a of e)X(a,t,n,r)||i.push({message:a.message??`Validation failed: ${a.call}`});return{valid:i.length===0,errors:i}}function X(e,t,n,r){if(e.condition)return I(e.condition,t,n,r)===!0;let i=I({call:e.call,args:e.args??{}},t,n,r);return i===!0||i===`true`}function Oe(e,t,n,r){if(!e||e.length===0)return!1;for(let i of e)if(!X(i,t,n,r))return!0;return!1}function ke(e){let t=(0,q.c)(21),{def:n,ctx:r}=e,i=n.action,a=n.variant??`primary`,o;t[0]!==r||t[1]!==n.checks||t[2]!==n.disabled?(o=n.disabled===!0||Oe(n.checks,r.dataModel,r.scopeData),t[0]=r,t[1]=n.checks,t[2]=n.disabled,t[3]=o):o=t[3];let s=o,c=a===`primary`?`bg-blue-600 hover:bg-blue-500 text-white font-bold`:a===`borderless`?`text-white/70 hover:text-white hover:bg-white/5`:`bg-white/5 hover:bg-white/10 text-white/70 border border-white/10`,l;t[4]!==i||t[5]!==r||t[6]!==n.id||t[7]!==s?(l=()=>{if(s)return;let e=i?.event??i,t=e?.name;if(!t)return;let a={},o=e.context??{};for(let[e,t]of Object.entries(o))
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./arrow-left-WyDPYZXU.js";import{t as o}from"./arrow-right-BuNjN-bk.js";import{t as s}from"./calendar-B6x9cw-q.js";import{t as c}from"./check-C8pw-7Fx.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./download-D0aDV8Y_.js";import{t as d}from"./ellipsis-vertical-BOW_iEOO.js";import{n as f,t as p}from"./slider-DR31eN3r.js";import{n as m,t as h}from"./eye-BVfTWOME.js";import{t as g}from"./info-BCD3-QX9.js";import{t as _}from"./lock-DpBean4K.js";import{t as v}from"./mail-Biwn8WrV.js";import{t as y}from"./pencil-BG8EFaS3.js";import{t as b}from"./plus-Bp8-V68t.js";import{t as x}from"./refresh-cw-D6F1zoC6.js";import{t as S}from"./search-CfNwwpMW.js";import{t as C}from"./send-CI868CBV.js";import{t as w}from"./settings-AEM2uWiD.js";import{t as T}from"./trash-2-BZsMCfso.js";import{n as E,t as D}from"./wifi-DNv53AfN.js";import{l as O}from"./vendor-router-DxU0Uf4R.js";import{B as k,G as A,H as ee,K as j,M as te,N as ne,Q as re,R as M,U as ie,V as ae,W as N,ht as oe,lt as P,nt as F,rt as se,z as I}from"./index-U0e4e5mL.js";import{t as ce}from"./badge-C6H33ePv.js";import{t as le}from"./scroll-area-CYMu7sU0.js";import{i as ue,n as L,r as R,t as z}from"./tabs-Ct92cLXr.js";import{c as B,i as V,r as H,s as U,t as de}from"./dialog-DO1fQCF7.js";var fe=i(`Camera`,[[`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`,key:`1tc9qg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),W=i(`CircleHelp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),pe=i(`CreditCard`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]),me=i(`Folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),G=i(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),he=i(`House`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),ge=i(`Image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),_e=i(`LockOpen`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),ve=i(`MapPin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),ye=i(`Phone`,[[`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z`,key:`foiqr5`}]]),be=i(`Printer`,[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]),xe=i(`Share2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Se=i(`ShoppingCart`,[[`circle`,{cx:`8`,cy:`21`,r:`1`,key:`jimo8o`}],[`circle`,{cx:`19`,cy:`21`,r:`1`,key:`13723u`}],[`path`,{d:`M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12`,key:`9zh506`}]]),Ce=i(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),we=i(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),K=e(t(),1),q=n(),J=r(),Y={h1:`text-2xl font-black text-white`,h2:`text-xl font-bold text-white`,h3:`text-base font-bold text-white`,h4:`text-sm font-semibold text-white/90`,h5:`text-xs font-semibold text-white/80`,body:`text-sm text-white/70 leading-relaxed`,caption:`text-xs text-white/40`,label:`text-xs font-semibold text-white/50 uppercase tracking-wider`,code:`font-mono text-xs text-green-300 bg-black/40 rounded-lg p-3 leading-relaxed whitespace-pre-wrap break-all`};function Te(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,i,a,o,s;if(t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.text||t[3]!==n.usageHint||t[4]!==n.variant||t[5]!==n.weight){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e=N(n.text,r.dataModel,r.scopeData),c=n.variant??n.usageHint??`body`,l=Y[c]??Y.body;if(c===`code`){s=(0,J.jsx)(`pre`,{className:l,children:e});break bb0}let u=e.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\n)/g);i=l,t[10]===n.weight?a=t[11]:(a=n.weight?{flex:n.weight}:void 0,t[10]=n.weight,t[11]=a),o=u.map(Ee)}t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.text,t[3]=n.usageHint,t[4]=n.variant,t[5]=n.weight,t[6]=i,t[7]=a,t[8]=o,t[9]=s}else i=t[6],a=t[7],o=t[8],s=t[9];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[12]!==i||t[13]!==a||t[14]!==o?(c=(0,J.jsx)(`p`,{className:i,style:a,children:o}),t[12]=i,t[13]=a,t[14]=o,t[15]=c):c=t[15],c}function Ee(e,t){return e.startsWith(`**`)&&e.endsWith(`**`)?(0,J.jsx)(`strong`,{className:`font-bold`,children:e.slice(2,-2)},t):e.startsWith(`*`)&&e.endsWith(`*`)?(0,J.jsx)(`em`,{className:`italic`,children:e.slice(1,-1)},t):e.startsWith("`")&&e.endsWith("`")?(0,J.jsx)(`code`,{className:`font-mono text-green-300 bg-black/30 px-1 rounded text-[0.9em]`,children:e.slice(1,-1)},t):e===`
|
|
2
|
+
`?(0,J.jsx)(`br`,{},t):e}function De(e,t,n,r){let i=[];for(let a of e)X(a,t,n,r)||i.push({message:a.message??`Validation failed: ${a.call}`});return{valid:i.length===0,errors:i}}function X(e,t,n,r){if(e.condition)return I(e.condition,t,n,r)===!0;let i=I({call:e.call,args:e.args??{}},t,n,r);return i===!0||i===`true`}function Oe(e,t,n,r){if(!e||e.length===0)return!1;for(let i of e)if(!X(i,t,n,r))return!0;return!1}function ke(e){let t=(0,q.c)(21),{def:n,ctx:r}=e,i=n.action,a=n.variant??`primary`,o;t[0]!==r||t[1]!==n.checks||t[2]!==n.disabled?(o=n.disabled===!0||Oe(n.checks,r.dataModel,r.scopeData),t[0]=r,t[1]=n.checks,t[2]=n.disabled,t[3]=o):o=t[3];let s=o,c=a===`primary`?`bg-blue-600 hover:bg-blue-500 text-white font-bold`:a===`borderless`?`text-white/70 hover:text-white hover:bg-white/5`:`bg-white/5 hover:bg-white/10 text-white/70 border border-white/10`,l;t[4]!==i||t[5]!==r||t[6]!==n.id||t[7]!==s?(l=()=>{if(s)return;let e=i?.event??i,t=e?.name;if(!t)return;let a={},o=e.context??{};for(let[e,t]of Object.entries(o))ae(t)?a[e]=j(t.path,r.dataModel,r.scopeData):k(t)?a[e]=I(t,r.dataModel,r.scopeData):a[e]=t;r.onAction(t,a,n.id)},t[4]=i,t[5]=r,t[6]=n.id,t[7]=s,t[8]=l):l=t[8];let u=l,d=`w-full py-2.5 rounded-xl text-sm transition-all disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${c}`,f;t[9]===n.weight?f=t[10]:(f=n.weight?{flex:n.weight}:void 0,t[9]=n.weight,t[10]=f);let p;t[11]!==r||t[12]!==n.child||t[13]!==n.text?(p=n.child?(0,J.jsx)(Q,{...r,id:n.child}):N(n.text,r.dataModel,r.scopeData)||`Button`,t[11]=r,t[12]=n.child,t[13]=n.text,t[14]=p):p=t[14];let m;return t[15]!==s||t[16]!==u||t[17]!==d||t[18]!==f||t[19]!==p?(m=(0,J.jsx)(`button`,{onClick:u,disabled:s,className:d,style:f,children:p}),t[15]=s,t[16]=u,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20],m}var Ae={start:`flex-start`,end:`flex-end`,center:`center`,spaceBetween:`space-between`,spaceAround:`space-around`,spaceEvenly:`space-evenly`};function je(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=Ae[String(n.justify??n.distribution??`start`)]??`flex-start`,a=n.align??n.alignment,o=a===`center`?`center`:a===`end`?`flex-end`:a===`stretch`?`stretch`:`flex-start`,s;t[0]===n.weight?s=t[1]:(s=n.weight?{flex:n.weight}:{},t[0]=n.weight,t[1]=s);let c;t[2]!==o||t[3]!==i||t[4]!==s?(c={justifyContent:i,alignItems:o,...s},t[2]=o,t[3]=i,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==r||t[7]!==n.children?(l=$(n.children,r),t[6]=r,t[7]=n.children,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,J.jsx)(`div`,{className:`flex flex-row gap-2`,style:c,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}var Me={start:`flex-start`,end:`flex-end`,center:`center`,spaceBetween:`space-between`,spaceAround:`space-around`,spaceEvenly:`space-evenly`};function Ne(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=Me[String(n.justify??n.distribution??`start`)]??`flex-start`,a=n.align??n.alignment,o=a===`center`?`center`:a===`end`?`flex-end`:a===`stretch`?`stretch`:`flex-start`,s;t[0]===n.weight?s=t[1]:(s=n.weight?{flex:n.weight}:{},t[0]=n.weight,t[1]=s);let c;t[2]!==o||t[3]!==i||t[4]!==s?(c={justifyContent:i,alignItems:o,...s},t[2]=o,t[3]=i,t[4]=s,t[5]=c):c=t[5];let l;t[6]!==r||t[7]!==n.children?(l=$(n.children,r),t[6]=r,t[7]=n.children,t[8]=l):l=t[8];let u;return t[9]!==c||t[10]!==l?(u=(0,J.jsx)(`div`,{className:`flex flex-col gap-3`,style:c,children:l}),t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Pe(e){let t=(0,q.c)(8),{def:n,ctx:r}=e,i;t[0]===n.weight?i=t[1]:(i={background:`rgba(255,255,255,0.03)`,borderColor:`rgba(255,255,255,0.08)`,...n.weight?{flex:n.weight}:{}},t[0]=n.weight,t[1]=i);let a;t[2]!==r||t[3]!==n.child?(a=n.child&&(0,J.jsx)(Q,{...r,id:n.child}),t[2]=r,t[3]=n.child,t[4]=a):a=t[4];let o;return t[5]!==i||t[6]!==a?(o=(0,J.jsx)(`div`,{className:`rounded-xl border p-4`,style:i,children:a}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function Fe(e){let t=(0,q.c)(12),{def:n,ctx:r}=e,i=n.direction===`horizontal`?`flex-row`:`flex-col`;if(n.children){let e=`flex ${i} gap-2 overflow-x-auto pb-1`,a;t[0]===n.weight?a=t[1]:(a=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=a);let o;t[2]!==r||t[3]!==n.children?(o=$(n.children,r),t[2]=r,t[3]=n.children,t[4]=o):o=t[4];let s;return t[5]!==e||t[6]!==a||t[7]!==o?(s=(0,J.jsx)(`div`,{className:e,style:a,children:o}),t[5]=e,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}if(n.child){let e;return t[9]!==r||t[10]!==n.child?(e=(0,J.jsx)(Q,{...r,id:n.child}),t[9]=r,t[10]=n.child,t[11]=e):e=t[11],e}return null}function Ie(e){let t=(0,q.c)(5),{def:n}=e,r=n.axis===`vertical`?`w-px bg-white/[0.06] self-stretch`:`h-px bg-white/[0.06] w-full`,i;t[0]===n.weight?i=t[1]:(i=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,J.jsx)(`div`,{className:r,style:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}var Le={contain:`contain`,cover:`cover`,fill:`fill`,none:`none`,"scale-down":`scale-down`},Re={icon:`w-8 h-8`,avatar:`w-12 h-12 rounded-full`,smallFeature:`w-24 h-24`,mediumFeature:`w-48 h-48`,largeFeature:`w-64 h-64`,header:`w-full h-48`};function ze(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.url?(i=N(n.url,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.url,t[3]=i):i=t[3];let a=i;if(!a)return null;let o=Le[n.fit??`contain`]??`contain`,s=Re[n.usageHint??``]??``,c=typeof n.alt==`string`?n.alt:``,l=`rounded-xl overflow-hidden border border-white/[0.08] ${s}`,u;t[4]===n.weight?u=t[5]:(u=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=u);let d=o,f;t[6]===d?f=t[7]:(f={objectFit:d},t[6]=d,t[7]=f);let p;t[8]!==c||t[9]!==f||t[10]!==a?(p=(0,J.jsx)(`img`,{src:a,alt:c,className:`w-full max-h-64 block`,style:f}),t[8]=c,t[9]=f,t[10]=a,t[11]=p):p=t[11];let m;return t[12]!==l||t[13]!==u||t[14]!==p?(m=(0,J.jsx)(`div`,{className:l,style:u,children:p}),t[12]=l,t[13]=u,t[14]=p,t[15]=m):m=t[15],m}var Be={settings:w,home:he,search:S,mail:v,call:ye,camera:fe,calendarToday:s,star:Ce,check:c,close:re,delete:T,download:u,upload:we,edit:y,refresh:x,send:C,share:xe,shoppingCart:Se,warning:se,info:g,error:l,favorite:G,favoriteOff:G,folder:me,help:W,lock:_,lockOpen:_e,visibility:h,visibilityOff:m,add:b,arrowBack:a,arrowForward:o,accountCircle:F,notifications:oe,moreVert:d,moreHoriz:f,locationOn:ve,payment:pe,photo:ge,print:be,person:F};function Ve(e){let t=(0,q.c)(5),{def:n,ctx:r}=e,i=Be[N(n.name,r.dataModel,r.scopeData)]??W,a;t[0]===n.weight?a=t[1]:(a=n.weight?{flex:n.weight}:void 0,t[0]=n.weight,t[1]=a);let o;return t[2]!==i||t[3]!==a?(o=(0,J.jsx)(i,{className:`text-white/70`,style:a}),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function He(e){let t=(0,q.c)(56),{def:n,ctx:r}=e,i=(typeof n.value==`object`&&n.value,n.value),a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let[o,s]=(0,K.useState)(a),c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==n.label?(c=N(n.label,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=n.label,t[7]=c):c=t[7];let l=c,u;t[8]!==r.dataModel||t[9]!==r.scopeData||t[10]!==n.placeholder?(u=N(n.placeholder,r.dataModel,r.scopeData),t[8]=r.dataModel,t[9]=r.scopeData,t[10]=n.placeholder,t[11]=u):u=t[11];let d=u,f=n.variant??n.textFieldType??`shortText`,p=f===`code`||f===`multiline_code`,m=f===`longText`||p||f===`multiline`,h;bb0:{if(n.checks){let e;t[12]!==r.dataModel||t[13]!==r.scopeData||t[14]!==n.checks?(e=De(n.checks,r.dataModel,r.scopeData),t[12]=r.dataModel,t[13]=r.scopeData,t[14]=n.checks,t[15]=e):e=t[15],h=e;break bb0}if(n.validationRegexp&&o){let e;t[16]!==n.validationRegexp||t[17]!==o?(e=new RegExp(n.validationRegexp).test(o),t[16]=n.validationRegexp,t[17]=o,t[18]=e):e=t[18];let r=e,i;t[19]===r?i=t[20]:(i=r?{valid:!0,errors:[]}:{valid:!1,errors:[{message:`Formato inválido`}]},t[19]=r,t[20]=i),h=i;break bb0}let e;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(e={valid:!0,errors:[]},t[21]=e):e=t[21],h=e}let g=h,_;t[22]!==r||t[23]!==n.value?(_=e=>{if(s(e.target.value),typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e.target.value,r})}},t[22]=r,t[23]=n.value,t[24]=_):_=t[24];let v=_,y;t[25]!==r||t[26]!==n.action||t[27]!==n.id?(y=e=>{let t=n.action,i=(t?.event??t)?.name;i&&r.onAction(i,{value:e},n.id)},t[25]=r,t[26]=n.action,t[27]=n.id,t[28]=y):y=t[28];let b=y,x;t[29]===b?x=t[30]:(x=e=>{b(e.target.value)},t[29]=b,t[30]=x);let S=x,C;t[31]!==b||t[32]!==m?(C=e=>{e.key===`Enter`&&!m&&b(e.target.value)},t[31]=b,t[32]=m,t[33]=C):C=t[33];let w=C,T=`w-full rounded-xl border px-3 py-2.5 text-sm resize-none outline-none transition-all
|
|
3
3
|
bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06]
|
|
4
4
|
disabled:opacity-50 placeholder:text-white/20
|
|
5
5
|
${p?`font-mono text-green-300 leading-relaxed`:`text-white/80 leading-relaxed`}
|
|
6
|
-
${g.valid?``:`border-red-500/50`}`,E;t[34]===n.weight?E=t[35]:(E=n.weight?{flex:n.weight}:void 0,t[34]=n.weight,t[35]=E);let D;t[36]===l?D=t[37]:(D=l&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:l}),t[36]=l,t[37]=D);let O;t[38]!==S||t[39]!==v||t[40]!==w||t[41]!==T||t[42]!==p||t[43]!==m||t[44]!==o||t[45]!==d||t[46]!==f?(O=m?(0,J.jsx)(`textarea`,{value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,rows:p?5:3,className:T}):(0,J.jsx)(`input`,{type:f===`obscured`?`password`:f===`number`?`number`:`text`,value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,className:T}),t[38]=S,t[39]=v,t[40]=w,t[41]=T,t[42]=p,t[43]=m,t[44]=o,t[45]=d,t[46]=f,t[47]=O):O=t[47];let k;t[48]!==g.errors||t[49]!==g.valid?(k=!g.valid&&g.errors.length>0&&(0,J.jsx)(`p`,{className:`text-xs text-red-400`,children:g.errors[0].message}),t[48]=g.errors,t[49]=g.valid,t[50]=k):k=t[50];let A;return t[51]!==E||t[52]!==D||t[53]!==O||t[54]!==k?(A=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:E,children:[D,O,k]}),t[51]=E,t[52]=D,t[53]=O,t[54]=k,t[55]=A):A=t[55],A}function Ue(e){let t=(0,q.c)(22),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.label?(i=N(n.label,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.label,t[3]=i):i=t[3];let a=i,o=n.value,s;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==o?(s=
|
|
6
|
+
${g.valid?``:`border-red-500/50`}`,E;t[34]===n.weight?E=t[35]:(E=n.weight?{flex:n.weight}:void 0,t[34]=n.weight,t[35]=E);let D;t[36]===l?D=t[37]:(D=l&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:l}),t[36]=l,t[37]=D);let O;t[38]!==S||t[39]!==v||t[40]!==w||t[41]!==T||t[42]!==p||t[43]!==m||t[44]!==o||t[45]!==d||t[46]!==f?(O=m?(0,J.jsx)(`textarea`,{value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,rows:p?5:3,className:T}):(0,J.jsx)(`input`,{type:f===`obscured`?`password`:f===`number`?`number`:`text`,value:o,onChange:v,onBlur:S,onKeyDown:w,placeholder:d,className:T}),t[38]=S,t[39]=v,t[40]=w,t[41]=T,t[42]=p,t[43]=m,t[44]=o,t[45]=d,t[46]=f,t[47]=O):O=t[47];let k;t[48]!==g.errors||t[49]!==g.valid?(k=!g.valid&&g.errors.length>0&&(0,J.jsx)(`p`,{className:`text-xs text-red-400`,children:g.errors[0].message}),t[48]=g.errors,t[49]=g.valid,t[50]=k):k=t[50];let A;return t[51]!==E||t[52]!==D||t[53]!==O||t[54]!==k?(A=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:E,children:[D,O,k]}),t[51]=E,t[52]=D,t[53]=O,t[54]=k,t[55]=A):A=t[55],A}function Ue(e){let t=(0,q.c)(22),{def:n,ctx:r}=e,i;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==n.label?(i=N(n.label,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=n.label,t[3]=i):i=t[3];let a=i,o=n.value,s;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==o?(s=ee(o,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=o,t[7]=s):s=t[7];let[c,l]=(0,K.useState)(s),u;t[8]!==r||t[9]!==n.value?(u=e=>{if(l(e.target.checked),typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e.target.checked,r})}},t[8]=r,t[9]=n.value,t[10]=u):u=t[10];let d=u,f;t[11]===n.weight?f=t[12]:(f=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=f);let p;t[13]!==d||t[14]!==c?(p=(0,J.jsx)(`input`,{type:`checkbox`,checked:c,onChange:d,className:`w-4 h-4 rounded border-white/20 bg-white/5 text-blue-500 focus:ring-blue-500/30`}),t[13]=d,t[14]=c,t[15]=p):p=t[15];let m;t[16]===a?m=t[17]:(m=(0,J.jsx)(`span`,{className:`text-sm text-white/70`,children:a}),t[16]=a,t[17]=m);let h;return t[18]!==f||t[19]!==p||t[20]!==m?(h=(0,J.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer`,style:f,children:[p,m]}),t[18]=f,t[19]=p,t[20]=m,t[21]=h):h=t[21],h}function Z(e){let t=(0,q.c)(30),{def:n,ctx:r}=e,i=n.variant===`mutuallyExclusive`?`single`:`multi`,a=n.maxAllowedSelections??(i===`single`?1:5),o=n.selections??n.value,s;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==o?(s=A(o,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=o,t[3]=s):s=t[3];let[c,l]=(0,K.useState)(s),u;t[4]===n.options?u=t[5]:(u=n.options??[],t[4]=n.options,t[5]=u);let d=u,f;t[6]!==r||t[7]!==n.action||t[8]!==n.id||t[9]!==n.selections||t[10]!==n.value||t[11]!==a||t[12]!==i?(f=e=>{l(t=>{let o;o=i===`single`?[e]:t.includes(e)?t.filter(t=>t!==e):t.length>=a?t:[...t,e];let s=n.selections??n.value;if(typeof s==`object`&&s&&`path`in s){let e=s.path;r.setDataModel(t=>{let n=structuredClone(t),r=e.replace(/^\//,``).split(`/`),i=n;for(let e=0;e<r.length-1;e++)i[r[e]]??(i[r[e]]={}),i=i[r[e]];return i[r[r.length-1]]=o,n})}let c=n.action,l=(c?.event??c)?.name;return l&&r.onAction(l,{selections:o,selected:o[0]??null},n.id),o})},t[6]=r,t[7]=n.action,t[8]=n.id,t[9]=n.selections,t[10]=n.value,t[11]=a,t[12]=i,t[13]=f):f=t[13];let p=f,m;t[14]===n.weight?m=t[15]:(m=n.weight?{flex:n.weight}:void 0,t[14]=n.weight,t[15]=m);let h;if(t[16]!==r.dataModel||t[17]!==r.scopeData||t[18]!==c||t[19]!==d||t[20]!==p){let e;t[22]!==r.dataModel||t[23]!==r.scopeData||t[24]!==c||t[25]!==p?(e=(e,t)=>{let n=N(e.label,r.dataModel,r.scopeData),i=e.value??n,a=c.includes(i),o=String.fromCharCode(65+t);return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>p(i),className:`w-full text-left px-3 py-2.5 rounded-xl border text-sm transition-all flex items-center gap-2.5
|
|
7
7
|
${a?`bg-blue-500/15 border-blue-500/50 text-blue-100`:`bg-white/[0.03] border-white/[0.08] text-white/65 hover:border-white/20 hover:bg-white/[0.06]`}`,children:[(0,J.jsx)(`span`,{className:`text-xs font-bold w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0 transition-colors
|
|
8
|
-
${a?`bg-blue-500/40 text-blue-200`:`bg-white/5 text-white/40`}`,children:a?`✓`:o}),(0,J.jsx)(`span`,{className:`leading-snug`,children:n})]},t)},t[22]=r.dataModel,t[23]=r.scopeData,t[24]=c,t[25]=p,t[26]=e):e=t[26],h=d.map(e),t[16]=r.dataModel,t[17]=r.scopeData,t[18]=c,t[19]=d,t[20]=p,t[21]=h}else h=t[21];let g;return t[27]!==m||t[28]!==h?(g=(0,J.jsx)(`div`,{className:`space-y-2`,style:m,children:h}),t[27]=m,t[28]=h,t[29]=g):g=t[29],g}function We(e){let t=(0,q.c)(39),{def:n,ctx:r}=e,i=typeof n.min==`number`?n.min:n.minValue??0,a=typeof n.max==`number`?n.max:n.maxValue??100,o=typeof n.step==`number`?n.step:1,s=n.label,c=n.value,l;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==c?(l=ae(c,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=c,t[3]=l):l=t[3];let[u,d]=(0,K.useState)(l),f;if(t[4]!==r||t[5]!==n.value){let e=e=>{if(typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e,r})}};f=t=>{d(t[0]),e(t[0])},t[4]=r,t[5]=n.value,t[6]=f}else f=t[6];let m=f,h;t[7]!==r||t[8]!==n.action||t[9]!==n.id?(h=e=>{let t=e[0],i=n.action,a=(i?.event??i)?.name;a&&r.onAction(a,{value:t},n.id)},t[7]=r,t[8]=n.action,t[9]=n.id,t[10]=h):h=t[10];let g=h,_;t[11]===n.weight?_=t[12]:(_=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=_);let v;t[13]===s?v=t[14]:(v=s&&(0,J.jsx)(`span`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:s}),t[13]=s,t[14]=v);let y;t[15]===i?y=t[16]:(y=(0,J.jsx)(`span`,{children:i}),t[15]=i,t[16]=y);let b;t[17]===u?b=t[18]:(b=(0,J.jsx)(`span`,{className:`text-white/70 font-mono`,children:u}),t[17]=u,t[18]=b);let x;t[19]===a?x=t[20]:(x=(0,J.jsx)(`span`,{children:a}),t[19]=a,t[20]=x);let S;t[21]!==y||t[22]!==b||t[23]!==x?(S=(0,J.jsxs)(`div`,{className:`flex justify-between text-xs text-white/40`,children:[y,b,x]}),t[21]=y,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===u?C=t[26]:(C=[u],t[25]=u,t[26]=C);let w;t[27]!==m||t[28]!==g||t[29]!==a||t[30]!==i||t[31]!==o||t[32]!==C?(w=(0,J.jsx)(p,{value:C,min:i,max:a,step:o,onValueChange:m,onValueCommit:g,className:`w-full`}),t[27]=m,t[28]=g,t[29]=a,t[30]=i,t[31]=o,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==S||t[35]!==w||t[36]!==_||t[37]!==v?(T=(0,J.jsxs)(`div`,{className:`space-y-2`,style:_,children:[v,S,w]}),t[34]=S,t[35]=w,t[36]=_,t[37]=v,t[38]=T):T=t[38],T}function Ge(e){let t=(0,q.c)(15),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(``),o;t[0]!==r||t[1]!==n.value?(o=e=>{if(a(e.target.value),typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e.target.value,r})}},t[0]=r,t[1]=n.value,t[2]=o):o=t[2];let s=o,c=n.enableTime&&n.enableDate?`datetime-local`:n.enableDate?`date`:`time`,l;t[3]===n.weight?l=t[4]:(l=n.weight?{flex:n.weight}:void 0,t[3]=n.weight,t[4]=l);let u;t[5]===n.label?u=t[6]:(u=n.label&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:typeof n.label==`string`?n.label:String(n.label)}),t[5]=n.label,t[6]=u);let d;t[7]!==s||t[8]!==c||t[9]!==i?(d=(0,J.jsx)(`input`,{type:c,value:i,onChange:s,className:`w-full rounded-xl border px-3 py-2.5 text-sm bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06] outline-none text-white/80`}),t[7]=s,t[8]=c,t[9]=i,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:l,children:[u,d]}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Ke(e){let t=(0,q.c)(25),{def:n,ctx:r}=e,i;t[0]!==n.tabItems||t[1]!==n.tabs?(i=Array.isArray(n.tabs)?n.tabs:n.tabItems??[],t[0]=n.tabItems,t[1]=n.tabs,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==a[0]?(o=a[0]?.title?N(a[0].title,r.dataModel,r.scopeData):``,t[3]=r,t[4]=a[0],t[5]=o):o=t[5];let s=o,c;t[6]===n.weight?c=t[7]:(c=n.weight?{flex:n.weight}:void 0,t[6]=n.weight,t[7]=c);let l;if(t[8]!==r||t[9]!==a){let e;t[11]===r?e=t[12]:(e=(e,t)=>(0,J.jsx)(L,{value:N(e.title,r.dataModel,r.scopeData),children:N(e.title,r.dataModel,r.scopeData)},t),t[11]=r,t[12]=e),l=a.map(e),t[8]=r,t[9]=a,t[10]=l}else l=t[10];let u;t[13]===l?u=t[14]:(u=(0,J.jsx)(z,{className:`w-full`,children:l}),t[13]=l,t[14]=u);let d;if(t[15]!==r||t[16]!==a){let e;t[18]===r?e=t[19]:(e=(e,t)=>(0,J.jsx)(R,{value:N(e.title,r.dataModel,r.scopeData),children:(0,J.jsx)(Q,{...r,id:e.child})},t),t[18]=r,t[19]=e),d=a.map(e),t[15]=r,t[16]=a,t[17]=d}else d=t[17];let f;return t[20]!==s||t[21]!==c||t[22]!==u||t[23]!==d?(f=(0,J.jsxs)(B,{defaultValue:s,style:c,children:[u,d]}),t[20]=s,t[21]=c,t[22]=u,t[23]=d,t[24]=f):f=t[24],f}function qe(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(!1),o;t[0]!==r||t[1]!==n.entryPointChild||t[2]!==n.trigger?(o=(n.trigger??n.entryPointChild)&&(0,J.jsx)(V,{asChild:!0,children:(0,J.jsx)(`div`,{className:`cursor-pointer`,children:(0,J.jsx)(Q,{...r,id:n.trigger??n.entryPointChild})})}),t[0]=r,t[1]=n.entryPointChild,t[2]=n.trigger,t[3]=o):o=t[3];let s,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(de,{className:`sr-only`,children:`Interactive modal`}),c=(0,J.jsx)(H,{className:`sr-only`,children:`Interactive modal content generated by the agent.`}),t[4]=s,t[5]=c):(s=t[4],c=t[5]);let l;t[6]!==r||t[7]!==n.content||t[8]!==n.contentChild?(l=(n.content??n.contentChild)&&(0,J.jsx)(Q,{...r,id:n.content??n.contentChild}),t[6]=r,t[7]=n.content,t[8]=n.contentChild,t[9]=l):l=t[9];let u;t[10]===l?u=t[11]:(u=(0,J.jsxs)(U,{children:[s,c,l]}),t[10]=l,t[11]=u);let d;return t[12]!==i||t[13]!==o||t[14]!==u?(d=(0,J.jsxs)(fe,{open:i,onOpenChange:a,children:[o,u]}),t[12]=i,t[13]=o,t[14]=u,t[15]=d):d=t[15],d}function Je(e){let t=(0,q.c)(11),{def:n,ctx:r}=e,i=n.url,a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let o=a;if(!o)return null;let s;t[4]===n.weight?s=t[5]:(s=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=s);let c;t[6]===o?c=t[7]:(c=(0,J.jsx)(`video`,{src:o,controls:!0,className:`w-full max-h-96`,children:`Tu navegador no soporta video.`}),t[6]=o,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsx)(`div`,{className:`rounded-xl overflow-hidden border border-white/[0.08]`,style:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Ye(e){let t=(0,q.c)(19),{def:n,ctx:r}=e,i=n.url,a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let o=a,s=n.description,c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==s?(c=N(s,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=s,t[7]=c):c=t[7];let l=c;if(!o)return null;let u;t[8]===n.weight?u=t[9]:(u=n.weight?{flex:n.weight}:void 0,t[8]=n.weight,t[9]=u);let d;t[10]===l?d=t[11]:(d=l&&(0,J.jsx)(`p`,{className:`text-xs text-white/40 mb-2`,children:l}),t[10]=l,t[11]=d);let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f={height:40},t[12]=f):f=t[12];let p;t[13]===o?p=t[14]:(p=(0,J.jsx)(`audio`,{src:o,controls:!0,className:`w-full`,style:f,children:`Tu navegador no soporta audio.`}),t[13]=o,t[14]=p);let m;return t[15]!==u||t[16]!==d||t[17]!==p?(m=(0,J.jsxs)(`div`,{className:`rounded-xl border border-white/[0.08] p-4 bg-white/[0.02]`,style:u,children:[d,p]}),t[15]=u,t[16]=d,t[17]=p,t[18]=m):m=t[18],m}function Xe(e){let t=(0,q.c)(22),{surface:n,onAction:r,isLoading:i}=e,{components:a,dataModel:o,rootId:s,theme:c}=n,l;t[0]===o?l=t[1]:(l=()=>structuredClone(o),t[0]=o,t[1]=l);let[u,d]=(0,K.useState)(l),f,p;t[2]===o?(f=t[3],p=t[4]):(f=()=>{d(structuredClone(o))},p=[o],t[2]=o,t[3]=f,t[4]=p),(0,K.useEffect)(f,p);let m;if(t[5]!==a){m=new Map;for(let e of a)m.set(e.id,e);t[5]=a,t[6]=m}else m=t[6];let h=m,g=c?.primaryColor||`#3B82F6`,_;t[7]!==r||t[8]!==n.surfaceId?(_=(e,t,i)=>{r&&r({name:e,surfaceId:n.surfaceId,sourceComponentId:i,timestamp:new Date().toISOString(),context:t})},t[7]=r,t[8]=n.surfaceId,t[9]=_):_=t[9];let v=_;if(i){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,J.jsx)(`span`,{className:`text-white/30 text-sm animate-pulse`,children:`Cargando superficie...`})}),t[10]=e):e=t[10],e}if(!s||!h.has(s)){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8 text-white/20 text-sm`,children:`Sin contenido disponible`}),t[11]=e):e=t[11],e}let y;t[12]===g?y=t[13]:(y={"--a2ui-primary":g},t[12]=g,t[13]=y);let b=y,x;t[14]!==h||t[15]!==v||t[16]!==u||t[17]!==s?(x=(0,J.jsx)(Q,{id:s,compMap:h,dataModel:u,setDataModel:d,scopeData:void 0,onAction:v}),t[14]=h,t[15]=v,t[16]=u,t[17]=s,t[18]=x):x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,J.jsx)(`div`,{className:`a2ui-surface`,style:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S}var Ze=48;function Q(e){let t=(0,q.c)(71),n=e.compMap,r,i,a,o;if(t[0]!==e){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=n.get(e.id),!i){o=null;break bb0}let s;t[5]===e.ancestors?s=t[6]:(s=e.ancestors??[],t[5]=e.ancestors,t[6]=s);let c=s;if(c.includes(e.id)||c.length>=Ze){let n;t[7]===e.id?n=t[8]:(n=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-amber-400/30 px-3 py-2 text-xs text-amber-300/70`,children:[`Componente "`,e.id,`" omitido: se contiene a sí mismo`]}),t[7]=e.id,t[8]=n),o=n;break bb0}let l;t[9]!==c||t[10]!==e.id?(l=[...c,e.id],t[9]=c,t[10]=e.id,t[11]=l):l=t[11];let u;t[12]!==e||t[13]!==l?(u={...e,ancestors:l},t[12]=e,t[13]=l,t[14]=u):u=t[14],r=u,a=i.component?.replace(/[^\x00-\x7F]/g,``).trim()}t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a;switch(s){case`Text`:{let e;return t[15]!==r||t[16]!==i?(e=(0,J.jsx)(Te,{def:i,ctx:r}),t[15]=r,t[16]=i,t[17]=e):e=t[17],e}case`Button`:{let e;return t[18]!==r||t[19]!==i?(e=(0,J.jsx)(ke,{def:i,ctx:r}),t[18]=r,t[19]=i,t[20]=e):e=t[20],e}case`Row`:{let e;return t[21]!==r||t[22]!==i?(e=(0,J.jsx)(je,{def:i,ctx:r}),t[21]=r,t[22]=i,t[23]=e):e=t[23],e}case`Column`:{let e;return t[24]!==r||t[25]!==i?(e=(0,J.jsx)(Ne,{def:i,ctx:r}),t[24]=r,t[25]=i,t[26]=e):e=t[26],e}case`Card`:{let e;return t[27]!==r||t[28]!==i?(e=(0,J.jsx)(Pe,{def:i,ctx:r}),t[27]=r,t[28]=i,t[29]=e):e=t[29],e}case`List`:{let e;return t[30]!==r||t[31]!==i?(e=(0,J.jsx)(Fe,{def:i,ctx:r}),t[30]=r,t[31]=i,t[32]=e):e=t[32],e}case`Divider`:{let e;return t[33]!==r||t[34]!==i?(e=(0,J.jsx)(Ie,{def:i,ctx:r}),t[33]=r,t[34]=i,t[35]=e):e=t[35],e}case`Image`:{let e;return t[36]!==r||t[37]!==i?(e=(0,J.jsx)(ze,{def:i,ctx:r}),t[36]=r,t[37]=i,t[38]=e):e=t[38],e}case`Icon`:{let e;return t[39]!==r||t[40]!==i?(e=(0,J.jsx)(Ve,{def:i,ctx:r}),t[39]=r,t[40]=i,t[41]=e):e=t[41],e}case`TextField`:{let e;return t[42]!==r||t[43]!==i?(e=(0,J.jsx)(He,{def:i,ctx:r}),t[42]=r,t[43]=i,t[44]=e):e=t[44],e}case`CheckBox`:{let e;return t[45]!==r||t[46]!==i?(e=(0,J.jsx)(Ue,{def:i,ctx:r}),t[45]=r,t[46]=i,t[47]=e):e=t[47],e}case`ChoicePicker`:{let e;return t[48]!==r||t[49]!==i?(e=(0,J.jsx)(Z,{def:i,ctx:r}),t[48]=r,t[49]=i,t[50]=e):e=t[50],e}case`Slider`:{let e;return t[51]!==r||t[52]!==i?(e=(0,J.jsx)(We,{def:i,ctx:r}),t[51]=r,t[52]=i,t[53]=e):e=t[53],e}case`DateTimeInput`:{let e;return t[54]!==r||t[55]!==i?(e=(0,J.jsx)(Ge,{def:i,ctx:r}),t[54]=r,t[55]=i,t[56]=e):e=t[56],e}case`Tabs`:{let e;return t[57]!==r||t[58]!==i?(e=(0,J.jsx)(Ke,{def:i,ctx:r}),t[57]=r,t[58]=i,t[59]=e):e=t[59],e}case`Modal`:{let e;return t[60]!==r||t[61]!==i?(e=(0,J.jsx)(qe,{def:i,ctx:r}),t[60]=r,t[61]=i,t[62]=e):e=t[62],e}case`Video`:{let e;return t[63]!==r||t[64]!==i?(e=(0,J.jsx)(Je,{def:i,ctx:r}),t[63]=r,t[64]=i,t[65]=e):e=t[65],e}case`AudioPlayer`:{let e;return t[66]!==r||t[67]!==i?(e=(0,J.jsx)(Ye,{def:i,ctx:r}),t[66]=r,t[67]=i,t[68]=e):e=t[68],e}default:{let e;return t[69]===s?e=t[70]:(e=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-white/10 px-3 py-2 text-xs text-white/30`,children:[`Unknown component: `,s]}),t[69]=s,t[70]=e),e}}}function $(e,t){if(!e)return[];if(typeof e==`string`)return[(0,J.jsx)(Q,{...t,id:e},e)];if(Array.isArray(e))return e.map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`explicitList`in e||`array`in e)return(`explicitList`in e?e.explicitList:e.array).map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`path`in e&&`componentId`in e){let n=e,r=j(n.path,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}if(`template`in e){let n=e.template,r=j(n.dataBinding,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}return[]}function Qe(){let e=M(e=>e.a2uiSurfaces),t=M(e=>e.sendA2UIAction),n=M(e=>e.deleteA2UISurface),[r,i]=(0,K.useState)(null),a=(0,K.useCallback)(e=>{t(e)},[t]),o=async e=>{i(e);try{await re(`/api/a2ui/surfaces/${encodeURIComponent(e)}`,{method:`DELETE`,showError:!0}),n(e)}catch{}finally{i(null)}},s=Array.from(e.values());return(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,style:{backgroundImage:`radial-gradient(circle, rgba(59,130,246,0.03) 1px, transparent 1px)`,backgroundSize:`40px 40px`},children:[s.length===0?(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-white/20`,children:[(0,J.jsx)(P,{className:`h-10 w-10 opacity-30`}),(0,J.jsx)(`p`,{className:`text-sm`,children:`Sin paneles interactivos activos`}),(0,J.jsx)(`p`,{className:`text-xs text-white/15`,children:`Los resultados y formularios creados por los agentes aparecerán aquí.`})]}):(0,J.jsx)(ue,{className:`flex-1 p-6`,children:s.length>0&&(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:s.map(e=>(0,J.jsxs)(`div`,{className:`rounded-xl border border-blue-500/20 bg-[rgba(255,255,255,0.02)] backdrop-blur-sm p-4`,style:e.theme?.primaryColor?{borderColor:`${e.theme.primaryColor}33`}:void 0,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3 pb-3 border-b border-white/5`,children:[e.theme?.agentDisplayName?(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.theme.iconUrl&&(0,J.jsx)(`img`,{src:e.theme.iconUrl,alt:``,className:`w-5 h-5 rounded-full`}),(0,J.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,style:{color:e.theme.primaryColor??`#93c5fd`},children:e.theme.agentDisplayName})]}):(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-white/40`,children:e.surfaceId}),(0,J.jsx)(`button`,{type:`button`,title:`Eliminar superficie ${e.surfaceId}`,"aria-label":`Eliminar superficie ${e.surfaceId}`,disabled:r===e.surfaceId,onClick:()=>o(e.surfaceId),className:`rounded-md p-1.5 text-white/25 transition hover:bg-red-500/10 hover:text-red-300 disabled:opacity-40`,children:(0,J.jsx)(E,{className:`h-3.5 w-3.5`})})]}),(0,J.jsx)(Xe,{surface:e,onAction:a})]},e.surfaceId))})}),(0,J.jsx)(`div`,{className:`border-t border-white/5 bg-white/[0.02] px-6 py-2.5`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(P,{className:`h-3 w-3 text-blue-400/50`}),(0,J.jsx)(`span`,{className:`hive-mono`,children:s.length>0?`${s.length} superficie${s.length>1?`s`:``} A2UI activa${s.length>1?`s`:``}`:`Panel interactivo · sin superficies`})]})})]})}function $e(){let e=(0,q.c)(20),{sessionId:t}=k(),{currentUser:n}=ne(),r=M(tt),i=M(et),a=t&&t!==`default`?t:n?.id,o,s;if(e[0]===i?(o=e[1],s=e[2]):(o=()=>{i()},s=[i],e[0]=i,e[1]=o,e[2]=s),(0,K.useEffect)(o,s),!a){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] items-center justify-center`,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cargando sesión...`})]})}),e[3]=t):t=e[3],t}let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:(0,J.jsx)(P,{className:`h-5 w-5`})}),l=(0,J.jsx)(`h2`,{className:`hive-title-page !text-lg`,children:`Panel interactivo`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(F,{className:`h-3 w-3`}),e[6]=u):u=e[6];let d;e[7]===a?d=e[8]:(d=(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c,(0,J.jsxs)(`div`,{children:[l,(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-white/40 mt-0.5`,children:[u,(0,J.jsx)(`span`,{className:`font-mono`,children:a})]})]})]}),e[7]=a,e[8]=d);let f=`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 border ${r?`bg-emerald-500/15 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20`:`bg-red-500/15 text-red-500 border-red-500/20 hover:bg-red-500/20`}`,p;e[9]===r?p=e[10]:(p=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(O,{className:`h-3.5 w-3.5 animate-pulse`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Live`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{className:`h-3.5 w-3.5`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Offline`})]}),e[9]=r,e[10]=p);let m;e[11]!==f||e[12]!==p?(m=(0,J.jsx)(le,{variant:`outline`,className:f,children:p}),e[11]=f,e[12]=p,e[13]=m):m=e[13];let h;e[14]!==d||e[15]!==m?(h=(0,J.jsxs)(`div`,{className:`flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4`,children:[d,m]}),e[14]=d,e[15]=m,e[16]=h):h=e[16];let g;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Qe,{}),e[17]=g):g=e[17];let _;return e[18]===h?_=e[19]:(_=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] flex-col bg-background/50 backdrop-blur-sm`,children:(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden p-4 lg:p-8`,children:(0,J.jsx)(`div`,{className:`mx-auto h-full max-w-7xl`,children:(0,J.jsxs)(`div`,{className:`hive-card flex h-full flex-col shadow-2xl`,children:[h,g]})})})}),e[18]=h,e[19]=_),_}function et(e){return e.markA2UISeen}function tt(e){return e.isConnected}export{$e as A2UIPage};
|
|
8
|
+
${a?`bg-blue-500/40 text-blue-200`:`bg-white/5 text-white/40`}`,children:a?`✓`:o}),(0,J.jsx)(`span`,{className:`leading-snug`,children:n})]},t)},t[22]=r.dataModel,t[23]=r.scopeData,t[24]=c,t[25]=p,t[26]=e):e=t[26],h=d.map(e),t[16]=r.dataModel,t[17]=r.scopeData,t[18]=c,t[19]=d,t[20]=p,t[21]=h}else h=t[21];let g;return t[27]!==m||t[28]!==h?(g=(0,J.jsx)(`div`,{className:`space-y-2`,style:m,children:h}),t[27]=m,t[28]=h,t[29]=g):g=t[29],g}function We(e){let t=(0,q.c)(39),{def:n,ctx:r}=e,i=typeof n.min==`number`?n.min:n.minValue??0,a=typeof n.max==`number`?n.max:n.maxValue??100,o=typeof n.step==`number`?n.step:1,s=n.label,c=n.value,l;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==c?(l=ie(c,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=c,t[3]=l):l=t[3];let[u,d]=(0,K.useState)(l),f;if(t[4]!==r||t[5]!==n.value){let e=e=>{if(typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e,r})}};f=t=>{d(t[0]),e(t[0])},t[4]=r,t[5]=n.value,t[6]=f}else f=t[6];let m=f,h;t[7]!==r||t[8]!==n.action||t[9]!==n.id?(h=e=>{let t=e[0],i=n.action,a=(i?.event??i)?.name;a&&r.onAction(a,{value:t},n.id)},t[7]=r,t[8]=n.action,t[9]=n.id,t[10]=h):h=t[10];let g=h,_;t[11]===n.weight?_=t[12]:(_=n.weight?{flex:n.weight}:void 0,t[11]=n.weight,t[12]=_);let v;t[13]===s?v=t[14]:(v=s&&(0,J.jsx)(`span`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:s}),t[13]=s,t[14]=v);let y;t[15]===i?y=t[16]:(y=(0,J.jsx)(`span`,{children:i}),t[15]=i,t[16]=y);let b;t[17]===u?b=t[18]:(b=(0,J.jsx)(`span`,{className:`text-white/70 font-mono`,children:u}),t[17]=u,t[18]=b);let x;t[19]===a?x=t[20]:(x=(0,J.jsx)(`span`,{children:a}),t[19]=a,t[20]=x);let S;t[21]!==y||t[22]!==b||t[23]!==x?(S=(0,J.jsxs)(`div`,{className:`flex justify-between text-xs text-white/40`,children:[y,b,x]}),t[21]=y,t[22]=b,t[23]=x,t[24]=S):S=t[24];let C;t[25]===u?C=t[26]:(C=[u],t[25]=u,t[26]=C);let w;t[27]!==m||t[28]!==g||t[29]!==a||t[30]!==i||t[31]!==o||t[32]!==C?(w=(0,J.jsx)(p,{value:C,min:i,max:a,step:o,onValueChange:m,onValueCommit:g,className:`w-full`}),t[27]=m,t[28]=g,t[29]=a,t[30]=i,t[31]=o,t[32]=C,t[33]=w):w=t[33];let T;return t[34]!==S||t[35]!==w||t[36]!==_||t[37]!==v?(T=(0,J.jsxs)(`div`,{className:`space-y-2`,style:_,children:[v,S,w]}),t[34]=S,t[35]=w,t[36]=_,t[37]=v,t[38]=T):T=t[38],T}function Ge(e){let t=(0,q.c)(15),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(``),o;t[0]!==r||t[1]!==n.value?(o=e=>{if(a(e.target.value),typeof n.value==`object`&&n.value!==null&&`path`in n.value){let t=n.value.path;r.setDataModel(n=>{let r=structuredClone(n),i=t.replace(/^\//,``).split(`/`),a=r;for(let e=0;e<i.length-1;e++)a[i[e]]??(a[i[e]]={}),a=a[i[e]];return a[i[i.length-1]]=e.target.value,r})}},t[0]=r,t[1]=n.value,t[2]=o):o=t[2];let s=o,c=n.enableTime&&n.enableDate?`datetime-local`:n.enableDate?`date`:`time`,l;t[3]===n.weight?l=t[4]:(l=n.weight?{flex:n.weight}:void 0,t[3]=n.weight,t[4]=l);let u;t[5]===n.label?u=t[6]:(u=n.label&&(0,J.jsx)(`label`,{className:`text-xs font-semibold text-white/45 uppercase tracking-wider`,children:typeof n.label==`string`?n.label:String(n.label)}),t[5]=n.label,t[6]=u);let d;t[7]!==s||t[8]!==c||t[9]!==i?(d=(0,J.jsx)(`input`,{type:c,value:i,onChange:s,className:`w-full rounded-xl border px-3 py-2.5 text-sm bg-white/[0.04] border-white/[0.08] focus:border-blue-500/50 focus:bg-white/[0.06] outline-none text-white/80`}),t[7]=s,t[8]=c,t[9]=i,t[10]=d):d=t[10];let f;return t[11]!==l||t[12]!==u||t[13]!==d?(f=(0,J.jsxs)(`div`,{className:`space-y-1.5`,style:l,children:[u,d]}),t[11]=l,t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function Ke(e){let t=(0,q.c)(25),{def:n,ctx:r}=e,i;t[0]!==n.tabItems||t[1]!==n.tabs?(i=Array.isArray(n.tabs)?n.tabs:n.tabItems??[],t[0]=n.tabItems,t[1]=n.tabs,t[2]=i):i=t[2];let a=i,o;t[3]!==r||t[4]!==a[0]?(o=a[0]?.title?N(a[0].title,r.dataModel,r.scopeData):``,t[3]=r,t[4]=a[0],t[5]=o):o=t[5];let s=o,c;t[6]===n.weight?c=t[7]:(c=n.weight?{flex:n.weight}:void 0,t[6]=n.weight,t[7]=c);let l;if(t[8]!==r||t[9]!==a){let e;t[11]===r?e=t[12]:(e=(e,t)=>(0,J.jsx)(ue,{value:N(e.title,r.dataModel,r.scopeData),children:N(e.title,r.dataModel,r.scopeData)},t),t[11]=r,t[12]=e),l=a.map(e),t[8]=r,t[9]=a,t[10]=l}else l=t[10];let u;t[13]===l?u=t[14]:(u=(0,J.jsx)(R,{className:`w-full`,children:l}),t[13]=l,t[14]=u);let d;if(t[15]!==r||t[16]!==a){let e;t[18]===r?e=t[19]:(e=(e,t)=>(0,J.jsx)(L,{value:N(e.title,r.dataModel,r.scopeData),children:(0,J.jsx)(Q,{...r,id:e.child})},t),t[18]=r,t[19]=e),d=a.map(e),t[15]=r,t[16]=a,t[17]=d}else d=t[17];let f;return t[20]!==s||t[21]!==c||t[22]!==u||t[23]!==d?(f=(0,J.jsxs)(z,{defaultValue:s,style:c,children:[u,d]}),t[20]=s,t[21]=c,t[22]=u,t[23]=d,t[24]=f):f=t[24],f}function qe(e){let t=(0,q.c)(16),{def:n,ctx:r}=e,[i,a]=(0,K.useState)(!1),o;t[0]!==r||t[1]!==n.entryPointChild||t[2]!==n.trigger?(o=(n.trigger??n.entryPointChild)&&(0,J.jsx)(B,{asChild:!0,children:(0,J.jsx)(`div`,{className:`cursor-pointer`,children:(0,J.jsx)(Q,{...r,id:n.trigger??n.entryPointChild})})}),t[0]=r,t[1]=n.entryPointChild,t[2]=n.trigger,t[3]=o):o=t[3];let s,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,J.jsx)(U,{className:`sr-only`,children:`Interactive modal`}),c=(0,J.jsx)(V,{className:`sr-only`,children:`Interactive modal content generated by the agent.`}),t[4]=s,t[5]=c):(s=t[4],c=t[5]);let l;t[6]!==r||t[7]!==n.content||t[8]!==n.contentChild?(l=(n.content??n.contentChild)&&(0,J.jsx)(Q,{...r,id:n.content??n.contentChild}),t[6]=r,t[7]=n.content,t[8]=n.contentChild,t[9]=l):l=t[9];let u;t[10]===l?u=t[11]:(u=(0,J.jsxs)(H,{children:[s,c,l]}),t[10]=l,t[11]=u);let d;return t[12]!==i||t[13]!==o||t[14]!==u?(d=(0,J.jsxs)(de,{open:i,onOpenChange:a,children:[o,u]}),t[12]=i,t[13]=o,t[14]=u,t[15]=d):d=t[15],d}function Je(e){let t=(0,q.c)(11),{def:n,ctx:r}=e,i=n.url,a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let o=a;if(!o)return null;let s;t[4]===n.weight?s=t[5]:(s=n.weight?{flex:n.weight}:void 0,t[4]=n.weight,t[5]=s);let c;t[6]===o?c=t[7]:(c=(0,J.jsx)(`video`,{src:o,controls:!0,className:`w-full max-h-96`,children:`Tu navegador no soporta video.`}),t[6]=o,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,J.jsx)(`div`,{className:`rounded-xl overflow-hidden border border-white/[0.08]`,style:s,children:c}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Ye(e){let t=(0,q.c)(19),{def:n,ctx:r}=e,i=n.url,a;t[0]!==r.dataModel||t[1]!==r.scopeData||t[2]!==i?(a=N(i,r.dataModel,r.scopeData),t[0]=r.dataModel,t[1]=r.scopeData,t[2]=i,t[3]=a):a=t[3];let o=a,s=n.description,c;t[4]!==r.dataModel||t[5]!==r.scopeData||t[6]!==s?(c=N(s,r.dataModel,r.scopeData),t[4]=r.dataModel,t[5]=r.scopeData,t[6]=s,t[7]=c):c=t[7];let l=c;if(!o)return null;let u;t[8]===n.weight?u=t[9]:(u=n.weight?{flex:n.weight}:void 0,t[8]=n.weight,t[9]=u);let d;t[10]===l?d=t[11]:(d=l&&(0,J.jsx)(`p`,{className:`text-xs text-white/40 mb-2`,children:l}),t[10]=l,t[11]=d);let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f={height:40},t[12]=f):f=t[12];let p;t[13]===o?p=t[14]:(p=(0,J.jsx)(`audio`,{src:o,controls:!0,className:`w-full`,style:f,children:`Tu navegador no soporta audio.`}),t[13]=o,t[14]=p);let m;return t[15]!==u||t[16]!==d||t[17]!==p?(m=(0,J.jsxs)(`div`,{className:`rounded-xl border border-white/[0.08] p-4 bg-white/[0.02]`,style:u,children:[d,p]}),t[15]=u,t[16]=d,t[17]=p,t[18]=m):m=t[18],m}function Xe(e){let t=(0,q.c)(22),{surface:n,onAction:r,isLoading:i}=e,{components:a,dataModel:o,rootId:s,theme:c}=n,l;t[0]===o?l=t[1]:(l=()=>structuredClone(o),t[0]=o,t[1]=l);let[u,d]=(0,K.useState)(l),f,p;t[2]===o?(f=t[3],p=t[4]):(f=()=>{d(structuredClone(o))},p=[o],t[2]=o,t[3]=f,t[4]=p),(0,K.useEffect)(f,p);let m;if(t[5]!==a){m=new Map;for(let e of a)m.set(e.id,e);t[5]=a,t[6]=m}else m=t[6];let h=m,g=c?.primaryColor||`#3B82F6`,_;t[7]!==r||t[8]!==n.surfaceId?(_=(e,t,i)=>{r&&r({name:e,surfaceId:n.surfaceId,sourceComponentId:i,timestamp:new Date().toISOString(),context:t})},t[7]=r,t[8]=n.surfaceId,t[9]=_):_=t[9];let v=_;if(i){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,J.jsx)(`span`,{className:`text-white/30 text-sm animate-pulse`,children:`Cargando superficie...`})}),t[10]=e):e=t[10],e}if(!s||!h.has(s)){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,J.jsx)(`div`,{className:`flex items-center justify-center py-8 text-white/20 text-sm`,children:`Sin contenido disponible`}),t[11]=e):e=t[11],e}let y;t[12]===g?y=t[13]:(y={"--a2ui-primary":g},t[12]=g,t[13]=y);let b=y,x;t[14]!==h||t[15]!==v||t[16]!==u||t[17]!==s?(x=(0,J.jsx)(Q,{id:s,compMap:h,dataModel:u,setDataModel:d,scopeData:void 0,onAction:v}),t[14]=h,t[15]=v,t[16]=u,t[17]=s,t[18]=x):x=t[18];let S;return t[19]!==b||t[20]!==x?(S=(0,J.jsx)(`div`,{className:`a2ui-surface`,style:b,children:x}),t[19]=b,t[20]=x,t[21]=S):S=t[21],S}var Ze=48;function Q(e){let t=(0,q.c)(71),n=e.compMap,r,i,a,o;if(t[0]!==e){o=Symbol.for(`react.early_return_sentinel`);bb0:{if(i=n.get(e.id),!i){o=null;break bb0}let s;t[5]===e.ancestors?s=t[6]:(s=e.ancestors??[],t[5]=e.ancestors,t[6]=s);let c=s;if(c.includes(e.id)||c.length>=Ze){let n;t[7]===e.id?n=t[8]:(n=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-amber-400/30 px-3 py-2 text-xs text-amber-300/70`,children:[`Componente "`,e.id,`" omitido: se contiene a sí mismo`]}),t[7]=e.id,t[8]=n),o=n;break bb0}let l;t[9]!==c||t[10]!==e.id?(l=[...c,e.id],t[9]=c,t[10]=e.id,t[11]=l):l=t[11];let u;t[12]!==e||t[13]!==l?(u={...e,ancestors:l},t[12]=e,t[13]=l,t[14]=u):u=t[14],r=u,a=i.component?.replace(/[^\x00-\x7F]/g,``).trim()}t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s=a;switch(s){case`Text`:{let e;return t[15]!==r||t[16]!==i?(e=(0,J.jsx)(Te,{def:i,ctx:r}),t[15]=r,t[16]=i,t[17]=e):e=t[17],e}case`Button`:{let e;return t[18]!==r||t[19]!==i?(e=(0,J.jsx)(ke,{def:i,ctx:r}),t[18]=r,t[19]=i,t[20]=e):e=t[20],e}case`Row`:{let e;return t[21]!==r||t[22]!==i?(e=(0,J.jsx)(je,{def:i,ctx:r}),t[21]=r,t[22]=i,t[23]=e):e=t[23],e}case`Column`:{let e;return t[24]!==r||t[25]!==i?(e=(0,J.jsx)(Ne,{def:i,ctx:r}),t[24]=r,t[25]=i,t[26]=e):e=t[26],e}case`Card`:{let e;return t[27]!==r||t[28]!==i?(e=(0,J.jsx)(Pe,{def:i,ctx:r}),t[27]=r,t[28]=i,t[29]=e):e=t[29],e}case`List`:{let e;return t[30]!==r||t[31]!==i?(e=(0,J.jsx)(Fe,{def:i,ctx:r}),t[30]=r,t[31]=i,t[32]=e):e=t[32],e}case`Divider`:{let e;return t[33]!==r||t[34]!==i?(e=(0,J.jsx)(Ie,{def:i,ctx:r}),t[33]=r,t[34]=i,t[35]=e):e=t[35],e}case`Image`:{let e;return t[36]!==r||t[37]!==i?(e=(0,J.jsx)(ze,{def:i,ctx:r}),t[36]=r,t[37]=i,t[38]=e):e=t[38],e}case`Icon`:{let e;return t[39]!==r||t[40]!==i?(e=(0,J.jsx)(Ve,{def:i,ctx:r}),t[39]=r,t[40]=i,t[41]=e):e=t[41],e}case`TextField`:{let e;return t[42]!==r||t[43]!==i?(e=(0,J.jsx)(He,{def:i,ctx:r}),t[42]=r,t[43]=i,t[44]=e):e=t[44],e}case`CheckBox`:{let e;return t[45]!==r||t[46]!==i?(e=(0,J.jsx)(Ue,{def:i,ctx:r}),t[45]=r,t[46]=i,t[47]=e):e=t[47],e}case`ChoicePicker`:{let e;return t[48]!==r||t[49]!==i?(e=(0,J.jsx)(Z,{def:i,ctx:r}),t[48]=r,t[49]=i,t[50]=e):e=t[50],e}case`Slider`:{let e;return t[51]!==r||t[52]!==i?(e=(0,J.jsx)(We,{def:i,ctx:r}),t[51]=r,t[52]=i,t[53]=e):e=t[53],e}case`DateTimeInput`:{let e;return t[54]!==r||t[55]!==i?(e=(0,J.jsx)(Ge,{def:i,ctx:r}),t[54]=r,t[55]=i,t[56]=e):e=t[56],e}case`Tabs`:{let e;return t[57]!==r||t[58]!==i?(e=(0,J.jsx)(Ke,{def:i,ctx:r}),t[57]=r,t[58]=i,t[59]=e):e=t[59],e}case`Modal`:{let e;return t[60]!==r||t[61]!==i?(e=(0,J.jsx)(qe,{def:i,ctx:r}),t[60]=r,t[61]=i,t[62]=e):e=t[62],e}case`Video`:{let e;return t[63]!==r||t[64]!==i?(e=(0,J.jsx)(Je,{def:i,ctx:r}),t[63]=r,t[64]=i,t[65]=e):e=t[65],e}case`AudioPlayer`:{let e;return t[66]!==r||t[67]!==i?(e=(0,J.jsx)(Ye,{def:i,ctx:r}),t[66]=r,t[67]=i,t[68]=e):e=t[68],e}default:{let e;return t[69]===s?e=t[70]:(e=(0,J.jsxs)(`div`,{className:`rounded-md border border-dashed border-white/10 px-3 py-2 text-xs text-white/30`,children:[`Unknown component: `,s]}),t[69]=s,t[70]=e),e}}}function $(e,t){if(!e)return[];if(typeof e==`string`)return[(0,J.jsx)(Q,{...t,id:e},e)];if(Array.isArray(e))return e.map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`explicitList`in e||`array`in e)return(`explicitList`in e?e.explicitList:e.array).map(e=>(0,J.jsx)(Q,{...t,id:e},e));if(`path`in e&&`componentId`in e){let n=e,r=j(n.path,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}if(`template`in e){let n=e.template,r=j(n.dataBinding,t.dataModel,t.scopeData);return Array.isArray(r)?r.map((e,r)=>{let i=typeof e==`object`&&e?e:{value:e,index:r};return(0,J.jsx)(Q,{...t,id:n.componentId,scopeData:i},`${n.componentId}_${r}`)}):[]}return[]}function Qe(){let e=M(e=>e.a2uiSurfaces),t=M(e=>e.sendA2UIAction),n=M(e=>e.deleteA2UISurface),[r,i]=(0,K.useState)(null),a=(0,K.useCallback)(e=>{t(e)},[t]),o=async e=>{i(e);try{await ne(`/api/a2ui/surfaces/${encodeURIComponent(e)}`,{method:`DELETE`,showError:!0}),n(e)}catch{}finally{i(null)}},s=Array.from(e.values());return(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,style:{backgroundImage:`radial-gradient(circle, rgba(59,130,246,0.03) 1px, transparent 1px)`,backgroundSize:`40px 40px`},children:[s.length===0?(0,J.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-white/20`,children:[(0,J.jsx)(P,{className:`h-10 w-10 opacity-30`}),(0,J.jsx)(`p`,{className:`text-sm`,children:`Sin paneles interactivos activos`}),(0,J.jsx)(`p`,{className:`text-xs text-white/15`,children:`Los resultados y formularios creados por los agentes aparecerán aquí.`})]}):(0,J.jsx)(le,{className:`flex-1 p-6`,children:s.length>0&&(0,J.jsx)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:s.map(e=>(0,J.jsxs)(`div`,{className:`rounded-xl border border-blue-500/20 bg-[rgba(255,255,255,0.02)] backdrop-blur-sm p-4`,style:e.theme?.primaryColor?{borderColor:`${e.theme.primaryColor}33`}:void 0,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mb-3 pb-3 border-b border-white/5`,children:[e.theme?.agentDisplayName?(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.theme.iconUrl&&(0,J.jsx)(`img`,{src:e.theme.iconUrl,alt:``,className:`w-5 h-5 rounded-full`}),(0,J.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider`,style:{color:e.theme.primaryColor??`#93c5fd`},children:e.theme.agentDisplayName})]}):(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-white/40`,children:e.surfaceId}),(0,J.jsx)(`button`,{type:`button`,title:`Eliminar superficie ${e.surfaceId}`,"aria-label":`Eliminar superficie ${e.surfaceId}`,disabled:r===e.surfaceId,onClick:()=>o(e.surfaceId),className:`rounded-md p-1.5 text-white/25 transition hover:bg-red-500/10 hover:text-red-300 disabled:opacity-40`,children:(0,J.jsx)(T,{className:`h-3.5 w-3.5`})})]}),(0,J.jsx)(Xe,{surface:e,onAction:a})]},e.surfaceId))})}),(0,J.jsx)(`div`,{className:`border-t border-white/5 bg-white/[0.02] px-6 py-2.5`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(P,{className:`h-3 w-3 text-blue-400/50`}),(0,J.jsx)(`span`,{className:`hive-mono`,children:s.length>0?`${s.length} superficie${s.length>1?`s`:``} A2UI activa${s.length>1?`s`:``}`:`Panel interactivo · sin superficies`})]})})]})}function $e(){let e=(0,q.c)(20),{sessionId:t}=O(),{currentUser:n}=te(),r=M(tt),i=M(et),a=t&&t!==`default`?t:n?.id,o,s;if(e[0]===i?(o=e[1],s=e[2]):(o=()=>{i()},s=[i],e[0]=i,e[1]=o,e[2]=s),(0,K.useEffect)(o,s),!a){let t;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] items-center justify-center`,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,J.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cargando sesión...`})]})}),e[3]=t):t=e[3],t}let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,J.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:(0,J.jsx)(P,{className:`h-5 w-5`})}),l=(0,J.jsx)(`h2`,{className:`hive-title-page !text-lg`,children:`Panel interactivo`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(F,{className:`h-3 w-3`}),e[6]=u):u=e[6];let d;e[7]===a?d=e[8]:(d=(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[c,(0,J.jsxs)(`div`,{children:[l,(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-white/40 mt-0.5`,children:[u,(0,J.jsx)(`span`,{className:`font-mono`,children:a})]})]})]}),e[7]=a,e[8]=d);let f=`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 border ${r?`bg-emerald-500/15 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20`:`bg-red-500/15 text-red-500 border-red-500/20 hover:bg-red-500/20`}`,p;e[9]===r?p=e[10]:(p=r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(D,{className:`h-3.5 w-3.5 animate-pulse`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Live`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(E,{className:`h-3.5 w-3.5`}),(0,J.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Offline`})]}),e[9]=r,e[10]=p);let m;e[11]!==f||e[12]!==p?(m=(0,J.jsx)(ce,{variant:`outline`,className:f,children:p}),e[11]=f,e[12]=p,e[13]=m):m=e[13];let h;e[14]!==d||e[15]!==m?(h=(0,J.jsxs)(`div`,{className:`flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4`,children:[d,m]}),e[14]=d,e[15]=m,e[16]=h):h=e[16];let g;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,J.jsx)(Qe,{}),e[17]=g):g=e[17];let _;return e[18]===h?_=e[19]:(_=(0,J.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] flex-col bg-background/50 backdrop-blur-sm`,children:(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden p-4 lg:p-8`,children:(0,J.jsx)(`div`,{className:`mx-auto h-full max-w-7xl`,children:(0,J.jsxs)(`div`,{className:`hive-card flex h-full flex-col shadow-2xl`,children:[h,g]})})})}),e[18]=h,e[19]=_),_}function et(e){return e.markA2UISeen}function tt(e){return e.isConnected}export{$e as A2UIPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./check-C8pw-7Fx.js";import{t as i}from"./circle-alert-CtDbK2nl.js";import{t as a}from"./useProviders-Dj1k5PCk.js";import{t as o}from"./external-link-6oTH9pUM.js";import{n as s,r as c,t as l}from"./ModelSelector-BX4IvuYY.js";import{t as u}from"./shield-CIarwBvx.js";import{t as d}from"./sparkles-DVvY6jDT.js";import{t as f}from"./utils-DEmd_M8c.js";import{F as p,N as m,O as h,Q as g,S as _,X as v,Y as y,ct as b}from"./index-BG3nUPKq.js";import{a as x,c as S,i as C,n as w,o as T,r as E,s as ee,t as D}from"./dialog-BP3GTCPn.js";import{t as O}from"./label-D_fvqJyD.js";import{t as k}from"./textarea-BgZJFZTX.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-v_3QBYrD.js";import{t as F}from"./switch-ndx8VCpm.js";import{a as I,i as L,n as R,r as z,t as B}from"./card-mTJ4oZbL.js";var V=e(t(),1),H=n(),U=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function W({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:W,updateAgent:G,isLoading:K,error:q}=_(),{activeProviders:te}=h(),[J,Y]=(0,V.useState)({isValidating:!1,exists:!1,accessible:!1}),[X,Z]=(0,V.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,V.useEffect)(()=>{e&&Z({...e,provider_id:e.provider_id||e.providerId||``,model_id:e.model_id||e.modelId||``})},[e]);let Q=async e=>{if(!e||e.trim()===``){Y({isValidating:!1,exists:!1,accessible:!1});return}Y({isValidating:!0,exists:!1,accessible:!1});try{let t=await m(`/api/workspace/validate`,{method:`POST`,body:{path:e}});Y({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){Y({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},ne=async()=>{if(X.workspace)try{await m(`/api/workspace/create`,{method:`POST`,body:{path:X.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await Q(X.workspace)}catch(e){p.fire(`Error`,e.message,`error`)}},re=async()=>{if(X.workspace)try{await m(`/api/workspace/open?path=${encodeURIComponent(X.workspace)}`,{method:`GET`})}catch(e){p.fire(`Error`,e.message,`error`)}},ie=async n=>{if(n.preventDefault(),!X.provider_id||!X.model_id){p.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await G(e.id,X):await W(X),t&&t()}catch(e){console.error(e)}},$=!!e?.id;return(0,H.jsxs)(B,{className:`hive-card--form group`,children:[(0,H.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,H.jsx)(L,{className:`relative`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:$?(0,H.jsx)(s,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(I,{className:`text-xl font-bold text-white/90`,children:$?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,H.jsx)(z,{className:`text-white/40`,children:$?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,H.jsx)(v,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,H.jsx)(g,{className:`h-5 w-5`})})]})}),(0,H.jsx)(R,{className:`relative space-y-6 pt-2`,children:(0,H.jsxs)(`form`,{onSubmit:ie,className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`grid gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,H.jsx)(y,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:X.name,onChange:e=>Z({...X,name:e.target.value}),disabled:K,required:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,H.jsx)(k,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:X.description,onChange:e=>Z({...X,description:e.target.value}),disabled:K})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(O,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,H.jsxs)(D,{children:[(0,H.jsx)(S,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,H.jsxs)(E,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,H.jsxs)(T,{children:[(0,H.jsx)(ee,{className:`text-xl`,children:`Editar System Prompt`}),(0,H.jsx)(C,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(k,{value:X.systemPrompt||``,onChange:e=>Z({...X,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:K})}),(0,H.jsx)(x,{children:(0,H.jsx)(w,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),X.systemPrompt?(0,H.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,X.systemPrompt,`"`]}):(0,H.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(c,{className:`h-4 w-4 text-emerald-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(y,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:X.workspace,onChange:e=>{Z({...X,workspace:e.target.value}),Q(e.target.value)},disabled:K}),X.workspace&&J.exists&&J.accessible&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`icon`,onClick:re,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,H.jsx)(o,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),X.workspace&&X.workspace.trim()!==``&&(0,H.jsxs)(`div`,{className:f(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,J.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!J.isValidating&&J.exists&&J.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!J.isValidating&&J.exists&&!J.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!J.isValidating&&!J.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[J.isValidating&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`h-3.5 w-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Validando directorio...`})]}),!J.isValidating&&J.exists&&J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`Directorio válido y accesible`})]}),!J.isValidating&&J.exists&&!J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!J.isValidating&&!J.exists&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio no existe`}),!J.error&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:ne,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,H.jsx)(`div`,{className:`hive-card-divider`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(a,{className:`h-4 w-4 text-blue-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,H.jsx)(l,{selectedProviderId:X.provider_id||void 0,selectedModelId:X.model_id||void 0,onProviderChange:e=>Z({...X,provider_id:e,model_id:``}),onModelChange:e=>Z({...X,model_id:e}),disabled:K,typeFilter:`llm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,H.jsxs)(P,{value:X.tone,onValueChange:e=>Z({...X,tone:e}),disabled:K,children:[(0,H.jsx)(M,{className:`hive-select-trigger`,children:(0,H.jsx)(N,{placeholder:`Selecciona un tono`})}),(0,H.jsx)(j,{className:`hive-select-content`,children:U.map(e=>(0,H.jsx)(A,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,H.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5 text-purple-400`}),(0,H.jsx)(O,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,H.jsxs)(P,{value:X.role,onValueChange:e=>Z({...X,role:e}),disabled:K,children:[(0,H.jsx)(M,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,H.jsx)(N,{})}),(0,H.jsxs)(j,{className:`bg-zinc-900 border-white/10`,children:[(0,H.jsx)(A,{value:`coordinator`,children:`Coordinador`}),(0,H.jsx)(A,{value:`worker`,children:`Worker`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-2 w-2 rounded-full ${X.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,H.jsx)(O,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,H.jsx)(F,{id:`enabled`,checked:X.enabled,onCheckedChange:e=>Z({...X,enabled:e}),disabled:K})]})]})]}),q&&(0,H.jsx)(`div`,{className:`hive-form-error`,children:q}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,H.jsx)(v,{type:`button`,variant:`outline`,onClick:n,disabled:K,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,H.jsx)(v,{type:`submit`,disabled:K,className:`hive-btn--form-submit`,children:K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,H.jsx)(H.Fragment,{children:$?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}export{W as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./check-C8pw-7Fx.js";import{t as i}from"./circle-alert-CtDbK2nl.js";import{t as a}from"./useProviders-CeSzDnx-.js";import{t as o}from"./external-link-DNJH7epD.js";import{n as s,r as c,t as l}from"./ModelSelector-njfNhkng.js";import{t as u}from"./shield-DvVIcbzd.js";import{t as d}from"./sparkles-DRe4GbSH.js";import{t as f}from"./utils-lc8H6VGT.js";import{F as p,N as m,O as h,Q as g,S as _,X as v,Y as y,ct as b}from"./index-U0e4e5mL.js";import{a as x,c as S,i as C,n as w,o as T,r as E,s as ee,t as D}from"./dialog-DO1fQCF7.js";import{t as O}from"./label-CvAtVE-v.js";import{t as k}from"./textarea-xtFAVuPf.js";import{i as A,n as j,o as M,s as N,t as P}from"./select-BjBXxyxL.js";import{t as F}from"./switch-B5dAwb54.js";import{a as I,i as L,n as R,r as z,t as B}from"./card-D0qneq1i.js";var V=e(t(),1),H=n(),U=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function W({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:W,updateAgent:G,isLoading:K,error:q}=_(),{activeProviders:te}=h(),[J,Y]=(0,V.useState)({isValidating:!1,exists:!1,accessible:!1}),[X,Z]=(0,V.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,V.useEffect)(()=>{e&&Z({...e,provider_id:e.provider_id||e.providerId||``,model_id:e.model_id||e.modelId||``})},[e]);let Q=async e=>{if(!e||e.trim()===``){Y({isValidating:!1,exists:!1,accessible:!1});return}Y({isValidating:!0,exists:!1,accessible:!1});try{let t=await m(`/api/workspace/validate`,{method:`POST`,body:{path:e}});Y({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){Y({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},ne=async()=>{if(X.workspace)try{await m(`/api/workspace/create`,{method:`POST`,body:{path:X.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await Q(X.workspace)}catch(e){p.fire(`Error`,e.message,`error`)}},re=async()=>{if(X.workspace)try{await m(`/api/workspace/open?path=${encodeURIComponent(X.workspace)}`,{method:`GET`})}catch(e){p.fire(`Error`,e.message,`error`)}},ie=async n=>{if(n.preventDefault(),!X.provider_id||!X.model_id){p.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await G(e.id,X):await W(X),t&&t()}catch(e){console.error(e)}},$=!!e?.id;return(0,H.jsxs)(B,{className:`hive-card--form group`,children:[(0,H.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,H.jsx)(L,{className:`relative`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:$?(0,H.jsx)(s,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(I,{className:`text-xl font-bold text-white/90`,children:$?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,H.jsx)(z,{className:`text-white/40`,children:$?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,H.jsx)(v,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,H.jsx)(g,{className:`h-5 w-5`})})]})}),(0,H.jsx)(R,{className:`relative space-y-6 pt-2`,children:(0,H.jsxs)(`form`,{onSubmit:ie,className:`space-y-8`,children:[(0,H.jsxs)(`div`,{className:`grid gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,H.jsx)(y,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:X.name,onChange:e=>Z({...X,name:e.target.value}),disabled:K,required:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,H.jsx)(k,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:X.description,onChange:e=>Z({...X,description:e.target.value}),disabled:K})]})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(O,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,H.jsxs)(D,{children:[(0,H.jsx)(S,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,H.jsxs)(E,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,H.jsxs)(T,{children:[(0,H.jsx)(ee,{className:`text-xl`,children:`Editar System Prompt`}),(0,H.jsx)(C,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,H.jsx)(`div`,{className:`py-2`,children:(0,H.jsx)(k,{value:X.systemPrompt||``,onChange:e=>Z({...X,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:K})}),(0,H.jsx)(x,{children:(0,H.jsx)(w,{asChild:!0,children:(0,H.jsx)(v,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),X.systemPrompt?(0,H.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,X.systemPrompt,`"`]}):(0,H.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(c,{className:`h-4 w-4 text-emerald-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,H.jsxs)(`div`,{className:`flex gap-2`,children:[(0,H.jsx)(y,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:X.workspace,onChange:e=>{Z({...X,workspace:e.target.value}),Q(e.target.value)},disabled:K}),X.workspace&&J.exists&&J.accessible&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`icon`,onClick:re,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,H.jsx)(o,{className:`h-4 w-4`})})]}),(0,H.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),X.workspace&&X.workspace.trim()!==``&&(0,H.jsxs)(`div`,{className:f(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,J.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!J.isValidating&&J.exists&&J.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!J.isValidating&&J.exists&&!J.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!J.isValidating&&!J.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[J.isValidating&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`h-3.5 w-3.5 animate-spin`}),(0,H.jsx)(`span`,{children:`Validando directorio...`})]}),!J.isValidating&&J.exists&&J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`Directorio válido y accesible`})]}),!J.isValidating&&J.exists&&!J.accessible&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!J.isValidating&&!J.exists&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c,{className:`h-3.5 w-3.5`}),(0,H.jsx)(`span`,{children:J.message||`El directorio no existe`}),!J.error&&(0,H.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:ne,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,H.jsx)(`div`,{className:`hive-card-divider`}),(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,H.jsx)(a,{className:`h-4 w-4 text-blue-400`}),(0,H.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,H.jsx)(l,{selectedProviderId:X.provider_id||void 0,selectedModelId:X.model_id||void 0,onProviderChange:e=>Z({...X,provider_id:e,model_id:``}),onModelChange:e=>Z({...X,model_id:e}),disabled:K,typeFilter:`llm`})]}),(0,H.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(O,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,H.jsxs)(P,{value:X.tone,onValueChange:e=>Z({...X,tone:e}),disabled:K,children:[(0,H.jsx)(M,{className:`hive-select-trigger`,children:(0,H.jsx)(N,{placeholder:`Selecciona un tono`})}),(0,H.jsx)(j,{className:`hive-select-content`,children:U.map(e=>(0,H.jsx)(A,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,H.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(u,{className:`h-3.5 w-3.5 text-purple-400`}),(0,H.jsx)(O,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,H.jsxs)(P,{value:X.role,onValueChange:e=>Z({...X,role:e}),disabled:K,children:[(0,H.jsx)(M,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,H.jsx)(N,{})}),(0,H.jsxs)(j,{className:`bg-zinc-900 border-white/10`,children:[(0,H.jsx)(A,{value:`coordinator`,children:`Coordinador`}),(0,H.jsx)(A,{value:`worker`,children:`Worker`})]})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`div`,{className:`h-2 w-2 rounded-full ${X.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,H.jsx)(O,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,H.jsx)(F,{id:`enabled`,checked:X.enabled,onCheckedChange:e=>Z({...X,enabled:e}),disabled:K})]})]})]}),q&&(0,H.jsx)(`div`,{className:`hive-form-error`,children:q}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,H.jsx)(v,{type:`button`,variant:`outline`,onClick:n,disabled:K,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,H.jsx)(v,{type:`submit`,disabled:K,className:`hive-btn--form-submit`,children:K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(b,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,H.jsx)(H.Fragment,{children:$?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}export{W as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{t as n}from"./vendor-react-kUOwxn0g.js";import{o as r}from"./vendor-query-Dj8xYhQD.js";import{t as i}from"./createLucideIcon-BRaPSYgN.js";import{t as a}from"./activity-C_GS5wrG.js";import{t as o}from"./calendar-B6x9cw-q.js";import{t as s}from"./check-C8pw-7Fx.js";import{t as c}from"./chevron-left-GK4EQOyZ.js";import{t as l}from"./circle-alert-CtDbK2nl.js";import{t as u}from"./circle-check-BKNT2_q6.js";import{n as d,r as f,t as p}from"./terminal-CpBDERBE.js";import{t as m}from"./useProviders-CeSzDnx-.js";import{t as h}from"./external-link-DNJH7epD.js";import{n as g,r as _,t as v}from"./ModelSelector-njfNhkng.js";import{a as y,i as b,o as x,r as S,s as ee}from"./agentCapabilities-Bf71Gir4.js";import{t as C}from"./shield-DvVIcbzd.js";import{t as w}from"./sparkles-DRe4GbSH.js";import{t as te}from"./zap-Yed86Sh8.js";import{t as T}from"./utils-lc8H6VGT.js";import{c as E,l as D}from"./vendor-router-DxU0Uf4R.js";import{$ as O,A as k,D as ne,I as A,N as j,O as M,P as N,S as P,X as F,Y as I,ct as L,dt as R,k as re,mt as z,nt as B}from"./index-U0e4e5mL.js";import{t as ie}from"./badge-C6H33ePv.js";import{a as V,c as H,i as ae,n as U,o as W,r as G,s as oe,t as se}from"./dialog-DO1fQCF7.js";import{t as K}from"./label-CvAtVE-v.js";import{t as ce}from"./textarea-xtFAVuPf.js";import{i as q,n as J,o as le,s as Y,t as X}from"./select-BjBXxyxL.js";import{t as ue}from"./switch-B5dAwb54.js";var Z=i(`BookOpenCheck`,[[`path`,{d:`M12 21V7`,key:`gj6g52`}],[`path`,{d:`m16 12 2 2 4-4`,key:`mdajum`}],[`path`,{d:`M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3`,key:`8arnkb`}]]),de=i(`CalendarClock`,[[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M17.5 17.5 16 16.3V14`,key:`akvzfd`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),Q=i(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),fe=i(`Fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pe=i(`LayoutGrid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),me=i(`PackageOpen`,[[`path`,{d:`M12 22v-9`,key:`x3hkom`}],[`path`,{d:`M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z`,key:`2ntwy6`}],[`path`,{d:`M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13`,key:`1pmm1c`}],[`path`,{d:`M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z`,key:`12ttoo`}]]),he=n(),ge=e(t(),1),$=r();function _e(e){let t=(0,he.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,$.jsx)(n,{...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function ve({agentId:e}){let{agents:t,updateAgent:n,fetchAgents:r}=P(),{fetchProviders:i}=M(),{fetchModels:o}=ne();(0,ge.useEffect)(()=>{r(),i(),o()},[r,i,o]);let c=t.find(t=>t.id===e),[u,d]=(0,ge.useState)({name:``,description:``,provider_id:``,model_id:``,tone:``,role:`coordinator`,enabled:!0,headers:``,systemPrompt:``,workspace:``}),[f,p]=(0,ge.useState)({isValidating:!1,exists:!1,accessible:!1});(0,ge.useEffect)(()=>{c&&(d({name:c.name||``,description:c.description||``,provider_id:c.provider_id||c.providerId||``,model_id:c.model_id||c.modelId||``,tone:c.tone||``,role:c.role||`coordinator`,enabled:!!c.enabled,headers:``,systemPrompt:c.systemPrompt||``,workspace:c.workspace||``}),c.workspace&&m(c.workspace))},[c]);let m=async e=>{if(!e||e.trim()===``){p({isValidating:!1,exists:!1,accessible:!1});return}p({isValidating:!0,exists:!1,accessible:!1});try{let t=await j(`/api/workspace/validate`,{method:`POST`,body:{path:e}});p({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){p({isValidating:!1,exists:!1,accessible:!1,error:e.message})}};return c?(0,$.jsx)(`div`,{className:`space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500`,children:(0,$.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,$.jsxs)(`div`,{className:`lg:col-span-1 space-y-6`,children:[(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-blue-500/10 border border-blue-500/20`,children:(0,$.jsx)(_e,{icon:B,className:`h-4 w-4 text-blue-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Identidad Base`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(K,{htmlFor:`name`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Nombre Público`}),(0,$.jsx)(I,{id:`name`,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Nombre del nodo`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(K,{htmlFor:`tone`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Tono Cognitivo`}),(0,$.jsx)(I,{id:`tone`,value:u.tone,onChange:e=>d(t=>({...t,tone:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Ej: Analítico, Conciso...`})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-purple-500/10 border border-purple-500/20`,children:(0,$.jsx)(_e,{icon:C,className:`h-4 w-4 text-purple-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Permisos de Red`})]}),(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(K,{className:`text-sm font-semibold`,children:`Rol`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Coordinador o Worker`})]}),(0,$.jsxs)(X,{value:u.role,onValueChange:e=>d(t=>({...t,role:e})),children:[(0,$.jsx)(le,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,$.jsx)(Y,{})}),(0,$.jsxs)(J,{className:`bg-zinc-900 border-white/10`,children:[(0,$.jsx)(q,{value:`coordinator`,children:`Coordinador`}),(0,$.jsx)(q,{value:`worker`,children:`Worker`})]})]})]}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(K,{className:`text-sm font-semibold`,children:`Nodo Activo`}),(0,$.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Disponible para la colmena`})]}),(0,$.jsx)(ue,{checked:u.enabled,onCheckedChange:e=>d(t=>({...t,enabled:e}))})]})]})]}),(0,$.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20`,children:(0,$.jsx)(_e,{icon:_,className:`h-4 w-4 text-emerald-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Workspace Directory`})]}),(0,$.jsx)(`div`,{className:`space-y-4`,children:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(K,{htmlFor:`workspace`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directorio de Trabajo`}),(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(I,{id:`workspace`,value:u.workspace,onChange:e=>{d(t=>({...t,workspace:e.target.value})),m(e.target.value)},className:`bg-white/5 border-white/10 focus:border-emerald-500/50 rounded-xl h-11 font-mono text-sm flex-1`,placeholder:`Ej: /home/user/proyectos, D:\\Work`}),u.workspace&&f.exists&&f.accessible&&(0,$.jsx)(F,{type:`button`,variant:`outline`,size:`icon`,onClick:async()=>{if(u.workspace)try{await j(`/api/workspace/open?path=${encodeURIComponent(u.workspace)}`,{method:`GET`})}catch(e){N.fire({icon:`error`,title:e.message})}},className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10 h-11 w-11`,title:`Abrir en el explorador`,children:(0,$.jsx)(h,{className:`h-4 w-4`})})]}),(0,$.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente operará. Puede ser cualquier ubicación (disco, USB, red).`}),u.workspace&&u.workspace.trim()!==``&&(0,$.jsxs)(`div`,{className:T(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,f.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!f.isValidating&&f.exists&&f.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!f.isValidating&&f.exists&&!f.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!f.isValidating&&!f.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[f.isValidating&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(L,{className:`h-3.5 w-3.5 animate-spin`}),(0,$.jsx)(`span`,{children:`Validando directorio...`})]}),!f.isValidating&&f.exists&&f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Directorio válido y accesible`})]}),!f.isValidating&&f.exists&&!f.accessible&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(l,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`Sin permisos de lectura/escritura`})]}),!f.isValidating&&!f.exists&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_,{className:`h-3.5 w-3.5`}),(0,$.jsx)(`span`,{children:f.message||`El directorio no existe`}),!f.error&&(0,$.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,onClick:async()=>{if(u.workspace)try{await j(`/api/workspace/create`,{method:`POST`,body:{path:u.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await m(u.workspace)}catch(e){N.fire({icon:`error`,title:e.message})}},className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear`})]})]})]})})]})]}),(0,$.jsx)(`div`,{className:`lg:col-span-2 space-y-6`,children:(0,$.jsxs)(`div`,{className:`p-8 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-8`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(`div`,{className:`p-2 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,$.jsx)(_e,{icon:w,className:`h-4 w-4 text-amber-400`})}),(0,$.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Configuración Cognitiva`})]}),(0,$.jsxs)(F,{onClick:async()=>{A.show(`Sincronizando configuración del agente...`);try{await n(e,{...u,role:u.role,enabled:+!!u.enabled,workspace:u.workspace||null}),N.fire({icon:`success`,title:`Cambios sincronizados correctamente`})}catch(e){N.fire({icon:`error`,title:e instanceof Error?e.message:`Error al sincronizar cambios`})}finally{A.hide()}},className:`bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl px-6 shadow-[0_4px_15px_rgba(37,99,235,0.3)] transition-all active:scale-95 gap-2`,children:[(0,$.jsx)(_e,{icon:g,className:`h-4 w-4`}),`Sincronizar Cambios`]})]}),(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(K,{htmlFor:`description`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directiva de Misión (Descripción)`}),(0,$.jsx)(ce,{id:`description`,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-2xl min-h-[80px] resize-none`,placeholder:`Define el propósito general de este nodo...`})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,$.jsx)(K,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`System Prompt (Markdown)`}),(0,$.jsxs)(se,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,$.jsxs)(G,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,$.jsxs)(W,{children:[(0,$.jsx)(oe,{className:`text-xl`,children:`Editar System Prompt`}),(0,$.jsx)(ae,{className:`text-sm text-white/50`,children:`El comportamiento principal del agente. Se recomienda usar Markdown.`})]}),(0,$.jsx)(`div`,{className:`py-2`,children:(0,$.jsx)(ce,{value:u.systemPrompt,onChange:e=>d(t=>({...t,systemPrompt:e.target.value})),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`})}),(0,$.jsx)(V,{children:(0,$.jsx)(U,{asChild:!0,children:(0,$.jsx)(F,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Listo`})})})]})]})]}),u.systemPrompt?(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4 max-h-[120px] overflow-y-auto custom-scrollbar`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/60 font-mono whitespace-pre-wrap italic`,children:u.systemPrompt})}):(0,$.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4`,children:(0,$.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})})]}),(0,$.jsx)(v,{selectedProviderId:u.provider_id||void 0,selectedModelId:u.model_id||void 0,onProviderChange:e=>d(t=>({...t,provider_id:e,model_id:``})),onModelChange:e=>d(t=>({...t,model_id:e})),typeFilter:`llm`})]}),(0,$.jsxs)(`div`,{className:`mt-8 p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-start gap-4 italic`,children:[(0,$.jsx)(_e,{icon:R,className:`h-5 w-5 text-white/20 mt-0.5`}),(0,$.jsx)(`p`,{className:`text-[11px] text-white/30 leading-relaxed`,children:`Las credenciales de acceso y llaves de cifrado para los headers personalizados se gestionan en una capa segura y no son visibles en texto plano para mantener la integridad de la red.`})]})]})})]})}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 rounded-3xl border border-dashed border-white/10 bg-white/5`,children:[(0,$.jsx)(_e,{icon:a,className:`h-12 w-12 text-white/10 animate-pulse`}),(0,$.jsx)(`p`,{className:`text-white/40 font-medium`,children:`Buscando nodo en la colmena...`})]})}function ye(e){let t=(0,he.c)(87),{agent:n}=e,{providers:r}=M(),{models:i}=ne(),s=n.role===`coordinator`,c=n.provider_id||n.providerId,l=n.model_id||n.modelId,u=n.created_at||n.createdAt,d;t[0]===u?d=t[1]:(d=u?y(typeof u==`string`?new Date(u):new Date(u*1e3),`PPP`,{locale:b}):`Fecha desconocida`,t[0]=u,t[1]=d);let f=d,p;t[2]!==c||t[3]!==r?(p=r.find(e=>e.id===c)?.name||c,t[2]=c,t[3]=r,t[4]=p):p=t[4];let h=p,g;t[5]!==l||t[6]!==i?(g=i.find(e=>e.id===l)?.name||l,t[5]=l,t[6]=i,t[7]=g):g=t[7];let _=g,v=`hive-card--internal group ${n.enabled?`hive-card--internal-active`:`hive-card--internal-disabled`}`,S;t[8]===n.enabled?S=t[9]:(S=n.enabled&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700`}),(0,$.jsx)(`div`,{className:`absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700`})]}),t[8]=n.enabled,t[9]=S);let ee=`hive-icon-wrap--internal ${n.enabled?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,C=`h-6 w-6 ${n.enabled?`text-blue-400`:`text-white/20`}`,w;t[10]===C?w=t[11]:(w=(0,$.jsx)(fe,{className:C}),t[10]=C,t[11]=w);let T;t[12]!==ee||t[13]!==w?(T=(0,$.jsx)(`div`,{className:ee,children:w}),t[12]=ee,t[13]=w,t[14]=T):T=t[14];let E=`hive-page-header__label ${!n.enabled&&`text-white/20`}`,D;t[15]===E?D=t[16]:(D=(0,$.jsx)(`span`,{className:E,children:`Identidad de Nodo`}),t[15]=E,t[16]=D);let O;t[17]!==n.enabled||t[18]!==s?(O=s&&(0,$.jsx)(ie,{className:`hive-tag--coordinator ${!n.enabled&&`bg-white/5 text-white/20 border-white/10`}`,children:`Coordinador`}),t[17]=n.enabled,t[18]=s,t[19]=O):O=t[19];let k;t[20]!==D||t[21]!==O?(k=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[D,O]}),t[20]=D,t[21]=O,t[22]=k):k=t[22];let A=`text-4xl font-black tracking-tighter ${n.enabled?`text-white`:`text-white/40`}`,j;t[23]!==n.name||t[24]!==A?(j=(0,$.jsx)(`h1`,{className:A,children:n.name}),t[23]=n.name,t[24]=A,t[25]=j):j=t[25];let N;t[26]!==k||t[27]!==j?(N=(0,$.jsxs)(`div`,{children:[k,j]}),t[26]=k,t[27]=j,t[28]=N):N=t[28];let P;t[29]!==N||t[30]!==T?(P=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[T,N]}),t[29]=N,t[30]=T,t[31]=P):P=t[31];let F=`text-lg leading-relaxed max-w-2xl font-light italic ${n.enabled?`text-white/60`:`text-white/20`}`,I=n.description||`Este agente no tiene una descripción definida aún.`,L;t[32]!==F||t[33]!==I?(L=(0,$.jsxs)(`p`,{className:F,children:[`"`,I,`"`]}),t[32]=F,t[33]=I,t[34]=L):L=t[34];let R;t[35]!==P||t[36]!==L?(R=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[P,L]}),t[35]=P,t[36]=L,t[37]=R):R=t[37];let re=n.enabled?`text-blue-400`:`text-white/20`,z;t[38]!==n.enabled||t[39]!==_||t[40]!==h||t[41]!==re?(z=(0,$.jsx)(be,{icon:m,label:`Infraestructura`,value:h,subValue:_,color:re,enabled:n.enabled}),t[38]=n.enabled,t[39]=_,t[40]=h,t[41]=re,t[42]=z):z=t[42];let B=n.tone||`Neutral`,V=n.enabled?`text-purple-400`:`text-white/20`,H;t[43]!==n.enabled||t[44]!==B||t[45]!==V?(H=(0,$.jsx)(be,{icon:te,label:`Personalidad`,value:B,color:V,enabled:n.enabled}),t[43]=n.enabled,t[44]=B,t[45]=V,t[46]=H):H=t[46];let ae=n.enabled?`text-emerald-400`:`text-white/20`,U;t[47]!==n.enabled||t[48]!==f||t[49]!==ae?(U=(0,$.jsx)(be,{icon:o,label:`Desplegado el`,value:f,color:ae,enabled:n.enabled}),t[47]=n.enabled,t[48]=f,t[49]=ae,t[50]=U):U=t[50];let W;t[51]!==z||t[52]!==H||t[53]!==U?(W=(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4`,children:[z,H,U]}),t[51]=z,t[52]=H,t[53]=U,t[54]=W):W=t[54];let G;t[55]!==R||t[56]!==W?(G=(0,$.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[R,W]}),t[55]=R,t[56]=W,t[57]=G):G=t[57];let oe;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(`span`,{className:`hive-label block`,children:`Estado Operativo`}),t[58]=oe):oe=t[58];let se=n.enabled?n.status:`hibernated`,K;t[59]===se?K=t[60]:(K=(0,$.jsxs)(`div`,{className:`text-center md:text-right space-y-2`,children:[oe,(0,$.jsx)(x,{status:se,className:`px-6 py-2 text-sm border-2`})]}),t[59]=se,t[60]=K);let ce;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`p`,{className:`hive-label mb-1`,children:`Carga de Red`}),t[61]=ce):ce=t[61];let q;t[62]===n.enabled?q=t[63]:(q=n.enabled&&(0,$.jsx)(`div`,{className:`hive-network-fill`}),t[62]=n.enabled,t[63]=q);let J;t[64]===q?J=t[65]:(J=(0,$.jsxs)(`div`,{className:`flex-1`,children:[ce,(0,$.jsx)(`div`,{className:`hive-network-track`,children:q})]}),t[64]=q,t[65]=J);let le=`h-5 w-5 ${n.enabled?`text-blue-400 animate-pulse`:`text-white/10`}`,Y;t[66]===le?Y=t[67]:(Y=(0,$.jsx)(a,{className:le}),t[66]=le,t[67]=Y);let X;t[68]!==J||t[69]!==Y?(X=(0,$.jsxs)(`div`,{className:`hive-network-panel md:w-auto`,children:[J,Y]}),t[68]=J,t[69]=Y,t[70]=X):X=t[70];let ue;t[71]!==K||t[72]!==X?(ue=(0,$.jsxs)(`div`,{className:`flex flex-col items-center md:items-end gap-6 min-w-[200px]`,children:[K,X]}),t[71]=K,t[72]=X,t[73]=ue):ue=t[73];let Z;t[74]!==G||t[75]!==ue?(Z=(0,$.jsxs)(`div`,{className:`relative flex flex-col md:flex-row gap-8 items-start justify-between`,children:[G,ue]}),t[74]=G,t[75]=ue,t[76]=Z):Z=t[76];let de=`hive-strip--bottom ${!n.enabled&&`opacity-20`}`,Q;t[77]===de?Q=t[78]:(Q=(0,$.jsx)(`div`,{className:de}),t[77]=de,t[78]=Q);let pe;t[79]===n.id?pe=t[80]:(pe=(0,$.jsxs)(`div`,{className:`absolute top-4 right-8 hive-mono hidden md:block`,children:[`NODE_UID: `,n.id]}),t[79]=n.id,t[80]=pe);let me;return t[81]!==v||t[82]!==Z||t[83]!==Q||t[84]!==pe||t[85]!==S?(me=(0,$.jsxs)(`div`,{className:v,children:[S,Z,Q,pe]}),t[81]=v,t[82]=Z,t[83]=Q,t[84]=pe,t[85]=S,t[86]=me):me=t[86],me}function be(e){let t=(0,he.c)(21),{icon:n,label:r,value:i,subValue:a,color:o,enabled:s}=e,c=`hive-info-card ${s?`hive-info-card--active`:`hive-info-card--disabled`}`,l=`h-3.5 w-3.5 ${o}`,u;t[0]!==n||t[1]!==l?(u=(0,$.jsx)(n,{className:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===r?d=t[4]:(d=(0,$.jsx)(`span`,{className:`hive-info-card__label`,children:r}),t[3]=r,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[u,d]}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=`hive-info-card__value ${s?`text-white/80 group-hover/item:text-white`:`text-white/20`}`,m;t[8]!==p||t[9]!==i?(m=(0,$.jsx)(`p`,{className:p,children:i}),t[8]=p,t[9]=i,t[10]=m):m=t[10];let h;t[11]!==s||t[12]!==a?(h=a&&(0,$.jsx)(`p`,{className:`hive-info-card__sub ${s?`text-white/40`:`text-white/10`}`,children:a}),t[11]=s,t[12]=a,t[13]=h):h=t[13];let g;t[14]!==m||t[15]!==h?(g=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[m,h]}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==c||t[18]!==f||t[19]!==g?(_=(0,$.jsxs)(`div`,{className:c,children:[f,g]}),t[17]=c,t[18]=f,t[19]=g,t[20]=_):_=t[20],_}var xe={filesystem:`Archivos`,web:`Web`,cron:`Automatización`,cli:`Terminal`,agents:`Agentes`,canvas:`Canvas`,office:`Office`,mcp:`MCP`,core:`Sistema`,google:`Google`};function Se(e){return e.startsWith(`fs_`)?`filesystem`:e.startsWith(`browser_`)||e.startsWith(`web_`)||e===`search_knowledge`?`web`:e.startsWith(`cron`)?`cron`:e.startsWith(`office_`)?`office`:e.startsWith(`mcp`)||e.includes(`_mcp`)?`mcp`:e.startsWith(`canvas_`)||e.startsWith(`a2ui_`)?`canvas`:e.startsWith(`cli_`)?`cli`:e.startsWith(`gmail_`)||e.startsWith(`gcal_`)||e.startsWith(`gdrive_`)?`google`:e.includes(`agent`)||e.includes(`task_`)||e.includes(`acceptance`)?`agents`:`core`}function Ce(e){return e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function we(e){let t=(0,he.c)(59),{agent:n}=e,{tools:r,isLoading:i,fetchTools:a}=k(),{skills:o,isLoading:s,fetchSkills:c}=re(),l,u;t[0]!==c||t[1]!==a||t[2]!==o.length||t[3]!==r.length?(l=()=>{r.length===0&&a(),o.length===0&&c()},u=[c,a,o.length,r.length],t[0]=c,t[1]=a,t[2]=o.length,t[3]=r.length,t[4]=l,t[5]=u):(l=t[4],u=t[5]),(0,ge.useEffect)(l,u);let d;t[6]===n.toolsJson?d=t[7]:(d=S(n.toolsJson),t[6]=n.toolsJson,t[7]=d);let f=d,p;t[8]===n.skillsJson?p=t[9]:(p=S(n.skillsJson),t[8]=n.skillsJson,t[9]=p);let m=p,h;t[10]!==n.minimalTools||t[11]!==n.role?(h=n.role===`coordinator`?n.minimalTools??[]:[],t[10]=n.minimalTools,t[11]=n.role,t[12]=h):h=t[12];let g=h,_;t[13]!==n.minimalSkills||t[14]!==n.role?(_=n.role===`coordinator`?n.minimalSkills??[]:[],t[13]=n.minimalSkills,t[14]=n.role,t[15]=_):_=t[15];let v=_,y;if(t[16]!==g||t[17]!==f||t[18]!==r){let e=new Map;g.forEach(t=>e.set(t,{id:t,source:`base`})),f.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),y=Array.from(e.values()).map(e=>{let t=r.find(t=>t.id===e.id);return{id:e.id,name:t?.name||e.suppliedName||Ce(e.id),description:t?.description||`Capacidad disponible en el loadout operativo de este agente.`,category:t?.category||Se(e.id),available:t?t.enabled&&t.active!==!1:!0,source:e.source}}),t[16]=g,t[17]=f,t[18]=r,t[19]=y}else y=t[19];let b=y,x;if(t[20]!==v||t[21]!==m||t[22]!==o){let e=new Map;v.forEach(t=>e.set(t.id,{id:t.id,suppliedName:t.name,source:`base`})),m.forEach(t=>{let n=e.get(t.id);e.set(t.id,{...t,source:n?.source??`assigned`})}),x=Array.from(e.values()).map(e=>{let t=o.find(t=>t.id===e.id),n=v.find(t=>t.id===e.id);return{id:e.id,name:t?.name||n?.name||e.suppliedName||Ce(e.id),description:t?.description||n?.description||`Conocimiento operativo incluido en el contexto de este agente.`,category:t?.category||n?.category||`core`,source:e.source}}),t[20]=v,t[21]=m,t[22]=o,t[23]=x}else x=t[23];let C=x,w;t[24]===b?w=t[25]:(w=new Set(b.map(ke)),t[24]=b,t[25]=w);let te=w.size,T;t[26]!==n.mcpServerIds||t[27]!==n.mcpServers?(T=n.mcpServers??(n.mcpServerIds??[]).map(Oe),t[26]=n.mcpServerIds,t[27]=n.mcpServers,t[28]=T):T=t[28];let E=T,D=i&&r.length===0||s&&o.length===0,ne,A;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-lg border border-emerald-500/20 bg-emerald-500/10`,children:(0,$.jsx)(O,{className:`h-4 w-4 text-emerald-400`})}),A=(0,$.jsx)(`h2`,{className:`text-sm font-black uppercase tracking-[0.12em] text-white/85`,children:`Loadout operativo`}),t[29]=ne,t[30]=A):(ne=t[29],A=t[30]);let j=n.role===`coordinator`?`Capacidades mínimas del coordinador y asignaciones adicionales`:`Tools y skills asignadas para ejecutar tareas`,M;t[31]===j?M=t[32]:(M=(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[ne,(0,$.jsxs)(`div`,{children:[A,(0,$.jsx)(`p`,{className:`mt-0.5 text-[11px] text-white/35`,children:j})]})]}),t[31]=j,t[32]=M);let N;t[33]===b.length?N=t[34]:(N=(0,$.jsx)(je,{value:b.length,label:`tools`,color:`text-emerald-400`}),t[33]=b.length,t[34]=N);let P;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),t[35]=P):P=t[35];let F;t[36]===C.length?F=t[37]:(F=(0,$.jsx)(je,{value:C.length,label:`skills`,color:`text-amber-400`}),t[36]=C.length,t[37]=F);let I;t[38]===E.length?I=t[39]:(I=E.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`h-7 w-px bg-white/[0.08]`}),(0,$.jsx)(je,{value:E.length,label:`MCP`,color:`text-violet-400`})]}),t[38]=E.length,t[39]=I);let R;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(`div`,{className:`hidden h-7 w-px bg-white/[0.08] sm:block`}),t[40]=R):R=t[40];let z;t[41]===te?z=t[42]:(z=(0,$.jsx)(`div`,{className:`hidden sm:block`,children:(0,$.jsx)(je,{value:te,label:`categorías`,color:`text-blue-400`})}),t[41]=te,t[42]=z);let B;t[43]!==N||t[44]!==F||t[45]!==I||t[46]!==z?(B=(0,$.jsxs)(`div`,{className:`flex items-center gap-4`,children:[N,P,F,I,R,z]}),t[43]=N,t[44]=F,t[45]=I,t[46]=z,t[47]=B):B=t[47];let ie;t[48]!==M||t[49]!==B?(ie=(0,$.jsxs)(`div`,{className:`flex flex-col gap-4 border-b border-white/[0.07] px-5 py-4 sm:flex-row sm:items-center sm:justify-between`,children:[M,B]}),t[48]=M,t[49]=B,t[50]=ie):ie=t[50];let V;t[51]!==E||t[52]!==D||t[53]!==C||t[54]!==b?(V=D&&b.length===0&&C.length===0&&E.length===0?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-14 text-xs text-white/35`,children:[(0,$.jsx)(L,{className:`h-4 w-4 animate-spin text-emerald-400`}),`Sincronizando loadout…`]}):b.length===0&&C.length===0&&E.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center px-5 py-14 text-center`,children:[(0,$.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl border border-dashed border-white/10 bg-white/[0.025]`,children:(0,$.jsx)(me,{className:`h-5 w-5 text-white/20`})}),(0,$.jsx)(`p`,{className:`mt-3 text-sm font-semibold text-white/60`,children:`Este agente no tiene capacidades asignadas`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-white/30`,children:`Su loadout operativo está vacío.`})]}):(0,$.jsxs)($.Fragment,{children:[b.length>0&&(0,$.jsxs)(`div`,{className:`p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(O,{className:`h-3.5 w-3.5 text-emerald-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Tools disponibles`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:b.map(De)})]}),E.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(ee,{className:`h-3.5 w-3.5 text-violet-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Integraciones MCP asignadas`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:E.map(Ee)})]}),C.length>0&&(0,$.jsxs)(`div`,{className:`border-t border-white/[0.07] p-4`,children:[(0,$.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`}),(0,$.jsx)(`h3`,{className:`text-[10px] font-black uppercase tracking-[0.16em] text-white/50`,children:`Skills en contexto`})]}),(0,$.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-3`,children:C.map(Te)})]})]}),t[51]=E,t[52]=D,t[53]=C,t[54]=b,t[55]=V):V=t[55];let H;return t[56]!==ie||t[57]!==V?(H=(0,$.jsxs)(`section`,{className:`mb-8 overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0b0e14]/75`,children:[ie,V]}),t[56]=ie,t[57]=V,t[58]=H):H=t[58],H}function Te(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-amber-500/10 bg-amber-500/[0.025] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-amber-500/15 bg-amber-500/[0.07]`,children:(0,$.jsx)(Z,{className:`h-3.5 w-3.5 text-amber-400`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-amber-400/65`,children:e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Ee(e){return(0,$.jsxs)(`article`,{className:`rounded-xl border border-violet-500/15 bg-violet-500/[0.035] p-3.5`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-violet-500/20 bg-violet-500/[0.08]`,children:(0,$.jsx)(ee,{className:`h-3.5 w-3.5 text-violet-300`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{className:`mt-1 h-2 w-2 shrink-0 rounded-full ${e.enabled?`bg-emerald-400`:`bg-white/20`}`})]}),(0,$.jsxs)(`p`,{className:`mt-1 text-[10px] leading-4 text-white/30`,children:[`Servidor completo · `,e.toolsCount,` tools sincronizadas`]})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-violet-300/70`,children:e.status}),(0,$.jsx)(`span`,{className:`rounded bg-violet-500/10 px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider text-violet-200/70`,children:`Persistente`})]})]},e.id)}function De(e){return(0,$.jsxs)(`article`,{className:`group rounded-xl border border-white/[0.07] bg-black/20 p-3.5 transition-colors hover:border-emerald-500/20 hover:bg-emerald-500/[0.025]`,children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,$.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-white/[0.07] bg-white/[0.035]`,children:(0,$.jsx)(Me(e.category),{className:`h-3.5 w-3.5 text-emerald-400/80`})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsx)(`h4`,{className:`truncate text-xs font-bold text-white/80`,title:e.name,children:e.name}),(0,$.jsx)(`span`,{title:e.available?`Disponible`:`No disponible`,children:(0,$.jsx)(u,{className:`h-3.5 w-3.5 shrink-0 ${e.available?`text-emerald-400`:`text-white/15`}`})})]}),(0,$.jsx)(`p`,{className:`mt-1 line-clamp-2 min-h-8 text-[10px] leading-4 text-white/30`,children:e.description})]})]}),(0,$.jsxs)(`div`,{className:`mt-3 flex items-center justify-between border-t border-white/[0.05] pt-2`,children:[(0,$.jsx)(`span`,{className:`text-[8px] font-bold uppercase tracking-[0.14em] text-emerald-400/65`,children:xe[e.category]||e.category}),(0,$.jsx)(Ae,{source:e.source})]})]},e.id)}function Oe(e){return{id:e,name:e,status:`unknown`,enabled:!0,toolsCount:0}}function ke(e){return e.category}function Ae(e){let t=(0,he.c)(3),{source:n}=e,r=`rounded px-1.5 py-0.5 text-[7px] font-black uppercase tracking-wider ${n===`base`?`bg-blue-500/10 text-blue-300/70`:`bg-white/5 text-white/25`}`,i=n===`base`?`Minimal · base`:`Asignada`,a;return t[0]!==r||t[1]!==i?(a=(0,$.jsx)(`span`,{className:r,children:i}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function je(e){let t=(0,he.c)(8),{value:n,label:r,color:i}=e,a=`text-base font-black tabular-nums ${i}`,o;t[0]!==a||t[1]!==n?(o=(0,$.jsx)(`p`,{className:a,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,$.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:r}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`text-right`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Me(e){switch(e){case`filesystem`:return Q;case`web`:return d;case`cron`:return de;case`cli`:return p;case`agents`:return z;case`canvas`:return f;case`mcp`:return ee;case`office`:return Q;default:return O}}function Ne(){let e=(0,he.c)(25),{id:t}=D(),n=E(),r=t??`unknown`,{agents:i,fetchAgents:o}=P(),s,l;e[0]===o?(s=e[1],l=e[2]):(s=()=>{o()},l=[o],e[0]=o,e[1]=s,e[2]=l),(0,ge.useEffect)(s,l);let u;if(e[3]!==r||e[4]!==i){let t;e[6]===r?t=e[7]:(t=e=>e.id===r,e[6]=r,e[7]=t),u=i.find(t),e[3]=r,e[4]=i,e[5]=u}else u=e[5];let d=u,f;e[8]===n?f=e[9]:(f=()=>n(`/agents`),e[8]=n,e[9]=f);let p,m;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(c,{className:`h-4 w-4 transition-transform group-hover:-translate-x-1`}),m=(0,$.jsx)(`span`,{className:`text-sm font-bold uppercase tracking-widest`,children:`Volver a la Colmena`}),e[10]=p,e[11]=m):(p=e[10],m=e[11]);let h;e[12]===f?h=e[13]:(h=(0,$.jsxs)(F,{variant:`ghost`,onClick:f,className:`group flex items-center gap-2 text-white/40 hover:text-white hover:bg-white/5 px-4 py-2 rounded-xl transition-colors`,children:[p,m]}),e[12]=f,e[13]=h);let g,_;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(pe,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Agentes`})]}),_=(0,$.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),e[14]=g,e[15]=_):(g=e[14],_=e[15]);let v;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-4 text-white/20`,children:[g,_,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(a,{className:`h-4 w-4`}),(0,$.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Detalles Operativos`})]})]}),e[16]=v):v=e[16];let y;e[17]===h?y=e[18]:(y=(0,$.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[h,v]}),e[17]=h,e[18]=y);let b;e[19]!==d||e[20]!==r?(b=d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ye,{agent:d}),(0,$.jsx)(we,{agent:d}),(0,$.jsx)(`div`,{className:`grid grid-cols-1 gap-8`,children:(0,$.jsx)(ve,{agentId:r})})]}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[60vh] text-center space-y-6`,children:[(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(`div`,{className:`h-24 w-24 rounded-full border-4 border-t-blue-500 border-white/5 animate-spin`}),(0,$.jsx)(a,{className:`absolute inset-0 m-auto h-8 w-8 text-blue-400 animate-pulse`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sincronizando con el Nodo`}),(0,$.jsx)(`p`,{className:`text-white/40 max-w-xs mx-auto`,children:`Estamos recuperando la configuración cuántica de este agente desde la base de datos central.`})]})]}),e[19]=d,e[20]=r,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=(0,$.jsx)(`div`,{className:`min-h-screen bg-transparent pb-20`,children:(0,$.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 animate-fade-in`,children:[y,b]})}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}export{Ne as AgentDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./vendor-react-kUOwxn0g.js";import{o as t}from"./vendor-query-Dj8xYhQD.js";import{t as n}from"./AgentCreateForm-
|
|
1
|
+
import{t as e}from"./vendor-react-kUOwxn0g.js";import{o as t}from"./vendor-query-Dj8xYhQD.js";import{t as n}from"./AgentCreateForm-Dr1l4Cvg.js";var r=e(),i=t();function a(){let e=(0,r.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,i.jsx)(n,{}),e[0]=t):t=e[0],t}export{a as AgentNewPage};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{_ as n,c as r,d as i,f as a,g as o,h as s,l as c,m as l,p as u,u as d,v as f,y as p}from"./vendor-radix-DUug7irY.js";import{t as m}from"./vendor-react-kUOwxn0g.js";import{o as h}from"./vendor-query-Dj8xYhQD.js";import{t as g}from"./createLucideIcon-BRaPSYgN.js";import{t as ee}from"./activity-C_GS5wrG.js";import{t as _}from"./arrow-up-right-DWzTsCXj.js";import{t as v}from"./calendar-B6x9cw-q.js";import{t as y}from"./check-C8pw-7Fx.js";import{t as b}from"./chevron-right-BupZqrxu.js";import{t as x}from"./useProviders-CeSzDnx-.js";import{t as S}from"./ellipsis-vertical-BOW_iEOO.js";import{t as C}from"./file-text-ByqNMpXm.js";import{r as w}from"./ModelSelector-njfNhkng.js";import{t as T}from"./gauge-CB4np0Vz.js";import{t as E}from"./lock-DpBean4K.js";import{a as D,i as O,n as k,o as A,s as j,t as te}from"./agentCapabilities-Bf71Gir4.js";import{t as ne}from"./pencil-BG8EFaS3.js";import{t as re}from"./plus-Bp8-V68t.js";import{t as ie}from"./refresh-cw-D6F1zoC6.js";import{t as ae}from"./shield-DvVIcbzd.js";import{t as M}from"./sparkles-DRe4GbSH.js";import{t as N}from"./trash-2-BZsMCfso.js";import{t as oe}from"./zap-Yed86Sh8.js";import{t as P}from"./utils-lc8H6VGT.js";import{c as se}from"./vendor-router-DxU0Uf4R.js";import{$ as ce,D as le,F,O as ue,Q as de,S as fe,X as I,mt as pe}from"./index-U0e4e5mL.js";import{t as me}from"./AgentCreateForm-Dr1l4Cvg.js";var he=g(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),L=g(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),R=g(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),z=g(`Pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),B=m(),V=e(t(),1),H=h(),ge=s,U=p,W=V.forwardRef((e,t)=>{let n=(0,B.c)(14),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({className:i,inset:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=a&&`pl-8`,c;n[5]!==i||n[6]!==s?(c=P(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent`,s,i),n[5]=i,n[6]=s,n[7]=c):c=n[7];let l;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,H.jsx)(b,{className:`ml-auto h-4 w-4`}),n[8]=l):l=n[8];let u;return n[9]!==r||n[10]!==o||n[11]!==t||n[12]!==c?(u=(0,H.jsxs)(f,{ref:t,className:c,...o,children:[r,l]}),n[9]=r,n[10]=o,n[11]=t,n[12]=c,n[13]=u):u=n[13],u});W.displayName=f.displayName;var G=V.forwardRef((e,t)=>{let r=(0,B.c)(9),i,a;r[0]===e?(i=r[1],a=r[2]):({className:i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let o;r[3]===i?o=r[4]:(o=P(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,i),r[3]=i,r[4]=o);let s;return r[5]!==a||r[6]!==t||r[7]!==o?(s=(0,H.jsx)(n,{ref:t,className:o,...a}),r[5]=a,r[6]=t,r[7]=o,r[8]=s):s=r[8],s});G.displayName=n.displayName;var _e=V.forwardRef((e,t)=>{let n=(0,B.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,sideOffset:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=a===void 0?4:a,s;n[4]===r?s=n[5]:(s=P(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,r),n[4]=r,n[5]=s);let l;return n[6]!==i||n[7]!==t||n[8]!==o||n[9]!==s?(l=(0,H.jsx)(u,{children:(0,H.jsx)(c,{ref:t,sideOffset:o,className:s,...i})}),n[6]=i,n[7]=t,n[8]=o,n[9]=s,n[10]=l):l=n[10],l});_e.displayName=c.displayName;var ve=V.forwardRef((e,t)=>{let n=(0,B.c)(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,inset:i,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o=i&&`pl-8`,s;n[4]!==r||n[5]!==o?(s=P(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,o,r),n[4]=r,n[5]=o,n[6]=s):s=n[6];let c;return n[7]!==a||n[8]!==t||n[9]!==s?(c=(0,H.jsx)(d,{ref:t,className:s,...a}),n[7]=a,n[8]=t,n[9]=s,n[10]=c):c=n[10],c});ve.displayName=d.displayName;var ye=V.forwardRef((e,t)=>{let n=(0,B.c)(14),a,o,s,c;n[0]===e?(a=n[1],o=n[2],s=n[3],c=n[4]):({className:s,children:o,checked:a,...c}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s,n[4]=c);let l;n[5]===s?l=n[6]:(l=P(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,s),n[5]=s,n[6]=l);let u;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(i,{children:(0,H.jsx)(y,{className:`h-4 w-4`})})}),n[7]=u):u=n[7];let d;return n[8]!==a||n[9]!==o||n[10]!==c||n[11]!==t||n[12]!==l?(d=(0,H.jsxs)(r,{ref:t,className:l,checked:a,...c,children:[u,o]}),n[8]=a,n[9]=o,n[10]=c,n[11]=t,n[12]=l,n[13]=d):d=n[13],d});ye.displayName=r.displayName;var K=V.forwardRef((e,t)=>{let n=(0,B.c)(12),r,a,o;n[0]===e?(r=n[1],a=n[2],o=n[3]):({className:a,children:r,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o);let s;n[4]===a?s=n[5]:(s=P(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,a),n[4]=a,n[5]=s);let c;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,H.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,H.jsx)(i,{children:(0,H.jsx)(L,{className:`h-2 w-2 fill-current`})})}),n[6]=c):c=n[6];let u;return n[7]!==r||n[8]!==o||n[9]!==t||n[10]!==s?(u=(0,H.jsxs)(l,{ref:t,className:s,...o,children:[c,r]}),n[7]=r,n[8]=o,n[9]=t,n[10]=s,n[11]=u):u=n[11],u});K.displayName=l.displayName;var be=V.forwardRef((e,t)=>{let n=(0,B.c)(11),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,inset:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s=i&&`pl-8`,c;n[4]!==r||n[5]!==s?(c=P(`px-2 py-1.5 text-sm font-semibold`,s,r),n[4]=r,n[5]=s,n[6]=c):c=n[6];let l;return n[7]!==o||n[8]!==t||n[9]!==c?(l=(0,H.jsx)(a,{ref:t,className:c,...o}),n[7]=o,n[8]=t,n[9]=c,n[10]=l):l=n[10],l});be.displayName=a.displayName;var xe=V.forwardRef((e,t)=>{let n=(0,B.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=P(`-mx-1 my-1 h-px bg-muted`,r),n[3]=r,n[4]=a);let s;return n[5]!==i||n[6]!==t||n[7]!==a?(s=(0,H.jsx)(o,{ref:t,className:a,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=s):s=n[8],s});xe.displayName=o.displayName;var q=e=>{let t=(0,B.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(`ml-auto text-xs tracking-widest opacity-60`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,H.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a};q.displayName=`DropdownMenuShortcut`;function Se(e){if(!e)return null;try{return D(new Date(e),`dd MMM yyyy`,{locale:O})}catch{return null}}function J(e){let t=(0,B.c)(165),{agent:n,onEdit:r}=e,i=se(),{deleteAgent:a}=fe(),{providers:o}=ue(),{models:s}=le(),c;t[0]!==n.id||t[1]!==i?(c=e=>{e.target.closest(`[role="menuitem"]`)||e.target.closest(`button`)||i(`/agents/${n.id}`)},t[0]=n.id,t[1]=i,t[2]=c):c=t[2];let l=c,u;t[3]!==n.id||t[4]!==n.name||t[5]!==a?(u=async e=>{if(e.stopPropagation(),(await F.fire({title:`¿Eliminar Agente?`,text:`¿Estás seguro de que deseas eliminar al agente "${n.name}"? Esta acción eliminará permanentemente su configuración.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,reverseButtons:!0,background:`#09090b`,color:`#fff`,customClass:{popup:`border border-white/10 rounded-xl`,confirmButton:`bg-red-500 hover:bg-red-600 text-white`,cancelButton:`bg-white/10 hover:bg-white/20 text-white`}})).isConfirmed)try{await a(n.id)}catch(e){console.error(e)}},t[3]=n.id,t[4]=n.name,t[5]=a,t[6]=u):u=t[6];let d=u,f=n.role===`coordinator`,p=n.provider_id||n.providerId,m=n.model_id||n.modelId,h;t[7]!==p||t[8]!==o?(h=o.find(e=>e.id===p)?.name||p,t[7]=p,t[8]=o,t[9]=h):h=t[9];let g=h,_;t[10]!==m||t[11]!==s?(_=s.find(e=>e.id===m)?.name||m,t[10]=m,t[11]=s,t[12]=_):_=t[12];let y=_,b=n.enabled?n.status:`hibernated`,D;t[13]===n?D=t[14]:(D=k(n),t[13]=n,t[14]=D);let O=D.length,j;t[15]===n?j=t[16]:(j=te(n),t[15]=n,t[16]=j);let ne=j.length,re=!!n.systemPrompt,ie=n.maxIterations||10,M=n.created_at||n.createdAt,P;t[17]===M?P=t[18]:(P=Se(M),t[17]=M,t[18]=P);let de=P,pe=`group relative overflow-hidden rounded-2xl border bg-black/40 backdrop-blur-xl transition-all duration-500 cursor-pointer flex flex-col h-full
|
|
2
|
+
${n.enabled?f?`border-purple-500/20 hover:border-purple-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(168,85,247,0.15)]`:`border-white/10 hover:border-blue-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(59,130,246,0.15)]`:`border-white/5 opacity-70 grayscale hover:grayscale-0`}
|
|
3
|
+
`,me;t[19]!==n.id||t[20]!==i?(me=e=>{(e.key===`Enter`||e.key===` `)&&i(`/agents/${n.id}`)},t[19]=n.id,t[20]=i,t[21]=me):me=t[21];let he;t[22]!==n.enabled||t[23]!==f?(he=n.enabled&&(0,H.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${f?`via-purple-500/60`:`via-blue-500/50`} to-transparent`}),t[22]=n.enabled,t[23]=f,t[24]=he):he=t[24];let L;t[25]!==n.enabled||t[26]!==f?(L=n.enabled&&(0,H.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br ${f?`from-purple-500/10 via-transparent to-blue-500/5`:`from-blue-500/10 via-transparent to-purple-500/10`} opacity-0 transition-opacity duration-500 group-hover:opacity-100 pointer-events-none`}),t[25]=n.enabled,t[26]=f,t[27]=L):L=t[27];let V=`w-11 h-11 rounded-xl flex items-center justify-center shrink-0 border transition-colors
|
|
4
|
+
${f?`bg-purple-500/10 border-purple-500/20 group-hover:border-purple-500/40`:`bg-blue-500/10 border-blue-500/20 group-hover:border-blue-500/40`}`,W;t[28]===f?W=t[29]:(W=f?(0,H.jsx)(ae,{className:`h-5 w-5 text-purple-400`}):(0,H.jsx)(x,{className:`h-5 w-5 text-blue-400`}),t[28]=f,t[29]=W);let G;t[30]!==V||t[31]!==W?(G=(0,H.jsx)(`div`,{className:V,children:W}),t[30]=V,t[31]=W,t[32]=G):G=t[32];let ye=`text-base font-bold tracking-tight transition-colors truncate ${n.enabled?`text-white/95 group-hover:text-white`:`text-white/40`}`,K;t[33]!==n.name||t[34]!==ye?(K=(0,H.jsx)(`h3`,{className:ye,children:n.name}),t[33]=n.name,t[34]=ye,t[35]=K):K=t[35];let be=`text-[9px] px-2 py-0.5 rounded-full font-bold uppercase border
|
|
5
|
+
${f?`bg-purple-500/10 text-purple-400 border-purple-500/20`:`bg-blue-500/10 text-blue-400 border-blue-500/20`}`,xe=f?`Coordinador`:`Worker`,q;t[36]!==be||t[37]!==xe?(q=(0,H.jsx)(`span`,{className:be,children:xe}),t[36]=be,t[37]=xe,t[38]=q):q=t[38];let J;t[39]===n.hasHeaders?J=t[40]:(J=n.hasHeaders&&(0,H.jsx)(`span`,{title:`Credenciales Mapeadas`,className:`flex items-center justify-center p-0.5 rounded bg-emerald-500/10 border border-emerald-500/20`,children:(0,H.jsx)(E,{className:`h-2.5 w-2.5 text-emerald-400`})}),t[39]=n.hasHeaders,t[40]=J);let Y;t[41]===n.parentId?Y=t[42]:(Y=n.parentId&&(0,H.jsx)(`span`,{title:`Sub-agente`,className:`flex items-center justify-center p-0.5 rounded bg-amber-500/10 border border-amber-500/20`,children:(0,H.jsx)(R,{className:`h-2.5 w-2.5 text-amber-400`})}),t[41]=n.parentId,t[42]=Y);let X;t[43]!==q||t[44]!==J||t[45]!==Y?(X=(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5 flex-wrap`,children:[q,J,Y]}),t[43]=q,t[44]=J,t[45]=Y,t[46]=X):X=t[46];let Ce;t[47]!==K||t[48]!==X?(Ce=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[K,X]}),t[47]=K,t[48]=X,t[49]=Ce):Ce=t[49];let Z;t[50]!==G||t[51]!==Ce?(Z=(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[G,Ce]}),t[50]=G,t[51]=Ce,t[52]=Z):Z=t[52];let Q;t[53]===b?Q=t[54]:(Q=(0,H.jsx)(A,{status:b}),t[53]=b,t[54]=Q);let we;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,H.jsx)(U,{asChild:!0,children:(0,H.jsx)(I,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-white/40 hover:text-white hover:bg-white/10 rounded-full transition-colors`,children:(0,H.jsx)(S,{className:`h-4 w-4`})})}),t[55]=we):we=t[55];let $;t[56]!==n||t[57]!==r?($=()=>r?.(n),t[56]=n,t[57]=r,t[58]=$):$=t[58];let Te,Ee;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,H.jsx)(z,{className:`h-4 w-4 text-blue-400`}),Ee=(0,H.jsx)(`span`,{children:`Editar Configuración`}),t[59]=Te,t[60]=Ee):(Te=t[59],Ee=t[60]);let De;t[61]===$?De=t[62]:(De=(0,H.jsxs)(ve,{onClick:$,className:`gap-2 cursor-pointer focus:bg-white/10 focus:text-white rounded-lg px-3 py-2 text-sm transition-colors`,children:[Te,Ee]}),t[61]=$,t[62]=De);let Oe,ke;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,H.jsx)(N,{className:`h-4 w-4`}),ke=(0,H.jsx)(`span`,{children:`Eliminar Agente`}),t[63]=Oe,t[64]=ke):(Oe=t[63],ke=t[64]);let Ae;t[65]===d?Ae=t[66]:(Ae=(0,H.jsxs)(ve,{onClick:d,className:`gap-2 cursor-pointer focus:bg-red-500/20 focus:text-red-400 rounded-lg px-3 py-2 text-sm text-red-400 transition-colors`,children:[Oe,ke]}),t[65]=d,t[66]=Ae);let je;t[67]!==De||t[68]!==Ae?(je=(0,H.jsxs)(ge,{children:[we,(0,H.jsxs)(_e,{align:`end`,className:`w-48 bg-black/90 backdrop-blur-xl border-white/10 text-white p-1 rounded-xl shadow-2xl`,children:[De,Ae]})]}),t[67]=De,t[68]=Ae,t[69]=je):je=t[69];let Me;t[70]!==Q||t[71]!==je?(Me=(0,H.jsxs)(`div`,{className:`flex flex-col items-end gap-2 shrink-0`,children:[Q,je]}),t[70]=Q,t[71]=je,t[72]=Me):Me=t[72];let Ne;t[73]!==Z||t[74]!==Me?(Ne=(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-4`,children:[Z,Me]}),t[73]=Z,t[74]=Me,t[75]=Ne):Ne=t[75];let Pe=n.description||`Sin descripción`,Fe;t[76]===Pe?Fe=t[77]:(Fe=(0,H.jsx)(`p`,{className:`text-xs text-white/50 line-clamp-2 leading-relaxed font-light mb-1`,children:Pe}),t[76]=Pe,t[77]=Fe);let Ie;t[78]!==n.enabled||t[79]!==p||t[80]!==g?(Ie=p&&(0,H.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
|
|
6
|
+
${n.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,H.jsx)(x,{className:`h-3 w-3`}),g]}),t[78]=n.enabled,t[79]=p,t[80]=g,t[81]=Ie):Ie=t[81];let Le;t[82]!==n.enabled||t[83]!==m||t[84]!==y?(Le=m&&(0,H.jsx)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium tracking-wider border backdrop-blur-md transition-colors truncate max-w-[120px]
|
|
7
|
+
${n.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,title:y,children:y}),t[82]=n.enabled,t[83]=m,t[84]=y,t[85]=Le):Le=t[85];let Re;t[86]!==n.enabled||t[87]!==n.tone?(Re=n.tone&&(0,H.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
|
|
8
|
+
${n.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,H.jsx)(ee,{className:`h-3 w-3`}),n.tone]}),t[86]=n.enabled,t[87]=n.tone,t[88]=Re):Re=t[88];let ze;t[89]!==n.enabled||t[90]!==n.workspace?(ze=n.workspace&&(0,H.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
|
|
9
|
+
${n.enabled?`bg-emerald-500/5 border-emerald-500/20 text-emerald-300 group-hover:bg-emerald-500/10 group-hover:border-emerald-500/30`:`bg-transparent border-white/5 text-white/30`}`,title:`Workspace: ${n.workspace}`,children:[(0,H.jsx)(w,{className:`h-3 w-3`}),(0,H.jsx)(`span`,{className:`truncate max-w-[100px]`,children:`Workspace`})]}),t[89]=n.enabled,t[90]=n.workspace,t[91]=ze):ze=t[91];let Be;t[92]!==Ie||t[93]!==Le||t[94]!==Re||t[95]!==ze?(Be=(0,H.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[Ie,Le,Re,ze]}),t[92]=Ie,t[93]=Le,t[94]=Re,t[95]=ze,t[96]=Be):Be=t[96];let Ve;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,H.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,H.jsx)(ce,{className:`h-3 w-3 text-emerald-400/70`}),`Tools`]}),t[97]=Ve):Ve=t[97];let He=`text-sm font-semibold font-mono ${n.enabled?`text-white/90`:`text-white/30`}`,Ue;t[98]!==He||t[99]!==O?(Ue=(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[Ve,(0,H.jsx)(`span`,{className:He,children:O})]}),t[98]=He,t[99]=O,t[100]=Ue):Ue=t[100];let We;t[101]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,H.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,H.jsx)(oe,{className:`h-3 w-3 text-amber-400/70`}),`Skills`]}),t[101]=We):We=t[101];let Ge=`text-sm font-semibold font-mono ${n.enabled?`text-white/90`:`text-white/30`}`,Ke;t[102]!==ne||t[103]!==Ge?(Ke=(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[We,(0,H.jsx)(`span`,{className:Ge,children:ne})]}),t[102]=ne,t[103]=Ge,t[104]=Ke):Ke=t[104];let qe;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,H.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,H.jsx)(C,{className:`h-3 w-3 text-blue-400/70`}),`Prompt`]}),t[105]=qe):qe=t[105];let Je=`text-sm font-bold ${n.enabled?re?`text-emerald-400`:`text-white/30`:`text-white/20`}`,Ye=re?`✓`:`—`,Xe;t[106]!==Je||t[107]!==Ye?(Xe=(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[qe,(0,H.jsx)(`span`,{className:Je,children:Ye})]}),t[106]=Je,t[107]=Ye,t[108]=Xe):Xe=t[108];let Ze;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,H.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,H.jsx)(T,{className:`h-3 w-3 text-purple-400/70`}),`Iters`]}),t[109]=Ze):Ze=t[109];let Qe=`text-sm font-semibold font-mono ${n.enabled?`text-white/90`:`text-white/30`}`,$e;t[110]!==ie||t[111]!==Qe?($e=(0,H.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[Ze,(0,H.jsx)(`span`,{className:Qe,children:ie})]}),t[110]=ie,t[111]=Qe,t[112]=$e):$e=t[112];let et;t[113]!==Ue||t[114]!==Ke||t[115]!==Xe||t[116]!==$e?(et=(0,H.jsxs)(`div`,{className:`mt-6 pt-5 border-t border-white/5 grid grid-cols-4 gap-2`,children:[Ue,Ke,Xe,$e]}),t[113]=Ue,t[114]=Ke,t[115]=Xe,t[116]=$e,t[117]=et):et=t[117];let tt;t[118]===n.systemPrompt?tt=t[119]:(tt=n.systemPrompt&&(0,H.jsxs)(`div`,{className:`mt-3 bg-white/[0.02] rounded-lg p-3 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,H.jsxs)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase mb-1.5 flex items-center gap-1.5`,children:[(0,H.jsx)(C,{className:`h-3 w-3 text-blue-400/70`}),`System Prompt`]}),(0,H.jsxs)(`p`,{className:`text-xs text-white/60 font-mono line-clamp-2 leading-relaxed italic`,children:[`"`,n.systemPrompt,`"`]})]}),t[118]=n.systemPrompt,t[119]=tt);let nt;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,H.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Tareas`}),t[120]=nt):nt=t[120];let rt=`text-sm font-semibold font-mono ${n.enabled?`text-white/90`:`text-white/30`}`,it=n.taskCount||0,at;t[121]!==rt||t[122]!==it?(at=(0,H.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[nt,(0,H.jsx)(`span`,{className:rt,children:it})]}),t[121]=rt,t[122]=it,t[123]=at):at=t[123];let ot;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,H.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Éxito`}),t[124]=ot):ot=t[124];let st=`text-sm font-semibold font-mono ${n.enabled?`text-emerald-400/90`:`text-white/30`}`,ct=n.successRate||0,lt;t[125]!==st||t[126]!==ct?(lt=(0,H.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[ot,(0,H.jsxs)(`span`,{className:st,children:[ct,`%`]})]}),t[125]=st,t[126]=ct,t[127]=lt):lt=t[127];let ut;t[128]!==at||t[129]!==lt?(ut=(0,H.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[at,lt]}),t[128]=at,t[129]=lt,t[130]=ut):ut=t[130];let dt=`h-2 w-2 rounded-full ${n.enabled?`bg-blue-400 shadow-[0_0_8px_rgba(96,165,250,0.8)] animate-pulse`:`bg-white/20`}`,ft;t[131]===dt?ft=t[132]:(ft=(0,H.jsx)(`div`,{className:dt}),t[131]=dt,t[132]=ft);let pt=`text-[10px] font-bold tracking-widest uppercase ${n.enabled?`text-blue-400`:`text-white/30`}`,mt=n.enabled?`ACTIVO`:`INACTIVO`,ht;t[133]!==pt||t[134]!==mt?(ht=(0,H.jsx)(`span`,{className:pt,children:mt}),t[133]=pt,t[134]=mt,t[135]=ht):ht=t[135];let gt;t[136]!==ft||t[137]!==ht?(gt=(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ft,ht]}),t[136]=ft,t[137]=ht,t[138]=gt):gt=t[138];let _t;t[139]===de?_t=t[140]:(_t=de&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-white/30 font-medium tracking-wider pl-3 border-l border-white/10`,children:[(0,H.jsx)(v,{className:`h-3 w-3`}),de]}),t[139]=de,t[140]=_t);let vt;t[141]!==gt||t[142]!==_t?(vt=(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[gt,_t]}),t[141]=gt,t[142]=_t,t[143]=vt):vt=t[143];let yt=`text-xs font-semibold tracking-wide flex items-center gap-1.5 transition-all
|
|
10
|
+
${n.enabled?`text-white/70 group-hover:text-blue-400 translate-x-1 group-hover:translate-x-0`:`text-white/20`}`,bt;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,H.jsx)(`span`,{className:`transition-transform group-hover:translate-x-1 opacity-0 group-hover:opacity-100 hidden sm:inline-block`,children:`→`}),t[144]=bt):bt=t[144];let xt;t[145]===yt?xt=t[146]:(xt=(0,H.jsxs)(`div`,{className:yt,children:[`INGRESAR`,bt]}),t[145]=yt,t[146]=xt);let St;t[147]!==vt||t[148]!==xt?(St=(0,H.jsxs)(`div`,{className:`mt-auto pt-5 flex items-center justify-between`,children:[vt,xt]}),t[147]=vt,t[148]=xt,t[149]=St):St=t[149];let Ct;t[150]!==Ne||t[151]!==Fe||t[152]!==Be||t[153]!==et||t[154]!==tt||t[155]!==ut||t[156]!==St?(Ct=(0,H.jsxs)(`div`,{className:`p-5 flex flex-col flex-1 relative z-10`,children:[Ne,Fe,Be,et,tt,ut,St]}),t[150]=Ne,t[151]=Fe,t[152]=Be,t[153]=et,t[154]=tt,t[155]=ut,t[156]=St,t[157]=Ct):Ct=t[157];let wt;return t[158]!==l||t[159]!==me||t[160]!==he||t[161]!==L||t[162]!==Ct||t[163]!==pe?(wt=(0,H.jsxs)(`div`,{role:`button`,tabIndex:0,className:pe,onClick:l,onKeyDown:me,children:[he,L,Ct]}),t[158]=l,t[159]=me,t[160]=he,t[161]=L,t[162]=Ct,t[163]=pe,t[164]=wt):wt=t[164],wt}var Y=Math.sqrt(3),X=82;function Ce(e,t){return{x:X*1.5*e,y:X*(Y/2*e+Y*t)}}var Z=[{q:1,r:0},{q:1,r:-1},{q:0,r:-1},{q:-1,r:0},{q:-1,r:1},{q:0,r:1}],Q=[{q:2,r:0},{q:2,r:-1},{q:2,r:-2},{q:1,r:-2},{q:0,r:-2},{q:-1,r:-1},{q:-2,r:0},{q:-2,r:1},{q:-2,r:2},{q:-1,r:2},{q:0,r:2},{q:1,r:1}];function we(e,t){return t<=0?[]:t>=e.length?e:Array.from({length:t},(n,r)=>e[Math.floor(r*e.length/t)])}var $=`polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)`,Te={active:{bg:`#22c55e22`,dot:`#22c55e`,glow:`0 0 12px #22c55e88`},idle:{bg:`#f59e0b22`,dot:`#f59e0b`,glow:`0 0 12px #f59e0b88`},thinking:{bg:`#6366f122`,dot:`#818cf8`,glow:`0 0 12px #6366f188`},error:{bg:`#ef444422`,dot:`#ef4444`,glow:`0 0 12px #ef444488`},hibernated:{bg:`#1f293700`,dot:`#4b5563`,glow:`none`}};function Ee(e){if(!e)return 0;try{let t=JSON.parse(e);return Array.isArray(t)?t.length:0}catch{return 0}}function De(e){let t=(0,B.c)(85),{agents:n,onEdit:r,selectedId:i,onSelect:a}=e,o=se(),{deleteAgent:s}=fe(),[c,l]=(0,V.useState)(null),u;t[0]===n?u=t[1]:(u=n.find(ke)??n[0],t[0]=n,t[1]=u);let d=u,f;if(t[2]!==n||t[3]!==d?.id){let e;t[5]===d?.id?e=t[6]:(e=e=>e.id!==d?.id,t[5]=d?.id,t[6]=e),f=n.filter(e),t[2]=n,t[3]=d?.id,t[4]=f}else f=t[4];let p=f,m;t[7]!==d||t[8]!==p?(m={coordinator:d,workers:p},t[7]=d,t[8]=p,t[9]=m):m=t[9];let{coordinator:h,workers:g}=m,ee=Math.min(g.length,Z.length),_=Math.min(Math.max(g.length-Z.length,0),Q.length),v;t[10]!==ee||t[11]!==_?(v=[...we(Z,ee),...we(Q,_)].map(Oe),t[10]=ee,t[11]=_,t[12]=v):v=t[12];let y=v,b,S,C,w,T,E,D;if(t[13]!==y||t[14]!==h||t[15]!==s||t[16]!==c||t[17]!==o||t[18]!==r||t[19]!==a||t[20]!==i||t[21]!==g){let e=g.slice(0,y.length),n=g.length>6?2:1,u=n===2?700:520,d=n===2?680:500,f=u/2,p=d/2,m=Math.round(164*Y/2),ee=Math.round(124*Y/2),_;t[29]===s?_=t[30]:(_=async(e,t)=>{if(t.stopPropagation(),(await F.fire({title:`¿Eliminar Agente?`,text:`¿Eliminar "${e.name}"?`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,background:`#09090b`,color:`#fff`})).isConfirmed)try{await s(e.id)}catch(e){console.error(`No se pudo eliminar el agente:`,e)}},t[29]=s,t[30]=_);let v=_,O=h?Te[h.enabled?h.status:`hibernated`]??Te.hibernated:Te.hibernated;S=`w-full overflow-x-auto overflow-y-visible py-3`,C=`relative mx-auto select-none`,t[31]!==d||t[32]!==u?(w={width:u,height:d},t[31]=d,t[32]=u,t[33]=w):w=t[33];let k=f-130,A=p-130;t[34]!==k||t[35]!==A?(T=(0,H.jsx)(`div`,{className:`absolute pointer-events-none rounded-full blur-[80px] opacity-30`,style:{width:260,height:260,left:k,top:A,background:`radial-gradient(circle, rgba(245,158,11,0.6) 0%, transparent 70%)`}}),t[34]=k,t[35]=A,t[36]=T):T=t[36];let j;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,H.jsx)(`pattern`,{id:`hc-hex`,x:`0`,y:`0`,width:`52`,height:`30`,patternUnits:`userSpaceOnUse`,children:(0,H.jsx)(`polygon`,{points:`26,1 51,15.5 51,29 26,29 1,15.5 1,1`,fill:`none`,stroke:`rgba(255,255,255,0.03)`,strokeWidth:`1`})}),t[37]=j):j=t[37];let te;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,H.jsxs)(`defs`,{children:[j,(0,H.jsxs)(`radialGradient`,{id:`fade-mask`,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,H.jsx)(`stop`,{offset:`0%`,stopColor:`white`,stopOpacity:`0.08`}),(0,H.jsx)(`stop`,{offset:`100%`,stopColor:`white`,stopOpacity:`0`})]})]}),t[38]=te):te=t[38];let ne,re;t[39]!==d||t[40]!==u?(ne=(0,H.jsx)(`rect`,{width:u,height:d,fill:`url(#hc-hex)`}),re=(0,H.jsx)(`rect`,{width:u,height:d,fill:`url(#fade-mask)`}),t[39]=d,t[40]=u,t[41]=ne,t[42]=re):(ne=t[41],re=t[42]);let ie;t[43]!==y||t[44]!==f||t[45]!==p||t[46]!==c||t[47]!==i?(ie=(e,t)=>{let n=y[t],r=c===e.id||i===e.id;return(0,H.jsxs)(`g`,{children:[(0,H.jsx)(`line`,{x1:f,y1:p,x2:f+n.x,y2:p+n.y,stroke:r?`rgba(245,158,11,0.5)`:`rgba(245,158,11,0.12)`,strokeWidth:r?2:1,strokeDasharray:`5 5`,style:{transition:`stroke 0.3s ease, stroke-width 0.3s ease`}}),e.enabled&&(0,H.jsx)(`circle`,{r:`3`,fill:`rgba(245,158,11,0.7)`,children:(0,H.jsx)(`animateMotion`,{dur:`${2.5+t*.4}s`,repeatCount:`indefinite`,path:`M ${f} ${p} L ${f+n.x} ${p+n.y}`})})]},`line-${e.id}`)},t[43]=y,t[44]=f,t[45]=p,t[46]=c,t[47]=i,t[48]=ie):ie=t[48],E=(0,H.jsxs)(`svg`,{className:`absolute inset-0 pointer-events-none`,width:u,height:d,xmlns:`http://www.w3.org/2000/svg`,children:[te,ne,re,e.map(ie)]}),t[49]!==O||t[50]!==h||t[51]!==f||t[52]!==p||t[53]!==o||t[54]!==r||t[55]!==a||t[56]!==i?(D=h&&(0,H.jsxs)(`div`,{className:`absolute z-20 cursor-pointer group outline-none`,style:{left:f-82,top:p-m/2,width:164,height:m},onMouseEnter:()=>l(h.id),onMouseLeave:()=>l(null),children:[(0,H.jsx)(`button`,{type:`button`,className:`absolute inset-0 z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-300/70`,style:{clipPath:$},onClick:()=>a?.(h.id),"aria-label":`Seleccionar ${h.name}`,"aria-pressed":i===h.id}),(0,H.jsx)(`div`,{className:`absolute inset-[-6px] blur-[10px] transition-opacity duration-500 ${i===h.id?`opacity-90`:`opacity-40 group-hover:opacity-80`}`,style:{clipPath:$,background:`rgba(245,158,11,0.5)`}}),(0,H.jsx)(`div`,{className:`absolute inset-0 transition-transform duration-300 ${i===h.id?`scale-105`:`group-hover:scale-105`}`,style:{clipPath:$,background:`rgba(245,158,11,0.55)`},children:(0,H.jsx)(`div`,{className:`absolute inset-[2px]`,style:{clipPath:$,background:`linear-gradient(145deg, #1c1100 0%, #0d0b00 60%, #120d00 100%)`},children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-1.5 px-3`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(ae,{className:`h-8 w-8 text-amber-400 drop-shadow-[0_0_8px_rgba(245,158,11,0.8)]`}),(0,H.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-black`,style:{backgroundColor:O.dot,boxShadow:O.glow}})]}),(0,H.jsx)(`span`,{className:`text-[10px] font-black text-amber-300 tracking-[0.12em] text-center leading-tight uppercase line-clamp-2`,children:h.name}),(0,H.jsx)(`span`,{className:`text-[8px] text-amber-500/70 tracking-widest uppercase font-semibold`,children:`Coordinadora`})]})})}),(0,H.jsxs)(`div`,{className:`pointer-events-none absolute -bottom-8 left-1/2 z-30 flex -translate-x-1/2 gap-1 opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100`,children:[(0,H.jsx)(`button`,{type:`button`,className:`p-1.5 rounded bg-black/80 border border-amber-500/30 text-amber-400 hover:bg-amber-500/20 transition-colors`,onClick:e=>{e.stopPropagation(),r?.(h)},title:`Editar`,children:(0,H.jsx)(z,{className:`h-3 w-3`})}),(0,H.jsx)(`button`,{type:`button`,className:`p-1.5 rounded bg-black/80 border border-white/10 text-white/50 hover:text-white hover:border-white/20 transition-colors`,onClick:e=>{e.stopPropagation(),o(`/agents/${h.id}`)},title:`Ver detalle`,children:(0,H.jsx)(`span`,{className:`text-[9px] px-0.5`,children:`→`})})]})]}),t[49]=O,t[50]=h,t[51]=f,t[52]=p,t[53]=o,t[54]=r,t[55]=a,t[56]=i,t[57]=D):D=t[57];let M;t[58]!==y||t[59]!==f||t[60]!==p||t[61]!==v||t[62]!==c||t[63]!==o||t[64]!==r||t[65]!==a||t[66]!==i?(M=(e,t)=>{let n=y[t],s=f+n.x-62,u=p+n.y-ee/2,d=Te[e.enabled?e.status:`hibernated`]??Te.hibernated,m=Ee(e.toolsJson),h=Ee(e.skillsJson),g=c===e.id,_=i===e.id,b=e.enabled?_?`rgba(245,158,11,0.95)`:g?`rgba(96,165,250,0.9)`:`rgba(59,130,246,0.45)`:`rgba(255,255,255,0.08)`,S=e.enabled?`linear-gradient(145deg, #050d1c 0%, #020912 60%, #040a18 100%)`:`#0a0a0b`;return(0,H.jsxs)(`div`,{className:`absolute z-10 cursor-pointer group outline-none`,style:{left:s,top:u,width:124,height:ee},onMouseEnter:()=>l(e.id),onMouseLeave:()=>l(null),children:[(0,H.jsx)(`button`,{type:`button`,className:`absolute inset-0 z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-300/70`,style:{clipPath:$},onClick:()=>a?.(e.id),"aria-label":`Seleccionar ${e.name}`,"aria-pressed":_}),e.enabled&&(0,H.jsx)(`div`,{className:`absolute inset-[-5px] transition-opacity duration-300 blur-[8px]`,style:{clipPath:$,background:_?`rgba(245,158,11,0.45)`:`rgba(59,130,246,0.35)`,opacity:_?.9:g?.8:.2}}),(0,H.jsx)(`div`,{className:`absolute inset-0 transition-transform duration-300`,style:{clipPath:$,background:b,transform:_?`scale(1.08)`:g?`scale(1.06)`:`scale(1)`},children:(0,H.jsx)(`div`,{className:`absolute inset-[1.5px]`,style:{clipPath:$,background:S},children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-1 px-2`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(x,{className:`h-5 w-5 transition-colors duration-300`,style:{color:_?`#fbbf24`:e.enabled?`#60a5fa`:`#374151`}}),(0,H.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full border border-[#020912]`,style:{backgroundColor:d.dot,boxShadow:d.glow}})]}),(0,H.jsx)(`span`,{className:`text-[8px] font-bold tracking-wide text-center leading-tight uppercase line-clamp-2 transition-colors duration-300`,style:{color:_?`#fde68a`:e.enabled?`#93c5fd`:`#374151`},children:e.name}),(m>0||h>0)&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5`,children:[m>0&&(0,H.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[7px] text-emerald-400/70`,children:[(0,H.jsx)(ce,{className:`h-2 w-2`}),m]}),h>0&&(0,H.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[7px] text-amber-400/70`,children:[(0,H.jsx)(oe,{className:`h-2 w-2`}),h]})]})]})})}),(0,H.jsx)(`div`,{className:`absolute -bottom-7 left-1/2 -translate-x-1/2 z-30 transition-opacity duration-200`,style:{opacity:+!!g,pointerEvents:g?`auto`:`none`},children:(0,H.jsxs)(`div`,{className:`flex gap-1`,children:[(0,H.jsx)(`button`,{type:`button`,className:`p-1 rounded bg-black/80 border border-blue-500/30 text-blue-400 hover:bg-blue-500/20 transition-colors`,onClick:t=>{t.stopPropagation(),r?.(e)},title:`Editar`,children:(0,H.jsx)(z,{className:`h-2.5 w-2.5`})}),(0,H.jsx)(`button`,{type:`button`,className:`p-1 rounded bg-black/80 border border-white/10 text-white/50 hover:text-white transition-colors`,onClick:t=>{t.stopPropagation(),o(`/agents/${e.id}`)},title:`Ver`,children:(0,H.jsx)(`span`,{className:`text-[8px]`,children:`→`})}),(0,H.jsx)(`button`,{type:`button`,className:`p-1 rounded bg-black/80 border border-red-500/20 text-red-400/60 hover:text-red-400 transition-colors`,onClick:t=>v(e,t),title:`Eliminar`,children:(0,H.jsx)(N,{className:`h-2.5 w-2.5`})})]})})]},e.id)},t[58]=y,t[59]=f,t[60]=p,t[61]=v,t[62]=c,t[63]=o,t[64]=r,t[65]=a,t[66]=i,t[67]=M):M=t[67],b=e.map(M),t[13]=y,t[14]=h,t[15]=s,t[16]=c,t[17]=o,t[18]=r,t[19]=a,t[20]=i,t[21]=g,t[22]=b,t[23]=S,t[24]=C,t[25]=w,t[26]=T,t[27]=E,t[28]=D}else b=t[22],S=t[23],C=t[24],w=t[25],T=t[26],E=t[27],D=t[28];let O;t[68]===g.length?O=t[69]:(O=g.length>Z.length+Q.length&&(0,H.jsxs)(`div`,{className:`absolute bottom-6 right-6 text-[11px] text-white/50 bg-white/5 rounded-full px-3 py-1 border border-white/10 backdrop-blur-sm`,children:[`+`,g.length-Z.length-Q.length,` agentes en lista`]}),t[68]=g.length,t[69]=O);let k;t[70]!==b||t[71]!==O||t[72]!==C||t[73]!==w||t[74]!==T||t[75]!==E||t[76]!==D?(k=(0,H.jsxs)(`div`,{className:C,style:w,children:[T,E,D,b,O]}),t[70]=b,t[71]=O,t[72]=C,t[73]=w,t[74]=T,t[75]=E,t[76]=D,t[77]=k):k=t[77];let A;t[78]!==o||t[79]!==g?(A=g.length>Z.length+Q.length&&(0,H.jsx)(`div`,{className:`mt-4 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 max-w-[740px] mx-auto px-4`,children:g.slice(Z.length+Q.length).map(e=>(0,H.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 px-3 py-2 rounded-lg border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] transition-colors text-left group`,onClick:()=>o(`/agents/${e.id}`),children:[(0,H.jsx)(x,{className:`h-4 w-4 text-blue-400/60 shrink-0`}),(0,H.jsx)(`span`,{className:`text-xs text-white/60 group-hover:text-white/90 truncate transition-colors`,children:e.name})]},e.id))}),t[78]=o,t[79]=g,t[80]=A):A=t[80];let j;return t[81]!==S||t[82]!==k||t[83]!==A?(j=(0,H.jsxs)(`div`,{className:S,children:[k,A]}),t[81]=S,t[82]=k,t[83]=A,t[84]=j):j=t[84],j}function Oe(e){let{q:t,r:n}=e;return Ce(t,n)}function ke(e){return e.role===`coordinator`}function Ae(e){let t=(0,B.c)(16),{agents:n,onEdit:r,selectedId:i,onSelect:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,H.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,H.jsx)(`div`,{className:`p-4 rounded-full bg-white/5 mb-4`,children:(0,H.jsx)(`div`,{className:`h-10 w-10 border-2 border-dashed border-white/20 rounded-full`})}),(0,H.jsx)(`p`,{className:`hive-label uppercase`,children:`No se detectaron nodos activos`}),(0,H.jsx)(`p`,{className:`text-xs text-white/20 mt-1`,children:`Comienza desplegando un nuevo agente en tu red.`})]}),t[0]=e):e=t[0],e}let o;t[1]!==n||t[2]!==r||t[3]!==a||t[4]!==i?(o=(0,H.jsx)(`div`,{className:`hidden md:block`,children:(0,H.jsx)(De,{agents:n,onEdit:r,selectedId:i,onSelect:a})}),t[1]=n,t[2]=r,t[3]=a,t[4]=i,t[5]=o):o=t[5];let s;if(t[6]!==n||t[7]!==r){let e;t[9]===r?e=t[10]:(e=e=>(0,H.jsx)(J,{agent:e,onEdit:r},e.id),t[9]=r,t[10]=e),s=n.map(e),t[6]=n,t[7]=r,t[8]=s}else s=t[8];let c;t[11]===s?c=t[12]:(c=(0,H.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 pb-20 md:hidden`,children:s}),t[11]=s,t[12]=c);let l;return t[13]!==o||t[14]!==c?(l=(0,H.jsxs)(H.Fragment,{children:[o,c]}),t[13]=o,t[14]=c,t[15]=l):l=t[15],l}function je(){let e=(0,B.c)(60),t=se(),{agents:n,isLoading:r,error:i,fetchAgents:a}=fe(),{providers:o,fetchProviders:s}=ue(),{models:c,fetchModels:l}=le(),[u,d]=(0,V.useState)(!1),[f,p]=(0,V.useState)(),[m,h]=(0,V.useState)(),g,ee;e[0]!==a||e[1]!==l||e[2]!==s?(g=()=>{a(),s(),l()},ee=[a,s,l],e[0]=a,e[1]=l,e[2]=s,e[3]=g,e[4]=ee):(g=e[3],ee=e[4]),(0,V.useEffect)(g,ee);let _;e[5]===n?_=e[6]:(_=n.find(Pe)??n[0],e[5]=n,e[6]=_);let v=_,y;e[7]!==n||e[8]!==v||e[9]!==m?(y=n.find(e=>e.id===m)??v,e[7]=n,e[8]=v,e[9]=m,e[10]=y):y=e[10];let b=y,x;e[11]===n?x=e[12]:(x=n.filter(Ne),e[11]=n,e[12]=x);let S=x.length,C;e[13]===n?C=e[14]:(C=n.filter(Me),e[13]=n,e[14]=C);let w=C.length,T;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{p(e),d(!0)},e[15]=T):T=e[15];let E=T,D;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{p(void 0),d(!0)},e[16]=D):D=e[16];let O=D,k;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{d(!1),p(void 0)},e[17]=k):k=e[17];let A=k,te;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_85%_0%,rgba(59,130,246,0.10),transparent_28%),radial-gradient(circle_at_8%_100%,rgba(245,158,11,0.08),transparent_32%)]`}),e[18]=te):te=e[18];let ne;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,H.jsxs)(`div`,{className:`mb-2.5 flex items-center gap-2 text-[9px] font-bold uppercase tracking-[0.24em] text-blue-400`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-blue-400 shadow-[0_0_8px_rgba(96,165,250,0.8)]`}),`Nexo central · configuración de agentes`]}),e[19]=ne):ne=e[19];let ae;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,H.jsxs)(`div`,{children:[ne,(0,H.jsxs)(`h1`,{className:`text-3xl font-black tracking-[-0.04em] text-white sm:text-4xl`,children:[`Tu colmena `,(0,H.jsx)(`span`,{className:`text-amber-400`,children:`inteligente`})]}),(0,H.jsx)(`p`,{className:`mt-2 max-w-2xl text-sm leading-6 text-white/45`,children:`Selecciona un nodo para revisar su configuración, ajustar su propósito o entrar a su espacio operativo.`})]}),e[20]=ae):ae=e[20];let M;e[21]===S?M=e[22]:(M=(0,H.jsx)(Fe,{value:S,label:`activos`,color:`text-emerald-400`}),e[21]=S,e[22]=M);let N;e[23]===w?N=e[24]:(N=(0,H.jsx)(Fe,{value:w,label:`especialistas`,color:`text-blue-400`}),e[23]=w,e[24]=N);let oe;e[25]!==M||e[26]!==N?(oe=(0,H.jsxs)(`div`,{className:`hidden items-center gap-4 xl:flex`,children:[M,N]}),e[25]=M,e[26]=N,e[27]=oe):oe=e[27];let P;e[28]===a?P=e[29]:(P=()=>a(),e[28]=a,e[29]=P);let ce=`h-3.5 w-3.5 text-blue-400 ${r?`animate-spin`:``}`,F;e[30]===ce?F=e[31]:(F=(0,H.jsx)(ie,{className:ce}),e[30]=ce,e[31]=F);let I;e[32]!==r||e[33]!==P||e[34]!==F?(I=(0,H.jsxs)(`button`,{type:`button`,onClick:P,disabled:r,className:`flex h-10 items-center gap-2 rounded-lg border border-white/10 bg-white/[0.035] px-3.5 text-xs font-semibold text-white/60 transition-colors hover:border-white/20 hover:bg-white/[0.07] hover:text-white disabled:opacity-50`,children:[F,`Sincronizar`]}),e[32]=r,e[33]=P,e[34]=F,e[35]=I):I=e[35];let he;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,H.jsxs)(`button`,{type:`button`,onClick:O,className:`flex h-10 items-center gap-2 rounded-lg border border-amber-300/40 bg-amber-400 px-4 text-xs font-bold text-[#181108] shadow-[0_0_20px_rgba(245,158,11,0.16)] transition hover:bg-amber-300`,children:[(0,H.jsx)(re,{className:`h-3.5 w-3.5`}),`Desplegar nodo`]}),e[36]=he):he=e[36];let L;e[37]===I?L=e[38]:(L=(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[I,he]}),e[37]=I,e[38]=L);let R;e[39]!==oe||e[40]!==L?(R=(0,H.jsxs)(`header`,{className:`relative overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0b0e14]/80 px-5 py-5 shadow-xl shadow-black/10 sm:px-6`,children:[te,(0,H.jsxs)(`div`,{className:`relative flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between`,children:[ae,(0,H.jsxs)(`div`,{className:`flex flex-col items-start gap-3 lg:items-end`,children:[oe,L]})]})]}),e[39]=oe,e[40]=L,e[41]=R):R=e[41];let z;e[42]!==S||e[43]!==n||e[44]!==i||e[45]!==r||e[46]!==c||e[47]!==t||e[48]!==o||e[49]!==b?(z=i?(0,H.jsxs)(`div`,{className:`mt-5 flex items-start gap-3 rounded-xl border border-red-500/20 bg-red-500/[0.07] p-4 text-red-300`,children:[(0,H.jsx)(de,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-xs font-bold uppercase tracking-wider`,children:`Error de enlace`}),(0,H.jsx)(`p`,{className:`mt-1 text-sm text-red-300/60`,children:i})]})]}):r&&n.length===0?(0,H.jsxs)(`div`,{className:`mt-5 grid gap-4 lg:grid-cols-[280px_1fr]`,children:[(0,H.jsx)(`div`,{className:`h-[560px] animate-pulse rounded-2xl border border-white/5 bg-white/[0.02]`}),(0,H.jsx)(`div`,{className:`h-[560px] animate-pulse rounded-2xl border border-white/5 bg-white/[0.02]`})]}):n.length===0?(0,H.jsxs)(`div`,{className:`mt-5 flex min-h-[500px] flex-col items-center justify-center rounded-2xl border border-dashed border-white/10 bg-black/20 px-6 text-center`,children:[(0,H.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-500/20 bg-amber-500/10`,children:(0,H.jsx)(pe,{className:`h-7 w-7 text-amber-400`})}),(0,H.jsx)(`h2`,{className:`mt-5 text-lg font-bold text-white`,children:`Colmena inactiva`}),(0,H.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-white/40`,children:`Despliega el primer agente para crear el núcleo de tu red.`}),(0,H.jsxs)(`button`,{type:`button`,onClick:O,className:`mt-6 flex h-10 items-center gap-2 rounded-lg bg-amber-400 px-4 text-xs font-bold text-[#181108]`,children:[(0,H.jsx)(re,{className:`h-4 w-4`}),`Desplegar primer nodo`]})]}):(0,H.jsxs)(`div`,{className:`mt-5 grid items-start gap-4 lg:grid-cols-[290px_minmax(0,1fr)]`,children:[(0,H.jsx)(Ie,{agent:b,providerName:o.find(e=>e.id===(b?.provider_id||b?.providerId))?.name,modelName:c.find(e=>e.id===(b?.model_id||b?.modelId))?.name,totalAgents:n.length,activeCount:S,onEdit:E,onOpen:e=>t(`/agents/${e.id}`)}),(0,H.jsxs)(`section`,{className:`min-w-0 overflow-hidden rounded-2xl border border-white/[0.08] bg-[#080b11]/75 shadow-2xl shadow-black/15`,children:[(0,H.jsxs)(`div`,{className:`flex flex-col gap-3 border-b border-white/[0.07] px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-lg border border-blue-500/20 bg-blue-500/10`,children:(0,H.jsx)(j,{className:`h-4 w-4 text-blue-400`})}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`text-xs font-bold uppercase tracking-[0.14em] text-white/80`,children:`Mapa de la colmena`}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[10px] text-white/30`,children:`Haz clic en un hexágono para inspeccionarlo`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] font-semibold uppercase tracking-wider text-white/30`,children:[(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-amber-400`}),`Coordinación`]}),(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-blue-400`}),`Especialistas`]})]})]}),(0,H.jsxs)(`div`,{className:`relative min-h-[560px] overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,rgba(245,158,11,0.045),transparent_38%)]`}),(0,H.jsx)(Ae,{agents:n,onEdit:E,selectedId:b?.id,onSelect:h})]})]})]}),e[42]=S,e[43]=n,e[44]=i,e[45]=r,e[46]=c,e[47]=t,e[48]=o,e[49]=b,e[50]=z):z=e[50];let ge;e[51]!==R||e[52]!==z?(ge=(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-[1480px] px-2 py-4 sm:px-4 lg:px-6 lg:py-6`,children:[R,z]}),e[51]=R,e[52]=z,e[53]=ge):ge=e[53];let U;e[54]!==f||e[55]!==u?(U=u&&(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-6`,children:[(0,H.jsx)(`button`,{type:`button`,"aria-label":`Cerrar configuración`,className:`absolute inset-0 cursor-default bg-black/75 backdrop-blur-sm`,onClick:A}),(0,H.jsx)(`div`,{className:`relative max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border border-white/10 bg-[#09090b] shadow-2xl`,children:(0,H.jsx)(me,{initialData:f,onSuccess:A,onCancel:A})})]}),e[54]=f,e[55]=u,e[56]=U):U=e[56];let W;return e[57]!==ge||e[58]!==U?(W=(0,H.jsxs)(`div`,{className:`hive-page min-h-full`,children:[ge,U]}),e[57]=ge,e[58]=U,e[59]=W):W=e[59],W}function Me(e){return e.role===`worker`}function Ne(e){return e.enabled}function Pe(e){return e.role===`coordinator`}function Fe(e){let t=(0,B.c)(8),{value:n,label:r,color:i}=e,a=`text-lg font-black tabular-nums ${i}`,o;t[0]!==a||t[1]!==n?(o=(0,H.jsx)(`span`,{className:a,children:n}),t[0]=a,t[1]=n,t[2]=o):o=t[2];let s;t[3]===r?s=t[4]:(s=(0,H.jsx)(`span`,{className:`text-[9px] font-bold uppercase tracking-wider text-white/25`,children:r}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,H.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function Ie(e){let t=(0,B.c)(94),{agent:n,providerName:r,modelName:i,totalAgents:a,activeCount:o,onEdit:s,onOpen:c}=e,l=se();if(!n)return null;let u=n.role===`coordinator`,d=n.provider_id||n.providerId,f=n.model_id||n.modelId,p;t[0]===n?p=t[1]:(p=k(n),t[0]=n,t[1]=p);let m=p.length,h;t[2]===n?h=t[3]:(h=te(n),t[2]=n,t[3]=h);let g=h.length,v=`h-1 w-full ${u?`bg-amber-400`:`bg-blue-500`}`,y;t[4]===v?y=t[5]:(y=(0,H.jsx)(`div`,{className:v}),t[4]=v,t[5]=y);let b=`flex h-11 w-11 items-center justify-center rounded-xl border ${u?`border-amber-500/20 bg-amber-500/10 text-amber-400`:`border-blue-500/20 bg-blue-500/10 text-blue-400`}`,x;t[6]===u?x=t[7]:(x=u?(0,H.jsx)(ae,{className:`h-5 w-5`}):(0,H.jsx)(he,{className:`h-5 w-5`}),t[6]=u,t[7]=x);let S;t[8]!==b||t[9]!==x?(S=(0,H.jsx)(`div`,{className:b,children:x}),t[8]=b,t[9]=x,t[10]=S):S=t[10];let C=`flex items-center gap-1.5 rounded-full border px-2 py-1 text-[9px] font-bold uppercase tracking-wider ${n.status===`archived`?`border-amber-500/20 bg-amber-500/10 text-amber-400`:n.enabled?`border-emerald-500/20 bg-emerald-500/10 text-emerald-400`:`border-white/10 bg-white/5 text-white/35`}`,T=`h-1.5 w-1.5 rounded-full ${n.status===`archived`?`bg-amber-400`:n.enabled?`bg-emerald-400`:`bg-white/30`}`,E;t[11]===T?E=t[12]:(E=(0,H.jsx)(`span`,{className:T}),t[11]=T,t[12]=E);let D=n.status===`archived`?`Archivado`:n.enabled?`Activo`:`Inactivo`,O;t[13]!==E||t[14]!==D||t[15]!==C?(O=(0,H.jsxs)(`span`,{className:C,children:[E,D]}),t[13]=E,t[14]=D,t[15]=C,t[16]=O):O=t[16];let A;t[17]!==O||t[18]!==S?(A=(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,O]}),t[17]=O,t[18]=S,t[19]=A):A=t[19];let j;t[20]!==n.enabled||t[21]!==n.id||t[22]!==l?(j=!n.enabled&&String(n.id).startsWith(`google_`)&&(0,H.jsxs)(`div`,{className:`mt-4 rounded-xl border border-amber-500/25 bg-amber-500/10 p-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] font-bold text-amber-300`,children:`Necesita tu cuenta de Google`}),(0,H.jsx)(`p`,{className:`mt-1 text-[11px] leading-4 text-white/55`,children:`Este agente se activa solo cuando conectas tu cuenta de Google.`}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>l(`/settings/perfil`),className:`mt-2 rounded-lg border border-amber-500/30 px-2.5 py-1.5 text-[10px] font-bold text-amber-300 hover:bg-amber-500/10`,children:`Conectar en Perfil →`})]}),t[20]=n.enabled,t[21]=n.id,t[22]=l,t[23]=j):j=t[23];let re=`mt-4 text-[9px] font-bold uppercase tracking-[0.2em] ${u?`text-amber-400`:`text-blue-400`}`,ie=u?`Nodo coordinador`:`Nodo especialista`,N;t[24]!==re||t[25]!==ie?(N=(0,H.jsx)(`p`,{className:re,children:ie}),t[24]=re,t[25]=ie,t[26]=N):N=t[26];let P;t[27]===n.name?P=t[28]:(P=(0,H.jsx)(`h2`,{className:`mt-1.5 text-xl font-black leading-tight tracking-tight text-white`,children:n.name}),t[27]=n.name,t[28]=P);let le=n.description||`Este agente todavía no tiene una descripción de propósito.`,F;t[29]===le?F=t[30]:(F=(0,H.jsx)(`p`,{className:`mt-2 line-clamp-3 min-h-[54px] text-xs leading-[18px] text-white/40`,children:le}),t[29]=le,t[30]=F);let ue=r||d||`Sin proveedor`,de;t[31]===ue?de=t[32]:(de=(0,H.jsx)(Le,{icon:he,label:`Motor`,value:ue}),t[31]=ue,t[32]=de);let fe=i||f||`Sin modelo`,I;t[33]===fe?I=t[34]:(I=(0,H.jsx)(Le,{icon:M,label:`Modelo`,value:fe}),t[33]=fe,t[34]=I);let pe=n.workspace||`Sin asignar`,me=!!n.workspace,L;t[35]!==pe||t[36]!==me?(L=(0,H.jsx)(Le,{icon:w,label:`Workspace`,value:pe,mono:me}),t[35]=pe,t[36]=me,t[37]=L):L=t[37];let R;t[38]!==de||t[39]!==I||t[40]!==L?(R=(0,H.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[de,I,L]}),t[38]=de,t[39]=I,t[40]=L,t[41]=R):R=t[41];let z;t[42]===m?z=t[43]:(z=(0,H.jsx)(Re,{icon:ce,value:m,label:`Tools`,color:`text-emerald-400`}),t[42]=m,t[43]=z);let V;t[44]===g?V=t[45]:(V=(0,H.jsx)(Re,{icon:oe,value:g,label:`Skills`,color:`text-amber-400`}),t[44]=g,t[45]=V);let ge=n.maxIterations||10,U;t[46]===ge?U=t[47]:(U=(0,H.jsx)(Re,{icon:ee,value:ge,label:`Iters`,color:`text-violet-400`}),t[46]=ge,t[47]=U);let W;t[48]!==z||t[49]!==V||t[50]!==U?(W=(0,H.jsxs)(`div`,{className:`mt-4 grid grid-cols-3 gap-1.5`,children:[z,V,U]}),t[48]=z,t[49]=V,t[50]=U,t[51]=W):W=t[51];let G;t[52]!==n||t[53]!==s?(G=()=>s(n),t[52]=n,t[53]=s,t[54]=G):G=t[54];let _e=`flex h-10 items-center justify-center gap-2 rounded-lg text-xs font-bold transition-colors ${u?`bg-amber-400 text-[#181108] hover:bg-amber-300`:`bg-blue-600 text-white hover:bg-blue-500`}`,ve;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,H.jsx)(ne,{className:`h-3.5 w-3.5`}),t[55]=ve):ve=t[55];let ye;t[56]!==G||t[57]!==_e?(ye=(0,H.jsxs)(`button`,{type:`button`,onClick:G,className:_e,children:[ve,`Configurar nodo`]}),t[56]=G,t[57]=_e,t[58]=ye):ye=t[58];let K;t[59]!==n||t[60]!==c?(K=()=>c(n),t[59]=n,t[60]=c,t[61]=K):K=t[61];let be;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,H.jsx)(_,{className:`h-3.5 w-3.5`}),t[62]=be):be=t[62];let xe;t[63]===K?xe=t[64]:(xe=(0,H.jsxs)(`button`,{type:`button`,onClick:K,className:`flex h-10 items-center justify-center gap-2 rounded-lg border border-white/10 bg-white/[0.03] text-xs font-semibold text-white/60 transition-colors hover:bg-white/[0.07] hover:text-white`,children:[`Abrir perfil`,be]}),t[63]=K,t[64]=xe);let q;t[65]!==ye||t[66]!==xe?(q=(0,H.jsxs)(`div`,{className:`mt-5 grid gap-2`,children:[ye,xe]}),t[65]=ye,t[66]=xe,t[67]=q):q=t[67];let Se;t[68]!==A||t[69]!==j||t[70]!==N||t[71]!==P||t[72]!==F||t[73]!==R||t[74]!==W||t[75]!==q?(Se=(0,H.jsxs)(`div`,{className:`p-5`,children:[A,j,N,P,F,R,W,q]}),t[68]=A,t[69]=j,t[70]=N,t[71]=P,t[72]=F,t[73]=R,t[74]=W,t[75]=q,t[76]=Se):Se=t[76];let J;t[77]===a?J=t[78]:(J=(0,H.jsx)(`p`,{className:`text-lg font-black tabular-nums text-white`,children:a}),t[77]=a,t[78]=J);let Y;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,H.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:`Nodos totales`}),t[79]=Y):Y=t[79];let X;t[80]===J?X=t[81]:(X=(0,H.jsxs)(`div`,{className:`bg-[#0b0e14] px-4 py-3`,children:[J,Y]}),t[80]=J,t[81]=X);let Ce;t[82]===o?Ce=t[83]:(Ce=(0,H.jsx)(`p`,{className:`text-lg font-black tabular-nums text-emerald-400`,children:o}),t[82]=o,t[83]=Ce);let Z;t[84]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,H.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:`En operación`}),t[84]=Z):Z=t[84];let Q;t[85]===Ce?Q=t[86]:(Q=(0,H.jsxs)(`div`,{className:`bg-[#0b0e14] px-4 py-3`,children:[Ce,Z]}),t[85]=Ce,t[86]=Q);let we;t[87]!==X||t[88]!==Q?(we=(0,H.jsxs)(`div`,{className:`grid grid-cols-2 gap-px border-t border-white/[0.07] bg-white/[0.07]`,children:[X,Q]}),t[87]=X,t[88]=Q,t[89]=we):we=t[89];let $;return t[90]!==y||t[91]!==Se||t[92]!==we?($=(0,H.jsxs)(`aside`,{className:`overflow-hidden rounded-2xl border border-white/[0.08] bg-[#0b0e14]/90 lg:sticky lg:top-4`,children:[y,Se,we]}),t[90]=y,t[91]=Se,t[92]=we,t[93]=$):$=t[93],$}function Le(e){let t=(0,B.c)(13),{icon:n,label:r,value:i,mono:a}=e,o=a===void 0?!1:a,s;t[0]===n?s=t[1]:(s=(0,H.jsx)(n,{className:`h-3.5 w-3.5 shrink-0 text-white/30`}),t[0]=n,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,H.jsx)(`p`,{className:`text-[8px] font-bold uppercase tracking-wider text-white/25`,children:r}),t[2]=r,t[3]=c);let l=`mt-0.5 truncate text-[11px] text-white/65 ${o?`font-mono`:`font-medium`}`,u;t[4]!==l||t[5]!==i?(u=(0,H.jsx)(`p`,{className:l,title:i,children:i}),t[4]=l,t[5]=i,t[6]=u):u=t[6];let d;t[7]!==c||t[8]!==u?(d=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[c,u]}),t[7]=c,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==s||t[11]!==d?(f=(0,H.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg border border-white/[0.06] bg-white/[0.025] px-3 py-2.5`,children:[s,d]}),t[10]=s,t[11]=d,t[12]=f):f=t[12],f}function Re(e){let t=(0,B.c)(11),{icon:n,value:r,label:i,color:a}=e,o=`mx-auto h-3.5 w-3.5 ${a}`,s;t[0]!==n||t[1]!==o?(s=(0,H.jsx)(n,{className:o}),t[0]=n,t[1]=o,t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=(0,H.jsx)(`p`,{className:`mt-1 text-sm font-black tabular-nums text-white/80`,children:r}),t[3]=r,t[4]=c);let l;t[5]===i?l=t[6]:(l=(0,H.jsx)(`p`,{className:`text-[7px] font-bold uppercase tracking-wider text-white/25`,children:i}),t[5]=i,t[6]=l);let u;return t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,H.jsxs)(`div`,{className:`rounded-lg border border-white/[0.06] bg-black/20 px-2 py-2.5 text-center`,children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10],u}export{je as AgentsPage};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./chevron-down-8GjmTjLR.js";import{t as i}from"./chevron-right-BupZqrxu.js";import{t as a}from"./circle-check-BKNT2_q6.js";import{t as o}from"./circle-x-DfBjbztU.js";import{t as s}from"./copy-wR7o7Ly8.js";import{t as c}from"./history-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{o as n}from"./vendor-query-Dj8xYhQD.js";import{t as r}from"./chevron-down-8GjmTjLR.js";import{t as i}from"./chevron-right-BupZqrxu.js";import{t as a}from"./circle-check-BKNT2_q6.js";import{t as o}from"./circle-x-DfBjbztU.js";import{t as s}from"./copy-wR7o7Ly8.js";import{t as c}from"./history-CbhJX41s.js";import{t as l}from"./plus-Bp8-V68t.js";import{t as u}from"./send-CI868CBV.js";import{t as d}from"./trash-2-BZsMCfso.js";import{t as f}from"./utils-lc8H6VGT.js";import{N as ee,X as p,Y as m,dt as h,ft as g}from"./index-U0e4e5mL.js";import{t as te}from"./badge-C6H33ePv.js";import{t as _}from"./scroll-area-CYMu7sU0.js";import{i as v,n as y,r as b,t as x}from"./tabs-Ct92cLXr.js";import{t as S}from"./textarea-xtFAVuPf.js";import{i as C,n as ne,o as re,s as w,t as T}from"./select-BjBXxyxL.js";import{a as E,i as D,n as O,t as k}from"./card-D0qneq1i.js";var A=e(t(),1),j=n(),ie=[`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`];function M(){return Math.random().toString(36).substring(2,9)}function N(){return{id:M(),key:``,value:``,enabled:!0}}function P(){let[e,t]=(0,A.useState)(`GET`),[n,P]=(0,A.useState)(``),[F,I]=(0,A.useState)([N()]),[L,R]=(0,A.useState)([N()]),[z,B]=(0,A.useState)(``),[V,H]=(0,A.useState)(null),[U,W]=(0,A.useState)(!1),[G,K]=(0,A.useState)(0),[q,J]=(0,A.useState)([]),[Y,ae]=(0,A.useState)(!1),[oe,se]=(0,A.useState)(`body`);(0,A.useEffect)(()=>{try{let e=localStorage.getItem(`hive-api-client-history`);e&&J(JSON.parse(e))}catch{}},[]);let ce=(0,A.useCallback)(e=>{localStorage.setItem(`hive-api-client-history`,JSON.stringify(e.slice(0,50)))},[]),X=(e,t,n,r,i)=>{t(e.map(e=>e.id===n?{...e,[r]:i}:e))},Z=(e,t)=>{t([...e,N()])},le=(e,t,n)=>{e.length===1?t([N()]):t(e.filter(e=>e.id!==n))},ue=()=>{let e={};for(let t of F)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},de=()=>{let e={};for(let t of L)t.enabled&&t.key.trim()&&(e[t.key.trim()]=t.value);return e},Q=async()=>{if(!n.trim())return;W(!0),H(null);let t=performance.now();try{let r={method:e,url:n.trim(),headers:ue(),query_params:de()};z.trim()&&e!==`GET`&&e!==`HEAD`&&(r.body=z.trim());let i=await ee(`/api/http-request`,{method:`POST`,body:r,showError:!1});K(Math.round(performance.now()-t)),H(i);let a=[{id:M(),method:e,url:n.trim(),timestamp:Date.now(),status:i.status,ok:i.ok},...q];J(a),ce(a)}catch(e){K(Math.round(performance.now()-t)),H({ok:!1,error:e.message||`Request failed`})}finally{W(!1)}},fe=e=>{t(e.method),P(e.url),H(null)},pe=e=>{navigator.clipboard.writeText(e)},me=e=>{if(e==null)return``;if(typeof e==`string`)try{let t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}return JSON.stringify(e,null,2)},he=e=>e?e>=200&&e<300?`bg-green-500`:e>=300&&e<400?`bg-yellow-500`:e>=400&&e<500?`bg-orange-500`:`bg-red-500`:`bg-gray-500`,$=(e,t,n,r)=>(0,j.jsxs)(`div`,{className:`space-y-2`,children:[e.map(i=>(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:i.enabled,onChange:n=>X(e,t,i.id,`enabled`,n.target.checked),className:`h-4 w-4 rounded border-white/20 bg-background`}),(0,j.jsx)(m,{placeholder:n,value:i.key,onChange:n=>X(e,t,i.id,`key`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(m,{placeholder:r,value:i.value,onChange:n=>X(e,t,i.id,`value`,n.target.value),className:`h-8 text-xs bg-background/50`}),(0,j.jsx)(p,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-muted-foreground hover:text-red-400`,onClick:()=>le(e,t,i.id),children:(0,j.jsx)(d,{className:`h-3.5 w-3.5`})})]},i.id)),(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`text-xs text-muted-foreground hover:text-primary`,onClick:()=>Z(e,t),children:[(0,j.jsx)(l,{className:`h-3.5 w-3.5 mr-1`}),`Agregar`]})]});return(0,j.jsxs)(`div`,{className:`hive-page-container animate-fade-in mt-10`,children:[(0,j.jsx)(`div`,{className:`hive-page-header mb-6`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,j.jsx)(`div`,{className:`h-10 w-10 rounded-xl bg-purple-500/10 border border-purple-500/20 flex items-center justify-center text-purple-400`,children:(0,j.jsx)(h,{className:`h-6 w-6`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h1`,{className:`text-3xl font-black text-white uppercase tracking-tighter`,children:`API Client`}),(0,j.jsx)(`p`,{className:`hive-subtitle`,children:`Cliente HTTP para probar endpoints REST directamente desde Hive.`})]})]})}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-6`,children:[(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsxs)(T,{value:e,onValueChange:t,children:[(0,j.jsx)(re,{className:`w-[110px] h-10 text-xs font-bold tracking-wider`,children:(0,j.jsx)(w,{})}),(0,j.jsx)(ne,{children:ie.map(e=>(0,j.jsx)(C,{value:e,className:`text-xs font-bold`,children:e},e))})]}),(0,j.jsx)(m,{placeholder:`https://api.example.com/endpoint`,value:n,onChange:e=>P(e.target.value),onKeyDown:e=>e.key===`Enter`&&Q(),className:`h-10 text-sm bg-background/50 font-mono`}),(0,j.jsxs)(p,{onClick:Q,disabled:U||!n.trim(),className:`h-10 px-6 bg-purple-600 hover:bg-purple-500 text-white font-bold text-xs tracking-wider`,children:[U?(0,j.jsx)(g,{className:`h-4 w-4 animate-spin mr-2`}):(0,j.jsx)(u,{className:`h-4 w-4 mr-2`}),`ENVIAR`]})]})})}),(0,j.jsx)(k,{className:`border-white/10 bg-card/50`,children:(0,j.jsx)(O,{className:`p-4`,children:(0,j.jsxs)(x,{defaultValue:`headers`,className:`w-full`,children:[(0,j.jsxs)(b,{className:`bg-background/50 h-8`,children:[(0,j.jsxs)(v,{value:`headers`,className:`text-xs h-7`,children:[`Headers (`,F.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsxs)(v,{value:`query`,className:`text-xs h-7`,children:[`Query Params (`,L.filter(e=>e.enabled&&e.key.trim()).length,`)`]}),(0,j.jsx)(v,{value:`body`,className:`text-xs h-7`,children:`Body`})]}),(0,j.jsx)(y,{value:`headers`,className:`mt-3`,children:$(F,I,`Header`,`Value`)}),(0,j.jsx)(y,{value:`query`,className:`mt-3`,children:$(L,R,`Key`,`Value`)}),(0,j.jsxs)(y,{value:`body`,className:`mt-3`,children:[(0,j.jsx)(S,{placeholder:`{
|
|
2
2
|
"key": "value"
|
|
3
3
|
}`,value:z,onChange:e=>B(e.target.value),className:`min-h-[140px] font-mono text-xs bg-background/50`}),(0,j.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-2`,children:`Se enviará como string crudo. Para JSON, asegúrate de que sea válido.`})]})]})})}),V&&(0,j.jsxs)(k,{className:f(`border-white/10`,V.ok?`bg-green-500/[0.02]`:`bg-red-500/[0.02]`),children:[(0,j.jsx)(D,{className:`pb-3`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(E,{className:`text-sm font-bold tracking-wider`,children:`RESPUESTA`}),V.status!==void 0&&(0,j.jsxs)(te,{variant:`outline`,className:f(`text-xs font-bold border-none`,he(V.status),`text-white`),children:[V.status,` `,V.statusText||``]}),V.ok?(0,j.jsx)(a,{className:`h-4 w-4 text-green-500`}):(0,j.jsx)(o,{className:`h-4 w-4 text-red-500`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-mono`,children:[G,`ms`]})]}),(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>pe(JSON.stringify(V,null,2)),children:[(0,j.jsx)(s,{className:`h-3 w-3 mr-1`}),`Copiar`]})]})}),(0,j.jsx)(O,{className:`pt-0`,children:(0,j.jsxs)(x,{value:oe,onValueChange:se,children:[(0,j.jsxs)(b,{className:`bg-background/50 h-8`,children:[(0,j.jsx)(v,{value:`body`,className:`text-xs h-7`,children:`Body`}),(0,j.jsx)(v,{value:`headers`,className:`text-xs h-7`,children:`Headers`}),(0,j.jsx)(v,{value:`raw`,className:`text-xs h-7`,children:`Raw`})]}),(0,j.jsx)(y,{value:`body`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:(0,j.jsx)(`pre`,{className:`font-mono text-xs text-green-400 whitespace-pre-wrap`,children:me(V.body??V)})})}),(0,j.jsx)(y,{value:`headers`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:V.headers?(0,j.jsx)(`div`,{className:`space-y-1`,children:Object.entries(V.headers).map(([e,t])=>(0,j.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,j.jsxs)(`span`,{className:`text-purple-400 shrink-0`,children:[e,`:`]}),(0,j.jsx)(`span`,{className:`text-white/70`,children:String(t)})]},e))}):(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No headers disponibles`})})}),(0,j.jsx)(y,{value:`raw`,className:`mt-3`,children:(0,j.jsx)(_,{className:`h-[300px] w-full rounded-md border bg-black/40 p-3`,children:(0,j.jsx)(`pre`,{className:`font-mono text-xs text-white/60 whitespace-pre-wrap`,children:JSON.stringify(V,null,2)})})})]})})]})]}),(0,j.jsx)(`div`,{children:(0,j.jsxs)(k,{className:`border-white/10 bg-card/50`,children:[(0,j.jsx)(D,{className:`pb-3`,children:(0,j.jsxs)(`button`,{onClick:()=>ae(!Y),className:`flex items-center justify-between w-full`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(c,{className:`h-4 w-4 text-muted-foreground`}),(0,j.jsx)(E,{className:`text-xs font-bold tracking-wider`,children:`HISTORIAL`})]}),Y?(0,j.jsx)(r,{className:`h-4 w-4 text-muted-foreground`}):(0,j.jsx)(i,{className:`h-4 w-4 text-muted-foreground`})]})}),Y&&(0,j.jsxs)(O,{className:`pt-0`,children:[q.length===0?(0,j.jsx)(`p`,{className:`text-xs text-muted-foreground text-center py-4`,children:`No hay requests en el historial`}):(0,j.jsx)(_,{className:`h-[calc(100vh-300px)]`,children:(0,j.jsx)(`div`,{className:`space-y-1`,children:q.map(e=>(0,j.jsxs)(`button`,{onClick:()=>fe(e),className:`w-full text-left p-2 rounded-lg hover:bg-white/5 transition-colors group`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`span`,{className:f(`text-[10px] font-bold px-1.5 py-0.5 rounded`,e.ok?`bg-green-500/20 text-green-400`:`bg-red-500/20 text-red-400`),children:e.method}),e.status&&(0,j.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.status})]}),(0,j.jsx)(`p`,{className:`text-[10px] text-white/50 truncate mt-1 font-mono`,children:e.url}),(0,j.jsx)(`p`,{className:`text-[9px] text-white/30 mt-0.5`,children:new Date(e.timestamp).toLocaleTimeString()})]},e.id))})}),q.length>0&&(0,j.jsxs)(p,{variant:`ghost`,size:`sm`,className:`w-full mt-2 text-[10px] text-muted-foreground hover:text-red-400`,onClick:()=>{J([]),localStorage.removeItem(`hive-api-client-history`)},children:[(0,j.jsx)(d,{className:`h-3 w-3 mr-1`}),`Limpiar historial`]})]})]})})]})]})}export{P as ApiClientPage};
|