@johpaz/hive-agents 1.0.5 → 1.1.0
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 +5 -5
- package/dist/hive.js +85466 -101014
- package/dist/tool-worker.js +13241 -17001
- package/dist/ui/assets/A2UIPage-CS0VPY6a.js +8 -0
- package/dist/ui/assets/{AgentCreateForm-Bcp3HN8D.js → AgentCreateForm-DXkjtXaS.js} +1 -1
- package/dist/ui/assets/AgentDetailPage-DUIX_cuQ.js +1 -0
- package/dist/ui/assets/AgentNewPage-SNXz2wik.js +1 -0
- package/dist/ui/assets/AgentsPage-CGsdgx5F.js +10 -0
- package/dist/ui/assets/{ApiClientPage-DHfIlSAg.js → ApiClientPage-MNMjfSDs.js} +2 -2
- package/dist/ui/assets/ChannelsPage-BEwxWUcE.js +8 -0
- package/dist/ui/assets/DashboardPage-D6cRFKWW.js +6 -0
- package/dist/ui/assets/{LoginPage-BaX6cAPa.js → LoginPage-ByYmIa2p.js} +1 -1
- package/dist/ui/assets/LogsPage-Bmk9rohg.js +1 -0
- package/dist/ui/assets/MeetingPage-Dm97Mbiw.js +1 -0
- package/dist/ui/assets/ModelSelector-gubC8j_Q.js +1 -0
- package/dist/ui/assets/NotFound-PUg3gEO0.js +1 -0
- package/dist/ui/assets/{Office3DPage-C3SIzd2H.css → Office3DPage-31AMJ-LN.css} +1 -1
- package/dist/ui/assets/Office3DPage-Bfi-S2kG.js +727 -0
- package/dist/ui/assets/ProvidersPage-CSo0MYxd.js +1 -0
- package/dist/ui/assets/{RecoverPage-C_Id9WM-.js → RecoverPage-YY2QU-qh.js} +1 -1
- package/dist/ui/assets/SettingsPage-DrafhhKw.js +9 -0
- package/dist/ui/assets/SetupPage-LXnd2XbV.js +1 -0
- package/dist/ui/assets/{Vignette-Cyi27LQH.js → Vignette-BcPWkNhm.js} +17 -17
- package/dist/ui/assets/VoicePage-p-hTMAq7.js +307 -0
- package/dist/ui/assets/WebChatPage-B61ZDjQ8.js +29 -0
- package/dist/ui/assets/agentCapabilities-PfTEVxG1.js +1 -0
- package/dist/ui/assets/alert-CjiX20jI.js +1 -0
- package/dist/ui/assets/badge-B5AKge1b.js +1 -0
- package/dist/ui/assets/card-mTJ4oZbL.js +1 -0
- package/dist/ui/assets/conversationsStore-BlwA3yd2.js +1 -0
- package/dist/ui/assets/dialog-B04KpdNt.js +1 -0
- package/dist/ui/assets/dist-js-Dh18rcg9.js +1 -0
- package/dist/ui/assets/{dist-js-Bg0g3vPS.js → dist-js-q7C_AB0j.js} +1 -1
- package/dist/ui/assets/index-ByTufXPh.css +2 -0
- package/dist/ui/assets/index-DKJFLL3a.js +116 -0
- package/dist/ui/assets/label-D_fvqJyD.js +1 -0
- package/dist/ui/assets/lock-3IApZyVy.js +1 -0
- package/dist/ui/assets/pencil-L3Li7_pz.js +1 -0
- package/dist/ui/assets/scroll-area-CbH8FOo8.js +1 -0
- package/dist/ui/assets/select-v_3QBYrD.js +1 -0
- package/dist/ui/assets/slider-DXS4h1LB.js +1 -0
- package/dist/ui/assets/switch-ndx8VCpm.js +1 -0
- package/dist/ui/assets/tabs-epu-3Tl4.js +1 -0
- package/dist/ui/assets/textarea-BgZJFZTX.js +1 -0
- package/dist/ui/assets/useAudioDevices-B2stUHvr.js +41 -0
- package/dist/ui/assets/{useHiveAgentsModelLoad-CHmtvNp4.js → useHiveAgentsModelLoad-B4EjHvj4.js} +1 -1
- package/dist/ui/assets/useOfficeModel-BaDn7U-X.js +1 -0
- package/dist/ui/assets/{useProviders-C7FA6z4M.js → useProviders-B1NS24md.js} +1 -1
- package/dist/ui/assets/vendor-react-kUOwxn0g.js +1 -0
- package/dist/ui/index.html +6 -6
- package/package.json +10 -6
- package/packages/cli/src/adapters/config.ts +11 -3
- package/packages/cli/src/commands/causal.ts +1 -1
- package/packages/cli/src/commands/doctor.ts +2 -2
- package/packages/core/src/agent/agent-catalog.ts +31 -31
- package/packages/core/src/agent/agent-loop.ts +67 -14
- package/packages/core/src/agent/capability-search.ts +2 -1
- package/packages/core/src/agent/compaction.ts +19 -7
- package/packages/core/src/agent/context-compiler.ts +165 -27
- package/packages/core/src/agent/conversation-store.ts +12 -1
- package/packages/core/src/agent/goal-runner.ts +2 -2
- package/packages/core/src/agent/jev-decisions.ts +148 -0
- package/packages/core/src/agent/jev-planner.ts +293 -0
- package/packages/core/src/agent/llm-client.ts +27 -5
- package/packages/core/src/agent/llm-providers/ollama.ts +17 -4
- package/packages/core/src/agent/llm-providers/openai-compat-base.ts +27 -12
- package/packages/core/src/agent/llm-providers/opencode-go.ts +37 -0
- package/packages/core/src/agent/realtime-providers/gemini-live.ts +5 -2
- package/packages/core/src/agent/skill-selector.ts +4 -2
- package/packages/core/src/agent/thread-id.ts +71 -0
- package/packages/core/src/agent/thread-store.ts +230 -0
- package/packages/core/src/agent/tool-selector.ts +1 -0
- package/packages/core/src/agent/tracer.ts +2 -0
- package/packages/core/src/canvas/canvas-manager.ts +17 -1
- package/packages/core/src/canvas/emitter.ts +24 -0
- package/packages/core/src/channels/telegram.ts +19 -1
- package/packages/core/src/channels/webchat.ts +47 -45
- package/packages/core/src/config/loader.ts +3 -2
- package/packages/core/src/gateway/channel-notify.ts +24 -5
- package/packages/core/src/gateway/delegation-groups.ts +3 -3
- package/packages/core/src/gateway/delegation-notify.ts +34 -5
- package/packages/core/src/gateway/durable-queue.ts +22 -0
- package/packages/core/src/gateway/failure-notify.ts +8 -2
- package/packages/core/src/gateway/job-executors.ts +3 -3
- package/packages/core/src/gateway/realtime/bridge-tools.ts +106 -28
- package/packages/core/src/gateway/realtime/index.ts +63 -7
- package/packages/core/src/gateway/realtime/prompt.ts +45 -0
- package/packages/core/src/gateway/realtime/voice-session.ts +1 -0
- package/packages/core/src/gateway/resolver.ts +31 -4
- package/packages/core/src/gateway/routes/artifacts.ts +13 -0
- package/packages/core/src/gateway/routes/chat.ts +20 -4
- package/packages/core/src/gateway/routes/conversations.ts +121 -0
- package/packages/core/src/gateway/routes/providers.ts +15 -0
- package/packages/core/src/gateway/routes/setup.ts +22 -11
- package/packages/core/src/gateway/routes/system.ts +4 -2
- package/packages/core/src/gateway/routes/tts-local.ts +2 -1
- package/packages/core/src/gateway/server.ts +85 -12
- package/packages/core/src/gateway/slash-commands.ts +46 -10
- package/packages/core/src/gateway/tts/src/server.ts +2 -1
- package/packages/core/src/gateway/webchat-turn.ts +68 -10
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/scheduler/CronScheduler.ts +20 -8
- package/packages/core/src/scheduler/cron/cron-engine.test.ts +295 -0
- package/packages/core/src/scheduler/cron/expression.ts +165 -0
- package/packages/core/src/scheduler/cron/index.ts +10 -0
- package/packages/core/src/scheduler/cron/job.ts +340 -0
- package/packages/core/src/scheduler/cron/next-run.ts +121 -0
- package/packages/core/src/scheduler/cron/zoned-time.ts +139 -0
- package/packages/core/src/scheduler/integration.ts +16 -5
- package/packages/core/src/scheduler/types.ts +3 -18
- package/packages/core/src/storage/bootstrap.ts +23 -0
- package/packages/core/src/storage/collections.ts +29 -1
- package/packages/core/src/storage/crypto.ts +23 -12
- package/packages/core/src/storage/reconcile.ts +6 -1
- package/packages/core/src/storage/seed.ts +63 -7
- package/packages/core/src/storage/usage.ts +53 -1
- package/packages/core/src/tool-runtime/index.ts +19 -1
- package/packages/core/src/tools/a2ui/index.ts +65 -1
- package/packages/core/src/tools/agents/get-available-models.ts +3 -1
- package/packages/core/src/tools/core/index.ts +39 -4
- package/packages/core/src/tools/cron/index.ts +4 -4
- package/packages/core/src/tools/index.ts +1 -1
- package/packages/core/src/tools/office/office-escribir-xlsx.ts +2 -1
- package/packages/core/src/tools/office/office-leer-xlsx.ts +2 -1
- package/packages/core/src/tools/office/xlsx-loader.ts +19 -0
- package/packages/core/src/tools/web/webview-backend.ts +140 -20
- package/packages/core/src/utils/port.ts +33 -0
- package/packages/core/src/voice/index.ts +2 -1
- package/packages/mcp/src/config.ts +2 -1
- package/packages/mcp/src/manager.ts +9 -0
- package/packages/mcp/src/transports/index.ts +42 -1
- package/packages/mcp/src/transports/sse.ts +11 -5
- package/packages/skills/src/bundled/a2ui/a2ui_dashboard/SKILL.md +2 -2
- package/packages/skills/src/bundled/a2ui/a2ui_form/SKILL.md +2 -2
- package/packages/skills/src/bundled/a2ui/a2ui_interactive/SKILL.md +4 -4
- package/packages/skills/src/bundled/agents/agent_spawner/SKILL.md +7 -7
- package/packages/skills/src/bundled/agents/memory_manager/SKILL.md +9 -9
- package/packages/skills/src/bundled/agents/research_and_remember/SKILL.md +8 -8
- package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +8 -8
- package/packages/skills/src/bundled/artifacts/artifact_reader/SKILL.md +104 -0
- package/packages/skills/src/bundled/cli/cli_pipeline/SKILL.md +6 -6
- package/packages/skills/src/bundled/cli/cli_safe_exec/SKILL.md +5 -5
- package/packages/skills/src/bundled/cron_manager/SKILL.md +29 -19
- package/packages/skills/src/bundled/cron_reminder/SKILL.md +5 -5
- package/packages/skills/src/bundled/filesystem/file_manager/SKILL.md +4 -4
- package/packages/skills/src/bundled/filesystem/file_read_and_summarize/SKILL.md +7 -7
- package/packages/skills/src/bundled/filesystem/file_writer/SKILL.md +10 -10
- package/packages/skills/src/bundled/search_knowledge/capability_discovery/SKILL.md +8 -8
- package/packages/skills/src/bundled/web/browser_automate/SKILL.md +21 -12
- package/packages/skills/src/bundled/web/browser_scrape/SKILL.md +28 -13
- package/packages/skills/src/bundled/web/web_monitor/SKILL.md +6 -6
- package/packages/skills/src/bundled/web/web_research/SKILL.md +5 -5
- package/packages/skills/src/bundled-data.generated.ts +837 -783
- package/dist/ui/assets/A2UIPage-DTW79pyL.js +0 -8
- package/dist/ui/assets/AgentDetailPage-10XptMde.js +0 -1
- package/dist/ui/assets/AgentNewPage-CUt49rVS.js +0 -1
- package/dist/ui/assets/AgentsPage-1_e1a9xa.js +0 -10
- package/dist/ui/assets/ChannelsPage-BnCQAGZL.js +0 -8
- package/dist/ui/assets/DashboardPage-BsCCKHgg.js +0 -6
- package/dist/ui/assets/LogsPage-DiFBQt7o.js +0 -1
- package/dist/ui/assets/MeetingPage-Bpv5zVXf.js +0 -1
- package/dist/ui/assets/ModelSelector-DfExlPzx.js +0 -1
- package/dist/ui/assets/NotFound-C8HBdF73.js +0 -1
- package/dist/ui/assets/Office3DPage-ChsGMapf.js +0 -319
- package/dist/ui/assets/ProvidersPage-B39pfWHf.js +0 -1
- package/dist/ui/assets/SettingsPage-BgFqasyg.js +0 -9
- package/dist/ui/assets/SetupPage-YeJFfgbt.js +0 -1
- package/dist/ui/assets/VoicePage-Cp63Abj4.js +0 -307
- package/dist/ui/assets/WebChatPage-DxFLWgtM.js +0 -29
- package/dist/ui/assets/agentCapabilities-DOeepCty.js +0 -1
- package/dist/ui/assets/alert-Cj4DpKv6.js +0 -1
- package/dist/ui/assets/badge-DKpeVCpY.js +0 -1
- package/dist/ui/assets/card-Cag15G4h.js +0 -1
- package/dist/ui/assets/dialog-7E3EoEt3.js +0 -1
- package/dist/ui/assets/dist-js-DwLn9F4C.js +0 -1
- package/dist/ui/assets/index-Bi8qEmrK.js +0 -116
- package/dist/ui/assets/index-D2UhaSb0.css +0 -2
- package/dist/ui/assets/label-C6atPuIh.js +0 -1
- package/dist/ui/assets/pencil-CUbpCfeG.js +0 -1
- package/dist/ui/assets/scroll-area-CSoG2z53.js +0 -1
- package/dist/ui/assets/select-DlCT21_r.js +0 -1
- package/dist/ui/assets/slider-Bb_PHFJT.js +0 -1
- package/dist/ui/assets/switch-CUsGuBNi.js +0 -1
- package/dist/ui/assets/tabs-Ckfc7DGG.js +0 -1
- package/dist/ui/assets/textarea-BH6pI9Ax.js +0 -1
- package/dist/ui/assets/useAudioDevices-Dpr_hn6i.js +0 -41
- package/dist/ui/assets/useOfficeModel-Cc5VkReZ.js +0 -1
- package/dist/ui/assets/vendor-react-DYyYpuMy.js +0 -1
- /package/dist/ui/assets/{core-Dz04EE_8.js → core-B_5cyOSV.js} +0 -0
- /package/dist/ui/assets/{download-D0aDV8Y_.js → download-BQXrpH0m.js} +0 -0
- /package/dist/ui/assets/{ellipsis-vertical-BOW_iEOO.js → ellipsis-vertical-D7uFJLGh.js} +0 -0
- /package/dist/ui/assets/{external-link-5cujQzfV.js → external-link-6oTH9pUM.js} +0 -0
- /package/dist/ui/assets/{eye-sRPY5qOa.js → eye-CxvxtQT5.js} +0 -0
- /package/dist/ui/assets/{file-text-DNSyNLUh.js → file-text-D5ZJEx3E.js} +0 -0
- /package/dist/ui/assets/{gateway-url-BzQV75Ig.js → gateway-url-BALS_wVh.js} +0 -0
- /package/dist/ui/assets/{gauge-C__zxC3_.js → gauge-CEu7PhTW.js} +0 -0
- /package/dist/ui/assets/{history-BHQWfE-7.js → history-DLK5rTlP.js} +0 -0
- /package/dist/ui/assets/{info-CG1VohyH.js → info-8ReWzubE.js} +0 -0
- /package/dist/ui/assets/{key-BC28VCjO.js → key-DPkOY-J0.js} +0 -0
- /package/dist/ui/assets/{lock-open-Bhp0UJlL.js → lock-open-v0EphssG.js} +0 -0
- /package/dist/ui/assets/{mail-Biwn8WrV.js → mail-vwCEHyhQ.js} +0 -0
- /package/dist/ui/assets/{mic-Rq4BxU1R.js → mic-CpDU_2as.js} +0 -0
- /package/dist/ui/assets/{pause-C2l5G2Py.js → pause-Cm9LzIZK.js} +0 -0
- /package/dist/ui/assets/{play-CMAscR3a.js → play-zqogwA2l.js} +0 -0
- /package/dist/ui/assets/{plus-DzvRxH4U.js → plus-Bm08ABhc.js} +0 -0
- /package/dist/ui/assets/{radio-DfGzov4y.js → radio-Cii1BjMt.js} +0 -0
- /package/dist/ui/assets/{refresh-cw-DZXu5FrG.js → refresh-cw-DXv3XgEt.js} +0 -0
- /package/dist/ui/assets/{rotate-ccw-Dx92orJM.js → rotate-ccw-LoM1AuqK.js} +0 -0
- /package/dist/ui/assets/{search-DB4w9YHW.js → search-BMwCI-pX.js} +0 -0
- /package/dist/ui/assets/{send-xi8HzUdc.js → send-D6fgWV7m.js} +0 -0
- /package/dist/ui/assets/{settings-pV0cF8Kf.js → settings-qV3kVkeG.js} +0 -0
- /package/dist/ui/assets/{shield-nLNsomh_.js → shield-CIarwBvx.js} +0 -0
- /package/dist/ui/assets/{sparkles-CerRDYxk.js → sparkles-DVvY6jDT.js} +0 -0
- /package/dist/ui/assets/{square-CcWzRWyG.js → square-D5zdNkAY.js} +0 -0
- /package/dist/ui/assets/{terminal-C2SUZUAD.js → terminal-BEcTK780.js} +0 -0
- /package/dist/ui/assets/{trash-2-BZsMCfso.js → trash-2-D6oziYAK.js} +0 -0
- /package/dist/ui/assets/{utils-lc8H6VGT.js → utils-DEmd_M8c.js} +0 -0
- /package/dist/ui/assets/{vendor-router-DCsSv_I7.js → vendor-router-DP84b3LQ.js} +0 -0
- /package/dist/ui/assets/{volume-2-CBMYsuF3.js → volume-2-EaA0JRvD.js} +0 -0
- /package/dist/ui/assets/{volume-x-vNFf2e4-.js → volume-x-CROXNMGT.js} +0 -0
- /package/dist/ui/assets/{wifi-DNv53AfN.js → wifi-BUJuOcgP.js} +0 -0
- /package/dist/ui/assets/{zap-Yed86Sh8.js → zap-DSoX9NDk.js} +0 -0
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-S-ySWqyJ.js";import{f as t}from"./vendor-charts-K3xcRl0X.js";import{n,t as r}from"./vendor-react-kUOwxn0g.js";import{o as i}from"./vendor-query-Dj8xYhQD.js";import{t as a}from"./createLucideIcon-BRaPSYgN.js";import{t as o}from"./activity-C_GS5wrG.js";import{t as s}from"./arrow-right-BuNjN-bk.js";import{t as c}from"./chevron-down-8GjmTjLR.js";import{t as l}from"./chevron-left-GK4EQOyZ.js";import{t as u}from"./chevron-right-BupZqrxu.js";import{t as d}from"./chevron-up-DZrzJIW8.js";import{t as f}from"./circle-check-BKNT2_q6.js";import{n as p,t as m}from"./useOfficeModel-BaDn7U-X.js";import{t as h}from"./gauge-CEu7PhTW.js";import{t as g}from"./radio-Cii1BjMt.js";import{t as _}from"./send-D6fgWV7m.js";import{t as v}from"./volume-2-EaA0JRvD.js";import{t as y}from"./volume-x-CROXNMGT.js";import{n as b,t as x}from"./wifi-BUJuOcgP.js";import{r as S}from"./gateway-url-BALS_wVh.js";import{N as C,O as w,Q as T,_ as E,at as D,q as O}from"./index-DKJFLL3a.js";import{A as k,At as A,E as j,Et as M,Mt as N,Ot as P,P as F,S as I,St as L,X as R,Y as z,Z as B,b as V,c as H,ct as ee,d as te,f as U,h as ne,i as re,j as ie,kt as W,l as ae,m as oe,mt as se,n as ce,ot as le,pt as ue,s as de,st as fe,t as pe,u as me,v as he,y as G,yt as ge,z as _e}from"./Vignette-BcPWkNhm.js";var ve=a(`Crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ye=a(`SearchCheck`,[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),K=r(),q=e(t(),1);function be(){let e=(0,K.c)(9),{agents:t,fetchAgents:n}=E(),r=C(we),i=C(Ce),a=C(Se),o=C(xe),s,c;e[0]===n?(s=e[1],c=e[2]):(s=()=>{n()},c=[n],e[0]=n,e[1]=s,e[2]=c),(0,q.useEffect)(s,c);let{coordinator:l,desks:u,interactions:d}=m(t,r,i),f;return e[3]!==l||e[4]!==u||e[5]!==d||e[6]!==o||e[7]!==a?(f={coordinator:l,desks:u,interactions:d,workEvents:a,isConnected:o},e[3]=l,e[4]=u,e[5]=d,e[6]=o,e[7]=a,e[8]=f):f=e[8],f}function xe(e){return e.isConnected}function Se(e){return e.workEvents}function Ce(e){return e.graphEdges}function we(e){return e.graphNodes}function Te(){return typeof window>`u`?!1:window.localStorage.getItem(`office3d-sound`)===`on`}var J=S(e=>({selectedAgentId:null,quality:`high`,motion:`calm`,introDone:!1,soundEnabled:Te(),activeCue:null,select:t=>e({selectedAgentId:t}),setQuality:t=>e({quality:t}),setMotion:t=>e({motion:t}),setIntroDone:()=>e({introDone:!0}),setSoundEnabled:t=>{typeof window<`u`&&window.localStorage.setItem(`office3d-sound`,t?`on`:`off`),e({soundEnabled:t})},setActiveCue:t=>e({activeCue:t})})),Ee=`#a78bfa`,De=`#94a3b8`,Oe={context:`Contexto`,iteration:`Iteración`,parallel:`Paralelismo`};function ke(e){return Oe[e]}function Ae(e){return e===`ready`?`activo`:e===`fallback`?`flujo clásico`:`desactivado`}function je(e){let t=Math.abs(e);return t<1e3?String(Math.round(t)):`${(t/1e3).toLocaleString(`es`,{maximumFractionDigits:1})}k`}function Me(e){return Math.abs(e)<50?null:`${e>0?`−`:`+`}${je(e)} tok`}function Ne(e){return e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function Pe(){let e=(0,K.c)(6),t=C(ze),n=C(Re),r=C(Le),i,a;e[0]===r?(i=e[1],a=e[2]):(i=()=>{if(C.getState().jevStatus)return;let e=!1;return w(`/api/providers`).then(t=>{let{providers:n}=t,i=n.find(Ie)?.jev;!e&&i&&!C.getState().jevStatus&&r(i)}).catch(Fe),()=>{e=!0}},a=[r],e[0]=r,e[1]=i,e[2]=a),(0,q.useEffect)(i,a);let o;return e[3]!==n||e[4]!==t?(o={status:t,decisions:n},e[3]=n,e[4]=t,e[5]=o):o=e[5],o}function Fe(){}function Ie(e){return e.id===`openrouter`}function Le(e){return e.setJevStatus}function Re(e){return e.jevDecisions}function ze(e){return e.jevStatus}var Be=e(n()),Ve=new W,He=new W,Ue=new W,We=new P;function Ge(e,t,n){let r=Ve.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[r.x*i+i,-(r.y*a)+a]}function Ke(e,t){let n=Ve.setFromMatrixPosition(e.matrixWorld),r=He.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(Ue);return i.angleTo(a)>Math.PI/2}function qe(e,t,n,r){let i=Ve.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),We.set(a.x,a.y),n.setFromCamera(We,t);let o=n.intersectObjects(r,!0);if(o.length){let e=o[0].distance;return i.distanceTo(n.ray.origin)<e}return!0}function Je(e,t){if(t instanceof fe)return t.zoom;if(t instanceof ee){let n=Ve.setFromMatrixPosition(e.matrixWorld),r=He.setFromMatrixPosition(t.matrixWorld),i=t.fov*Math.PI/180,a=n.distanceTo(r);return 1/(2*Math.tan(i/2)*a)}else return 1}function Ye(e,t,n){if(t instanceof ee||t instanceof fe){let r=Ve.setFromMatrixPosition(e.matrixWorld),i=He.setFromMatrixPosition(t.matrixWorld),a=r.distanceTo(i),o=(n[1]-n[0])/(t.far-t.near),s=n[1]-o*t.far;return Math.round(o*a+s)}}var Xe=e=>Math.abs(e)<1e-10?0:e;function Ze(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=Xe(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}var Qe=(e=>t=>Ze(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),$e=(e=>(t,n)=>Ze(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]);function et(e){return e&&typeof e==`object`&&`current`in e}var tt=q.forwardRef(({children:e,eps:t=.001,style:n,className:r,prepend:i,center:a,fullscreen:o,portal:s,distanceFactor:c,sprite:l=!1,transform:u=!1,occlude:d,onOcclude:f,castShadow:p,receiveShadow:m,material:h,geometry:g,zIndexRange:_=[16777271,0],calculatePosition:v=Ge,as:y=`div`,wrapperClass:b,pointerEvents:x=`auto`,...S},C)=>{let{gl:w,camera:T,scene:E,size:D,raycaster:O,events:k,viewport:A}=oe(),[j]=q.useState(()=>document.createElement(y)),M=q.useRef(),N=q.useRef(null),P=q.useRef(0),F=q.useRef([0,0]),I=q.useRef(null),L=q.useRef(null),R=s?.current||k.connected||w.domElement.parentNode,z=q.useRef(null),B=q.useRef(!1),V=q.useMemo(()=>d&&d!==`blending`||Array.isArray(d)&&d.length&&et(d[0]),[d]);q.useLayoutEffect(()=>{let e=w.domElement;d&&d===`blending`?(e.style.zIndex=`${Math.floor(_[0]/2)}`,e.style.position=`absolute`,e.style.pointerEvents=`none`):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[d]),q.useLayoutEffect(()=>{if(N.current){let e=M.current=Be.createRoot(j);if(E.updateMatrixWorld(),u)j.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let e=v(N.current,T,D);j.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return R&&(i?R.prepend(j):R.appendChild(j)),()=>{R&&R.removeChild(j),e.unmount()}}},[R,u]),q.useLayoutEffect(()=>{b&&(j.className=b)},[b]);let H=q.useMemo(()=>u?{position:`absolute`,top:0,left:0,width:D.width,height:D.height,transformStyle:`preserve-3d`,pointerEvents:`none`}:{position:`absolute`,transform:a?`translate3d(-50%,-50%,0)`:`none`,...o&&{top:-D.height/2,left:-D.width/2,width:D.width,height:D.height},...n},[n,a,o,D,u]),ee=q.useMemo(()=>({position:`absolute`,pointerEvents:x}),[x]);q.useLayoutEffect(()=>{if(B.current=!1,u){var t;(t=M.current)==null||t.render(q.createElement(`div`,{ref:I,style:H},q.createElement(`div`,{ref:L,style:ee},q.createElement(`div`,{ref:C,className:r,style:n,children:e}))))}else{var i;(i=M.current)==null||i.render(q.createElement(`div`,{ref:C,style:H,className:r,children:e}))}});let te=q.useRef(!0);U(e=>{if(N.current){T.updateMatrixWorld(),N.current.updateWorldMatrix(!0,!1);let e=u?F.current:v(N.current,T,D);if(u||Math.abs(P.current-T.zoom)>t||Math.abs(F.current[0]-e[0])>t||Math.abs(F.current[1]-e[1])>t){let t=Ke(N.current,T),n=!1;V&&(Array.isArray(d)?n=d.map(e=>e.current):d!==`blending`&&(n=[E]));let r=te.current;n?te.current=qe(N.current,T,O,n)&&!t:te.current=!t,r!==te.current&&(f?f(!te.current):j.style.display=te.current?`block`:`none`);let i=Math.floor(_[0]/2),a=d?V?[_[0],i]:[i-1,0]:_;if(j.style.zIndex=`${Ye(N.current,T,a)}`,u){let[e,t]=[D.width/2,D.height/2],n=T.projectionMatrix.elements[5]*t,{isOrthographicCamera:r,top:i,left:a,bottom:o,right:s}=T,u=Qe(T.matrixWorldInverse),d=r?`scale(${n})translate(${Xe(-(s+a)/2)}px,${Xe((i+o)/2)}px)`:`translateZ(${n}px)`,f=N.current.matrixWorld;l&&(f=T.matrixWorldInverse.clone().transpose().copyPosition(f).scale(N.current.scale),f.elements[3]=f.elements[7]=f.elements[11]=0,f.elements[15]=1),j.style.width=D.width+`px`,j.style.height=D.height+`px`,j.style.perspective=r?``:`${n}px`,I.current&&L.current&&(I.current.style.transform=`${d}${u}translate(${e}px,${t}px)`,L.current.style.transform=$e(f,1/((c||10)/400)))}else{let t=c===void 0?1:Je(N.current,T)*c;j.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}F.current=e,P.current=T.zoom}}if(!V&&z.current&&!B.current)if(u){if(I.current){let e=I.current.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=T;if(t||g)S.scale&&(Array.isArray(S.scale)?S.scale instanceof W?z.current.scale.copy(S.scale.clone().divideScalar(1)):z.current.scale.set(1/S.scale[0],1/S.scale[1],1/S.scale[2]):z.current.scale.setScalar(1/S.scale));else{let t=(c||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;z.current.scale.set(n,r,1)}B.current=!0}}}else{let t=j.children[0];if(t!=null&&t.clientWidth&&t!=null&&t.clientHeight){let e=1/A.factor,n=t.clientWidth*e,r=t.clientHeight*e;z.current.scale.set(n,r,1),B.current=!0}z.current.lookAt(e.camera.position)}});let ne=q.useMemo(()=>({vertexShader:u?void 0:`
|
|
2
|
+
/*
|
|
3
|
+
This shader is from the THREE's SpriteMaterial.
|
|
4
|
+
We need to turn the backing plane into a Sprite
|
|
5
|
+
(make it always face the camera) if "transfrom"
|
|
6
|
+
is false.
|
|
7
|
+
*/
|
|
8
|
+
#include <common>
|
|
9
|
+
|
|
10
|
+
void main() {
|
|
11
|
+
vec2 center = vec2(0., 1.);
|
|
12
|
+
float rotation = 0.0;
|
|
13
|
+
|
|
14
|
+
// This is somewhat arbitrary, but it seems to work well
|
|
15
|
+
// Need to figure out how to derive this dynamically if it even matters
|
|
16
|
+
float size = 0.03;
|
|
17
|
+
|
|
18
|
+
vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
19
|
+
vec2 scale;
|
|
20
|
+
scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
|
|
21
|
+
scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
|
|
22
|
+
|
|
23
|
+
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
|
24
|
+
if ( isPerspective ) scale *= - mvPosition.z;
|
|
25
|
+
|
|
26
|
+
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
|
|
27
|
+
vec2 rotatedPosition;
|
|
28
|
+
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
|
29
|
+
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
|
30
|
+
mvPosition.xy += rotatedPosition;
|
|
31
|
+
|
|
32
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
33
|
+
}
|
|
34
|
+
`,fragmentShader:`
|
|
35
|
+
void main() {
|
|
36
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
37
|
+
}
|
|
38
|
+
`}),[u]);return q.createElement(`group`,ae({},S,{ref:N}),d&&!V&&q.createElement(`mesh`,{castShadow:p,receiveShadow:m,ref:z},g||q.createElement(`planeGeometry`,null),h||q.createElement(`shaderMaterial`,{side:2,vertexShader:ne.vertexShader,fragmentShader:ne.fragmentShader})))}),nt=H>=125?`uv1`:`uv2`,rt=new he,it=new W,at=class extends k{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type=`LineSegmentsGeometry`,this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute(`position`,new j([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute(`uv`,new j([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new ie(t,6,1);return this.setAttribute(`instanceStart`,new F(n,3,0)),this.setAttribute(`instanceEnd`,new F(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let r=new ie(n,t*2,1);return this.setAttribute(`instanceColorStart`,new F(r,t,0)),this.setAttribute(`instanceColorEnd`,new F(r,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new N(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new he);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),rt.setFromBufferAttribute(t),this.boundingBox.union(rt))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new L),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i<a;i++)it.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(it)),it.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(it));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error(`THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.`,this)}}toJSON(){}applyMatrix(e){return console.warn(`THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().`),this.applyMatrix4(e)}},ot=class extends at{constructor(){super(),this.isLineGeometry=!0,this.type=`LineGeometry`}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e,t=3){let n=e.length-t,r=new Float32Array(2*n);if(t===3)for(let i=0;i<n;i+=t)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5];else for(let i=0;i<n;i+=t)r[2*i]=e[i],r[2*i+1]=e[i+1],r[2*i+2]=e[i+2],r[2*i+3]=e[i+3],r[2*i+4]=e[i+4],r[2*i+5]=e[i+5],r[2*i+6]=e[i+6],r[2*i+7]=e[i+7];return super.setColors(r,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}},st=class extends ge{constructor(e){super({type:`LineMaterial`,uniforms:M.clone(M.merge([ne.common,ne.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new P(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
39
|
+
#include <common>
|
|
40
|
+
#include <fog_pars_vertex>
|
|
41
|
+
#include <logdepthbuf_pars_vertex>
|
|
42
|
+
#include <clipping_planes_pars_vertex>
|
|
43
|
+
|
|
44
|
+
uniform float linewidth;
|
|
45
|
+
uniform vec2 resolution;
|
|
46
|
+
|
|
47
|
+
attribute vec3 instanceStart;
|
|
48
|
+
attribute vec3 instanceEnd;
|
|
49
|
+
|
|
50
|
+
#ifdef USE_COLOR
|
|
51
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
52
|
+
varying vec4 vLineColor;
|
|
53
|
+
attribute vec4 instanceColorStart;
|
|
54
|
+
attribute vec4 instanceColorEnd;
|
|
55
|
+
#else
|
|
56
|
+
varying vec3 vLineColor;
|
|
57
|
+
attribute vec3 instanceColorStart;
|
|
58
|
+
attribute vec3 instanceColorEnd;
|
|
59
|
+
#endif
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
#ifdef WORLD_UNITS
|
|
63
|
+
|
|
64
|
+
varying vec4 worldPos;
|
|
65
|
+
varying vec3 worldStart;
|
|
66
|
+
varying vec3 worldEnd;
|
|
67
|
+
|
|
68
|
+
#ifdef USE_DASH
|
|
69
|
+
|
|
70
|
+
varying vec2 vUv;
|
|
71
|
+
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
#else
|
|
75
|
+
|
|
76
|
+
varying vec2 vUv;
|
|
77
|
+
|
|
78
|
+
#endif
|
|
79
|
+
|
|
80
|
+
#ifdef USE_DASH
|
|
81
|
+
|
|
82
|
+
uniform float dashScale;
|
|
83
|
+
attribute float instanceDistanceStart;
|
|
84
|
+
attribute float instanceDistanceEnd;
|
|
85
|
+
varying float vLineDistance;
|
|
86
|
+
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
90
|
+
|
|
91
|
+
// trim end segment so it terminates between the camera plane and the near plane
|
|
92
|
+
|
|
93
|
+
// conservative estimate of the near plane
|
|
94
|
+
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
95
|
+
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
96
|
+
float nearEstimate = - 0.5 * b / a;
|
|
97
|
+
|
|
98
|
+
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
99
|
+
|
|
100
|
+
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
void main() {
|
|
105
|
+
|
|
106
|
+
#ifdef USE_COLOR
|
|
107
|
+
|
|
108
|
+
vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
109
|
+
|
|
110
|
+
#endif
|
|
111
|
+
|
|
112
|
+
#ifdef USE_DASH
|
|
113
|
+
|
|
114
|
+
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
115
|
+
vUv = uv;
|
|
116
|
+
|
|
117
|
+
#endif
|
|
118
|
+
|
|
119
|
+
float aspect = resolution.x / resolution.y;
|
|
120
|
+
|
|
121
|
+
// camera space
|
|
122
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
123
|
+
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
124
|
+
|
|
125
|
+
#ifdef WORLD_UNITS
|
|
126
|
+
|
|
127
|
+
worldStart = start.xyz;
|
|
128
|
+
worldEnd = end.xyz;
|
|
129
|
+
|
|
130
|
+
#else
|
|
131
|
+
|
|
132
|
+
vUv = uv;
|
|
133
|
+
|
|
134
|
+
#endif
|
|
135
|
+
|
|
136
|
+
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
137
|
+
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
138
|
+
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
139
|
+
// perhaps there is a more elegant solution -- WestLangley
|
|
140
|
+
|
|
141
|
+
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
142
|
+
|
|
143
|
+
if ( perspective ) {
|
|
144
|
+
|
|
145
|
+
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
146
|
+
|
|
147
|
+
trimSegment( start, end );
|
|
148
|
+
|
|
149
|
+
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
150
|
+
|
|
151
|
+
trimSegment( end, start );
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// clip space
|
|
158
|
+
vec4 clipStart = projectionMatrix * start;
|
|
159
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
160
|
+
|
|
161
|
+
// ndc space
|
|
162
|
+
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
163
|
+
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
164
|
+
|
|
165
|
+
// direction
|
|
166
|
+
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
167
|
+
|
|
168
|
+
// account for clip-space aspect ratio
|
|
169
|
+
dir.x *= aspect;
|
|
170
|
+
dir = normalize( dir );
|
|
171
|
+
|
|
172
|
+
#ifdef WORLD_UNITS
|
|
173
|
+
|
|
174
|
+
// get the offset direction as perpendicular to the view vector
|
|
175
|
+
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
176
|
+
vec3 offset;
|
|
177
|
+
if ( position.y < 0.5 ) {
|
|
178
|
+
|
|
179
|
+
offset = normalize( cross( start.xyz, worldDir ) );
|
|
180
|
+
|
|
181
|
+
} else {
|
|
182
|
+
|
|
183
|
+
offset = normalize( cross( end.xyz, worldDir ) );
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// sign flip
|
|
188
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
189
|
+
|
|
190
|
+
float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
|
|
191
|
+
|
|
192
|
+
// don't extend the line if we're rendering dashes because we
|
|
193
|
+
// won't be rendering the endcaps
|
|
194
|
+
#ifndef USE_DASH
|
|
195
|
+
|
|
196
|
+
// extend the line bounds to encompass endcaps
|
|
197
|
+
start.xyz += - worldDir * linewidth * 0.5;
|
|
198
|
+
end.xyz += worldDir * linewidth * 0.5;
|
|
199
|
+
|
|
200
|
+
// shift the position of the quad so it hugs the forward edge of the line
|
|
201
|
+
offset.xy -= dir * forwardOffset;
|
|
202
|
+
offset.z += 0.5;
|
|
203
|
+
|
|
204
|
+
#endif
|
|
205
|
+
|
|
206
|
+
// endcaps
|
|
207
|
+
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
208
|
+
|
|
209
|
+
offset.xy += dir * 2.0 * forwardOffset;
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// adjust for linewidth
|
|
214
|
+
offset *= linewidth * 0.5;
|
|
215
|
+
|
|
216
|
+
// set the world position
|
|
217
|
+
worldPos = ( position.y < 0.5 ) ? start : end;
|
|
218
|
+
worldPos.xyz += offset;
|
|
219
|
+
|
|
220
|
+
// project the worldpos
|
|
221
|
+
vec4 clip = projectionMatrix * worldPos;
|
|
222
|
+
|
|
223
|
+
// shift the depth of the projected points so the line
|
|
224
|
+
// segments overlap neatly
|
|
225
|
+
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
226
|
+
clip.z = clipPose.z * clip.w;
|
|
227
|
+
|
|
228
|
+
#else
|
|
229
|
+
|
|
230
|
+
vec2 offset = vec2( dir.y, - dir.x );
|
|
231
|
+
// undo aspect ratio adjustment
|
|
232
|
+
dir.x /= aspect;
|
|
233
|
+
offset.x /= aspect;
|
|
234
|
+
|
|
235
|
+
// sign flip
|
|
236
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
237
|
+
|
|
238
|
+
// endcaps
|
|
239
|
+
if ( position.y < 0.0 ) {
|
|
240
|
+
|
|
241
|
+
offset += - dir;
|
|
242
|
+
|
|
243
|
+
} else if ( position.y > 1.0 ) {
|
|
244
|
+
|
|
245
|
+
offset += dir;
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// adjust for linewidth
|
|
250
|
+
offset *= linewidth;
|
|
251
|
+
|
|
252
|
+
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
253
|
+
offset /= resolution.y;
|
|
254
|
+
|
|
255
|
+
// select end
|
|
256
|
+
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
257
|
+
|
|
258
|
+
// back to clip space
|
|
259
|
+
offset *= clip.w;
|
|
260
|
+
|
|
261
|
+
clip.xy += offset;
|
|
262
|
+
|
|
263
|
+
#endif
|
|
264
|
+
|
|
265
|
+
gl_Position = clip;
|
|
266
|
+
|
|
267
|
+
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
268
|
+
|
|
269
|
+
#include <logdepthbuf_vertex>
|
|
270
|
+
#include <clipping_planes_vertex>
|
|
271
|
+
#include <fog_vertex>
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
`,fragmentShader:`
|
|
275
|
+
uniform vec3 diffuse;
|
|
276
|
+
uniform float opacity;
|
|
277
|
+
uniform float linewidth;
|
|
278
|
+
|
|
279
|
+
#ifdef USE_DASH
|
|
280
|
+
|
|
281
|
+
uniform float dashOffset;
|
|
282
|
+
uniform float dashSize;
|
|
283
|
+
uniform float gapSize;
|
|
284
|
+
|
|
285
|
+
#endif
|
|
286
|
+
|
|
287
|
+
varying float vLineDistance;
|
|
288
|
+
|
|
289
|
+
#ifdef WORLD_UNITS
|
|
290
|
+
|
|
291
|
+
varying vec4 worldPos;
|
|
292
|
+
varying vec3 worldStart;
|
|
293
|
+
varying vec3 worldEnd;
|
|
294
|
+
|
|
295
|
+
#ifdef USE_DASH
|
|
296
|
+
|
|
297
|
+
varying vec2 vUv;
|
|
298
|
+
|
|
299
|
+
#endif
|
|
300
|
+
|
|
301
|
+
#else
|
|
302
|
+
|
|
303
|
+
varying vec2 vUv;
|
|
304
|
+
|
|
305
|
+
#endif
|
|
306
|
+
|
|
307
|
+
#include <common>
|
|
308
|
+
#include <fog_pars_fragment>
|
|
309
|
+
#include <logdepthbuf_pars_fragment>
|
|
310
|
+
#include <clipping_planes_pars_fragment>
|
|
311
|
+
|
|
312
|
+
#ifdef USE_COLOR
|
|
313
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
314
|
+
varying vec4 vLineColor;
|
|
315
|
+
#else
|
|
316
|
+
varying vec3 vLineColor;
|
|
317
|
+
#endif
|
|
318
|
+
#endif
|
|
319
|
+
|
|
320
|
+
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
321
|
+
|
|
322
|
+
float mua;
|
|
323
|
+
float mub;
|
|
324
|
+
|
|
325
|
+
vec3 p13 = p1 - p3;
|
|
326
|
+
vec3 p43 = p4 - p3;
|
|
327
|
+
|
|
328
|
+
vec3 p21 = p2 - p1;
|
|
329
|
+
|
|
330
|
+
float d1343 = dot( p13, p43 );
|
|
331
|
+
float d4321 = dot( p43, p21 );
|
|
332
|
+
float d1321 = dot( p13, p21 );
|
|
333
|
+
float d4343 = dot( p43, p43 );
|
|
334
|
+
float d2121 = dot( p21, p21 );
|
|
335
|
+
|
|
336
|
+
float denom = d2121 * d4343 - d4321 * d4321;
|
|
337
|
+
|
|
338
|
+
float numer = d1343 * d4321 - d1321 * d4343;
|
|
339
|
+
|
|
340
|
+
mua = numer / denom;
|
|
341
|
+
mua = clamp( mua, 0.0, 1.0 );
|
|
342
|
+
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
343
|
+
mub = clamp( mub, 0.0, 1.0 );
|
|
344
|
+
|
|
345
|
+
return vec2( mua, mub );
|
|
346
|
+
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
void main() {
|
|
350
|
+
|
|
351
|
+
#include <clipping_planes_fragment>
|
|
352
|
+
|
|
353
|
+
#ifdef USE_DASH
|
|
354
|
+
|
|
355
|
+
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
356
|
+
|
|
357
|
+
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
358
|
+
|
|
359
|
+
#endif
|
|
360
|
+
|
|
361
|
+
float alpha = opacity;
|
|
362
|
+
|
|
363
|
+
#ifdef WORLD_UNITS
|
|
364
|
+
|
|
365
|
+
// Find the closest points on the view ray and the line segment
|
|
366
|
+
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
367
|
+
vec3 lineDir = worldEnd - worldStart;
|
|
368
|
+
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
369
|
+
|
|
370
|
+
vec3 p1 = worldStart + lineDir * params.x;
|
|
371
|
+
vec3 p2 = rayEnd * params.y;
|
|
372
|
+
vec3 delta = p1 - p2;
|
|
373
|
+
float len = length( delta );
|
|
374
|
+
float norm = len / linewidth;
|
|
375
|
+
|
|
376
|
+
#ifndef USE_DASH
|
|
377
|
+
|
|
378
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
379
|
+
|
|
380
|
+
float dnorm = fwidth( norm );
|
|
381
|
+
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
382
|
+
|
|
383
|
+
#else
|
|
384
|
+
|
|
385
|
+
if ( norm > 0.5 ) {
|
|
386
|
+
|
|
387
|
+
discard;
|
|
388
|
+
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
#endif
|
|
392
|
+
|
|
393
|
+
#endif
|
|
394
|
+
|
|
395
|
+
#else
|
|
396
|
+
|
|
397
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
398
|
+
|
|
399
|
+
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
400
|
+
float a = vUv.x;
|
|
401
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
402
|
+
float len2 = a * a + b * b;
|
|
403
|
+
float dlen = fwidth( len2 );
|
|
404
|
+
|
|
405
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
406
|
+
|
|
407
|
+
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
408
|
+
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
#else
|
|
412
|
+
|
|
413
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
414
|
+
|
|
415
|
+
float a = vUv.x;
|
|
416
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
417
|
+
float len2 = a * a + b * b;
|
|
418
|
+
|
|
419
|
+
if ( len2 > 1.0 ) discard;
|
|
420
|
+
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
#endif
|
|
424
|
+
|
|
425
|
+
#endif
|
|
426
|
+
|
|
427
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
428
|
+
#ifdef USE_COLOR
|
|
429
|
+
#ifdef USE_LINE_COLOR_ALPHA
|
|
430
|
+
diffuseColor *= vLineColor;
|
|
431
|
+
#else
|
|
432
|
+
diffuseColor.rgb *= vLineColor;
|
|
433
|
+
#endif
|
|
434
|
+
#endif
|
|
435
|
+
|
|
436
|
+
#include <logdepthbuf_fragment>
|
|
437
|
+
|
|
438
|
+
gl_FragColor = diffuseColor;
|
|
439
|
+
|
|
440
|
+
#include <tonemapping_fragment>
|
|
441
|
+
#include <${H>=154?`colorspace_fragment`:`encodings_fragment`}>
|
|
442
|
+
#include <fog_fragment>
|
|
443
|
+
#include <premultiplied_alpha_fragment>
|
|
444
|
+
|
|
445
|
+
}
|
|
446
|
+
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA=`1`:delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return`WORLD_UNITS`in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS=``:delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return`USE_DASH`in this.defines},set(e){!!e!=`USE_DASH`in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH=``:delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return`USE_ALPHA_TO_COVERAGE`in this.defines},set:function(e){!!e!=`USE_ALPHA_TO_COVERAGE`in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE=``,this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}},ct=new A,lt=new W,ut=new W,Y=new A,X=new A,dt=new A,ft=new W,pt=new R,Z=new _e,mt=new W,ht=new he,gt=new L,_t=new A,vt,yt;function bt(e,t,n){return _t.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),_t.multiplyScalar(1/_t.w),_t.x=yt/n.width,_t.y=yt/n.height,_t.applyMatrix4(e.projectionMatrixInverse),_t.multiplyScalar(1/_t.w),Math.abs(Math.max(_t.x,_t.y))}function xt(e,t){let n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,o=Math.min(r.instanceCount,i.count);for(let r=0,s=o;r<s;r++){Z.start.fromBufferAttribute(i,r),Z.end.fromBufferAttribute(a,r),Z.applyMatrix4(n);let o=new W,s=new W;vt.distanceSqToSegment(Z.start,Z.end,s,o),s.distanceTo(o)<yt*.5&&t.push({point:s,pointOnLine:o,distance:vt.origin.distanceTo(s),object:e,face:null,faceIndex:r,uv:null,[nt]:null})}}function St(e,t,n){let r=t.projectionMatrix,i=e.material.resolution,a=e.matrixWorld,o=e.geometry,s=o.attributes.instanceStart,c=o.attributes.instanceEnd,l=Math.min(o.instanceCount,s.count),u=-t.near;vt.at(1,dt),dt.w=1,dt.applyMatrix4(t.matrixWorldInverse),dt.applyMatrix4(r),dt.multiplyScalar(1/dt.w),dt.x*=i.x/2,dt.y*=i.y/2,dt.z=0,ft.copy(dt),pt.multiplyMatrices(t.matrixWorldInverse,a);for(let t=0,o=l;t<o;t++){if(Y.fromBufferAttribute(s,t),X.fromBufferAttribute(c,t),Y.w=1,X.w=1,Y.applyMatrix4(pt),X.applyMatrix4(pt),Y.z>u&&X.z>u)continue;if(Y.z>u){let e=Y.z-X.z,t=(Y.z-u)/e;Y.lerp(X,t)}else if(X.z>u){let e=X.z-Y.z,t=(X.z-u)/e;X.lerp(Y,t)}Y.applyMatrix4(r),X.applyMatrix4(r),Y.multiplyScalar(1/Y.w),X.multiplyScalar(1/X.w),Y.x*=i.x/2,Y.y*=i.y/2,X.x*=i.x/2,X.y*=i.y/2,Z.start.copy(Y),Z.start.z=0,Z.end.copy(X),Z.end.z=0;let o=Z.closestPointToPointParameter(ft,!0);Z.at(o,mt);let l=z.lerp(Y.z,X.z,o),d=l>=-1&&l<=1,f=ft.distanceTo(mt)<yt*.5;if(d&&f){Z.start.fromBufferAttribute(s,t),Z.end.fromBufferAttribute(c,t),Z.start.applyMatrix4(a),Z.end.applyMatrix4(a);let r=new W,i=new W;vt.distanceSqToSegment(Z.start,Z.end,i,r),n.push({point:i,pointOnLine:r,distance:vt.origin.distanceTo(i),object:e,face:null,faceIndex:t,uv:null,[nt]:null})}}}var Ct=class extends B{constructor(e=new at,t=new st({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type=`LineSegments2`}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let e=0,i=0,a=t.count;e<a;e++,i+=2)lt.fromBufferAttribute(t,e),ut.fromBufferAttribute(n,e),r[i]=i===0?0:r[i-1],r[i+1]=r[i]+lt.distanceTo(ut);let i=new ie(r,2,1);return e.setAttribute(`instanceDistanceStart`,new F(i,1,0)),e.setAttribute(`instanceDistanceEnd`,new F(i,1,1)),this}raycast(e,t){let n=this.material.worldUnits,r=e.camera;r===null&&!n&&console.error(`LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.`);let i=e.params.Line2===void 0?0:e.params.Line2.threshold||0;vt=e.ray;let a=this.matrixWorld,o=this.geometry,s=this.material;yt=s.linewidth+i,o.boundingSphere===null&&o.computeBoundingSphere(),gt.copy(o.boundingSphere).applyMatrix4(a);let c;if(c=n?yt*.5:bt(r,Math.max(r.near,gt.distanceToPoint(vt.origin)),s.resolution),gt.radius+=c,vt.intersectsSphere(gt)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),ht.copy(o.boundingBox).applyMatrix4(a);let l;l=n?yt*.5:bt(r,Math.max(r.near,ht.distanceToPoint(vt.origin)),s.resolution),ht.expandByScalar(l),vt.intersectsBox(ht)!==!1&&(n?xt(this,t):St(this,r,t))}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(ct),this.material.uniforms.resolution.value.set(ct.z,ct.w))}},wt=class extends Ct{constructor(e=new ot,t=new st({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type=`Line2`}},Tt=q.forwardRef(function({points:e,color:t=16777215,vertexColors:n,linewidth:r,lineWidth:i,segments:a,dashed:o,...s},c){var l;let u=oe(e=>e.size),d=q.useMemo(()=>a?new Ct:new wt,[a]),[f]=q.useState(()=>new st),p=(n==null||(l=n[0])==null?void 0:l.length)===4?4:3,m=q.useMemo(()=>{let r=a?new at:new ot,i=e.map(e=>{let t=Array.isArray(e);return e instanceof W||e instanceof A?[e.x,e.y,e.z]:e instanceof P?[e.x,e.y,0]:t&&e.length===3?[e[0],e[1],e[2]]:t&&e.length===2?[e[0],e[1],0]:e});if(r.setPositions(i.flat()),n){t=16777215;let e=n.map(e=>e instanceof I?e.toArray():e);r.setColors(e.flat(),p)}return r},[e,a,n,p]);return q.useLayoutEffect(()=>{d.computeLineDistances()},[e,d]),q.useLayoutEffect(()=>{o?f.defines.USE_DASH=``:delete f.defines.USE_DASH,f.needsUpdate=!0},[o,f]),q.useEffect(()=>()=>{m.dispose(),f.dispose()},[m]),q.createElement(`primitive`,ae({object:d,ref:c},s),q.createElement(`primitive`,{object:m,attach:`geometry`}),q.createElement(`primitive`,ae({object:f,attach:`material`,color:t,vertexColors:!!n,resolution:[u.width,u.height],linewidth:r??i??1,dashed:o,transparent:p===4},s)))}),Et=new W,Dt=q.forwardRef(function({start:e=[0,0,0],end:t=[0,0,0],mid:n,segments:r=20,...i},a){let o=q.useRef(null);q.useImperativeHandle(a,()=>o.current);let[s]=q.useState(()=>new ue(void 0,void 0,void 0)),c=q.useCallback((e,t,n,r=20)=>(e instanceof W?s.v0.copy(e):s.v0.set(...e),t instanceof W?s.v2.copy(t):s.v2.set(...t),n instanceof W?s.v1.copy(n):Array.isArray(n)?s.v1.set(...n):s.v1.copy(s.v0.clone().add(s.v2.clone().sub(s.v0)).add(Et.set(0,s.v0.y-s.v2.y,0))),s.getPoints(r)),[]);q.useLayoutEffect(()=>{o.current.setPoints=(e,t,n)=>{let r=c(e,t,n);o.current.geometry&&o.current.geometry.setPositions(r.map(e=>e.toArray()).flat())}},[]);let l=q.useMemo(()=>c(e,t,n,r),[e,t,n,r]);return q.createElement(Tt,ae({ref:o,points:l},i))}),Ot=Object.defineProperty,kt=(e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(kt(e,typeof t==`symbol`?t:t+``,n),n);function At(e,t,n,r,i){let a;if(e=e.subarray||e.slice?e:e.buffer,n=n.subarray||n.slice?n:n.buffer,e=t?e.subarray?e.subarray(t,i&&t+i):e.slice(t,i&&t+i):e,n.set)n.set(e,r);else for(a=0;a<e.length;a++)n[a+r]=e[a];return n}function jt(e){return e instanceof Float32Array?e:e instanceof V?e.getAttribute(`position`).array:e.map(e=>{let t=Array.isArray(e);return e instanceof W?[e.x,e.y,e.z]:e instanceof P?[e.x,e.y,0]:t&&e.length===3?[e[0],e[1],e[2]]:t&&e.length===2?[e[0],e[1],0]:e}).flat()}var Mt=class extends V{constructor(){super(),Q(this,`type`,`MeshLine`),Q(this,`isMeshLine`,!0),Q(this,`positions`,[]),Q(this,`previous`,[]),Q(this,`next`,[]),Q(this,`side`,[]),Q(this,`width`,[]),Q(this,`indices_array`,[]),Q(this,`uvs`,[]),Q(this,`counters`,[]),Q(this,`widthCallback`,null),Q(this,`_attributes`),Q(this,`_points`,[]),Q(this,`points`),Q(this,`matrixWorld`,new R),Object.defineProperties(this,{points:{enumerable:!0,get(){return this._points},set(e){this.setPoints(e,this.widthCallback)}}})}setMatrixWorld(e){this.matrixWorld=e}setPoints(e,t){if(e=jt(e),this._points=e,this.widthCallback=t??null,this.positions=[],this.counters=[],e.length&&e[0]instanceof W)for(let t=0;t<e.length;t++){let n=e[t],r=t/(e.length-1);this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(r),this.counters.push(r)}else for(let t=0;t<e.length;t+=3){let n=t/(e.length-1);this.positions.push(e[t],e[t+1],e[t+2]),this.positions.push(e[t],e[t+1],e[t+2]),this.counters.push(n),this.counters.push(n)}this.process()}compareV3(e,t){let n=e*6,r=t*6;return this.positions[n]===this.positions[r]&&this.positions[n+1]===this.positions[r+1]&&this.positions[n+2]===this.positions[r+2]}copyV3(e){let t=e*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]}process(){let e=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];let t,n;n=this.compareV3(0,e-1)?this.copyV3(e-2):this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(let r=0;r<e;r++){if(this.side.push(1),this.side.push(-1),t=this.widthCallback?this.widthCallback(r/(e-1)):1,this.width.push(t),this.width.push(t),this.uvs.push(r/(e-1),0),this.uvs.push(r/(e-1),1),r<e-1){n=this.copyV3(r),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);let e=r*2;this.indices_array.push(e,e+1,e+2),this.indices_array.push(e+2,e+1,e+3)}r>0&&(n=this.copyV3(r),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]))}n=this.compareV3(e-1,0)?this.copyV3(1):this.copyV3(e-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]),!this._attributes||this._attributes.position.count!==this.counters.length?this._attributes={position:new G(new Float32Array(this.positions),3),previous:new G(new Float32Array(this.previous),3),next:new G(new Float32Array(this.next),3),side:new G(new Float32Array(this.side),1),width:new G(new Float32Array(this.width),1),uv:new G(new Float32Array(this.uvs),2),index:new G(new Uint16Array(this.indices_array),1),counters:new G(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute(`position`,this._attributes.position),this.setAttribute(`previous`,this._attributes.previous),this.setAttribute(`next`,this._attributes.next),this.setAttribute(`side`,this._attributes.side),this.setAttribute(`width`,this._attributes.width),this.setAttribute(`uv`,this._attributes.uv),this.setAttribute(`counters`,this._attributes.counters),this.setAttribute(`position`,this._attributes.position),this.setAttribute(`previous`,this._attributes.previous),this.setAttribute(`next`,this._attributes.next),this.setAttribute(`side`,this._attributes.side),this.setAttribute(`width`,this._attributes.width),this.setAttribute(`uv`,this._attributes.uv),this.setAttribute(`counters`,this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()}advance({x:e,y:t,z:n}){let r=this._attributes.position.array,i=this._attributes.previous.array,a=this._attributes.next.array,o=r.length;At(r,0,i,0,o),At(r,6,r,0,o-6),r[o-6]=e,r[o-5]=t,r[o-4]=n,r[o-3]=e,r[o-2]=t,r[o-1]=n,At(r,6,a,0,o-6),a[o-6]=e,a[o-5]=t,a[o-4]=n,a[o-3]=e,a[o-2]=t,a[o-1]=n,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0}},Nt=`
|
|
447
|
+
#include <common>
|
|
448
|
+
#include <logdepthbuf_pars_vertex>
|
|
449
|
+
#include <fog_pars_vertex>
|
|
450
|
+
#include <clipping_planes_pars_vertex>
|
|
451
|
+
|
|
452
|
+
attribute vec3 previous;
|
|
453
|
+
attribute vec3 next;
|
|
454
|
+
attribute float side;
|
|
455
|
+
attribute float width;
|
|
456
|
+
attribute float counters;
|
|
457
|
+
|
|
458
|
+
uniform vec2 resolution;
|
|
459
|
+
uniform float lineWidth;
|
|
460
|
+
uniform vec3 color;
|
|
461
|
+
uniform float opacity;
|
|
462
|
+
uniform float sizeAttenuation;
|
|
463
|
+
|
|
464
|
+
varying vec2 vUV;
|
|
465
|
+
varying vec4 vColor;
|
|
466
|
+
varying float vCounters;
|
|
467
|
+
|
|
468
|
+
vec2 fix(vec4 i, float aspect) {
|
|
469
|
+
vec2 res = i.xy / i.w;
|
|
470
|
+
res.x *= aspect;
|
|
471
|
+
return res;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
void main() {
|
|
475
|
+
float aspect = resolution.x / resolution.y;
|
|
476
|
+
vColor = vec4(color, opacity);
|
|
477
|
+
vUV = uv;
|
|
478
|
+
vCounters = counters;
|
|
479
|
+
|
|
480
|
+
mat4 m = projectionMatrix * modelViewMatrix;
|
|
481
|
+
vec4 finalPosition = m * vec4(position, 1.0) * aspect;
|
|
482
|
+
vec4 prevPos = m * vec4(previous, 1.0);
|
|
483
|
+
vec4 nextPos = m * vec4(next, 1.0);
|
|
484
|
+
|
|
485
|
+
vec2 currentP = fix(finalPosition, aspect);
|
|
486
|
+
vec2 prevP = fix(prevPos, aspect);
|
|
487
|
+
vec2 nextP = fix(nextPos, aspect);
|
|
488
|
+
|
|
489
|
+
float w = lineWidth * width;
|
|
490
|
+
|
|
491
|
+
vec2 dir;
|
|
492
|
+
if (nextP == currentP) dir = normalize(currentP - prevP);
|
|
493
|
+
else if (prevP == currentP) dir = normalize(nextP - currentP);
|
|
494
|
+
else {
|
|
495
|
+
vec2 dir1 = normalize(currentP - prevP);
|
|
496
|
+
vec2 dir2 = normalize(nextP - currentP);
|
|
497
|
+
dir = normalize(dir1 + dir2);
|
|
498
|
+
|
|
499
|
+
vec2 perp = vec2(-dir1.y, dir1.x);
|
|
500
|
+
vec2 miter = vec2(-dir.y, dir.x);
|
|
501
|
+
//w = clamp(w / dot(miter, perp), 0., 4. * lineWidth * width);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
//vec2 normal = (cross(vec3(dir, 0.), vec3(0., 0., 1.))).xy;
|
|
505
|
+
vec4 normal = vec4(-dir.y, dir.x, 0., 1.);
|
|
506
|
+
normal.xy *= .5 * w;
|
|
507
|
+
//normal *= projectionMatrix;
|
|
508
|
+
if (sizeAttenuation == 0.) {
|
|
509
|
+
normal.xy *= finalPosition.w;
|
|
510
|
+
normal.xy /= (vec4(resolution, 0., 1.) * projectionMatrix).xy * aspect;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
finalPosition.xy += normal.xy * side;
|
|
514
|
+
gl_Position = finalPosition;
|
|
515
|
+
#include <logdepthbuf_vertex>
|
|
516
|
+
#include <fog_vertex>
|
|
517
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
518
|
+
#include <clipping_planes_vertex>
|
|
519
|
+
#include <fog_vertex>
|
|
520
|
+
}
|
|
521
|
+
`,Pt=`
|
|
522
|
+
#include <fog_pars_fragment>
|
|
523
|
+
#include <logdepthbuf_pars_fragment>
|
|
524
|
+
#include <clipping_planes_pars_fragment>
|
|
525
|
+
|
|
526
|
+
uniform sampler2D map;
|
|
527
|
+
uniform sampler2D alphaMap;
|
|
528
|
+
uniform float useGradient;
|
|
529
|
+
uniform float useMap;
|
|
530
|
+
uniform float useAlphaMap;
|
|
531
|
+
uniform float useDash;
|
|
532
|
+
uniform float dashArray;
|
|
533
|
+
uniform float dashOffset;
|
|
534
|
+
uniform float dashRatio;
|
|
535
|
+
uniform float visibility;
|
|
536
|
+
uniform float alphaTest;
|
|
537
|
+
uniform vec2 repeat;
|
|
538
|
+
uniform vec3 gradient[2];
|
|
539
|
+
|
|
540
|
+
varying vec2 vUV;
|
|
541
|
+
varying vec4 vColor;
|
|
542
|
+
varying float vCounters;
|
|
543
|
+
|
|
544
|
+
void main() {
|
|
545
|
+
#include <logdepthbuf_fragment>
|
|
546
|
+
vec4 diffuseColor = vColor;
|
|
547
|
+
if (useGradient == 1.) diffuseColor = vec4(mix(gradient[0], gradient[1], vCounters), 1.0);
|
|
548
|
+
if (useMap == 1.) diffuseColor *= texture2D(map, vUV * repeat);
|
|
549
|
+
if (useAlphaMap == 1.) diffuseColor.a *= texture2D(alphaMap, vUV * repeat).a;
|
|
550
|
+
if (diffuseColor.a < alphaTest) discard;
|
|
551
|
+
if (useDash == 1.) diffuseColor.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));
|
|
552
|
+
diffuseColor.a *= step(vCounters, visibility);
|
|
553
|
+
#include <clipping_planes_fragment>
|
|
554
|
+
gl_FragColor = diffuseColor;
|
|
555
|
+
#include <fog_fragment>
|
|
556
|
+
#include <tonemapping_fragment>
|
|
557
|
+
#include <${parseInt(`185`.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}>
|
|
558
|
+
}
|
|
559
|
+
`,Ft=class extends ge{constructor(e){super({uniforms:{...ne.fog,lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new I(16777215)},gradient:{value:[new I(16711680),new I(65280)]},opacity:{value:1},resolution:{value:new P(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},useGradient:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new P(1,1)}},vertexShader:Nt,fragmentShader:Pt}),Q(this,`lineWidth`),Q(this,`map`),Q(this,`useMap`),Q(this,`alphaMap`),Q(this,`useAlphaMap`),Q(this,`color`),Q(this,`gradient`),Q(this,`resolution`),Q(this,`sizeAttenuation`),Q(this,`dashArray`),Q(this,`dashOffset`),Q(this,`dashRatio`),Q(this,`useDash`),Q(this,`useGradient`),Q(this,`visibility`),Q(this,`repeat`),this.type=`MeshLineMaterial`,Object.defineProperties(this,{lineWidth:{enumerable:!0,get(){return this.uniforms.lineWidth.value},set(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get(){return this.uniforms.map.value},set(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get(){return this.uniforms.useMap.value},set(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get(){return this.uniforms.alphaMap.value},set(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get(){return this.uniforms.useAlphaMap.value},set(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get(){return this.uniforms.color.value},set(e){this.uniforms.color.value=e}},gradient:{enumerable:!0,get(){return this.uniforms.gradient.value},set(e){this.uniforms.gradient.value=e}},opacity:{enumerable:!0,get(){return this.uniforms.opacity.value},set(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get(){return this.uniforms.resolution.value},set(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get(){return this.uniforms.sizeAttenuation.value},set(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get(){return this.uniforms.dashArray.value},set(e){this.uniforms.dashArray.value=e,this.useDash=e===0?0:1}},dashOffset:{enumerable:!0,get(){return this.uniforms.dashOffset.value},set(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get(){return this.uniforms.dashRatio.value},set(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get(){return this.uniforms.useDash.value},set(e){this.uniforms.useDash.value=e}},useGradient:{enumerable:!0,get(){return this.uniforms.useGradient.value},set(e){this.uniforms.useGradient.value=e}},visibility:{enumerable:!0,get(){return this.uniforms.visibility.value},set(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get(){return this.uniforms.alphaTest.value},set(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get(){return this.uniforms.repeat.value},set(e){this.uniforms.repeat.value.copy(e)}}}),this.setValues(e)}copy(e){return super.copy(e),this.lineWidth=e.lineWidth,this.map=e.map,this.useMap=e.useMap,this.alphaMap=e.alphaMap,this.useAlphaMap=e.useAlphaMap,this.color.copy(e.color),this.gradient=e.gradient,this.opacity=e.opacity,this.resolution.copy(e.resolution),this.sizeAttenuation=e.sizeAttenuation,this.dashArray=e.dashArray,this.dashOffset=e.dashOffset,this.dashRatio=e.dashRatio,this.useDash=e.useDash,this.useGradient=e.useGradient,this.visibility=e.visibility,this.alphaTest=e.alphaTest,this.repeat.copy(e.repeat),this}},It={width:.2,length:1,decay:1,local:!1,stride:0,interval:1},Lt=(e,t=1)=>(e.set(e.subarray(t)),e.fill(-1/0,-t),e);function Rt(e,t){let{length:n,local:r,decay:i,interval:a,stride:o}={...It,...t},s=q.useRef(),[c]=q.useState(()=>new W);q.useLayoutEffect(()=>{e&&(s.current=Float32Array.from({length:n*10*3},(t,n)=>e.position.getComponent(n%3)))},[n,e]);let l=q.useRef(new W),u=q.useRef(0);return U(()=>{if(e&&s.current){if(u.current===0){let t;r?t=e.position:(e.getWorldPosition(c),t=c);let n=1*i;for(let e=0;e<n;e++)t.distanceTo(l.current)<o||(Lt(s.current,3),s.current.set(t.toArray(),s.current.length-3));l.current.copy(t)}u.current++,u.current%=a}}),s}var zt=q.forwardRef((e,t)=>{let{children:n}=e,{width:r,length:i,decay:a,local:o,stride:s,interval:c}={...It,...e},{color:l=`hotpink`,attenuation:u,target:d}=e,f=oe(e=>e.size),p=oe(e=>e.scene),m=q.useRef(null),[h,g]=q.useState(null),_=Rt(h,{length:i,decay:a,local:o,stride:s,interval:c});q.useEffect(()=>{let e=d?.current||m.current.children.find(e=>e instanceof le);e&&g(e)},[_,d]);let v=q.useMemo(()=>new Mt,[]),y=q.useMemo(()=>{let e=new Ft({lineWidth:.1*r,color:l,sizeAttenuation:1,resolution:new P(f.width,f.height)}),t;if(n)if(Array.isArray(n))t=n.find(e=>{let t=e;return typeof t.type==`string`&&t.type===`meshLineMaterial`});else{let e=n;typeof e.type==`string`&&e.type===`meshLineMaterial`&&(t=e)}return typeof t?.props==`object`&&e.setValues(t.props),e},[r,l,f,n]);return q.useEffect(()=>{y.uniforms.resolution.value.set(f.width,f.height)},[f]),U(()=>{_.current&&v.setPoints(_.current,u)}),q.createElement(`group`,null,te(q.createElement(`mesh`,{ref:t,geometry:v,material:y}),p),q.createElement(`group`,{ref:m},n))}),Bt=(0,q.createContext)(null);function Vt({iterations:e=10,ms:t=250,threshold:n=.75,step:r=.1,factor:i=.5,flipflops:a=1/0,bounds:o=e=>e>100?[60,100]:[40,60],onIncline:s,onDecline:c,onChange:l,onFallback:u,children:d}){let[f,p]=(0,q.useState)(()=>({fps:0,index:0,factor:i,flipped:0,refreshrate:0,fallback:!1,frames:[],averages:[],subscriptions:new Map,subscribe:e=>{let t=Symbol();return f.subscriptions.set(t,e.current),()=>void f.subscriptions.delete(t)}})),m=0;return U(()=>{let{frames:i,averages:d}=f;if(!f.fallback&&d.length<e){i.push(performance.now());let p=i[i.length-1]-i[0];if(p>=t){if(f.fps=Math.round(i.length/p*1e3*1)/1,f.refreshrate=Math.max(f.refreshrate,f.fps),d[f.index++%e]=f.fps,d.length===e){let[t,i]=o(f.refreshrate),p=d.filter(e=>e>=i),h=d.filter(e=>e<t);p.length>e*n&&(f.factor=Math.min(1,f.factor+r),f.flipped++,s&&s(f),f.subscriptions.forEach(e=>e.onIncline&&e.onIncline(f))),h.length>e*n&&(f.factor=Math.max(0,f.factor-r),f.flipped++,c&&c(f),f.subscriptions.forEach(e=>e.onDecline&&e.onDecline(f))),m!==f.factor&&(m=f.factor,l&&l(f),f.subscriptions.forEach(e=>e.onChange&&e.onChange(f))),f.flipped>a&&!f.fallback&&(f.fallback=!0,u&&u(f),f.subscriptions.forEach(e=>e.onFallback&&e.onFallback(f))),f.averages=[]}f.frames=[]}}}),q.createElement(Bt.Provider,{value:f},d)}function Ht(e,t){let n=t.clone(),r=0;e&&(r=e.distanceTo(t),n.add(e).multiplyScalar(.5));let i=Math.max(22,14+r*1.05);return{target:n,position:new W(n.x,n.y+i,n.z+.8)}}var $=i(),Ut=new W(0,46,62),Wt=new W(0,15.5,24.5),Gt=1.35,Kt=new W(0,2.2,0),qt=new W(0,15.5,24.5),Jt=new W(0,3.1,0),Yt=.025;function Xt(e){return 1-(1-e)**3}function Zt(e){let t=(0,K.c)(26),{coordinatorId:n,selectedAgentId:r,swarmRef:i,motion:a}=e,o=(0,q.useRef)(null),s=oe(rn),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t[0]=c):c=t[0];let l=c,u=J(nn),d=J(tn),f=J(en),p=(0,q.useRef)(null),m=(0,q.useRef)(!1),[h]=(0,q.useState)($t),[g]=(0,q.useState)(Qt),_=(0,q.useRef)(null),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v={position:qt.clone(),target:Kt.clone()},t[1]=v):v=t[1];let y=(0,q.useRef)(v),b=(0,q.useRef)(!1),x,S;t[2]!==f||t[3]!==n||t[4]!==a?(x=()=>{if(a!==`calm`||l){_.current=null;return}f?_.current={sourceId:f.actorId,targetId:f.targetId||n||f.actorId,phase:`focus`}:_.current?.phase===`focus`&&(_.current.phase=`return`)},S=[f,n,a,l],t[2]=f,t[3]=n,t[4]=a,t[5]=x,t[6]=S):(x=t[5],S=t[6]),(0,q.useEffect)(x,S);let C,w;t[7]===r?(C=t[8],w=t[9]):(C=()=>{r?b.current=!0:b.current&&(b.current=!1,_.current={sourceId:null,targetId:``,phase:`return`})},w=[r],t[7]=r,t[8]=C,t[9]=w),(0,q.useEffect)(C,w);let T;t[10]!==s||t[11]!==n||t[12]!==g||t[13]!==h||t[14]!==u||t[15]!==a||t[16]!==r||t[17]!==d||t[18]!==i?(T=(e,t)=>{if(l&&!u){s.position.copy(qt),s.lookAt(Kt),d();return}if(!u){p.current===null&&(p.current=e.clock.elapsedTime,s.position.copy(Ut));let t=Math.min(1,(e.clock.elapsedTime-p.current)/Gt);s.position.lerpVectors(Ut,Wt,Xt(t)),s.lookAt(Kt),t>=1&&(y.current.position.copy(qt),y.current.target.copy(Kt),d());return}let c=o.current;if(c){if(!m.current){s.position.copy(qt),c.target.copy(Kt),y.current.position.copy(qt),y.current.target.copy(Kt),c.update(),m.current=!0;return}let e=_.current;if(e&&a===`calm`&&!l){if(e.phase===`focus`){let t=e.sourceId===n?Jt:e.sourceId?i.current.get(e.sourceId)?.pos:null,r=e.targetId===n?Jt:i.current.get(e.targetId)?.pos;if(r){let e=Ht(t??null,r);h.copy(e.target),g.copy(e.position)}}else{let e=r===n?Jt:r?i.current.get(r)?.pos:null;b.current&&e?(h.copy(e),g.set(e.x,e.y+7,e.z+11)):(h.copy(y.current.target),g.copy(y.current.position))}let a=1-.035**t,o=1-.06**t;c.target.lerp(h,a),s.position.lerp(g,o),e.phase===`return`&&c.target.distanceToSquared(h)<Yt&&s.position.distanceToSquared(g)<Yt&&(_.current=null)}else if(b.current&&r&&a===`calm`&&!l){let e=r===n?Jt:i.current.get(r)?.pos;e&&(h.copy(e),g.set(e.x,e.y+7,e.z+11),c.target.lerp(h,1-.035**t),s.position.lerp(g,1-.06**t))}c.update()}},t[10]=s,t[11]=n,t[12]=g,t[13]=h,t[14]=u,t[15]=a,t[16]=r,t[17]=d,t[18]=i,t[19]=T):T=t[19],U(T);let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{_.current=null,b.current=!1},t[20]=E):E=t[20];let D;t[21]===s?D=t[22]:(D=()=>{let e=o.current;e&&(y.current.position.copy(s.position),y.current.target.copy(e.target))},t[21]=s,t[22]=D);let O;return t[23]!==u||t[24]!==D?(O=(0,$.jsx)(de,{ref:o,makeDefault:!0,enabled:u,enableDamping:!0,dampingFactor:.06,enablePan:!0,minDistance:9,maxDistance:60,maxPolarAngle:1.42,autoRotate:!1,onStart:E,onEnd:D}),t[23]=u,t[24]=D,t[25]=O):O=t[25],O}function Qt(){return qt.clone()}function $t(){return Kt.clone()}function en(e){return e.activeCue}function tn(e){return e.setIntroDone}function nn(e){return e.introDone}function rn(e){return e.camera}var an=`
|
|
560
|
+
varying vec3 vWorldPos;
|
|
561
|
+
void main() {
|
|
562
|
+
vec4 world = modelMatrix * vec4(position, 1.0);
|
|
563
|
+
vWorldPos = world.xyz;
|
|
564
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
565
|
+
}
|
|
566
|
+
`,on=`
|
|
567
|
+
varying vec3 vWorldPos;
|
|
568
|
+
uniform vec3 uColor;
|
|
569
|
+
|
|
570
|
+
// Distancia a aristas de un tiling hexagonal (pointy-top).
|
|
571
|
+
float hexEdge(vec2 p) {
|
|
572
|
+
p.x *= 0.57735 * 2.0;
|
|
573
|
+
p.y += mod(floor(p.x), 2.0) * 0.5;
|
|
574
|
+
p = abs(fract(p) - 0.5);
|
|
575
|
+
return abs(max(p.x * 1.5 + p.y, p.y * 2.0) - 1.0);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
void main() {
|
|
579
|
+
vec2 uv = vWorldPos.xz;
|
|
580
|
+
float dist = length(uv);
|
|
581
|
+
|
|
582
|
+
// Una referencia espacial estable, sin barridos ni pulsos.
|
|
583
|
+
float g1 = hexEdge(uv * 0.55);
|
|
584
|
+
float g2 = hexEdge(uv * 2.2);
|
|
585
|
+
float lines = smoothstep(0.065, 0.0, g1) * 0.42 + smoothstep(0.035, 0.0, g2) * 0.035;
|
|
586
|
+
|
|
587
|
+
// Fade radial hacia el vacío
|
|
588
|
+
float fade = smoothstep(46.0, 14.0, dist);
|
|
589
|
+
float centerGlow = exp(-dist * 0.11) * 0.12;
|
|
590
|
+
|
|
591
|
+
vec3 col = uColor * (lines + centerGlow);
|
|
592
|
+
float alpha = clamp((lines * 0.22 + centerGlow) * fade, 0.0, 0.22);
|
|
593
|
+
gl_FragColor = vec4(col, alpha);
|
|
594
|
+
}
|
|
595
|
+
`;function sn(){let e=(0,K.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={uColor:{value:new I(`#4f8ff7`)}},e[0]=t):t=e[0];let n=t,r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`mesh`,{rotation:[-Math.PI/2,0,0],position:[0,.01,0],children:[(0,$.jsx)(`circleGeometry`,{args:[48,72]}),(0,$.jsx)(`shaderMaterial`,{vertexShader:an,fragmentShader:on,uniforms:n,transparent:!0,depthWrite:!1,blending:2})]}),e[1]=r):r=e[1],r}var cn=[0,0,0],ln=4.2,un=4.4,dn=[{radius:7.5,yBase:2.8,inclination:.55},{radius:10.5,yBase:3.8,inclination:.9},{radius:13.5,yBase:4.8,inclination:1.25}],fn=Math.PI*(3-Math.sqrt(5));function pn(e,t){let n=dn[e%dn.length],r=Math.floor(e/dn.length),i=Math.max(1,Math.ceil(t/dn.length));return{radius:n.radius,yBase:n.yBase,inclination:n.inclination,phase:r*Math.PI*2/i+e%dn.length*fn*.37,angularSpeed:.05+e*7%5*.016}}function mn(e,t,n,r,i){return[Math.cos(r)*t,n+Math.sin(r)*e.inclination,Math.sin(r)*t]}function hn(e,t){return e===`disabled`||e===`archived`?0:e===`tool_call`?.65:e===`thinking`?t?.42:.2:e===`stuck`?.08:0}function gn(e,t,n){return e===`disabled`||e===`archived`?20:t?ln:n}function _n(e,t,n){return e===`disabled`||e===`archived`?1.4:t?un:n}var vn=`#f59e0b`;function yn({coordinator:e,active:t,swarmRef:n}){let r=(0,q.useRef)(null),i=(0,q.useRef)(null),a=(0,q.useRef)(null),o=(0,q.useRef)(null),s=(0,q.useRef)(null),c=(0,q.useRef)(null),l=J(t=>!!e&&t.selectedAgentId===e.id),u=J(e=>e.select),d=J(e=>e.motion),f=J(e=>e.activeCue),p=e?.status===`thinking`||e?.status===`tool_call`;return U((l,u)=>{let m=l.clock.elapsedTime,h=!!e&&(f?.actorId===e.id||f?.targetId===e.id),g=f?.actorId===e?.id?f.targetId:f?.actorId,_=g?n.current.get(g)?.pos:null;if(r.current){let e=d===`calm`&&(t||p)?Math.sin(m*2.1)*.04:0;r.current.position.y=1.05+e;let n=d===`calm`?Math.sin(m*.38)*.08:0,i=h&&_?Math.atan2(_.x,_.z):n;r.current.rotation.y=z.damp(r.current.rotation.y,i,4.5,u);let a=h&&d===`calm`?1.08:1,o=z.damp(r.current.scale.x,a,5,u);r.current.scale.setScalar(o)}let v=d===`calm`?Math.sin(m*(h?7:t||p?4.2:1.4))*(h?.34:t||p?.24:.08):0;i.current&&(i.current.rotation.z=.28+v),a.current&&(a.current.rotation.z=-.28-v),o.current&&(o.current.intensity+=((t||p?12:6)-o.current.intensity)*.04),s.current&&(s.current.rotation.y+=u*(h?1.2:.22)),c.current&&(c.current.rotation.z=h&&d===`calm`?Math.sin(m*7)*.08:0)}),(0,$.jsxs)(`group`,{position:cn,children:[(0,$.jsxs)(`mesh`,{position:[0,.3,0],children:[(0,$.jsx)(`cylinderGeometry`,{args:[2.5,2.8,.45,6]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#0b0f1a`,metalness:.7,roughness:.35,emissive:vn,emissiveIntensity:l?.5:.18})]}),(0,$.jsxs)(`mesh`,{position:[0,.54,0],rotation:[-Math.PI/2,0,0],children:[(0,$.jsx)(`ringGeometry`,{args:[1.85,2.22,6]}),(0,$.jsx)(`meshBasicMaterial`,{color:vn,transparent:!0,opacity:l?.9:.48,blending:2})]}),(0,$.jsxs)(`group`,{ref:r,onClick:t=>{t.stopPropagation(),e&&u(l?null:e.id)},onPointerOver:e=>{e.stopPropagation(),document.body.style.cursor=`pointer`},onPointerOut:()=>{document.body.style.cursor=`auto`},children:[(0,$.jsxs)(`mesh`,{position:[0,1.2,0],scale:[.74,1.28,.68],children:[(0,$.jsx)(`sphereGeometry`,{args:[.72,24,20]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#e6a519`,emissive:vn,emissiveIntensity:l?.8:.42,metalness:.34,roughness:.36})]}),[.58,1.02,1.46].map((e,t)=>(0,$.jsxs)(`mesh`,{position:[0,e,0],rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[.5-t*.035,.075,8,28]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#251807`,metalness:.52,roughness:.48})]},e)),(0,$.jsxs)(`mesh`,{position:[0,-.02,0],rotation:[0,0,Math.PI],children:[(0,$.jsx)(`coneGeometry`,{args:[.14,.52,8]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#ffcf6a`,emissive:vn,emissiveIntensity:.5})]}),(0,$.jsxs)(`mesh`,{position:[0,2.25,0],scale:[1,.9,.82],children:[(0,$.jsx)(`sphereGeometry`,{args:[.7,22,18]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#593c12`,emissive:vn,emissiveIntensity:l?.55:.24,metalness:.48,roughness:.42})]}),(0,$.jsxs)(`mesh`,{position:[0,3.15,0],children:[(0,$.jsx)(`sphereGeometry`,{args:[.54,22,18]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#d69113`,emissive:vn,emissiveIntensity:l?.95:.48,metalness:.38,roughness:.34})]}),[-1,1].map(e=>(0,$.jsxs)(`mesh`,{position:[e*.34,3.2,.4],scale:[1,1.18,.42],children:[(0,$.jsx)(`sphereGeometry`,{args:[.15,12,10]}),(0,$.jsx)(`meshBasicMaterial`,{color:`#fff1a8`})]},e)),(0,$.jsx)(`group`,{ref:c,position:[0,3.55,0],children:[-1,1].map(e=>(0,$.jsxs)(`group`,{rotation:[0,0,e*-.36],children:[(0,$.jsxs)(`mesh`,{position:[e*.22,.28,0],children:[(0,$.jsx)(`capsuleGeometry`,{args:[.035,.42,4,8]}),(0,$.jsx)(`meshBasicMaterial`,{color:`#ffd465`})]}),(0,$.jsxs)(`mesh`,{position:[e*.32,.53,0],children:[(0,$.jsx)(`sphereGeometry`,{args:[.07,8,8]}),(0,$.jsx)(`meshBasicMaterial`,{color:`#fff0a6`})]})]},e))}),(0,$.jsxs)(`group`,{ref:i,position:[.48,2.45,0],children:[(0,$.jsxs)(`mesh`,{position:[.62,.18,0],rotation:[.08,.15,-.18],scale:[1.65,.12,.72],children:[(0,$.jsx)(`sphereGeometry`,{args:[.48,16,12]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#e8f8ff`,emissive:`#8cdcff`,emissiveIntensity:.58,transparent:!0,opacity:.48,side:2,depthWrite:!1})]}),(0,$.jsxs)(`mesh`,{position:[.46,-.34,.05],rotation:[.08,.1,.2],scale:[1.25,.1,.58],children:[(0,$.jsx)(`sphereGeometry`,{args:[.4,14,10]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#dff7ff`,emissive:`#77c8ff`,emissiveIntensity:.42,transparent:!0,opacity:.38,side:2,depthWrite:!1})]})]}),(0,$.jsxs)(`group`,{ref:a,position:[-.48,2.45,0],children:[(0,$.jsxs)(`mesh`,{position:[-.62,.18,0],rotation:[.08,-.15,.18],scale:[1.65,.12,.72],children:[(0,$.jsx)(`sphereGeometry`,{args:[.48,16,12]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#e8f8ff`,emissive:`#8cdcff`,emissiveIntensity:.58,transparent:!0,opacity:.48,side:2,depthWrite:!1})]}),(0,$.jsxs)(`mesh`,{position:[-.46,-.34,.05],rotation:[.08,-.1,-.2],scale:[1.25,.1,.58],children:[(0,$.jsx)(`sphereGeometry`,{args:[.4,14,10]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#dff7ff`,emissive:`#77c8ff`,emissiveIntensity:.42,transparent:!0,opacity:.38,side:2,depthWrite:!1})]})]}),(0,$.jsxs)(`group`,{ref:s,position:[0,4.08,0],children:[(0,$.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[.48,.055,6,6]}),(0,$.jsx)(`meshBasicMaterial`,{color:`#ffe38a`,blending:2})]}),[-.4,0,.4].map((e,t)=>(0,$.jsxs)(`mesh`,{position:[e,t===1?.25:.14,0],children:[(0,$.jsx)(`coneGeometry`,{args:[.11,t===1?.48:.34,5]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#ffd465`,emissive:vn,emissiveIntensity:.9,metalness:.6,roughness:.2})]},e))]})]}),(0,$.jsx)(`pointLight`,{ref:o,position:[0,3,0],color:vn,intensity:6,distance:18,decay:1.8})]})}var bn=`
|
|
596
|
+
varying vec2 vUv;
|
|
597
|
+
void main() {
|
|
598
|
+
vUv = uv;
|
|
599
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
600
|
+
}
|
|
601
|
+
`,xn=`
|
|
602
|
+
varying vec2 vUv;
|
|
603
|
+
uniform vec3 uColor;
|
|
604
|
+
uniform float uTime;
|
|
605
|
+
uniform float uSpeed;
|
|
606
|
+
uniform float uIntensity;
|
|
607
|
+
|
|
608
|
+
void main() {
|
|
609
|
+
// uv.y recorre la longitud del cilindro (delegante → worker)
|
|
610
|
+
float flow = fract(vUv.y * 3.0 - uTime * uSpeed);
|
|
611
|
+
float packet = smoothstep(0.0, 0.12, flow) * smoothstep(0.42, 0.12, flow);
|
|
612
|
+
float flow2 = fract(vUv.y * 7.0 - uTime * uSpeed * 1.7);
|
|
613
|
+
float packet2 = smoothstep(0.0, 0.06, flow2) * smoothstep(0.2, 0.06, flow2);
|
|
614
|
+
|
|
615
|
+
float core = 0.3 + packet * 1.6 + packet2 * 0.9;
|
|
616
|
+
float ends = smoothstep(0.0, 0.05, vUv.y) * smoothstep(1.0, 0.95, vUv.y);
|
|
617
|
+
float glow = core * uIntensity;
|
|
618
|
+
gl_FragColor = vec4(uColor * glow, clamp(glow * 0.6 * ends, 0.0, 1.0));
|
|
619
|
+
}
|
|
620
|
+
`,Sn=new W(0,4.4,0),Cn=new W,wn=new W,Tn=new W,En=new W,Dn=new W(0,1,0),On=new se;function kn(e){let t=(0,K.c)(11),{desks:n,interactions:r,swarmRef:i,coordinatorId:a}=e,o;if(t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i){let e;t[5]!==a||t[6]!==n||t[7]!==i?(e=e=>(0,$.jsx)(An,{interaction:e,targetDesk:n.find(t=>t.agent.id===e.targetId)??null,swarmRef:i,coordinatorId:a},e.id),t[5]=a,t[6]=n,t[7]=i,t[8]=e):e=t[8],o=r.map(e),t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=(0,$.jsx)(`group`,{children:o}),t[9]=o,t[10]=s),s}function An({interaction:e,targetDesk:t,swarmRef:n,coordinatorId:r}){let i=(0,q.useRef)(null),a=(0,q.useRef)(null),o=(0,q.useMemo)(()=>({uTime:{value:0},uColor:{value:new I(t?.color??`#f59e0b`)},uSpeed:{value:.52},uIntensity:{value:.82}}),[t?.color]);return U(t=>{o.uTime.value=t.clock.elapsedTime;let s=n.current.get(e.targetId);if(!s||!i.current)return;if(e.sourceId===r)Cn.copy(Sn);else{let t=n.current.get(e.sourceId);if(!t){i.current.visible=!1;return}Cn.copy(t.pos)}wn.copy(s.pos),Tn.subVectors(wn,Cn);let c=Tn.length();i.current.visible=c>.5,!(c<=.5)&&(En.addVectors(Cn,wn).multiplyScalar(.5),i.current.position.copy(En),a.current?.position.copy(En),On.setFromUnitVectors(Dn,Tn.normalize()),i.current.quaternion.copy(On),i.current.scale.set(.055,c,.055))}),(0,$.jsxs)(`group`,{children:[(0,$.jsxs)(`mesh`,{ref:i,visible:!1,children:[(0,$.jsx)(`cylinderGeometry`,{args:[1,1,1,6,1,!0]}),(0,$.jsx)(`shaderMaterial`,{vertexShader:bn,fragmentShader:xn,uniforms:o,transparent:!0,depthWrite:!1,side:2,blending:2})]}),(0,$.jsx)(`group`,{ref:a,children:(0,$.jsx)(tt,{position:[0,.55,0],center:!0,distanceFactor:24,className:`pointer-events-none select-none`,children:(0,$.jsxs)(`div`,{className:`office3d-beam-label`,style:{"--chip-color":t?.color??`#f59e0b`},children:[(0,$.jsx)(`strong`,{children:e.kind===`reviews`?`REVISIÓN EN CURSO`:`TRABAJO DELEGADO`}),e.taskName&&(0,$.jsx)(`span`,{children:e.taskName})]})})})]})}var jn=`
|
|
621
|
+
attribute float aSeed;
|
|
622
|
+
uniform float uTime;
|
|
623
|
+
uniform float uPixelRatio;
|
|
624
|
+
varying float vSeed;
|
|
625
|
+
varying float vFade;
|
|
626
|
+
|
|
627
|
+
void main() {
|
|
628
|
+
vSeed = aSeed;
|
|
629
|
+
vec3 pos = position;
|
|
630
|
+
float t = uTime * (0.08 + aSeed * 0.12);
|
|
631
|
+
// Deriva orgánica
|
|
632
|
+
pos.x += sin(uTime * 0.25 + aSeed * 40.0) * 1.6;
|
|
633
|
+
pos.z += cos(uTime * 0.2 + aSeed * 31.0) * 1.6;
|
|
634
|
+
// Ascenso envolvente (polen que sube y reaparece abajo)
|
|
635
|
+
pos.y = mod(position.y + t * 6.0, 22.0);
|
|
636
|
+
vFade = smoothstep(0.0, 3.0, pos.y) * smoothstep(22.0, 16.0, pos.y);
|
|
637
|
+
|
|
638
|
+
vec4 mv = modelViewMatrix * vec4(pos, 1.0);
|
|
639
|
+
gl_PointSize = (1.4 + aSeed * 2.4) * uPixelRatio * (28.0 / -mv.z);
|
|
640
|
+
gl_Position = projectionMatrix * mv;
|
|
641
|
+
}
|
|
642
|
+
`,Mn=`
|
|
643
|
+
uniform vec3 uColor;
|
|
644
|
+
uniform float uOpacity;
|
|
645
|
+
varying float vSeed;
|
|
646
|
+
varying float vFade;
|
|
647
|
+
|
|
648
|
+
void main() {
|
|
649
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
650
|
+
float d = length(c);
|
|
651
|
+
float disc = smoothstep(0.5, 0.05, d);
|
|
652
|
+
gl_FragColor = vec4(uColor * (0.6 + vSeed * 0.8), disc * uOpacity * vFade);
|
|
653
|
+
}
|
|
654
|
+
`,Nn=`
|
|
655
|
+
attribute vec3 aVel;
|
|
656
|
+
attribute float aSeed;
|
|
657
|
+
uniform float uTime;
|
|
658
|
+
uniform float uStart;
|
|
659
|
+
uniform float uPixelRatio;
|
|
660
|
+
varying float vLife;
|
|
661
|
+
|
|
662
|
+
void main() {
|
|
663
|
+
float t = clamp((uTime - uStart) / 1.4, 0.0, 1.0);
|
|
664
|
+
vLife = 1.0 - t;
|
|
665
|
+
vec3 pos = aVel * (t * 3.2 - t * t * 1.1); // desaceleración
|
|
666
|
+
pos.y += t * 1.2; // ligera ascensión
|
|
667
|
+
vec4 mv = modelViewMatrix * vec4(pos, 1.0);
|
|
668
|
+
gl_PointSize = (2.2 + aSeed * 2.0) * vLife * uPixelRatio * (30.0 / -mv.z);
|
|
669
|
+
gl_Position = projectionMatrix * mv;
|
|
670
|
+
}
|
|
671
|
+
`,Pn=`
|
|
672
|
+
uniform vec3 uColor;
|
|
673
|
+
varying float vLife;
|
|
674
|
+
void main() {
|
|
675
|
+
vec2 c = gl_PointCoord - 0.5;
|
|
676
|
+
float disc = smoothstep(0.5, 0.05, length(c));
|
|
677
|
+
gl_FragColor = vec4(uColor * (0.8 + vLife), disc * vLife);
|
|
678
|
+
}
|
|
679
|
+
`,Fn=780,In=42,Ln=22;function Rn(){let e=(0,q.useRef)(null),t=oe(e=>e.viewport.dpr),n=(0,q.useMemo)(()=>{let e=new V,t=new Float32Array(Fn*3),n=new Float32Array(Fn);for(let e=0;e<Fn;e++){let r=Math.sqrt(Math.random())*In,i=Math.random()*Math.PI*2;t[e*3]=Math.cos(i)*r,t[e*3+1]=Math.random()*Ln,t[e*3+2]=Math.sin(i)*r,n[e]=Math.random()}return e.setAttribute(`position`,new j(t,3)),e.setAttribute(`aSeed`,new j(n,1)),e},[]),r=(0,q.useMemo)(()=>({uTime:{value:0},uColor:{value:new I(`#6aa9ff`)},uOpacity:{value:.16},uPixelRatio:{value:t}}),[]);return U(e=>{r.uTime.value=e.clock.elapsedTime,r.uPixelRatio.value=e.viewport.dpr}),(0,$.jsx)(`points`,{geometry:n,frustumCulled:!1,children:(0,$.jsx)(`shaderMaterial`,{ref:e,vertexShader:jn,fragmentShader:Mn,uniforms:r,transparent:!0,depthWrite:!1,blending:2})})}var zn=64,Bn=1700,Vn=0;function Hn({desks:e,swarmRef:t}){let[n,r]=(0,q.useState)([]),i=(0,q.useRef)(new Map);return(0,q.useEffect)(()=>{let n=i.current;for(let i of e){if(n.get(i.agent.id)===`tool_call`&&i.state!==`tool_call`){let e=t.current.get(i.agent.id);if(e){let t=++Vn;r(n=>[...n,{id:t,position:e.pos.toArray(),color:i.color}]),setTimeout(()=>{r(e=>e.filter(e=>e.id!==t))},Bn)}}n.set(i.agent.id,i.state)}},[e,t]),(0,$.jsx)(`group`,{children:n.map(e=>(0,$.jsx)(Un,{burst:e},e.id))})}function Un({burst:e}){let t=(0,q.useMemo)(()=>{let e=new V,t=new Float32Array(zn*3),n=new Float32Array(zn*3),r=new Float32Array(zn);for(let e=0;e<zn;e++){let t=Math.random()*Math.PI*2,i=Math.acos(2*Math.random()-1),a=.6+Math.random()*1.4;n[e*3]=Math.sin(i)*Math.cos(t)*a,n[e*3+1]=Math.cos(i)*a*.9,n[e*3+2]=Math.sin(i)*Math.sin(t)*a,r[e]=Math.random()}return e.setAttribute(`position`,new j(t,3)),e.setAttribute(`aVel`,new j(n,3)),e.setAttribute(`aSeed`,new j(r,1)),e},[]),n=(0,q.useMemo)(()=>({uTime:{value:0},uStart:{value:-1},uColor:{value:new I(e.color)},uPixelRatio:{value:1}}),[e.color]);return U(e=>{n.uTime.value=e.clock.elapsedTime,n.uStart.value<0&&(n.uStart.value=e.clock.elapsedTime),n.uPixelRatio.value=e.viewport.dpr}),(0,$.jsx)(`points`,{geometry:t,position:e.position,frustumCulled:!1,children:(0,$.jsx)(`shaderMaterial`,{vertexShader:Nn,fragmentShader:Pn,uniforms:n,transparent:!0,depthWrite:!1,blending:2})})}function Wn(e){let t=(0,K.c)(5),{quality:n}=e,r=n===`high`?.52:.32,i;t[0]===r?i=t[1]:(i=(0,$.jsx)(ce,{mipmapBlur:!0,intensity:r,luminanceThreshold:.38,luminanceSmoothing:.22}),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(pe,{offset:.34,darkness:.38}),t[2]=a):a=t[2];let o;return t[3]===i?o=t[4]:(o=(0,$.jsxs)(re,{multisampling:0,children:[i,a]}),t[3]=i,t[4]=o),o}var Gn=new W;function Kn(e){let t=(0,K.c)(11),{desks:n,swarmRef:r,motion:i}=e,a;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>[e.agent.id,pn(t,n.length)],t[2]=n.length,t[3]=e),a=new Map(n.map(e)),t[0]=n,t[1]=a}else a=t[1];let o=a,s=(0,q.useRef)(n),c,l;t[4]===n?(c=t[5],l=t[6]):(c=()=>{s.current=n},l=[n],t[4]=n,t[5]=c,t[6]=l),(0,q.useEffect)(c,l);let u;return t[7]!==i||t[8]!==o||t[9]!==r?(u=(e,t)=>{let n=e.clock.elapsedTime,a=r.current;for(let e of s.current){let r=e.agent.id,s=o.get(r);if(!s)continue;let c=a.get(r);if(!c){let[e,t,i]=mn(s,s.radius,s.yBase,s.phase,n);c={pos:new W(e,t,i),prevPos:new W(e,t,i),angle:s.phase,radius:s.radius,y:s.yBase,speedMul:1},a.set(r,c)}let l=!!e.currentTask,u=gn(e.state,l,s.radius),d=_n(e.state,l,s.yBase),f=i===`off`?0:hn(e.state,l),p=1-.12**t;c.radius+=(u-c.radius)*p,c.y+=(d-c.y)*p,c.speedMul+=(f-c.speedMul)*p,c.angle+=s.angularSpeed*c.speedMul*t,c.prevPos.copy(c.pos);let[m,h,g]=mn(s,c.radius,c.y,c.angle,n);Gn.set(m,h,g),i===`calm`&&e.state===`stuck`&&(Gn.x+=Math.sin(n*31+s.phase*7)*.22,Gn.y+=Math.cos(n*41+s.phase*3)*.15,Gn.z+=Math.sin(n*37+s.phase*5)*.22),c.pos.copy(Gn)}for(let e of a.keys())o.has(e)||a.delete(e)},t[7]=i,t[8]=o,t[9]=r,t[10]=u):u=t[10],U(u,-1),null}var qn={task_delegate:`Delegando tarea`,task_status:`Consultando estado`,web_search:`Buscando en la web`,web_fetch:`Leyendo página web`,browser_navigate:`Navegando`,browser_click:`Haciendo clic`,browser_type:`Escribiendo en la página`,browser_screenshot:`Tomando captura`,computer_use_task:`Operando el navegador`,browser_extract:`Extrayendo datos`,fs_read:`Leyendo archivo`,fs_write:`Escribiendo archivo`,fs_exists:`Verificando archivo`,exec:`Ejecutando comando`,search_knowledge:`Buscando herramientas`,a2ui_create_surface:`Creando interfaz`,a2ui_update_components:`Actualizando interfaz`,a2ui_update_data_model:`Actualizando datos`,memory_write:`Guardando en memoria`,memory_read:`Leyendo memoria`,memory_search:`Buscando en memoria`,save_note:`Guardando nota`,"cron.create":`Programando tarea`,notify:`Enviando aviso`,report_progress:`Reportando avance`};function Jn(e){if(!e)return null;if(qn[e])return qn[e];let t=e.split(`__`)[0];if(t&&t!==e)return`Usando ${t}`;let n=e.replace(/[_.]+/g,` `).trim();return n.charAt(0).toUpperCase()+n.slice(1)}var Yn=`
|
|
680
|
+
varying vec3 vNormal;
|
|
681
|
+
varying vec3 vWorldPos;
|
|
682
|
+
varying vec3 vViewDir;
|
|
683
|
+
uniform float uTime;
|
|
684
|
+
uniform float uGlitch;
|
|
685
|
+
|
|
686
|
+
float hash(float n) { return fract(sin(n) * 43758.5453123); }
|
|
687
|
+
|
|
688
|
+
void main() {
|
|
689
|
+
vec3 pos = position;
|
|
690
|
+
if (uGlitch > 0.01) {
|
|
691
|
+
float row = floor(position.y * 14.0 + uTime * 18.0);
|
|
692
|
+
float slice = step(0.94, hash(row));
|
|
693
|
+
pos.x += slice * uGlitch * (hash(uTime * 43.0) - 0.5) * 0.45;
|
|
694
|
+
pos.z += slice * uGlitch * (hash(uTime * 71.0) - 0.5) * 0.2;
|
|
695
|
+
}
|
|
696
|
+
vec4 world = modelMatrix * vec4(pos, 1.0);
|
|
697
|
+
vWorldPos = world.xyz;
|
|
698
|
+
vNormal = normalize(normalMatrix * normal);
|
|
699
|
+
vViewDir = cameraPosition - world.xyz;
|
|
700
|
+
gl_Position = projectionMatrix * viewMatrix * world;
|
|
701
|
+
}
|
|
702
|
+
`,Xn=`
|
|
703
|
+
varying vec3 vNormal;
|
|
704
|
+
varying vec3 vWorldPos;
|
|
705
|
+
varying vec3 vViewDir;
|
|
706
|
+
uniform vec3 uColor;
|
|
707
|
+
uniform float uTime;
|
|
708
|
+
uniform float uIntensity;
|
|
709
|
+
uniform float uGlitch;
|
|
710
|
+
uniform float uOpacity;
|
|
711
|
+
|
|
712
|
+
void main() {
|
|
713
|
+
vec3 n = normalize(vNormal);
|
|
714
|
+
vec3 v = normalize(vViewDir);
|
|
715
|
+
float fresnel = pow(1.0 - abs(dot(n, v)), 2.2);
|
|
716
|
+
float scan = 0.82 + 0.18 * sin(vWorldPos.y * 90.0 - uTime * 6.0);
|
|
717
|
+
float flicker = 0.93 + 0.07 * sin(uTime * 37.0 + vWorldPos.x * 10.0);
|
|
718
|
+
vec3 col = uColor;
|
|
719
|
+
if (uGlitch > 0.01) {
|
|
720
|
+
col = mix(col, vec3(1.0, 0.28, 0.2), uGlitch * 0.65);
|
|
721
|
+
flicker *= 0.75 + 0.25 * step(0.5, fract(uTime * 24.0));
|
|
722
|
+
}
|
|
723
|
+
float alpha = (0.16 + fresnel * 0.95) * scan * flicker * uOpacity;
|
|
724
|
+
vec3 glow = col * (uIntensity * (0.45 + fresnel * 1.7));
|
|
725
|
+
gl_FragColor = vec4(glow, alpha);
|
|
726
|
+
}
|
|
727
|
+
`;function Zn(e){let t=e?.toLowerCase()??``;return/knowledge|memory|rag|embed|document|vector/.test(t)?`knowledge`:/browser|web|search|fetch|http|url/.test(t)?`browser`:/file|code|exec|shell|terminal|git|patch|write|read/.test(t)?`code`:/message|mail|slack|discord|telegram|whatsapp|notify/.test(t)?`communication`:`generic`}function Qn(e){let t=(0,K.c)(2),{color:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`meshBasicMaterial`,{color:n,transparent:!0,opacity:.72,wireframe:!0,blending:2,depthWrite:!1}),t[0]=n,t[1]=r),r}function $n(e){let t=(0,K.c)(27),{toolName:n,color:r}=e,i=(0,q.useRef)(null),a;t[0]===n?a=t[1]:(a=Zn(n),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{i.current&&(i.current.rotation.y=i.current.rotation.y+t*.85,i.current.position.y=1.05+Math.sin(e.clock.elapsedTime*2.4)*.08)},t[2]=s):s=t[2],U(s);let c;t[3]!==o||t[4]!==r?(c=o===`browser`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`mesh`,{children:[(0,$.jsx)(`sphereGeometry`,{args:[.42,10,8]}),(0,$.jsx)(Qn,{color:r})]}),(0,$.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[.53,.035,6,24]}),(0,$.jsx)(Qn,{color:r})]})]}),t[3]=o,t[4]=r,t[5]=c):c=t[5];let l;t[6]!==o||t[7]!==r?(l=o===`code`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`mesh`,{children:[(0,$.jsx)(`boxGeometry`,{args:[.75,.55,.12]}),(0,$.jsx)(Qn,{color:r})]}),(0,$.jsxs)(`mesh`,{position:[-.16,0,.1],rotation:[0,0,-.55],children:[(0,$.jsx)(`boxGeometry`,{args:[.06,.32,.05]}),(0,$.jsx)(Qn,{color:r})]}),(0,$.jsxs)(`mesh`,{position:[.16,0,.1],rotation:[0,0,.55],children:[(0,$.jsx)(`boxGeometry`,{args:[.06,.32,.05]}),(0,$.jsx)(Qn,{color:r})]})]}),t[6]=o,t[7]=r,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==r?(u=o===`knowledge`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`mesh`,{children:[(0,$.jsx)(`octahedronGeometry`,{args:[.46,0]}),(0,$.jsx)(Qn,{color:r})]}),(0,$.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[.58,.025,6,6]}),(0,$.jsx)(Qn,{color:r})]})]}),t[9]=o,t[10]=r,t[11]=u):u=t[11];let d;t[12]!==o||t[13]!==r?(d=o===`communication`&&(0,$.jsx)($.Fragment,{children:[.25,.42,.59].map(e=>(0,$.jsxs)(`mesh`,{rotation:[0,Math.PI/2,0],children:[(0,$.jsx)(`torusGeometry`,{args:[e,.025,5,20,Math.PI]}),(0,$.jsx)(Qn,{color:r})]},e))}),t[12]=o,t[13]=r,t[14]=d):d=t[14];let f;t[15]!==o||t[16]!==r?(f=o===`generic`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`mesh`,{children:[(0,$.jsx)(`icosahedronGeometry`,{args:[.4,0]}),(0,$.jsx)(Qn,{color:r})]}),(0,$.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[.56,.025,5,24]}),(0,$.jsx)(Qn,{color:r})]})]}),t[15]=o,t[16]=r,t[17]=f):f=t[17];let p;t[18]===r?p=t[19]:(p=(0,$.jsx)(`pointLight`,{color:r,intensity:2.2,distance:4,decay:2}),t[18]=r,t[19]=p);let m;return t[20]!==c||t[21]!==l||t[22]!==u||t[23]!==d||t[24]!==f||t[25]!==p?(m=(0,$.jsxs)(`group`,{ref:i,scale:.7,children:[c,l,u,d,f,p]}),t[20]=c,t[21]=l,t[22]=u,t[23]=d,t[24]=f,t[25]=p,t[26]=m):m=t[26],m}var er=new W,tr=new R,nr=new se,rr=new W(0,1,0),ir=new W(0,0,0),ar={archived:{flap:0,intensity:.08,opacity:.12},idle:{flap:0,intensity:.45,opacity:.72},thinking:{flap:5,intensity:.85,opacity:.9},tool_call:{flap:8,intensity:1.05,opacity:1},stuck:{flap:2,intensity:.9,opacity:.95},disabled:{flap:0,intensity:.12,opacity:.06}};function or({desk:e,swarmRef:t}){let{agent:n,state:r,color:i}=e,a=J(e=>e.selectedAgentId===n.id),o=J(e=>e.select),s=J(e=>e.motion),c=J(e=>e.activeCue),l=(0,q.useRef)(null),u=(0,q.useRef)(null),d=(0,q.useRef)(null),f=(0,q.useRef)(null),p=(0,q.useRef)(null),m=(0,q.useRef)(null),h=(0,q.useMemo)(()=>new ge({vertexShader:Yn,fragmentShader:Xn,uniforms:{uTime:{value:0},uColor:{value:new I(i)},uIntensity:{value:.65},uGlitch:{value:0},uOpacity:{value:.8}},transparent:!0,depthWrite:!1,side:2,blending:2}),[i]),g=(0,q.useMemo)(()=>new ge({vertexShader:Yn,fragmentShader:Xn,uniforms:{uTime:{value:0},uColor:{value:new I(i).lerp(new I(`#ffffff`),.55)},uIntensity:{value:.9},uGlitch:{value:0},uOpacity:{value:.4}},transparent:!0,depthWrite:!1,side:2,blending:2}),[i]),_=(0,q.useMemo)(()=>new I(i),[i]);U((e,i)=>{let o=e.clock.elapsedTime,_=ar[r],v=c?.actorId===n.id||c?.targetId===n.id,y=c&&!v&&!a?.28:1;h.uniforms.uTime.value=o,g.uniforms.uTime.value=o;let b=1-.002**i;h.uniforms.uIntensity.value+=(_.intensity-h.uniforms.uIntensity.value)*b,h.uniforms.uOpacity.value+=(_.opacity*y-h.uniforms.uOpacity.value)*b,g.uniforms.uOpacity.value+=(.4*y-g.uniforms.uOpacity.value)*b,h.uniforms.uGlitch.value+=(+(r===`stuck`)-h.uniforms.uGlitch.value)*b;let x=t.current.get(n.id);x&&l.current&&(l.current.position.copy(x.pos),u.current&&(er.subVectors(x.pos,x.prevPos),er.lengthSq()>1e-8&&(tr.lookAt(er,ir,rr),nr.setFromRotationMatrix(tr),u.current.quaternion.slerp(nr,1-.01**i))));let S=s===`calm`&&_.flap>0?Math.sin(o*_.flap)*.45+.2:.15;if(f.current&&(f.current.rotation.z=S),p.current&&(p.current.rotation.z=-S),m.current){let e=r===`disabled`||r===`archived`?0:r===`tool_call`?7:2.6;m.current.intensity+=(e-m.current.intensity)*b}if(d.current){let e=c?.phase===`delegated`&&c.targetId===n.id,t=c?.actorId===n.id&&(c.phase===`completed`||c.phase===`failed`),r=s===`calm`&&e?Math.sin(o*8.5)*.22:s===`calm`&&t?-.16:0;d.current.rotation.x=z.damp(d.current.rotation.x,r,7,i);let a=v&&s===`calm`?1.12:1,l=z.damp(d.current.scale.x,a,6,i);d.current.scale.setScalar(l)}});let v=e=>{e.stopPropagation(),o(a?null:n.id)},y=r===`tool_call`?Jn(e.currentTool):null;return(0,$.jsxs)(`group`,{ref:l,children:[(0,$.jsx)(`group`,{onClick:v,onPointerOver:e=>{e.stopPropagation(),document.body.style.cursor=`pointer`},onPointerOut:()=>{document.body.style.cursor=`auto`},children:(0,$.jsx)(zt,{width:r===`idle`||r===`disabled`||r===`archived`?0:.65,length:2.2,color:_,attenuation:e=>e*e,children:(0,$.jsx)(`group`,{ref:u,scale:a?.85:.62,children:(0,$.jsxs)(`group`,{ref:d,children:[(0,$.jsx)(`mesh`,{material:h,scale:[.85,.75,1.35],children:(0,$.jsx)(`sphereGeometry`,{args:[.32,14,14]})}),(0,$.jsxs)(`mesh`,{position:[0,0,.1],children:[(0,$.jsx)(`torusGeometry`,{args:[.24,.045,8,20]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#241804`,metalness:.4,roughness:.6})]}),(0,$.jsxs)(`mesh`,{position:[0,0,-.14],children:[(0,$.jsx)(`torusGeometry`,{args:[.22,.04,8,20]}),(0,$.jsx)(`meshStandardMaterial`,{color:`#241804`,metalness:.4,roughness:.6})]}),(0,$.jsx)(`mesh`,{material:h,position:[0,.03,.5],children:(0,$.jsx)(`sphereGeometry`,{args:[.18,12,12]})}),(0,$.jsx)(`mesh`,{material:h,position:[0,0,-.52],rotation:[-Math.PI/2,0,0],children:(0,$.jsx)(`coneGeometry`,{args:[.07,.22,8]})}),(0,$.jsx)(`mesh`,{ref:f,material:g,position:[.26,.24,.05],rotation:[.35,0,.5],scale:[1,.08,.55],children:(0,$.jsx)(`sphereGeometry`,{args:[.3,10,10]})}),(0,$.jsx)(`mesh`,{ref:p,material:g,position:[-.26,.24,.05],rotation:[.35,0,-.5],scale:[1,.08,.55],children:(0,$.jsx)(`sphereGeometry`,{args:[.3,10,10]})})]})})})}),(0,$.jsx)(`pointLight`,{ref:m,color:i,intensity:2.6,distance:8,decay:1.7}),r===`tool_call`&&(0,$.jsx)($n,{toolName:e.currentTool,color:i}),r===`thinking`&&(0,$.jsxs)(`mesh`,{position:[0,.95,0],rotation:[-Math.PI/2,0,0],children:[(0,$.jsx)(`ringGeometry`,{args:[.42,.52,6]}),(0,$.jsx)(`meshBasicMaterial`,{color:i,transparent:!0,opacity:.42,blending:2,depthWrite:!1})]}),r===`stuck`&&(0,$.jsxs)(`mesh`,{position:[0,1.05,0],rotation:[-Math.PI/2,0,0],children:[(0,$.jsx)(`ringGeometry`,{args:[.52,.68,6]}),(0,$.jsx)(`meshBasicMaterial`,{color:`#fb7185`,transparent:!0,opacity:.86,blending:2,depthWrite:!1})]}),e.currentTask&&(0,$.jsx)(tt,{position:[0,1.55,0],center:!0,distanceFactor:17,className:`pointer-events-none select-none`,children:(0,$.jsxs)(`div`,{className:`office3d-task-chip`,style:{"--chip-color":i},children:[(0,$.jsx)(`span`,{className:`office3d-task-chip-prefix`,children:`◈`}),` `,e.currentTask]})}),y&&(0,$.jsx)(tt,{position:[0,e.currentTask?1.05:1.3,0],center:!0,distanceFactor:17,className:`pointer-events-none select-none`,children:(0,$.jsx)(`div`,{className:`office3d-tool-chip`,style:{"--chip-color":i},children:y})}),(0,$.jsx)(tt,{position:[0,-.85,0],center:!0,distanceFactor:16,className:`pointer-events-none select-none`,zIndexRange:[10,0],children:(0,$.jsxs)(`div`,{className:`office3d-name-plate ${a?`is-active`:``}`,style:{"--chip-color":i},children:[(0,$.jsx)(`span`,{className:`office3d-name-dot office3d-name-dot--${r}`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:n.name}),(0,$.jsx)(`small`,{children:n.description||`Agente especialista`})]})]})})]})}var sr=new Set([`failed`,`aborted`,`review_failed`,`blocked`]);function cr(e){return sr.has(e)?4200:e===`completed`?3200:2800}function lr(e){return sr.has(e)}function ur(e,t){return e.some(e=>e.eventId===t.eventId)?e:(lr(t.phase)?[t,...e]:[...e,t]).slice(0,3)}function dr(e){switch(e){case`delegated`:return`Delegando trabajo`;case`review_passed`:return`Revisión aprobada`;case`review_failed`:return`Revisión no aprobada`;case`completed`:return`Entregando resultado`;case`failed`:return`Trabajo fallido`;case`aborted`:return`Trabajo interrumpido`;case`blocked`:return`Agente bloqueado`}}function fr(e){return e===`failed`||e===`aborted`||e===`review_failed`?`alert`:e===`completed`||e===`review_passed`?`done`:`work`}var pr=new W(0,4.4,0),mr=2.25,hr=0;function gr(e,t){let n=fr(e.phase);return n===`alert`?`#fb7185`:n===`done`?`#86efac`:n===`review`?`#67e8f9`:t??`#f59e0b`}function _r({desks:e,events:t,swarmRef:n,coordinatorId:r,coordinatorName:i}){let[a,o]=(0,q.useState)([]),s=(0,q.useRef)(new Set),c=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{if(!c.current){t.forEach(e=>s.current.add(e.eventId)),c.current=!0;return}let n=new Map(e.map(e=>[e.agent.id,e])),a=e=>e===r?i:n.get(e)?.agent.name??`Agente`,l=[];for(let e of t){if(s.current.has(e.eventId))continue;s.current.add(e.eventId);let t=e.targetId||r;t&&l.push({id:++hr,event:e,startId:e.actorId,endId:t,sourceName:a(e.actorId),targetName:a(t),color:gr(e,n.get(t)?.color??n.get(e.actorId)?.color)})}l.length>0&&o(e=>[...e,...l].slice(-8))},[r,i,e,t]),(0,$.jsx)(`group`,{children:a.map(e=>(0,$.jsx)(vr,{transfer:e,swarmRef:n,coordinatorId:r,onDone:()=>o(t=>t.filter(t=>t.id!==e.id))},e.id))})}function vr({transfer:e,swarmRef:t,coordinatorId:n,onDone:r}){let i=(0,q.useRef)(null),a=(0,q.useRef)(null),o=(0,q.useRef)(null),s=(0,q.useRef)(0),c=(0,q.useRef)(!1),l=(0,q.useRef)(new W),u=(0,q.useRef)(new W);U((d,f)=>{if(c.current||!i.current)return;s.current=Math.min(mr,s.current+f);let p=e.startId===n?pr:t.current.get(e.startId)?.pos,m=e.endId===n?pr:t.current.get(e.endId)?.pos;if(!p||!m){i.current.visible=!1,s.current>=mr&&(c.current=!0,r());return}i.current.visible=!0,l.current.copy(p),u.current.copy(m);let h=s.current/mr,g=1-(1-Math.min(1,Math.max(0,(h-.14)/.86)))**3;if(i.current.position.lerpVectors(l.current,u.current,g),i.current.position.y+=Math.sin(g*Math.PI)*2.2,i.current.rotation.x+=f*2.4,i.current.rotation.y+=f*3.2,o.current?.position.copy(i.current.position),a.current){a.current.position.copy(l.current),a.current.visible=h<.46;let e=.8+h*5.2%1*1.35;a.current.scale.setScalar(e),a.current.rotation.y+=f*.8}s.current>=mr&&(c.current=!0,r())});let d=e.event.phase===`delegated`?`${e.sourceName} llama a ${e.targetName}`:e.event.phase===`completed`?`${e.sourceName} entrega a ${e.targetName}`:`${e.sourceName} informa a ${e.targetName}`;return(0,$.jsxs)(`group`,{children:[(0,$.jsx)(`group`,{ref:a,children:[.72,1.08].map((t,n)=>(0,$.jsxs)(`mesh`,{rotation:[Math.PI/2,0,0],children:[(0,$.jsx)(`torusGeometry`,{args:[t,n===0?.055:.035,6,28]}),(0,$.jsx)(`meshBasicMaterial`,{color:e.color,transparent:!0,opacity:n===0?.72:.42,blending:2,depthWrite:!1})]},t))}),(0,$.jsxs)(`mesh`,{ref:i,children:[(0,$.jsx)(`octahedronGeometry`,{args:[.3,0]}),(0,$.jsx)(`meshBasicMaterial`,{color:e.color,transparent:!0,opacity:.98,blending:2,depthWrite:!1})]}),(0,$.jsx)(`group`,{ref:o,children:(0,$.jsx)(tt,{position:[0,.75,0],center:!0,distanceFactor:20,className:`pointer-events-none select-none`,children:(0,$.jsxs)(`div`,{className:`office3d-transfer-label is-compact is-${fr(e.event.phase)}`,style:{"--chip-color":e.color},children:[(0,$.jsx)(`span`,{children:d}),(0,$.jsx)(`strong`,{children:dr(e.event.phase).toUpperCase()})]})})})]})}function yr({events:e,desks:t,coordinatorId:n}){let r=J(e=>e.setActiveCue),i=(0,q.useRef)(new Set),a=(0,q.useRef)(!1),o=(0,q.useRef)([]),s=(0,q.useRef)(null),c=(0,q.useRef)(null),l=(0,q.useRef)(new Map),u=(0,q.useRef)(!1),d=(0,q.useCallback)(function e(){if(s.current||o.current.length===0)return;let t=o.current.shift()??null;s.current=t,r(t),t&&(c.current=setTimeout(()=>{s.current=null,r(null),c.current=null,e()},cr(t.phase)))},[r]),f=(0,q.useCallback)(e=>{lr(e.phase)&&s.current&&!lr(s.current.phase)&&(c.current&&clearTimeout(c.current),o.current=ur(o.current,s.current),s.current=null,r(null)),o.current=ur(o.current,e),d()},[d,r]);return(0,q.useEffect)(()=>{if(!a.current){e.forEach(e=>i.current.add(e.eventId)),a.current=!0;return}for(let t of e)i.current.has(t.eventId)||(i.current.add(t.eventId),f(t))},[e,f]),(0,q.useEffect)(()=>{if(!u.current){l.current=new Map(t.map(e=>[e.agent.id,e.state])),u.current=!0;return}for(let e of t){let t=l.current.get(e.agent.id);e.state===`stuck`&&t!==`stuck`&&f({eventId:`blocked:${e.agent.id}:${Date.now()}`,phase:`blocked`,taskRef:e.taskId??`agent:${e.agent.id}`,taskName:e.currentTask??`Ejecución del agente`,actorId:e.agent.id,targetId:n,detail:`El agente necesita atención`,timestamp:Date.now()}),l.current.set(e.agent.id,e.state)}},[n,t,f]),(0,q.useEffect)(()=>()=>{c.current&&clearTimeout(c.current),r(null)},[r]),null}var br=new W(0,7.6,0),xr=new W(0,4.4,0),Sr=1.7,Cr=6;function wr(e){let t=(0,K.c)(41),{status:n,decisions:r,swarmRef:i,coordinatorId:a,motion:o}=e,s=(0,q.useRef)(null),c=(0,q.useRef)(null),l=(0,q.useRef)(null),u=(0,q.useRef)(null),d=(0,q.useRef)(0),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],t[0]=f):f=t[0];let[p,m]=(0,q.useState)(f),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Set,t[1]=h):h=t[1];let g=(0,q.useRef)(h),_=(0,q.useRef)(!1),v,y;t[2]!==r||t[3]!==o?(v=()=>{if(!_.current){r.forEach(e=>g.current.add(e.eventId)),_.current=!0;return}let e=r.filter(e=>!g.current.has(e.eventId));e.length!==0&&(e.forEach(e=>g.current.add(e.eventId)),d.current=1,o!==`off`&&m(t=>[...t,...e.map(Tr)].slice(-Cr)))},y=[r,o],t[2]=r,t[3]=o,t[4]=v,t[5]=y):(v=t[4],y=t[5]),(0,q.useEffect)(v,y);let b=n?.state===`fallback`,x=b?De:Ee,S;if(t[6]!==b||t[7]!==o?(S=(e,t)=>{let n=e.clock.elapsedTime;d.current=Math.max(0,d.current-t*1.4);let r=o===`calm`?(b?.12:.35)+d.current*2.2:0;if(s.current&&(s.current.rotation.y=s.current.rotation.y+t*r,s.current.rotation.x=s.current.rotation.x+t*r*.4,s.current.scale.setScalar(1+d.current*.22)),c.current){let e=c.current.material;e.emissiveIntensity=(b?.25+Math.max(0,Math.sin(n*9))*.15:.7+Math.sin(n*1.6)*.12)+d.current*1.6,c.current.rotation.y=c.current.rotation.y-t*r*.6}l.current&&(l.current.rotation.z=l.current.rotation.z+t*(o===`calm`?.5+d.current*3:0)),u.current&&(u.current.intensity=(b?1.2:3)+d.current*9)},t[6]=b,t[7]=o,t[8]=S):S=t[8],U(S),!n||n.state===`off`)return null;let C;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`icosahedronGeometry`,{args:[.95,0]}),t[9]=C):C=t[9];let w;t[10]===x?w=t[11]:(w=(0,$.jsxs)(`mesh`,{ref:s,children:[C,(0,$.jsx)(`meshBasicMaterial`,{color:x,wireframe:!0,transparent:!0,opacity:.55,blending:2,depthWrite:!1})]}),t[10]=x,t[11]=w);let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`octahedronGeometry`,{args:[.45,0]}),t[12]=T):T=t[12];let E;t[13]===x?E=t[14]:(E=(0,$.jsxs)(`mesh`,{ref:c,children:[T,(0,$.jsx)(`meshStandardMaterial`,{color:`#1e1535`,emissive:x,emissiveIntensity:.7,metalness:.4,roughness:.25})]}),t[13]=x,t[14]=E);let D,O;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=[Math.PI/2,0,0],O=(0,$.jsx)(`torusGeometry`,{args:[1.45,.025,6,48]}),t[15]=D,t[16]=O):(D=t[15],O=t[16]);let k,A;t[17]===x?(k=t[18],A=t[19]):(k=(0,$.jsx)(`group`,{ref:l,rotation:D,children:(0,$.jsxs)(`mesh`,{children:[O,(0,$.jsx)(`meshBasicMaterial`,{color:x,transparent:!0,opacity:.45,blending:2,depthWrite:!1})]})}),A=(0,$.jsx)(`pointLight`,{ref:u,color:x,intensity:3,distance:12,decay:1.8}),t[17]=x,t[18]=k,t[19]=A);let j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=[0,1.55,0],t[20]=j):j=t[20];let M=`office3d-jev-tag ${b?`is-fallback`:``}`,N;t[21]===M?N=t[22]:(N=(0,$.jsx)(tt,{position:j,center:!0,distanceFactor:22,className:`pointer-events-none select-none`,children:(0,$.jsx)(`div`,{className:M,children:`JEV`})}),t[21]=M,t[22]=N);let P;t[23]!==k||t[24]!==A||t[25]!==N||t[26]!==w||t[27]!==E?(P=(0,$.jsxs)(`group`,{position:br,children:[w,E,k,A,N]}),t[23]=k,t[24]=A,t[25]=N,t[26]=w,t[27]=E,t[28]=P):P=t[28];let F;if(t[29]!==p||t[30]!==x||t[31]!==a||t[32]!==i){let e;t[34]!==x||t[35]!==a||t[36]!==i?(e=e=>(0,$.jsx)(Er,{beam:e,swarmRef:i,coordinatorId:a,color:x,onDone:()=>m(t=>t.filter(t=>t.decision.eventId!==e.decision.eventId))},e.decision.eventId),t[34]=x,t[35]=a,t[36]=i,t[37]=e):e=t[37],F=p.map(e),t[29]=p,t[30]=x,t[31]=a,t[32]=i,t[33]=F}else F=t[33];let I;return t[38]!==P||t[39]!==F?(I=(0,$.jsxs)(`group`,{children:[P,F]}),t[38]=P,t[39]=F,t[40]=I):I=t[40],I}function Tr(e){return{decision:e,chip:Me(e.savedTokens)}}function Er(e){let t=(0,K.c)(30),{beam:n,swarmRef:r,coordinatorId:i,color:a,onDone:o}=e,s=(0,q.useRef)(null),c=(0,q.useRef)(null),l=(0,q.useRef)(null),u=(0,q.useRef)(0),d=(0,q.useRef)(!1),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=new W,t[0]=f):f=t[0];let p=(0,q.useRef)(f),m;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(m=new W,t[1]=m):m=t[1];let h=(0,q.useRef)(m),{decision:g,chip:_}=n,v;t[2]!==i||t[3]!==g.agentId||t[4]!==o||t[5]!==r?(v=(e,t)=>{if(d.current)return;u.current+=t;let n=g.agentId===i?xr:r.current.get(g.agentId)?.pos;n?p.current.copy(n):p.current.copy(xr),h.current.lerpVectors(br,p.current,.5),h.current.y=h.current.y+2.4;let a=Math.min(1,u.current/Sr),f=a<.2?a/.2:1-Math.max(0,(a-.55)/.45);if(s.current&&(s.current.setPoints(br,p.current,h.current),s.current.material.opacity=f*.85),c.current){let e=Math.min(1,a/.45),t=1-e;c.current.position.set(t*t*br.x+2*t*e*h.current.x+e*e*p.current.x,t*t*br.y+2*t*e*h.current.y+e*e*p.current.y,t*t*br.z+2*t*e*h.current.z+e*e*p.current.z),c.current.material.opacity=f}l.current?.position.copy(p.current),a>=1&&(d.current=!0,o())},t[2]=i,t[3]=g.agentId,t[4]=o,t[5]=r,t[6]=v):v=t[6],U(v);let y;t[7]===a?y=t[8]:(y=(0,$.jsx)(Dt,{ref:s,start:br,end:xr,color:a,lineWidth:1.6,transparent:!0,opacity:0,depthWrite:!1}),t[7]=a,t[8]=y);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`sphereGeometry`,{args:[.16,10,8]}),t[9]=b):b=t[9];let x;t[10]===a?x=t[11]:(x=(0,$.jsxs)(`mesh`,{ref:c,children:[b,(0,$.jsx)(`meshBasicMaterial`,{color:a,transparent:!0,opacity:0,blending:2,depthWrite:!1})]}),t[10]=a,t[11]=x);let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=[0,1.35,0],t[12]=S):S=t[12];let C;t[13]===g.kind?C=t[14]:(C=ke(g.kind),t[13]=g.kind,t[14]=C);let w;t[15]===C?w=t[16]:(w=(0,$.jsxs)(`span`,{children:[`Jev · `,C]}),t[15]=C,t[16]=w);let T;t[17]!==_||t[18]!==g.savedTokens?(T=_&&(0,$.jsx)(`strong`,{className:g.savedTokens<0?`is-cost`:``,children:_}),t[17]=_,t[18]=g.savedTokens,t[19]=T):T=t[19];let E;t[20]===g.latencyMs?E=t[21]:(E=(0,$.jsxs)(`small`,{children:[g.latencyMs,` ms`]}),t[20]=g.latencyMs,t[21]=E);let D;t[22]!==T||t[23]!==E||t[24]!==w?(D=(0,$.jsx)(`group`,{ref:l,children:(0,$.jsx)(tt,{position:S,center:!0,distanceFactor:20,className:`pointer-events-none select-none`,children:(0,$.jsxs)(`div`,{className:`office3d-jev-chip`,children:[w,T,E]})})}),t[22]=T,t[23]=E,t[24]=w,t[25]=D):D=t[25];let O;return t[26]!==D||t[27]!==y||t[28]!==x?(O=(0,$.jsxs)(`group`,{children:[y,x,D]}),t[26]=D,t[27]=y,t[28]=x,t[29]=O):O=t[29],O}function Dr(e){let t=(0,K.c)(74),{desks:n,coordinator:r,interactions:i,workEvents:a,jev:o}=e,s=J(Pr),c=J(Nr),l=J(Mr),u=typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`off`:l,d=J(jr),f=J(Ar),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=new Map,t[0]=p):p=t[0];let m=(0,q.useRef)(p),h;t[1]===n?h=t[2]:(h=n.some(kr),t[1]=n,t[2]=h);let g=h,_;t[3]===s?_=t[4]:(_=s===`high`?[1,1.75]:1,t[3]=s,t[4]=_);let v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v={antialias:!1,alpha:!1,powerPreference:`high-performance`},t[5]=v):v=t[5];let y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y={fov:42,near:.1,far:220,position:[0,46,62]},t[6]=y):y=t[6];let b;t[7]===f?b=t[8]:(b=()=>f(null),t[7]=f,t[8]=b);let x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`color`,{attach:`background`,args:[`#04060c`]}),t[9]=x):x=t[9];let S,C,w;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`fog`,{attach:`fog`,args:[`#04060c`,34,100]}),w=(0,$.jsx)(`ambientLight`,{intensity:.35}),S=(0,$.jsx)(`directionalLight`,{position:[12,24,8],intensity:.35,color:`#9db8ff`}),t[10]=S,t[11]=C,t[12]=w):(S=t[10],C=t[11],w=t[12]);let T=r?.id??null,E;t[13]!==n||t[14]!==T||t[15]!==a?(E=(0,$.jsx)(yr,{events:a,desks:n,coordinatorId:T}),t[13]=n,t[14]=T,t[15]=a,t[16]=E):E=t[16];let D;t[17]!==n||t[18]!==u?(D=(0,$.jsx)(Kn,{desks:n,swarmRef:m,motion:u}),t[17]=n,t[18]=u,t[19]=D):D=t[19];let O=r?.id??null,k;t[20]!==u||t[21]!==d||t[22]!==O?(k=(0,$.jsx)(Zt,{coordinatorId:O,selectedAgentId:d,swarmRef:m,motion:u}),t[20]=u,t[21]=d,t[22]=O,t[23]=k):k=t[23];let A;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(sn,{}),t[24]=A):A=t[24];let j;t[25]!==g||t[26]!==r?(j=(0,$.jsx)(yn,{coordinator:r,active:g,swarmRef:m}),t[25]=g,t[26]=r,t[27]=j):j=t[27];let M;t[28]===n?M=t[29]:(M=n.map(e=>(0,$.jsx)(or,{desk:e,swarmRef:m},e.agent.id)),t[28]=n,t[29]=M);let N=r?.id??null,P;t[30]!==n||t[31]!==i||t[32]!==N?(P=(0,$.jsx)(kn,{desks:n,interactions:i,swarmRef:m,coordinatorId:N}),t[30]=n,t[31]=i,t[32]=N,t[33]=P):P=t[33];let F=r?.id??null,I;t[34]!==u||t[35]!==o.decisions||t[36]!==o.status||t[37]!==F?(I=(0,$.jsx)(wr,{status:o.status,decisions:o.decisions,swarmRef:m,coordinatorId:F,motion:u}),t[34]=u,t[35]=o.decisions,t[36]=o.status,t[37]=F,t[38]=I):I=t[38];let L;t[39]!==r?.id||t[40]!==r?.name||t[41]!==n||t[42]!==u||t[43]!==a?(L=u===`calm`&&(0,$.jsx)(_r,{desks:n,events:a,swarmRef:m,coordinatorId:r?.id??null,coordinatorName:r?.name??`Coordinador`}),t[39]=r?.id,t[40]=r?.name,t[41]=n,t[42]=u,t[43]=a,t[44]=L):L=t[44];let R;t[45]!==n||t[46]!==u||t[47]!==s?(R=u===`calm`&&s===`high`&&(0,$.jsx)(Hn,{desks:n,swarmRef:m}),t[45]=n,t[46]=u,t[47]=s,t[48]=R):R=t[48];let z;t[49]!==u||t[50]!==s?(z=u===`calm`&&s===`high`&&(0,$.jsx)(Rn,{}),t[49]=u,t[50]=s,t[51]=z):z=t[51];let B;t[52]===s?B=t[53]:(B=(0,$.jsx)(Wn,{quality:s}),t[52]=s,t[53]=B);let V;t[54]!==s||t[55]!==c?(V=(0,$.jsx)(Vt,{bounds:Or,onDecline:()=>{s===`high`&&c(`low`)}}),t[54]=s,t[55]=c,t[56]=V):V=t[56];let H;t[57]!==E||t[58]!==D||t[59]!==k||t[60]!==j||t[61]!==M||t[62]!==P||t[63]!==I||t[64]!==L||t[65]!==R||t[66]!==z||t[67]!==B||t[68]!==V?(H=(0,$.jsxs)(q.Suspense,{fallback:null,children:[E,D,k,A,j,M,P,I,L,R,z,B,V]}),t[57]=E,t[58]=D,t[59]=k,t[60]=j,t[61]=M,t[62]=P,t[63]=I,t[64]=L,t[65]=R,t[66]=z,t[67]=B,t[68]=V,t[69]=H):H=t[69];let ee;return t[70]!==H||t[71]!==_||t[72]!==b?(ee=(0,$.jsxs)(me,{dpr:_,gl:v,camera:y,onPointerMissed:b,children:[x,C,w,S,H]}),t[70]=H,t[71]=_,t[72]=b,t[73]=ee):ee=t[73],ee}function Or(e){return[Math.min(42,e*.68),e*.92]}function kr(e){return e.state===`thinking`||e.state===`tool_call`||e.state===`stuck`}function Ar(e){return e.select}function jr(e){return e.selectedAgentId}function Mr(e){return e.motion}function Nr(e){return e.setQuality}function Pr(e){return e.quality}function Fr(e){let t=(0,K.c)(8),{events:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`office3d-ticker-title`,children:`Actividad`}),t[0]=r):r=t[0];let i;t[1]===n.length?i=t[2]:(i=n.length===0&&(0,$.jsx)(`div`,{className:`office3d-ticker-empty`,children:`Sin eventos todavía…`}),t[1]=n.length,t[2]=i);let a;t[3]===n?a=t[4]:(a=n.slice(0,6).map(Ir),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,$.jsxs)(`div`,{className:`office3d-ticker`,children:[r,(0,$.jsxs)(`div`,{className:`office3d-ticker-list`,role:`log`,"aria-live":`polite`,"aria-relevant":`additions`,children:[i,a]})]}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function Ir(e){return(0,$.jsxs)(`div`,{className:`office3d-ticker-item office3d-ticker-item--${e.kind}`,children:[(0,$.jsx)(`span`,{className:`office3d-ticker-dot`,style:{background:e.color}}),(0,$.jsx)(`span`,{className:`office3d-ticker-text`,children:e.text}),(0,$.jsx)(`span`,{className:`office3d-ticker-time`,children:e.time})]},e.id)}var Lr=0;function Rr(e,t){return t===`tool_call`&&!e.currentTask?{text:`${e.agent.name} · ${Jn(e.currentTool)??`Ejecutando herramienta`}`,color:e.color,kind:`work`}:t===`thinking`&&!e.currentTask?{text:`${e.agent.name} está pensando…`,color:e.color,kind:`info`}:t===`stuck`?{text:`${e.agent.name} necesita ayuda`,color:`#f87171`,kind:`warn`}:null}function zr(e,t,n,r,i=[]){let[a,o]=(0,q.useState)([]),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Set),l=(0,q.useRef)(new Set),u=(0,q.useRef)(!1);return(0,q.useEffect)(()=>{let a=s.current,d=new Map(e.map(e=>[e.agent.id,e])),f=[],p=new Date().toLocaleTimeString(`es`,{hour12:!1}),m=e=>e===n?.id?n.name:d.get(e)?.agent.name??e;if(u.current){for(let e of r){if(c.current.has(e.eventId))continue;c.current.add(e.eventId);let t=fr(e.phase);f.push({id:++Lr,time:new Date(e.timestamp).toLocaleTimeString(`es`,{hour12:!1}),text:`${dr(e.phase)} · ${m(e.actorId)}${e.targetId?` → ${m(e.targetId)}`:``}: «${e.taskName}»`,color:t===`alert`?`#fb7185`:t===`done`?`#86efac`:d.get(e.targetId??``)?.color??`#f59e0b`,kind:t===`alert`?`warn`:t===`done`?`done`:`work`})}for(let e of i){if(l.current.has(e.eventId)||(l.current.add(e.eventId),e.kind!==`context`))continue;let t=Me(e.savedTokens);f.push({id:++Lr,time:new Date(e.timestamp).toLocaleTimeString(`es`,{hour12:!1}),text:`Jev → ${m(e.agentId)}: ${e.summary}${t?` (${t})`:``}${e.recommendedAgentId?` · sugiere ${m(e.recommendedAgentId)}`:``}${e.mcpOff?.length?` (encender ${e.mcpOff.join(`, `)})`:``}`,color:Ee,kind:`info`})}}else{r.forEach(e=>c.current.add(e.eventId)),i.forEach(e=>l.current.add(e.eventId));for(let e of t)f.push({id:++Lr,time:p,text:`${m(e.sourceId)} → ${m(e.targetId)}: «${e.taskName??`Flujo activo`}»`,color:d.get(e.targetId)?.color??`#f59e0b`,kind:`work`});u.current=!0}for(let t of e){let e=a.get(t.agent.id);if(e&&e.state!==t.state){let e=Rr(t,t.state);e&&f.push({id:++Lr,time:p,...e})}a.set(t.agent.id,{state:t.state})}f.length&&o(e=>[...f.reverse(),...e].slice(0,24))},[e,t,n,r,i]),a}function Br(e){let t=(0,K.c)(55),{status:n,decisions:r,coordinator:i,desks:a}=e,[o,s]=(0,q.useState)(!1),l=C(Wr);if(!n||n.state===`off`)return null;let u;t[0]!==i||t[1]!==a?(u=e=>e===i?.id?i.name:a.find(t=>t.agent.id===e)?.agent.name??e,t[0]=i,t[1]=a,t[2]=u):u=t[2];let f=u,m;t[3]===n.totals?m=t[4]:(m=n.totals??{decisions:0,savedTokens:0,costUsd:0},t[3]=n.totals,t[4]=m);let h=m,g=r[r.length-1],_;t[5]===r?_=t[6]:(_=r.length?Math.round(r.reduce(Ur,0)/r.length):null,t[5]=r,t[6]=_);let v=_,y;if(t[7]!==v||t[8]!==l||t[9]!==o||t[10]!==g||t[11]!==f||t[12]!==n.lastError||t[13]!==n.state||t[14]!==h.costUsd||t[15]!==h.decisions||t[16]!==h.savedTokens){let e=Object.entries(l).sort(Hr).slice(0,4),r,i;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{className:`office3d-jev-icon`,children:(0,$.jsx)(p,{size:14})}),i=(0,$.jsx)(`span`,{className:`office3d-section-kicker`,children:`PLANO DE DECISIÓN`}),t[18]=r,t[19]=i):(r=t[18],i=t[19]);let a;t[20]===n.state?a=t[21]:(a=Ae(n.state),t[20]=n.state,t[21]=a);let u;t[22]===a?u=t[23]:(u=(0,$.jsxs)(`div`,{children:[i,(0,$.jsxs)(`h2`,{children:[`Jev · `,a]})]}),t[22]=a,t[23]=u);let m;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>s(Vr),t[24]=m):m=t[24];let _=o?`Mostrar detalle de Jev`:`Ocultar detalle de Jev`,b=!o,x;t[25]===o?x=t[26]:(x=o?(0,$.jsx)(c,{size:14}):(0,$.jsx)(d,{size:14}),t[25]=o,t[26]=x);let S;t[27]!==_||t[28]!==b||t[29]!==x?(S=(0,$.jsx)(`button`,{type:`button`,className:`office3d-roster-toggle`,onClick:m,"aria-label":_,"aria-expanded":b,children:x}),t[27]=_,t[28]=b,t[29]=x,t[30]=S):S=t[30];let C;t[31]!==S||t[32]!==u?(C=(0,$.jsxs)(`header`,{className:`office3d-jev-head`,children:[r,u,S]}),t[31]=S,t[32]=u,t[33]=C):C=t[33];let w;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`dt`,{children:`Decisiones`}),t[34]=w):w=t[34];let T;t[35]===h.decisions?T=t[36]:(T=(0,$.jsxs)(`div`,{children:[w,(0,$.jsx)(`dd`,{children:h.decisions})]}),t[35]=h.decisions,t[36]=T);let E=h.savedTokens>=0?`Tokens ahorrados`:`Tokens añadidos`,D;t[37]===E?D=t[38]:(D=(0,$.jsx)(`dt`,{children:E}),t[37]=E,t[38]=D);let O;t[39]===h.savedTokens?O=t[40]:(O=je(h.savedTokens),t[39]=h.savedTokens,t[40]=O);let k;t[41]===O?k=t[42]:(k=(0,$.jsxs)(`dd`,{children:[`~`,O]}),t[41]=O,t[42]=k);let A;t[43]!==D||t[44]!==k?(A=(0,$.jsxs)(`div`,{children:[D,k]}),t[43]=D,t[44]=k,t[45]=A):A=t[45];let j;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`dt`,{children:`Costo Jev`}),t[46]=j):j=t[46];let M;t[47]===h.costUsd?M=t[48]:(M=Ne(h.costUsd),t[47]=h.costUsd,t[48]=M);let N;t[49]===M?N=t[50]:(N=(0,$.jsxs)(`div`,{children:[j,(0,$.jsx)(`dd`,{children:M})]}),t[49]=M,t[50]=N);let P;t[51]!==T||t[52]!==A||t[53]!==N?(P=(0,$.jsxs)(`dl`,{className:`office3d-jev-metrics`,children:[T,A,N]}),t[51]=T,t[52]=A,t[53]=N,t[54]=P):P=t[54],y=(0,$.jsxs)(`section`,{className:`office3d-jev office3d-glass ${n.state===`fallback`?`is-fallback`:``} ${o?`is-collapsed`:``}`,"aria-label":`Jev, plano de decisión`,children:[C,P,!o&&(0,$.jsxs)($.Fragment,{children:[n.state===`fallback`&&n.lastError&&(0,$.jsxs)(`p`,{className:`office3d-jev-warn`,children:[`Usando el flujo clásico: `,n.lastError]}),g&&(0,$.jsxs)(`div`,{className:`office3d-jev-latest`,children:[(0,$.jsxs)(`span`,{children:[`Última decisión · `,f(g.agentId),` · `,ke(g.kind)]}),(0,$.jsx)(`p`,{children:g.summary}),g.recommendedAgentId&&(g.mcpOff?.length?(0,$.jsxs)(`p`,{className:`office3d-jev-warn`,children:[f(g.recommendedAgentId),` es el indicado, pero necesita encender `,g.mcpOff.join(`, `)]}):(0,$.jsxs)(`p`,{children:[`Recomendó delegar en `,f(g.recommendedAgentId)]}))]}),e.length>0&&(0,$.jsx)(`ul`,{className:`office3d-jev-agents`,"aria-label":`Ahorro por agente desde que abriste la oficina`,children:e.map(e=>{let[t,n]=e;return(0,$.jsxs)(`li`,{children:[(0,$.jsx)(`span`,{children:f(t)}),(0,$.jsxs)(`b`,{children:[n.savedTokens>=0?`−`:`+`,je(n.savedTokens)]}),(0,$.jsxs)(`small`,{children:[n.decisions,` dec.`]})]},t)})}),(0,$.jsxs)(`p`,{className:`office3d-jev-note`,children:[`Estimación frente al flujo clásico (caracteres ÷ 4)`,v===null?``:` · ${v} ms de media`]})]})]}),t[7]=v,t[8]=l,t[9]=o,t[10]=g,t[11]=f,t[12]=n.lastError,t[13]=n.state,t[14]=h.costUsd,t[15]=h.decisions,t[16]=h.savedTokens,t[17]=y}else y=t[17];return y}function Vr(e){return!e}function Hr(e,t){let[,n]=e,[,r]=t;return r.savedTokens-n.savedTokens}function Ur(e,t){return e+t.latencyMs}function Wr(e){return e.jevByAgent}function Gr(e){let t=(0,K.c)(9),{agentId:n}=e,r;t[0]===n?r=t[1]:(r=e=>e.jevByAgent[n],t[0]=n,t[1]=r);let i=C(r);if(!i)return null;let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Jev`}),t[2]=a):a=t[2];let o=i.decisions,s=i.savedTokens>=0?`−`:`+`,c;t[3]===i.savedTokens?c=t[4]:(c=je(i.savedTokens),t[3]=i.savedTokens,t[4]=c);let l;return t[5]!==i.decisions||t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[a,(0,$.jsxs)(`span`,{className:`font-mono`,children:[o,` dec. · `,s,c,` tok`]})]}),t[5]=i.decisions,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}var Kr={archived:`Archivado manualmente`,disabled:`Desactivado`,idle:`En espera`,thinking:`Pensando`,tool_call:`Ejecutando herramienta`,stuck:`Atascado`};function qr({desk:e,delegatorName:t}){let n=J(e=>e.select);if(!e)return null;let{agent:r}=e;return(0,$.jsxs)(`aside`,{className:`office3d-inspector`,style:{"--agent-color":e.color},children:[(0,$.jsx)(`button`,{type:`button`,className:`office3d-inspector-close`,onClick:()=>n(null),"aria-label":`Cerrar`,children:(0,$.jsx)(O,{size:14})}),(0,$.jsxs)(`div`,{className:`office3d-inspector-head`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-orb`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`office3d-inspector-name`,children:r.name}),(0,$.jsx)(`span`,{className:`office3d-inspector-id`,children:r.id})]})]}),(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Rol`}),(0,$.jsx)(`span`,{children:r.role===`coordinator`?`Coordinador`:`Especialista`})]}),(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Estado`}),(0,$.jsx)(`span`,{className:`office3d-state-chip office3d-state-chip--${e.state}`,children:Kr[e.state]})]}),e.currentTask&&(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Tarea`}),(0,$.jsx)(`span`,{className:`office3d-inspector-task`,children:e.currentTask})]}),e.delegatedBy&&(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Delegado por`}),(0,$.jsx)(`span`,{children:t})]}),e.currentTool&&(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Herramienta`}),(0,$.jsx)(`span`,{className:`office3d-inspector-tool`,children:Jn(e.currentTool)})]}),(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Workers`}),(0,$.jsx)(`span`,{className:`font-mono`,children:e.workerCount})]}),(0,$.jsx)(Gr,{agentId:r.id}),r.description&&(0,$.jsx)(`p`,{className:`office3d-inspector-desc`,children:r.description})]})}function Jr({coordinator:e}){let t=J(e=>e.select);return e?(0,$.jsxs)(`aside`,{className:`office3d-inspector office3d-inspector--coordinator`,style:{"--agent-color":`#f59e0b`},children:[(0,$.jsx)(`button`,{type:`button`,className:`office3d-inspector-close`,onClick:()=>t(null),"aria-label":`Cerrar`,children:(0,$.jsx)(O,{size:14})}),(0,$.jsxs)(`div`,{className:`office3d-inspector-head`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-orb`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{className:`office3d-inspector-eyebrow`,children:`Coordinador principal`}),(0,$.jsx)(`h3`,{className:`office3d-inspector-name`,children:e.name})]})]}),(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Función`}),(0,$.jsx)(`span`,{children:`Asigna y supervisa`})]}),(0,$.jsxs)(`div`,{className:`office3d-inspector-row`,children:[(0,$.jsx)(`span`,{className:`office3d-inspector-label`,children:`Estado`}),(0,$.jsx)(`span`,{className:`office3d-state-chip office3d-state-chip--${e.status}`,children:e.status===`tool_call`?`Ejecutando herramienta`:e.status===`thinking`?`Pensando`:`En espera`})]}),(0,$.jsx)(Gr,{agentId:e.id}),typeof e.description==`string`&&(0,$.jsx)(`p`,{className:`office3d-inspector-desc`,children:e.description})]}):null}var Yr={archived:`Archivado`,disabled:`Desactivado`,idle:`Disponible`,thinking:`Pensando`,tool_call:`Ejecutando`,stuck:`Necesita ayuda`};function Xr(e){let t=e.agent.description?.trim();return t?t.length>62?`${t.slice(0,59)}…`:t:`Agente especialista`}function Zr({coordinator:e,desks:t,interactions:n,workEvents:r}){let[i,a]=(0,q.useState)(!1),o=J(e=>e.selectedAgentId),c=J(e=>e.select),d=new Map(t.map(e=>[e.agent.id,e])),f=t=>t===e?.id?e.name:d.get(t)?.agent.name??t,p=new Map;for(let e of r)p.set(e.taskRef,e);return(0,$.jsxs)(`aside`,{className:`office3d-roster office3d-glass ${i?`is-collapsed`:``}`,"aria-label":`Equipo y flujo de trabajo`,children:[(0,$.jsxs)(`div`,{className:`office3d-roster-heading`,children:[(0,$.jsxs)(`div`,{className:`office3d-roster-title`,children:[(0,$.jsx)(`span`,{className:`office3d-section-kicker`,children:`CENTRO DE OPERACIONES`}),(0,$.jsx)(`h2`,{children:`Quién hace qué`})]}),(0,$.jsx)(`span`,{className:`office3d-roster-live`,"aria-label":`${n.length} flujos activos`,children:(0,$.jsx)(g,{size:15,className:n.length?`is-active`:``})}),(0,$.jsx)(`button`,{type:`button`,className:`office3d-roster-toggle`,onClick:()=>a(e=>!e),"aria-expanded":!i,"aria-label":i?`Abrir centro de operaciones`:`Colapsar centro de operaciones`,title:i?`Abrir centro de operaciones`:`Colapsar centro de operaciones`,children:i?(0,$.jsx)(l,{size:16}):(0,$.jsx)(u,{size:16})})]}),(0,$.jsxs)(`div`,{className:`office3d-roster-content`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`office3d-roster-coordinator ${o===e?.id?`is-selected`:``}`,onClick:()=>e&&c(o===e.id?null:e.id),disabled:!e,children:[(0,$.jsx)(ve,{size:17}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`small`,{children:`ABEJA REINA · COORDINADOR`}),(0,$.jsx)(`strong`,{children:e?.name??`Conectando…`}),(0,$.jsx)(`em`,{children:`Asigna · supervisa · recibe`})]})]}),(0,$.jsxs)(`div`,{className:`office3d-flow`,children:[(0,$.jsxs)(`div`,{className:`office3d-section-title`,children:[`Flujo activo `,(0,$.jsx)(`span`,{children:n.length})]}),n.length===0?(0,$.jsx)(`p`,{className:`office3d-flow-empty`,children:`El equipo está disponible. Las delegaciones aparecerán aquí.`}):n.map(e=>{let t=d.get(e.targetId),n=e.taskId?p.get(e.taskId):null,r=n?.phase===`completed`||n?.phase===`review_passed`?3:e.kind===`reviews`?2:+(t?.state===`thinking`||t?.state===`tool_call`),i=n?.phase===`failed`||n?.phase===`aborted`||n?.phase===`review_failed`||n?.phase===`blocked`;return(0,$.jsxs)(`div`,{className:`office3d-flow-item ${i?`is-failed`:``}`,children:[(0,$.jsx)(`span`,{children:f(e.sourceId)}),(0,$.jsx)(s,{size:12}),(0,$.jsx)(`span`,{children:f(e.targetId)}),(0,$.jsx)(`strong`,{children:e.kind===`reviews`?`Revisión`:`Delegación`}),e.taskName&&(0,$.jsx)(`small`,{children:e.taskName}),(0,$.jsx)(`div`,{className:`office3d-flow-steps`,"aria-label":`Progreso del trabajo`,children:[`Delegado`,`Trabajando`,`Revisando`,i?`Atención`:`Entregado`].map((e,t)=>(0,$.jsx)(`span`,{className:`${t<r?`is-done`:``} ${t===r?`is-current`:``}`,children:e},e))})]},e.id)})]}),(0,$.jsxs)(`div`,{className:`office3d-agents-list`,children:[(0,$.jsxs)(`div`,{className:`office3d-section-title`,children:[`Especialistas `,(0,$.jsx)(`span`,{children:t.length})]}),t.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`office3d-agent-row ${o===e.agent.id?`is-selected`:``}`,onClick:()=>c(o===e.agent.id?null:e.agent.id),style:{"--agent-color":e.color},children:[(0,$.jsx)(`span`,{className:`office3d-agent-status office3d-name-dot--${e.state}`}),(0,$.jsxs)(`span`,{className:`office3d-agent-copy`,children:[(0,$.jsx)(`strong`,{children:e.agent.name}),(0,$.jsx)(`small`,{children:e.currentTask||Xr(e)})]}),(0,$.jsx)(`em`,{children:Yr[e.state]})]},e.agent.id))]})]})]})}function Qr(e){let t=(0,K.c)(46),{coordinator:n,desks:r}=e,i=J(ei);if(!i)return null;let a,o,s,c,l,u,d,p,m,h;if(t[0]!==n||t[1]!==i.actorId||t[2]!==i.phase||t[3]!==i.targetId||t[4]!==r){let e=new Map(r.map($r)),v=t=>t?t===n?.id?n.name:e.get(t)?.agent.name??`Agente`:n?.name??`Coordinador`,y;t[15]===i.phase?y=t[16]:(y=fr(i.phase),t[15]=i.phase,t[16]=y);let b=y,x=b===`alert`?T:b===`done`?f:b===`review`?ye:i.phase===`delegated`?_:g;p=`office3d-now office3d-glass is-${b}`,m=b===`alert`?`assertive`:`polite`,h=`true`,t[17]===x?o=t[18]:(o=(0,$.jsx)(`div`,{className:`office3d-now-icon`,children:(0,$.jsx)(x,{size:17})}),t[17]=x,t[18]=o),l=`office3d-now-copy`,t[19]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`span`,{children:`AHORA OCURRE`}),t[19]=u):u=t[19];let S;t[20]===i.phase?S=t[21]:(S=dr(i.phase),t[20]=i.phase,t[21]=S),t[22]===S?d=t[23]:(d=(0,$.jsx)(`strong`,{children:S}),t[22]=S,t[23]=d),a=v(i.actorId),t[24]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`b`,{children:`→`}),t[24]=s):s=t[24],c=v(i.targetId),t[0]=n,t[1]=i.actorId,t[2]=i.phase,t[3]=i.targetId,t[4]=r,t[5]=a,t[6]=o,t[7]=s,t[8]=c,t[9]=l,t[10]=u,t[11]=d,t[12]=p,t[13]=m,t[14]=h}else a=t[5],o=t[6],s=t[7],c=t[8],l=t[9],u=t[10],d=t[11],p=t[12],m=t[13],h=t[14];let v;t[25]!==a||t[26]!==s||t[27]!==c?(v=(0,$.jsxs)(`p`,{children:[a,s,c]}),t[25]=a,t[26]=s,t[27]=c,t[28]=v):v=t[28];let y;t[29]===i.taskName?y=t[30]:(y=(0,$.jsx)(`small`,{children:i.taskName}),t[29]=i.taskName,t[30]=y);let b;t[31]===i.detail?b=t[32]:(b=i.detail&&(0,$.jsx)(`em`,{children:i.detail}),t[31]=i.detail,t[32]=b);let x;t[33]!==v||t[34]!==y||t[35]!==b||t[36]!==l||t[37]!==u||t[38]!==d?(x=(0,$.jsxs)(`div`,{className:l,children:[u,d,v,y,b]}),t[33]=v,t[34]=y,t[35]=b,t[36]=l,t[37]=u,t[38]=d,t[39]=x):x=t[39];let S;return t[40]!==o||t[41]!==x||t[42]!==p||t[43]!==m||t[44]!==h?(S=(0,$.jsxs)(`section`,{className:p,"aria-live":m,"aria-atomic":h,children:[o,x]}),t[40]=o,t[41]=x,t[42]=p,t[43]=m,t[44]=h,t[45]=S):S=t[45],S}function $r(e){return[e.agent.id,e]}function ei(e){return e.activeCue}var ti=null;function ni(){if(!(typeof window>`u`))try{ti??=new AudioContext,ti.state===`suspended`&&ti.resume()}catch{ti=null}}var ri={delegated:[520,680],review_passed:[720,960],review_failed:[260,190],completed:[660,880],failed:[220,150],aborted:[280,210],blocked:[240,180]};function ii(e){if(ni(),!ti||ti.state!==`running`)return;let[t,n]=ri[e.phase],r=ti.currentTime,i=ti.createGain();i.gain.setValueAtTime(1e-4,r),i.gain.exponentialRampToValueAtTime(.045,r+.018),i.gain.exponentialRampToValueAtTime(1e-4,r+.34),i.connect(ti.destination);for(let[e,a]of[[t,0],[n,.12]]){let t=ti.createOscillator();t.type=`sine`,t.frequency.setValueAtTime(e,r+a),t.connect(i),t.start(r+a),t.stop(r+a+.2)}}function ai(e){let t=(0,K.c)(89),{desks:n,coordinator:r,interactions:i,workEvents:a,isConnected:s,selectedDesk:c,coordinatorSelected:l,coordinatorName:u,jev:d}=e,f=J(fi),m=J(di),g=J(ui),_=J(li),S=J(ci),C=J(si),w=zr(n,i,r,a,d.decisions),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,t[0]=T):T=t[0];let E=(0,q.useRef)(T),O=(0,q.useRef)(!1),k,A;t[1]!==S||t[2]!==a?(k=()=>{if(!O.current){a.forEach(e=>E.current.add(e.eventId)),O.current=!0;return}for(let e of a)E.current.has(e.eventId)||(E.current.add(e.eventId),S&&ii(e))},A=[S,a],t[1]=S,t[2]=a,t[3]=k,t[4]=A):(k=t[3],A=t[4]),(0,q.useEffect)(k,A);let j;t[5]===n?j=t[6]:(j=n.filter(oi),t[5]=n,t[6]=j);let M=j.length,N;t[7]!==u||t[8]!==n||t[9]!==c?(N=c?.delegatedBy?n.find(e=>e.agent.id===c.delegatedBy)?.agent.name??u:u,t[7]=u,t[8]=n,t[9]=c,t[10]=N):N=t[10];let P=N,F,I;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`div`,{className:`office3d-logo`,children:(0,$.jsx)(D,{size:18})}),I=(0,$.jsx)(`h1`,{className:`office3d-title`,children:`HoloHive · Oficina 3D`}),t[11]=F,t[12]=I):(F=t[11],I=t[12]);let L;t[13]!==n.length||t[14]!==M?(L=(0,$.jsxs)(`div`,{className:`office3d-topbar-left`,children:[F,(0,$.jsxs)(`div`,{children:[I,(0,$.jsxs)(`p`,{className:`office3d-subtitle`,children:[n.length,` especialistas · `,M,` trabajando`]})]})]}),t[13]=n.length,t[14]=M,t[15]=L):L=t[15];let R=`office3d-live-badge ${s?`is-live`:`is-off`}`,z;t[16]===s?z=t[17]:(z=s?(0,$.jsx)(x,{size:12}):(0,$.jsx)(b,{size:12}),t[16]=s,t[17]=z);let B=s?`LIVE`:`OFFLINE`,V;t[18]!==z||t[19]!==B||t[20]!==R?(V=(0,$.jsxs)(`span`,{className:R,children:[z,B]}),t[18]=z,t[19]=B,t[20]=R,t[21]=V):V=t[21];let H;t[22]===d.status?H=t[23]:(H=d.status&&d.status.state!==`off`&&(0,$.jsxs)(`span`,{className:`office3d-jev-badge is-${d.status.state}`,title:`Jev ${Ae(d.status.state)}`,children:[(0,$.jsx)(p,{size:11}),`JEV`,d.status.totals&&d.status.totals.savedTokens>0&&(0,$.jsxs)(`b`,{children:[`−`,je(d.status.totals.savedTokens)]})]}),t[22]=d.status,t[23]=H);let ee;t[24]!==f||t[25]!==m?(ee=()=>m(f===`high`?`low`:`high`),t[24]=f,t[25]=m,t[26]=ee):ee=t[26];let te;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(h,{size:13}),t[27]=te):te=t[27];let U=f===`high`?`Alta`:`Eco`,ne;t[28]!==ee||t[29]!==U?(ne=(0,$.jsxs)(`button`,{type:`button`,className:`office3d-hud-btn`,onClick:ee,title:`Alternar calidad gráfica`,children:[te,U]}),t[28]=ee,t[29]=U,t[30]=ne):ne=t[30];let re=`office3d-hud-btn ${g===`calm`?`is-on`:``}`,ie;t[31]!==g||t[32]!==_?(ie=()=>_(g===`calm`?`off`:`calm`),t[31]=g,t[32]=_,t[33]=ie):ie=t[33];let W;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(o,{size:13}),t[34]=W):W=t[34];let ae=g===`calm`?`Enfoque`:`Fijo`,oe;t[35]!==re||t[36]!==ie||t[37]!==ae?(oe=(0,$.jsxs)(`button`,{type:`button`,className:re,onClick:ie,title:`Alternar enfoque y movimiento de eventos`,children:[W,ae]}),t[35]=re,t[36]=ie,t[37]=ae,t[38]=oe):oe=t[38];let se=`office3d-hud-btn ${S?`is-on`:``}`,ce;t[39]!==C||t[40]!==S?(ce=()=>{S||ni(),C(!S)},t[39]=C,t[40]=S,t[41]=ce):ce=t[41];let le=S?`Desactivar sonido de eventos`:`Activar sonido de eventos`,ue;t[42]===S?ue=t[43]:(ue=S?(0,$.jsx)(v,{size:13}):(0,$.jsx)(y,{size:13}),t[42]=S,t[43]=ue);let de=S?`Audio`:`Silencio`,fe;t[44]!==S||t[45]!==se||t[46]!==ce||t[47]!==le||t[48]!==ue||t[49]!==de?(fe=(0,$.jsxs)(`button`,{type:`button`,className:se,onClick:ce,title:le,"aria-pressed":S,children:[ue,de]}),t[44]=S,t[45]=se,t[46]=ce,t[47]=le,t[48]=ue,t[49]=de,t[50]=fe):fe=t[50];let pe;t[51]!==V||t[52]!==H||t[53]!==ne||t[54]!==oe||t[55]!==fe?(pe=(0,$.jsxs)(`div`,{className:`office3d-topbar-right`,children:[V,H,ne,oe,fe]}),t[51]=V,t[52]=H,t[53]=ne,t[54]=oe,t[55]=fe,t[56]=pe):pe=t[56];let me;t[57]!==pe||t[58]!==L?(me=(0,$.jsxs)(`header`,{className:`office3d-topbar office3d-glass`,children:[L,pe]}),t[57]=pe,t[58]=L,t[59]=me):me=t[59];let he;t[60]!==r||t[61]!==n?(he=(0,$.jsx)(Qr,{coordinator:r,desks:n}),t[60]=r,t[61]=n,t[62]=he):he=t[62];let G;t[63]!==r||t[64]!==n||t[65]!==d.decisions||t[66]!==d.status?(G=(0,$.jsx)(Br,{status:d.status,decisions:d.decisions,coordinator:r,desks:n}),t[63]=r,t[64]=n,t[65]=d.decisions,t[66]=d.status,t[67]=G):G=t[67];let ge;t[68]!==r||t[69]!==n||t[70]!==i||t[71]!==a?(ge=(0,$.jsx)(Zr,{coordinator:r,desks:n,interactions:i,workEvents:a}),t[68]=r,t[69]=n,t[70]=i,t[71]=a,t[72]=ge):ge=t[72];let _e;t[73]===w?_e=t[74]:(_e=(0,$.jsx)(`div`,{className:`office3d-bottom-left`,children:(0,$.jsx)(Fr,{events:w})}),t[73]=w,t[74]=_e);let ve;t[75]!==P||t[76]!==c?(ve=(0,$.jsx)(qr,{desk:c,delegatorName:P}),t[75]=P,t[76]=c,t[77]=ve):ve=t[77];let ye;t[78]!==r||t[79]!==l?(ye=l&&(0,$.jsx)(Jr,{coordinator:r}),t[78]=r,t[79]=l,t[80]=ye):ye=t[80];let be;return t[81]!==me||t[82]!==he||t[83]!==G||t[84]!==ge||t[85]!==_e||t[86]!==ve||t[87]!==ye?(be=(0,$.jsxs)(`div`,{className:`office3d-hud`,children:[me,he,G,ge,_e,ve,ye]}),t[81]=me,t[82]=he,t[83]=G,t[84]=ge,t[85]=_e,t[86]=ve,t[87]=ye,t[88]=be):be=t[88],be}function oi(e){return e.state===`thinking`||e.state===`tool_call`}function si(e){return e.setSoundEnabled}function ci(e){return e.soundEnabled}function li(e){return e.setMotion}function ui(e){return e.motion}function di(e){return e.setQuality}function fi(e){return e.quality}function pi(){let e=(0,K.c)(22),{coordinator:t,desks:n,interactions:r,workEvents:i,isConnected:a}=be(),o=J(mi),s=Pe(),c;e[0]!==n||e[1]!==o?(c=n.find(e=>e.agent.id===o)??null,e[0]=n,e[1]=o,e[2]=c):c=e[2];let l=c,u=!!t&&o===t.id,d=t?.name??`Coordinador`,f=t??null,p;e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==f||e[7]!==i?(p=(0,$.jsx)(Dr,{desks:n,coordinator:f,interactions:r,workEvents:i,jev:s}),e[3]=n,e[4]=r,e[5]=s,e[6]=f,e[7]=i,e[8]=p):p=e[8];let m=t??null,h;e[9]!==d||e[10]!==u||e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==s||e[15]!==l||e[16]!==m||e[17]!==i?(h=(0,$.jsx)(ai,{desks:n,coordinator:m,interactions:r,workEvents:i,isConnected:a,selectedDesk:l,coordinatorSelected:u,coordinatorName:d,jev:s}),e[9]=d,e[10]=u,e[11]=n,e[12]=r,e[13]=a,e[14]=s,e[15]=l,e[16]=m,e[17]=i,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=(0,$.jsxs)(`div`,{className:`office3d-root`,children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function mi(e){return e.selectedAgentId}export{pi as default};
|