@yuriai/web 0.2.40-beta.5 → 0.2.40-beta.6
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/dist/assets/{AgentAvatar-B7KbxN8Y.js → AgentAvatar-XDXiFZvA.js} +1 -1
- package/dist/assets/AssistantConversationSurface-B59k-lXE.css +1 -0
- package/dist/assets/AssistantConversationSurface-CQnJaKTn.js +3 -0
- package/dist/assets/AssistantSessionCard-DXY8-wyP.js +2 -0
- package/dist/assets/{AssistantUnreadBadge-vu4ZhTft.js → AssistantUnreadBadge-B-G015yE.js} +1 -1
- package/dist/assets/{AssistantView-CEfEWUIr.js → AssistantView-CasyQbii.js} +1 -1
- package/dist/assets/{DiagramView-Dlzr08J_.js → DiagramView-DhWnsM9v.js} +1 -1
- package/dist/assets/{FadeInOnReveal-DMRmNsau.js → FadeInOnReveal-Ca9EVP3a.js} +1 -1
- package/dist/assets/{GuiPluginPage-DVug4z_p.js → GuiPluginPage-DKOsUpVL.js} +1 -1
- package/dist/assets/{GuiPluginSurface-L43o6Xv8.js → GuiPluginSurface-BfXMBqdD.js} +1 -1
- package/dist/assets/{GuiPluginWindow-tHXkS18H.js → GuiPluginWindow-Dmg2Qui6.js} +1 -1
- package/dist/assets/{Icon-DizeYahT.js → Icon-ChyA050P.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-BZC5m_km.js → ImageLoadingPlaceholder-C8QUF5aV.js} +1 -1
- package/dist/assets/{LoadingImage-Csw4L-Dr.js → LoadingImage-BxRq1dMQ.js} +1 -1
- package/dist/assets/{MarkdownRenderer-D_0iKhQN.js → MarkdownRenderer-CvWLikEO.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-BZ0XgjS0.js → MarkdownRendererImpl-CcNsQOEn.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-DBd6Glg9.js → MarkstreamRendererImpl-D9W5XXPo.js} +1 -1
- package/dist/assets/MobileDetailNavigation-CnwIZn5g.js +1 -0
- package/dist/assets/{MobileResizableSheet-CQQ7O-2X.js → MobileResizableSheet-Bpp079l7.js} +1 -1
- package/dist/assets/{MobileShareBridge-IO45gM2G.js → MobileShareBridge-C-GpJfF6.js} +1 -1
- package/dist/assets/MobileSurface-CrNI8cYQ.js +2 -0
- package/dist/assets/{MultiRunWindow-fJ3XfntS.js → MultiRunWindow-DvywQkz9.js} +1 -1
- package/dist/assets/{OnboardingScreen-MJS5T5rL.js → OnboardingScreen-BvueSxVk.js} +1 -1
- package/dist/assets/{OverlayScrollbar-jtMYTn1y.js → OverlayScrollbar-CPaH_j8g.js} +1 -1
- package/dist/assets/RemoteAssistantSessionCard-CFWE00xD.js +1 -0
- package/dist/assets/{SettingsView-ZWFLpPSI.js → SettingsView-Df6GCFPI.js} +10 -10
- package/dist/assets/{SettingsWindow-DGRmrIWz.js → SettingsWindow-BpaRjeR-.js} +1 -1
- package/dist/assets/{SetupTourDialog-BYbAubwA.js → SetupTourDialog-DD_4qiTz.js} +1 -1
- package/dist/assets/{TerminalView-CoJ6_9P1.js → TerminalView-CRTtNAfA.js} +1 -1
- package/dist/assets/{ToolOutputDialog-5xBwOJ6a.js → ToolOutputDialog-omGmWntf.js} +1 -1
- package/dist/assets/{VoiceSettings-CN33koSc.js → VoiceSettings-Du-Yd5MF.js} +2 -2
- package/dist/assets/{YuriWordmark-DnFAS-Ko.js → YuriWordmark-B7lmpLRB.js} +1 -1
- package/dist/assets/{capgoAdapter-CCLtBZL1.js → capgoAdapter-CqMX4zC-.js} +1 -1
- package/dist/assets/{checkbox-rOV6DjeG.js → checkbox-KNAgqjPZ.js} +1 -1
- package/dist/assets/{client-uz8O6TPX.js → client-1Fk5IbQR.js} +3 -3
- package/dist/assets/{collapsible-CKswuqAw.js → collapsible-CdiLY07j.js} +1 -1
- package/dist/assets/{context-menu-B4njwT_M.js → context-menu-CO_VRWeV.js} +1 -1
- package/dist/assets/{diagram-BppQ_USn.js → diagram-9b-Aaful.js} +1 -1
- package/dist/assets/{dialog-Bg8MJnOV.js → dialog-8YYmYPFP.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-D-AdTJVr.js → fileMentionTouchSelection-CLQBqWR8.js} +1 -1
- package/dist/assets/{gitApi-DVx_V1x6.js → gitApi-uhoLUa-e.js} +1 -1
- package/dist/assets/gitApiHttp-B0FJaIhU.js +3 -0
- package/dist/assets/{gui-DN2sVP96.js → gui-BMN3-WPc.js} +1 -1
- package/dist/assets/{host-DrGjjO6K.js → host-D9EDWNmx.js} +1 -1
- package/dist/assets/{input-DRjuZMeA.js → input-DK8VTvJw.js} +1 -1
- package/dist/assets/{input-store-CjUOfpyA.js → input-store-CsY-uaSj.js} +1 -1
- package/dist/assets/insertionBoundaries-rYqUxuB-.js +1 -0
- package/dist/assets/{main-D2s9J_jN.js → main-BMx-2MjO.js} +14 -14
- package/dist/assets/main-DzqojuZ1.js +2 -0
- package/dist/assets/{markdownHeightCache-BL99DlhC.js → markdownHeightCache-DAvnT6xF.js} +1 -1
- package/dist/assets/{mcpQueries-HzYMEVWd.js → mcpQueries-CpH8vPf1.js} +1 -1
- package/dist/assets/miniChat-BTE_XpRk.js +2 -0
- package/dist/assets/mobile-BBZOulQ1.js +2 -0
- package/dist/assets/{mobileBackNavigation--ZdrI-Yj.js → mobileBackNavigation-Cq08UPxZ.js} +1 -1
- package/dist/assets/{mobileConnections-C3eGEOPy.js → mobileConnections-ZehAozpe.js} +2 -2
- package/dist/assets/{multirun-CDYNyLBH.js → multirun-Cll2Meol.js} +1 -1
- package/dist/assets/{native-DsqzO52u.js → native-CDqNKjmz.js} +1 -1
- package/dist/assets/{native-config-DOawZfln.js → native-config-DtUZFauV.js} +1 -1
- package/dist/assets/{navigation-Ibk_Pw-q.js → navigation-J3d8PQcs.js} +2 -2
- package/dist/assets/openRemoteProjectSession-oJZpCDPT.js +1 -0
- package/dist/assets/{projectMeta-D1Ytss9U.js → projectMeta-BBpfOmij.js} +1 -1
- package/dist/assets/prompt-attachment-upload-9fjmgafL.js +1 -0
- package/dist/assets/{pwa-CXupOTsD.js → pwa-C8B1Mf_t.js} +1 -1
- package/dist/assets/{queue-abort-optimistic-CQXpIlq6.js → queue-abort-optimistic-B1Uskf6F.js} +1 -1
- package/dist/assets/{react-CgRToPwO.js → react-45rBMaUm.js} +1 -1
- package/dist/assets/{readiness-BfuZm6Yw.js → readiness-CrjBrUa_.js} +2 -2
- package/dist/assets/reference-history-DqfMBWzF.js +1 -0
- package/dist/assets/{remote-input-store-BOdCWpQY.js → remote-input-store-84i8uDyM.js} +1 -1
- package/dist/assets/remoteProjectQueries-B6lrEDMq.js +1 -0
- package/dist/assets/remoteSessionReference-YiGvdabX.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-BuHQB0V8.js +2 -0
- package/dist/assets/renderMobileApp-D_VswCi0.js +29 -0
- package/dist/assets/{runtimeConfig-tHm7o_0I.js → runtimeConfig-CMbNyYbK.js} +1 -1
- package/dist/assets/runtimeEndpointReset-zo-HZQgX.js +151 -0
- package/dist/assets/scheduledTaskNavigation-y5g8D2ee.js +1 -0
- package/dist/assets/{select-B1On-Y4Z.js → select-VWoGVTBZ.js} +1 -1
- package/dist/assets/sessionLookup-JAf5UU7-.js +1 -0
- package/dist/assets/{sortable-tabs-strip-nD1Me06z.js → sortable-tabs-strip-Dbt3TTAs.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BYhNpzDJ.js → speechSettingsQueries-Bidfcv0W.js} +1 -1
- package/dist/assets/{terminalApi-madXrfqA.js → terminalApi-Cq0vjFe1.js} +1 -1
- package/dist/assets/{textarea-Qt06OhhX.js → textarea-vyMsAV5p.js} +1 -1
- package/dist/assets/{tooltip-D382RCy1.js → tooltip-DWqHWi4N.js} +1 -1
- package/dist/assets/{types-CHszLAS3.js → types-DeOkRCgE.js} +1 -1
- package/dist/assets/{useAppFontEffects-CqXrCJVt.js → useAppFontEffects-z382Lhm_.js} +60 -60
- package/dist/assets/useDesktopWindowControlsLayout-BEs7i5qj.js +1 -0
- package/dist/assets/{useDictation-Bs7TWO9r.js → useDictation-e68rFA6y.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-CCKRdyK9.js → useEffectiveDirectory-CcM3S1OQ.js} +1 -1
- package/dist/assets/{useFontPreferences-CPrl1_3z.js → useFontPreferences-CO-L-Gd7.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-BNtVrnSw.js → useMobileNavigationStore-BA0IaUi_.js} +9 -9
- package/dist/assets/{usePluginsStore-bMuGciUE.js → usePluginsStore-BG5MW5LR.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-BFCXBu2J.js → useProjectRuntimeAPIs-Be4gXG7P.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-C8xAqcgP.js → useStreamingTextThrottle-DylP9HFC.js} +1 -1
- package/dist/assets/{vendor-opencode-client-cQ47ywrT.js → vendor-opencode-client-BM2r1f0o.js} +3 -3
- package/dist/assets/{vendor-opencode-plugin-BmdTE4Te.js → vendor-opencode-plugin-ZhpPgHCL.js} +1 -1
- package/dist/assets/{vendor-solid-js-D98iXT7C.js → vendor-solid-js-BBVUd3Hw.js} +1 -1
- package/dist/index.html +10 -10
- package/dist/mini-chat.html +10 -10
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/index.js +1 -0
- package/server/lib/assistants/DOCUMENTATION.md +87 -0
- package/server/lib/assistants/assign.js +10 -7
- package/server/lib/assistants/builtin-skills.js +1 -0
- package/server/lib/assistants/builtin-skills.test.js +1 -1
- package/server/lib/assistants/cards.js +6 -1
- package/server/lib/assistants/contact-store.js +22 -5
- package/server/lib/assistants/contact-tools.js +46 -26
- package/server/lib/assistants/execution-target.js +136 -0
- package/server/lib/assistants/opencode-tools.js +22 -9
- package/server/lib/assistants/remote-execution.test.js +378 -0
- package/server/lib/assistants/remote-watch-reconciler.js +43 -0
- package/server/lib/assistants/remote-watch-reconciler.test.js +88 -0
- package/server/lib/assistants/routes.js +1 -0
- package/server/lib/assistants/service.js +302 -99
- package/server/lib/assistants/yuri-project.http.test.js +2 -2
- package/server/lib/gui-customization/DOCUMENTATION.md +8 -2
- package/server/lib/gui-customization/projects-client.mjs +10 -8
- package/server/lib/gui-customization/projects-remote.js +101 -0
- package/server/lib/gui-customization/projects-remote.test.js +125 -0
- package/server/lib/gui-customization/projects.js +30 -6
- package/server/lib/gui-customization/projects.test.js +66 -1
- package/server/lib/gui-customization/session-skill.js +2 -2
- package/server/lib/gui-customization/session-skill.test.js +4 -0
- package/server/lib/gui-customization/skill/SKILL.md +3 -1
- package/server/lib/gui-customization/skill/references/projects.md +30 -3
- package/server/lib/gui-customization/skill/references/remote-connections.md +2 -0
- package/server/lib/opencode/DOCUMENTATION.md +6 -0
- package/server/lib/opencode/feature-routes-runtime.js +2 -0
- package/server/lib/opencode/v2-client.js +9 -4
- package/server/lib/remote-hosts/DOCUMENTATION.md +52 -0
- package/server/lib/remote-hosts/gateway.js +136 -36
- package/server/lib/remote-hosts/json-lifecycle.test.js +35 -0
- package/server/lib/remote-hosts/routes.js +10 -13
- package/server/lib/remote-hosts/routes.test.js +251 -0
- package/server/lib/remote-hosts/store.js +17 -3
- package/server/lib/remote-hosts/store.test.js +19 -0
- package/server/lib/remote-hosts/task-client.js +25 -0
- package/server/lib/remote-hosts/task-client.test.js +60 -0
- package/server/lib/remote-hosts/transport.js +7 -2
- package/server/lib/request-cors.js +1 -1
- package/server/lib/request-cors.test.js +1 -0
- package/server/lib/scheduled-tasks/session-skill.test.js +33 -2
- package/dist/assets/AssistantConversationSurface-BnK_KTBO.js +0 -3
- package/dist/assets/AssistantConversationSurface-n9w_Av0k.css +0 -1
- package/dist/assets/MobileDetailNavigation-xgwvsQuR.js +0 -1
- package/dist/assets/MobileSurface-DmYgZONB.js +0 -2
- package/dist/assets/gitApiHttp-DvTBxvX8.js +0 -3
- package/dist/assets/insertionBoundaries-DZtQt2Ah.js +0 -1
- package/dist/assets/main-BMFY9mtb.js +0 -2
- package/dist/assets/miniChat-BbJ0GKpk.js +0 -2
- package/dist/assets/mobile-_zUth69Z.js +0 -2
- package/dist/assets/prompt-attachment-upload-BNhDXymd.js +0 -1
- package/dist/assets/remoteProjectQueries-CkxdZNw4.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-pJ59iC34.js +0 -2
- package/dist/assets/renderMobileApp-BQFC-gOA.js +0 -29
- package/dist/assets/runtimeEndpointReset-BhHWFNvo.js +0 -150
- package/dist/assets/scheduledTaskNavigation-BIDtQ4wN.js +0 -1
- package/dist/assets/sessionLookup-RcyTTDOy.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-KH4UP7Gj.js +0 -1
- /package/dist/assets/{sessionLookup-8C8nv-EP.css → reference-history-8C8nv-EP.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./useUIStore-Cfmg-aDQ.js";var n=`yuri:close-embedded-session-chat`,r=`yuri:embedded-visibility`,i=`yuri:embedded-visibility-request`,a=e=>new URLSearchParams(e).get(`yuriPanel`)===`session-chat`,o=(e,t,n)=>JSON.stringify({sessionID:e,directory:t||``,readOnly:n===!0}),s=(e,t,n,r)=>{if(typeof window>`u`)return``;let i=new URL(window.location.pathname,window.location.origin);return i.searchParams.set(`yuriPanel`,`session-chat`),i.searchParams.set(`surface`,`desktop`),i.searchParams.set(`sessionId`,e),n?i.searchParams.set(`readOnly`,`1`):i.searchParams.delete(`readOnly`),t&&t.trim().length>0?i.searchParams.set(`directory`,t):i.searchParams.delete(`directory`),i.searchParams.set(`themeMode`,r.mode),i.searchParams.set(`lightThemeId`,r.lightThemeId),i.searchParams.set(`darkThemeId`,r.darkThemeId),i.searchParams.set(`themeVariant`,r.currentTheme.metadata.variant===`dark`?`dark`:`light`),i.searchParams.set(`currentTheme`,JSON.stringify(r.currentTheme)),i.hash=``,i.toString()},c=(e,t,n,r,i,a)=>{let c=o(n,r,i),l=e.get(t);if(l?.signature===c)return l.src;let u=s(n,r,i,a);return e.set(t,{signature:c,src:u}),u},l=null,u=()=>{if(l!==null)return l;if(typeof window>`u`)return l=!1,!1;try{return l=new URLSearchParams(window.location.search).get(`yuriPanel`)===`session-chat`,l}catch{return l=!1,!1}},d=()=>{if(!u())return null;try{let e=new URLSearchParams(window.location.search).get(`sessionId`);return e&&e.trim().length>0?e.trim():null}catch{return null}},f=[`connection`,`personalization`,`workspace`,`opencode`,`content`,`system`],p=[`instances`,`appearance`,`chat`,`notifications`,`sessions`,`archived-sessions`,`summary-ai`,`shortcuts`,`projects`,`git`,`remote-instances`,`providers`,`agents`,`assistants`,`behavior`,`commands`,`mcp`,`plugins`,`global-config`,`magic-prompts`,`skills.installed`,`skills.catalog`,`usage`,`voice`,`about`],m=[`instances`,`appearance`,`chat`,`notifications`,`sessions`,`archived-sessions`,`summary-ai`,`projects`,`git`,`providers`,`agents`,`assistants`,`behavior`,`commands`,`mcp`,`plugins`,`magic-prompts`,`skills.installed`,`usage`,`voice`,`about`],h=[{slug:`home`,title:`Settings`,group:`personalization`,kind:`single`,description:`Search and jump to common pages.`,keywords:[`search`,`settings`]},{slug:`projects`,title:`Projects`,group:`workspace`,kind:`split`,keywords:[`project`,`projects`,`worktree`,`worktrees`,`repo`,`repository`,`directory`]},{slug:`instances`,title:`Switch instance`,group:`connection`,kind:`single`,keywords:[`instance`,`instances`,`server`,`connection`,`switch`],isAvailable:e=>e.isMobile},{slug:`remote-instances`,title:`Remote Instances`,group:`workspace`,kind:`single`,keywords:[`ssh`,`remote`,`instances`,`forwarding`,`connection`],isAvailable:e=>!e.isVSCode},{slug:`providers`,title:`Providers`,group:`opencode`,kind:`split`,keywords:[`provider`,`providers`,`models`,`model`,`api key`,`api keys`,`openai`,`anthropic`,`ollama`,`credentials`]},{slug:`usage`,title:`Usage`,group:`system`,kind:`split`,keywords:[`quota`,`billing`,`tokens`,`usage`,`limits`]},{slug:`agents`,title:`Agents`,group:`opencode`,kind:`split`,keywords:[`agent`,`agents`,`prompts`,`tools`,`permissions`]},{slug:`assistants`,title:`Bots`,group:`opencode`,kind:`split`,keywords:[`bot`,`bots`,`assistant`,`assistants`,`sharing`]},{slug:`behavior`,title:`Behavior`,group:`opencode`,kind:`single`,keywords:[`behavior`,`agents.md`,`system prompt`,`global rules`,`instructions`,`override`]},{slug:`commands`,title:`Commands`,group:`opencode`,kind:`split`,keywords:[`command`,`commands`,`slash`,`macros`,`automation`]},{slug:`mcp`,title:`MCP`,group:`opencode`,kind:`split`,keywords:[`mcp`,`model context protocol`,`servers`,`tools`,`remote`,`stdio`]},{slug:`plugins`,title:`Plugins`,group:`opencode`,kind:`split`,keywords:[`plugin`,`plugins`,`extensions`,`addons`,`npm`,`opencode-wakatime`]},{slug:`global-config`,title:`Global Configuration`,group:`opencode`,kind:`single`,keywords:[`global`,`configuration`,`opencode.json`,`opencode.jsonc`]},{slug:`skills.installed`,title:`Skills`,group:`content`,kind:`split`,keywords:[`skill`,`skills`,`instructions`,`install`,`catalog`]},{slug:`skills.catalog`,title:`Skills Catalog`,group:`content`,kind:`single`,keywords:[`install`,`catalog`,`external`,`repository`,`skills catalog`]},{slug:`git`,title:`Git`,group:`workspace`,kind:`single`,keywords:[`git`,`github`,`identity`,`identities`,`ssh`,`profiles`,`credentials`,`keys`,`commit`,`gitmoji`,`oauth`,`prs`,`issues`],isAvailable:e=>!e.isVSCode},{slug:`appearance`,title:`Appearance`,group:`personalization`,kind:`single`,keywords:[`theme`,`font`,`spacing`,`padding`,`corner radius`,`radius`,`input bar`,`keyboard`,`viewport`,`mobile`,`terminal`,`pwa`,`install name`,`app shortcuts`]},{slug:`chat`,title:`Chat`,group:`personalization`,kind:`single`,keywords:[`tools`,`diff`,`reasoning`,`dotfiles`,`draft`,`queue`,`output`,`copy`,`image`,`split messages`,`message actions`]},{slug:`shortcuts`,title:`Shortcuts`,group:`personalization`,kind:`single`,keywords:[`keyboard`,`hotkeys`,`shortcuts`,`bindings`],isAvailable:e=>!e.isVSCode},{slug:`sessions`,title:`Sessions`,group:`personalization`,kind:`single`,keywords:[`defaults`,`default agent`,`default model`,`retention`,`memory`,`limits`,`zen`]},{slug:`archived-sessions`,title:`Archived sessions`,group:`personalization`,kind:`single`,keywords:[`archive`,`archived`,`restore`,`preview`,`history`]},{slug:`summary-ai`,title:`Summary AI`,group:`personalization`,kind:`single`,keywords:[`summary`,`commit`,`session title`,`prompt`,`provider`,`custom api`,`base url`,`api token`]},{slug:`magic-prompts`,title:`Magic Prompts`,group:`content`,kind:`split`,keywords:[`prompts`,`templates`,`git`,`github`,`review`,`commit`,`pull request`],isAvailable:e=>!e.isVSCode},{slug:`notifications`,title:`Notifications`,group:`personalization`,kind:`single`,keywords:[`alerts`,`native`,`summary`,`summarization`]},{slug:`voice`,title:`Voice`,group:`system`,kind:`single`,keywords:[`tts`,`speech`,`voice`],isAvailable:e=>!e.isVSCode},{slug:`about`,title:`About`,group:`system`,kind:`single`,keywords:[`about`,`version`,`updates`,`release`,`changelog`],isAvailable:e=>e.isMobile||e.isDesktop}];function g(e){let t=new Map(p.map((e,t)=>[e,t])),n=new Map;for(let t of e){let e=n.get(t.group)??[];e.push(t),n.set(t.group,e)}return f.flatMap(e=>{let r=n.get(e);return r?.length?[{group:e,pages:r.sort((e,n)=>(t.get(e.slug)??999)-(t.get(n.slug)??999))}]:[]})}var _={sessions:`sessions`,agents:`agents`,commands:`commands`,mcp:`mcp`,skills:`skills.installed`,providers:`providers`,usage:`usage`,"git-identities":`git`,settings:`home`};function v(e){let t=e.trim().toLowerCase();return h.find(e=>e.slug===t)??null}function y(e){let t=(e??``).trim().toLowerCase();if(!t)return`home`;let n=_[t];if(n)return n;let r=v(t);return r?r.slug:`home`}var b=`schedule`,x=[`git`,`diff`,`terminal`,`files`,`diagram`],S=[`tasks`,`history`],C=`/session/new`,w=new Set(x),T=new Set(S),E=new Set([`staged`,`working`,`turn`]);function D(e){return!e||e===`chat`?`chat`:e===`scheduled`||e===`schedule`?b:e===`assistant`?`assistant`:w.has(e)?e:`chat`}function O(e){return y(e)}function k(e){return e&&T.has(e)?e:null}function A(e){return e&&E.has(e)?e:null}function j(e){let t=new URLSearchParams;return M(t,e?.location,e?.projectId),t.size?`${C}?${t}`:C}function M(e,t,n){if(t?.hostId){if(!t.hubId||!t.directory)throw Error(`Remote navigation requires a Hub and raw directory`);e.set(`hubId`,t.hubId),e.set(`hostId`,t.hostId),e.set(`directory`,t.directory),n&&e.set(`projectId`,n)}}function N(e,t){return`/plugins/${encodeURIComponent(e)}/${encodeURIComponent(t)}`}function P(e,t){let n=O(typeof e==`string`?e:e.slug),r=typeof e==`string`?t:e.entityId,i=`/settings/${n}`;return r&&r.trim().length>0?`${i}/${encodeURIComponent(r.trim())}`:i}function F(e,t){return t&&t.trim().length>0?`${e}/agent/${encodeURIComponent(t.trim())}`:e}function I(e={}){let t=k(e.scheduleView??e.scheduledView)??`tasks`,n=e.scheduleProjectId??e.scheduledProjectId??null,r=e.scheduleTaskId??e.scheduledTaskId??null,i;return i=n&&r?`/schedule/tasks/${encodeURIComponent(n)}/${encodeURIComponent(r)}`:t===`history`?`/schedule/history`:`/schedule`,F(i,e.focusSessionId)}function L(e={}){let t=`/assistant`;return e.assistantId&&e.assistantId.trim().length>0&&(t=`/assistant/${encodeURIComponent(e.assistantId.trim())}`),F(t,e.focusSessionId)}function R(e){let t=encodeURIComponent(e.sessionId),n=D(e.tab);if(n===`schedule`)return I({});if(n===`assistant`)return L({});let r;r=n===`chat`?`/session/${t}`:`/session/${t}/${n}`;let i=new URLSearchParams;M(i,e.location,e.projectId),e.file&&i.set(`file`,e.file);let a=A(e.scope);a&&i.set(`scope`,a);let o=i.toString();return o?`${r}?${o}`:r}function z(e){let t=D(e.tab);return t===`schedule`?I({scheduleView:e.scheduleView??e.scheduledView,scheduleProjectId:e.scheduleProjectId??e.scheduledProjectId,scheduleTaskId:e.scheduleTaskId??e.scheduledTaskId,focusSessionId:e.focusSessionId}):t===`assistant`?L({assistantId:e.assistantId,focusSessionId:e.focusSessionId}):e.sessionId&&e.sessionId.trim().length>0?R({sessionId:e.sessionId.trim(),tab:t,file:e.file,scope:e.scope,location:e.location,projectId:e.projectId}):`/`}function B(e){let t=new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),n=t.get(`file`),r=A(t.get(`scope`)),i=t.get(`hostId`);if(i!==null){let e=t.get(`hubId`),a=t.get(`directory`);if(!i||!e||!a)return{file:n,scope:r,invalidRemote:!0};let o=t.get(`projectId`);return{file:n,scope:r,location:{hubId:e,hostId:i,directory:a},...o?{projectId:o}:{}}}return{file:n,scope:r}}function V(e){let t=e.indexOf(`agent`);return t>=0&&e[t+1]?{rest:e.slice(0,t),focusSessionId:decodeURIComponent(e[t+1])}:{rest:e,focusSessionId:null}}function H(e,t){let n=e[1];return n?n===`history`?{kind:`schedule`,scheduleView:`history`,scheduleProjectId:null,scheduleTaskId:null,focusSessionId:t}:n===`tasks`&&e[2]&&e[3]?{kind:`schedule`,scheduleView:`tasks`,scheduleProjectId:decodeURIComponent(e[2]),scheduleTaskId:decodeURIComponent(e[3]),focusSessionId:t}:{kind:`schedule`,scheduleView:`tasks`,scheduleProjectId:null,scheduleTaskId:null,focusSessionId:t}:{kind:`schedule`,scheduleView:`tasks`,scheduleProjectId:null,scheduleTaskId:null,focusSessionId:t}}function U(e){let t=e,n=``,r=e.indexOf(`?`);r>=0&&(t=e.slice(0,r),n=e.slice(r));let i=t.indexOf(`#`);if(i>=0&&(t=t.slice(0,i)),t===`/session/new`||t===`/new`||t===`/session/new/`){let{location:e,projectId:t,invalidRemote:r}=B(n);return r?{kind:`unknown`}:{kind:`new`,...e?{location:e,...t?{projectId:t}:{}}:{}}}if(t===`/connect`)return{kind:`connect`};let a=t.match(/^\/plugins\/([^/]+)\/([^/]+)\/?$/);if(a)try{return{kind:`plugin`,pluginId:decodeURIComponent(a[1]),pageId:decodeURIComponent(a[2])}}catch{return{kind:`unknown`}}let o=t.match(/^\/settings(?:\/([^/]+)(?:\/([^/]+))?)?$/);if(o)return{kind:`settings`,slug:O(o[1]??`home`),entityId:o[2]?decodeURIComponent(o[2]):null};let s=t.split(`/`).filter(Boolean);if(s.length===0)return{kind:`unknown`};let{rest:c,focusSessionId:l}=V(s),u=c[0];if(u===`schedule`||u===`scheduled`)return H(c,l);if(u===`assistant`)return{kind:`assistant`,assistantId:c[1]?decodeURIComponent(c[1]):null,focusSessionId:l};if(u===`session`){let e=c[1]?decodeURIComponent(c[1]):``;if(!e)return{kind:`unknown`};if(e===`new`)return{kind:`new`};let{file:t,scope:r,location:i,projectId:a,invalidRemote:o}=B(n);if(o)return{kind:`unknown`};let s=i?{location:i,...a?{projectId:a}:{}}:{},u=c[2];if(u===`schedule`||u===`scheduled`)return H(c.slice(2),l);if(u===`assistant`)return{kind:`assistant`,assistantId:c[3]?decodeURIComponent(c[3]):null,focusSessionId:l};if(!u)return{kind:`session`,sessionId:e,tab:`chat`,file:t,scope:r,...s};let d=D(u);return d===`chat`&&u!==`chat`?{kind:`session`,sessionId:e,tab:`chat`,file:t,scope:r,...s}:{kind:`session`,sessionId:e,tab:d,file:t,scope:r,...s}}return{kind:`unknown`}}function W(e){return typeof window>`u`?K():G(e===void 0?`${window.location.pathname}${window.location.search}`:`${window.location.pathname}?${e.toString()}`)}function G(e){let t=U(e),n=new URL(e,`https://router.invalid`).searchParams,r=n.has(`hostId`)?{hostId:n.get(`hostId`),hubId:n.get(`hubId`),directory:n.get(`directory`),projectId:n.get(`projectId`)}:{};switch(t.kind){case`plugin`:return{...K(),tab:`plugin`,guiPageKey:JSON.stringify([t.pluginId,t.pageId])};case`new`:return{...K(),...r,isNewSession:!0,tab:`chat`};case`session`:{let e=t.tab;return{sessionId:t.sessionId,...r,isNewSession:!1,tab:e===`chat`?null:e,settingsPath:null,settingsEntityId:null,diffFile:t.file,diffScope:t.scope,scheduleView:null,scheduleProjectId:null,scheduleTaskId:null,assistantId:null,focusSessionId:null}}case`schedule`:return{sessionId:null,isNewSession:!1,tab:b,settingsPath:null,settingsEntityId:null,diffFile:null,diffScope:null,scheduleView:t.scheduleView,scheduleProjectId:t.scheduleProjectId,scheduleTaskId:t.scheduleTaskId,assistantId:null,focusSessionId:t.focusSessionId};case`assistant`:return{sessionId:null,isNewSession:!1,tab:`assistant`,settingsPath:null,settingsEntityId:null,diffFile:null,diffScope:null,scheduleView:null,scheduleProjectId:null,scheduleTaskId:null,assistantId:t.assistantId,focusSessionId:t.focusSessionId};case`settings`:return{sessionId:null,isNewSession:!1,tab:null,settingsPath:t.slug,settingsEntityId:t.entityId,diffFile:null,diffScope:null,scheduleView:null,scheduleProjectId:null,scheduleTaskId:null,assistantId:null,focusSessionId:null};default:return K()}}function K(){return{sessionId:null,isNewSession:!1,tab:null,settingsPath:null,settingsEntityId:null,diffFile:null,diffScope:null,scheduleView:null,scheduleProjectId:null,scheduleTaskId:null,assistantId:null,focusSessionId:null}}function q(){if(typeof window>`u`)return!1;try{let e=U(`${window.location.pathname}${window.location.search}`);return e.kind===`session`||e.kind===`new`||e.kind===`schedule`||e.kind===`assistant`||e.kind===`plugin`||e.kind===`settings`||e.kind===`connect`}catch{return!1}}function J(e){if(e.isSettingsOpen)return P({slug:e.settingsPath.trim().length>0?e.settingsPath:`home`,entityId:e.settingsEntityId??null});if(e.tab===`schedule`)return z({tab:b,scheduleView:e.scheduleView,scheduleProjectId:e.scheduleProjectId,scheduleTaskId:e.scheduleTaskId,focusSessionId:e.focusSessionId});if(e.tab===`plugin`){try{let t=JSON.parse(e.guiPageKey??`null`);if(Array.isArray(t)&&t.length===2&&t.every(e=>typeof e==`string`&&e))return N(t[0],t[1])}catch{}return`/`}if(e.tab===`assistant`)return z({tab:`assistant`,assistantId:e.assistantId,focusSessionId:e.focusSessionId});let t=t=>{if(!e.hostId)return t;if(!e.hubId||!e.directory)throw Error(`Remote route requires Hub and raw directory`);let n=new URL(t,`https://router.invalid`);return n.searchParams.set(`hostId`,e.hostId),n.searchParams.set(`hubId`,e.hubId),n.searchParams.set(`directory`,e.directory),e.projectId&&n.searchParams.set(`projectId`,e.projectId),`${n.pathname}${n.search}`};if((e.isNewSession||!e.sessionId&&e.tab===`chat`)&&e.isNewSession)return t(j());if(e.sessionId&&e.sessionId.trim().length>0&&e.sessionId!==`new`){let n=new Set([`diff`,`files`,`diagram`]).has(e.tab)&&e.diffFile?e.diffFile:null;return t(z({sessionId:e.sessionId.trim(),tab:e.tab,file:n,scope:e.tab===`diff`?e.diffScope??null:null}))}return e.isNewSession?t(j()):`/`}function Y(e){if(typeof window>`u`)return!0;try{let t=`${window.location.pathname}${window.location.search}`,n=J(e);return JSON.stringify(G(t))===JSON.stringify(G(n))}catch{return!0}}function X(e,t={}){if(!(typeof window>`u`)&&!(Z()||u())&&!(!t.force&&Y(e)))try{let n=J(e);t.replace?window.history.replaceState({...window.history.state,route:e},``,n):window.history.pushState({route:e},``,n)}catch{}}function Z(){return typeof window>`u`?!1:window.__VSCODE_CONFIG__!==void 0}var Q=e({openScheduledTask:()=>$});function $(e,n){let r=t.getState();r.setActiveMainTab(`schedule`)&&(r.setSettingsDialogOpen(!1),X({sessionId:null,tab:`schedule`,isSettingsOpen:!1,settingsPath:r.settingsPage,diffFile:null,scheduleView:`tasks`,scheduleProjectId:e,scheduleTaskId:n}),r.setScheduledTaskOpenRequest({projectId:e,taskId:n}),r.isMobile&&r.setScheduledTasksDialogOpen(!0))}export{a as _,W as a,v as c,n as d,r as f,u as g,c as h,q as i,g as l,d as m,Q as n,m as o,i as p,X as r,h as s,$ as t,y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{R as t,n,t as r}from"./platform-wF65ZFgV.js";import{it as i,ot as a,st as o}from"./vendor-base-ui-z2M4boRm.js";import{n as s}from"./client-uz8O6TPX.js";import{c,h as l,l as u,m as d,v as f}from"./prompt-attachment-upload-BNhDXymd.js";import{n as p}from"./vendor-react-P8wFrkcT.js";import{m,r as h}from"./vendor-reactuses-core-Dyjw5sZR.js";import{a as g,n as _}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as v}from"./i18n-RH7UieOS.js";import{In as y,Rn as b,Si as x,Wi as S,Xi as C,hi as w,vi as T,wi as ee}from"./useMobileNavigationStore-BNtVrnSw.js";import{o as E,t as D}from"./vendor-framer-motion-CF9BQLta.js";import{n as O}from"./Icon-DizeYahT.js";import{r as te}from"./themes-BgDJcxRc.js";import{t as k}from"./MobileResizableSheet-CQQ7O-2X.js";import{n as A,t as ne}from"./useDictation-Bs7TWO9r.js";import{t as re}from"./LoadingImage-Csw4L-Dr.js";import{t as j}from"./textarea-Qt06OhhX.js";var M=e(o(),1),N=p(),P=a(),ie=e(i(),1),ae=g(`YuriMedia`);function oe(e){return e.platform===`android`||/Android/i.test(e.userAgent)||e.userAgentDataPlatform===`Android`}function se(){if(typeof window>`u`)return!1;let e=navigator.userAgentData;return oe({platform:r(),userAgent:navigator.userAgent||``,userAgentDataPlatform:e?.platform})}function F(){return n()&&_.getPlatform()===`android`&&_.isPluginAvailable(`YuriMedia`)}async function ce(e){if(!F())return null;let t=await ae.pickMedia({limit:e});if(t.cancelled)return[];let n=[];for(let e of t.files){let t=await fetch(_.convertFileSrc(e.path));if(!t.ok)throw Error(`Native media fetch failed (${t.status})`);let r=await t.blob();n.push(new File([r],e.name,{type:e.mimeType}))}return n}var I=`h-auto min-h-12 w-full justify-start gap-3 rounded-none supports-[corner-shape:squircle]:rounded-none px-4 border-b border-[var(--surface-subtle)] last:border-b-0`,L=e=>{let t=(0,N.c)(38),{id:n,open:r,onOpenChange:i,onPickPhotos:a,onPickFiles:o}=e,{t:s}=v(),c;t[0]===s?c=t[1]:(c=s(`chat.chatInput.actions.addAttachment`),t[0]=s,t[1]=c);let l;t[2]===c?l=t[3]:(l=(0,P.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold`,children:c}),t[2]=c,t[3]=l);let u;t[4]===s?u=t[5]:(u=s(`chat.chatInput.actions.addAttachment`),t[4]=s,t[5]=u);let d;t[6]===s?d=t[7]:(d=s(`mobile.surface.closeAria`),t[6]=s,t[7]=d);let f;t[8]===s?f=t[9]:(f=s(`mobile.sessions.sheet.resizeAria`),t[8]=s,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(O,{name:`file-image`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===s?m=t[12]:(m=s(`chat.chatInput.actions.attachPhotos`),t[11]=s,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,P.jsx)(`span`,{className:`truncate`,children:m}),t[13]=m,t[14]=h);let g;t[15]!==a||t[16]!==h?(g=(0,P.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:I,"data-mobile-press-feedback":`none`,onClick:a,children:[p,h]}),t[15]=a,t[16]=h,t[17]=g):g=t[17];let _;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,P.jsx)(O,{name:`attachment-2`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[18]=_):_=t[18];let b;t[19]===s?b=t[20]:(b=s(`chat.chatInput.actions.attachFiles`),t[19]=s,t[20]=b);let x;t[21]===b?x=t[22]:(x=(0,P.jsx)(`span`,{className:`truncate`,children:b}),t[21]=b,t[22]=x);let S;t[23]!==o||t[24]!==x?(S=(0,P.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:I,"data-mobile-press-feedback":`none`,onClick:o,children:[_,x]}),t[23]=o,t[24]=x,t[25]=S):S=t[25];let C;t[26]!==S||t[27]!==g?(C=(0,P.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto overscroll-contain px-3 pb-3`,children:(0,P.jsxs)(`div`,{className:`overflow-hidden rounded-2xl bg-[var(--surface-muted)]`,"data-page-scroll-lock":`true`,children:[g,S]})}),t[26]=S,t[27]=g,t[28]=C):C=t[28];let w;return t[29]!==n||t[30]!==i||t[31]!==r||t[32]!==C||t[33]!==l||t[34]!==u||t[35]!==d||t[36]!==f?(w=(0,P.jsx)(k,{id:n,open:r,onOpenChange:i,title:l,ariaLabel:u,closeAriaLabel:d,resizeAriaLabel:f,fitContent:!0,children:C}),t[29]=n,t[30]=i,t[31]=r,t[32]=C,t[33]=l,t[34]=u,t[35]=d,t[36]=f,t[37]=w):w=t[37],w},R={glyph:`_glyph_1xs2e_1`,lens:`_lens_1xs2e_12`,shape:`_shape_1xs2e_21`,revolve:`_revolve_1xs2e_1`};function le(e){let t=(0,N.c)(18),{decorative:n,size:r}=e,i=n!==void 0&&n,a=r===void 0?20:r,{t:o}=v(),s;t[0]===a?s=t[1]:(s={width:a,height:a},t[0]=a,t[1]=s);let c=i||void 0,l=i?void 0:`img`,u;t[2]!==i||t[3]!==o?(u=i?void 0:o(`common.loading`),t[2]=i,t[3]=o,t[4]=u):u=t[4];let d=`scale(${a/28})`,f;t[5]===d?f=t[6]:(f={transform:d},t[5]=d,t[6]=f);let p,m,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,P.jsx)(`span`,{className:R.shape}),p=(0,P.jsx)(`span`,{className:R.shape}),m=(0,P.jsx)(`span`,{className:R.shape}),t[7]=p,t[8]=m,t[9]=h):(p=t[7],m=t[8],h=t[9]);let g;t[10]===f?g=t[11]:(g=(0,P.jsxs)(`span`,{className:R.lens,style:f,children:[h,p,m]}),t[10]=f,t[11]=g);let _;return t[12]!==g||t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==u?(_=(0,P.jsx)(`span`,{"data-dictation-loading":!0,className:R.glyph,style:s,"aria-hidden":c,role:l,"aria-label":u,children:g}),t[12]=g,t[13]=s,t[14]=c,t[15]=l,t[16]=u,t[17]=_):_=t[17],_}var z=te(!1).colors,ue=`M-50 74.564 A600 600 0 0 1 147.707 22.283 A38 38 0 0 1 154.330 97.994 A524 524 0 0 0 -18.333 143.653 Z`,de=`M450 74.564 A600 600 0 0 0 252.293 22.283 A38 38 0 0 0 245.670 97.994 A524 524 0 0 1 418.333 143.653 Z`,B={colorScheme:`light`,"--surface-background":z.surface.background,"--surface-foreground":z.surface.foreground,"--primary-base":z.primary.base,"--foreground":z.surface.background,"--interactive-hover":`color-mix(in srgb, var(--surface-background) 12%, transparent)`,"--interactive-active":`color-mix(in srgb, var(--surface-background) 20%, transparent)`,"--ring":z.interactive.focusRing,"--status-error":z.status.error};function fe(e){let t=(0,N.c)(85),{containerRef:n,disabled:r,onInsert:i,onSend:a,onRelease:o,onError:s,onHintChange:c}=e,{t:l}=v(),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(!1),[m,g]=(0,M.useState)(`send`),_=(0,M.useRef)(null),y=(0,M.useRef)(null),b=(0,M.useRef)(`insert`),x=(0,M.useRef)(null),S=(0,M.useId)(),C=(0,M.useId)(),w=(0,M.useId)(),T;t[0]!==i||t[1]!==a?(T=e=>b.current===`send`?a(e):i(e),t[0]=i,t[1]=a,t[2]=T):T=t[2];let E;t[3]!==s||t[4]!==T?(E={onTranscript:T,onError:s},t[3]=s,t[4]=T,t[5]=E):E=t[5];let D=ne(E),{status:O,isStarting:te,partialTranscript:k,error:A,volume:re}=D,j=h(c),ae=u?m===`cancel`?`cancelling`:m===`edit`?`editing`:`recording`:f?`processing`:null,oe,se;t[6]!==ae||t[7]!==j?(oe=()=>{j(ae)},se=[ae,j],t[6]=ae,t[7]=j,t[8]=oe,t[9]=se):(oe=t[8],se=t[9]),(0,M.useEffect)(oe,se);let F,ce;t[10]===j?(F=t[11],ce=t[12]):(F=()=>()=>j(null),ce=[j],t[10]=j,t[11]=F,t[12]=ce),(0,M.useEffect)(F,ce);let I;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{y.current&&clearTimeout(y.current),y.current=null},t[13]=I):I=t[13];let L=h(I),R;t[14]!==n||t[15]!==r?(R=e=>{if(r||!(e instanceof HTMLElement))return null;let t=n.current?.querySelector(`textarea`);return!t||t.value!==``||t.disabled||t.readOnly||t.ownerDocument.activeElement===t||e!==t&&!e.closest(`[data-yuri-composer-compact-surface]`)||e.closest(`button, [data-composer-action]`)?null:t},t[14]=n,t[15]=r,t[16]=R):R=t[16];let z=h(R),fe;t[17]!==L||t[18]!==D||t[19]!==A||t[20]!==f||t[21]!==O?(fe=()=>{f||(L(),_.current=null,d(!1),g(`send`),O===`failed`||O===`idle`&&A?D.discardFailedDictation():D.cancelDictation())},t[17]=L,t[18]=D,t[19]=A,t[20]=f,t[21]=O,t[22]=fe):fe=t[22];let V=h(fe),H;t[23]!==D||t[24]!==r||t[25]!==z||t[26]!==f||t[27]!==O?(H=e=>{let t=e.target;r||f||O!==`idle`||_.current||!e.isPrimary||e.button!==0||!(t instanceof HTMLElement)||z(t)&&(e.preventDefault(),e.stopPropagation(),_.current={pointer:e.pointerId,x:e.clientX,y:e.clientY,intent:`send`,started:!1},y.current=setTimeout(()=>{if(y.current=null,!_.current)return;let e=z(t);if(!e){_.current=null;return}e.blur(),_.current.started=!0,b.current=`insert`,d(!0),g(`send`),D.startDictation()},300))},t[23]=D,t[24]=r,t[25]=z,t[26]=f,t[27]=O,t[28]=H):H=t[28];let U=h(H),me;t[29]===L?me=t[30]:(me=e=>{let t=_.current;if(!t||t.pointer!==e.pointerId)return;e.preventDefault(),e.stopPropagation();let n=e.clientX-t.x,r=x.current?.getBoundingClientRect(),i=r&&r.width>0&&e.clientY>=r.top&&e.clientY<=r.bottom?e.clientX<r.left+r.width/2?`cancel`:`edit`:n<=-64?`cancel`:n>=64?`edit`:`send`;if(!t.started&&Math.hypot(n,t.y-e.clientY)>12){L(),_.current=null;return}t.started&&i!==t.intent&&(t.intent=i,g(i),ee(i===`send`?`light`:`medium`,{bypassCadence:!0}))},t[29]=L,t[30]=me);let W=h(me),he;t[31]!==V||t[32]!==L||t[33]!==n||t[34]!==D||t[35]!==A||t[36]!==o||t[37]!==k||t[38]!==O?(he=e=>{let t=_.current;if(!(!t||t.pointer!==e.pointerId)){if(e.preventDefault(),e.stopPropagation(),L(),A||O===`failed`){V();return}_.current=null,d(!1),t.started?t.intent===`cancel`?D.cancelDictation():(b.current=t.intent===`edit`?`insert`:`send`,o(k),p(!0),Promise.resolve(D.confirmDictation()).finally(()=>{p(!1),D.discardFailedDictation(),t.intent===`edit`&&n.current?.querySelector(`textarea`)?.focus()})):n.current?.querySelector(`textarea`)?.focus()}},t[31]=V,t[32]=L,t[33]=n,t[34]=D,t[35]=A,t[36]=o,t[37]=k,t[38]=O,t[39]=he):he=t[39];let G=h(he),ge;t[40]===V?ge=t[41]:(ge=e=>{_.current?.pointer===e.pointerId&&V()},t[40]=V,t[41]=ge);let K=h(ge),_e;t[42]===z?_e=t[43]:(_e=e=>{z(e.target)&&e.preventDefault()},t[42]=z,t[43]=_e);let q=h(_e),ve,J;t[44]!==V||t[45]!==L||t[46]!==n||t[47]!==U||t[48]!==K||t[49]!==W||t[50]!==q||t[51]!==G?(ve=()=>{let e=n.current;if(!e)return;let t=()=>{document.visibilityState===`hidden`&&V()};return e.addEventListener(`pointerdown`,U,!0),e.addEventListener(`touchstart`,q,{capture:!0,passive:!1}),window.addEventListener(`pointermove`,W,{capture:!0,passive:!1}),window.addEventListener(`pointerup`,G,!0),window.addEventListener(`pointercancel`,K,!0),e.addEventListener(`contextmenu`,q,!0),e.addEventListener(`selectstart`,q,!0),window.addEventListener(`blur`,V),document.addEventListener(`visibilitychange`,t),()=>{L(),e.removeEventListener(`pointerdown`,U,!0),e.removeEventListener(`touchstart`,q,!0),window.removeEventListener(`pointermove`,W,!0),window.removeEventListener(`pointerup`,G,!0),window.removeEventListener(`pointercancel`,K,!0),e.removeEventListener(`contextmenu`,q,!0),e.removeEventListener(`selectstart`,q,!0),window.removeEventListener(`blur`,V),document.removeEventListener(`visibilitychange`,t)}},J=[n,U,W,G,K,V,L,q],t[44]=V,t[45]=L,t[46]=n,t[47]=U,t[48]=K,t[49]=W,t[50]=q,t[51]=G,t[52]=ve,t[53]=J):(ve=t[52],J=t[53]),(0,M.useEffect)(ve,J);let Y,ye;if(t[54]!==V||t[55]!==r?(Y=()=>{r&&V()},ye=[r,V],t[54]=V,t[55]=r,t[56]=Y,t[57]=ye):(Y=t[56],ye=t[57]),(0,M.useEffect)(Y,ye),!u&&!f)return null;let be=Math.min(1,Math.max(0,re))**.6,xe=!!A,Se=A?V:void 0,X;t[58]===be?X=t[59]:(X={...B,"--speech-energy":be},t[58]=be,t[59]=X);let Ce=X,we;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,P.jsx)(`div`,{className:`yuri-speech-light-field`,"aria-hidden":`true`,children:[`ice`,`lilac`,`mint`,`blush`,`mid`,`core`].map(pe)}),t[60]=we):we=t[60];let Te=te||f,Z;t[61]!==A||t[62]!==te||t[63]!==k||t[64]!==f||t[65]!==O||t[66]!==l?(Z=A&&!f?(0,P.jsx)(`p`,{role:`alert`,className:`yuri-speech-caption yuri-speech-error`,children:A}):(0,P.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`yuri-speech-caption`,children:te||f?(0,P.jsx)(le,{size:72}):k?(0,P.jsx)(`span`,{className:`yuri-speech-interim`,children:k}):l(O===`uploading`?`chat.dictation.processing`:`chat.dictation.listening`)}),t[61]=A,t[62]=te,t[63]=k,t[64]=f,t[65]=O,t[66]=l,t[67]=Z):Z=t[67];let Q;t[68]!==Te||t[69]!==Z?(Q=(0,P.jsx)(`div`,{className:`yuri-speech-content`,"data-starting":Te,children:Z}),t[68]=Te,t[69]=Z,t[70]=Q):Q=t[70];let $;t[71]!==S||t[72]!==C||t[73]!==w||t[74]!==u||t[75]!==m||t[76]!==l?($=u&&(0,P.jsx)(`div`,{className:`yuri-speech-gesture-stage`,"aria-hidden":`true`,children:(0,P.jsxs)(`div`,{className:`yuri-speech-gesture-surfaces`,children:[(0,P.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${C})`}}),(0,P.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${w})`}}),(0,P.jsxs)(`svg`,{className:`yuri-speech-geometry`,viewBox:`0 0 400 226`,focusable:`false`,children:[(0,P.jsxs)(`defs`,{children:[(0,P.jsx)(`clipPath`,{id:C,clipPathUnits:`objectBoundingBox`,children:(0,P.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:ue})}),(0,P.jsx)(`clipPath`,{id:w,clipPathUnits:`objectBoundingBox`,children:(0,P.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:de})}),(0,P.jsxs)(`linearGradient`,{id:S,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,P.jsx)(`stop`,{offset:`0%`,className:`yuri-speech-arc-top`}),(0,P.jsx)(`stop`,{offset:`100%`,className:`yuri-speech-arc-bottom`})]})]}),(0,P.jsxs)(`g`,{className:`yuri-speech-targets`,ref:x,children:[(0,P.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--cancel`,"data-active":m===`cancel`,children:[(0,P.jsx)(`path`,{d:ue}),(0,P.jsx)(`text`,{x:`95`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(-11 95 68)`,children:l(`chat.dictation.cancelGesture`)})]}),(0,P.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--edit`,"data-active":m===`edit`,children:[(0,P.jsx)(`path`,{d:de}),(0,P.jsx)(`text`,{x:`305`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(11 305 68)`,children:l(`chat.dictation.edit`)})]})]}),(0,P.jsx)(`path`,{className:`yuri-speech-hold-arc`,fill:`url(#${S})`,d:`M-50 186.987 A500 500 0 0 1 450 186.987 L450 300 H-50 Z`})]})]})}),t[71]=S,t[72]=C,t[73]=w,t[74]=u,t[75]=m,t[76]=l,t[77]=$):$=t[77];let Ee;return t[78]!==m||t[79]!==xe||t[80]!==Se||t[81]!==Ce||t[82]!==Q||t[83]!==$?(Ee=(0,ie.createPortal)((0,P.jsxs)(`div`,{className:`yuri-speech-overlay`,"data-intent":m,"data-error":xe,onClick:Se,style:Ce,children:[we,Q,$]}),document.body),t[78]=m,t[79]=xe,t[80]=Se,t[81]=Ce,t[82]=Q,t[83]=$,t[84]=Ee):Ee=t[84],Ee}function pe(e){return(0,P.jsx)(`div`,{className:`yuri-speech-reactor yuri-speech-reactor--${e}`,children:(0,P.jsx)(`div`,{className:`yuri-speech-light`})},e)}function V(e){let n=(0,N.c)(7),{available:r}=e,i=C(H),[a,o]=(0,M.useState)(null),s;n[0]!==r||n[1]!==i?(s=r&&i&&!t()&&A(),n[0]=r,n[1]=i,n[2]=s):s=n[2];let c=s,l=c?a:null,u;return n[3]!==c||n[4]!==i||n[5]!==l?(u={globallyEnabled:i,enabled:c,hint:l,onHintChange:o},n[3]=c,n[4]=i,n[5]=l,n[6]=u):u=n[6],u}function H(e){return e.dictationEnabled}var U=M.createContext(null),me=e=>{let t=(0,N.c)(3),{actions:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,P.jsx)(U.Provider,{value:n,children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},W=()=>M.useContext(U),he=e=>e.nativeEvent.isComposing||e.nativeEvent.keyCode===229;function G(e){let t=(0,N.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=b(`inline-flex shrink-0 items-center justify-center rounded-full bg-foreground text-background`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,P.jsx)(`span`,{className:a,...i,"aria-hidden":!0,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function ge(e){let t=(0,N.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(`span`,{"data-stop-glyph":`true`,className:`block size-[38%] rounded-[20%] bg-current`}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,P.jsx)(G,{className:n,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function K(e){let t=(0,N.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,spinning:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i,o=a?`loader-4`:`arrow-up`,s=a?`size-[50%] animate-spin`:`size-[56%]`,c;t[4]===s?c=t[5]:(c=b(s),t[4]=s,t[5]=c);let l;t[6]!==o||t[7]!==c?(l=(0,P.jsx)(O,{name:o,weight:`medium`,className:c}),t[6]=o,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==l?(u=(0,P.jsx)(G,{className:n,...r,children:l}),t[9]=n,t[10]=r,t[11]=l,t[12]=u):u=t[12],u}var _e=`border border-[color-mix(in_srgb,var(--interactive-border)_50%,transparent)] dark:border-transparent bg-[var(--surface-background)] shadow-[0_2px_6px_-3px_color-mix(in_srgb,var(--surface-foreground)_4%,transparent),inset_0_1px_0_var(--yuri-mobile-glass-highlight)] transition-colors duration-150 motion-reduce:transition-none dark:bg-[color-mix(in_srgb,var(--surface-background),var(--surface-foreground)_8%)] dark:shadow-none`,q=M.memo(function(){let e=(0,N.c)(10),t=M.useRef(null),n=M.useRef(0),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let i=M.useRef(r),a=D(),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>t.current?.parentElement,e[1]=o):o=e[1];let s=o,c;e[2]===a?c=e[3]:(c=()=>{let e=t.current,r=e?.parentElement;if(!e||!r)return;let o=r.getBoundingClientRect().height,s=n.current;if(!o||Math.abs(o-s)<.5)return;n.current=o;let c=r.querySelector(`[data-composer-input-shell]`),l=new DOMMatrixReadOnly(window.getComputedStyle(e).transform).m22,u=c?new DOMMatrixReadOnly(window.getComputedStyle(c).transform).m42:0;if(i.current.forEach(J),i.current=[],!s||a){e.style.transform=``,c&&(c.style.transform=``);return}let d={duration:.2,ease:`easeOut`};i.current.push(E(e,{scaleY:[s*l/o,1]},d)),c&&i.current.push(E(c,{y:[o-s+u,0]},d))},e[2]=a,e[3]=c),m(typeof ResizeObserver<`u`?s:null,c);let l,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=t.current,r=e?.parentElement;return n.current=r?.getBoundingClientRect().height??0,()=>{i.current.forEach(Y),e&&(e.style.transform=``);let t=r?.querySelector(`[data-composer-input-shell]`);t&&(t.style.transform=``)}},u=[],e[4]=l,e[5]=u):(l=e[4],u=e[5]),M.useLayoutEffect(l,u);let d,f;e[6]===a?(d=e[7],f=e[8]):(d=()=>{if(!a)return;i.current.forEach(ye),i.current=[],t.current&&(t.current.style.transform=``);let e=t.current?.parentElement?.querySelector(`[data-composer-input-shell]`);e&&(e.style.transform=``)},f=[a],e[6]=a,e[7]=d,e[8]=f),M.useLayoutEffect(d,f);let p;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,P.jsx)(`div`,{ref:t,"aria-hidden":`true`,"data-composer-material":``,className:b(`pointer-events-none absolute -inset-px -z-10`,_e,`dark:group-hover/composer:bg-[color-mix(in_srgb,var(--surface-background),var(--surface-foreground)_11%)] dark:group-focus-within/composer:bg-[color-mix(in_srgb,var(--surface-background),var(--surface-foreground)_11%)]`),style:{borderRadius:`inherit`,transformOrigin:`50% 100%`}}),e[9]=p):p=e[9],p}),ve=M.forwardRef((e,t)=>{let n=(0,N.c)(23),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,className:i,expanded:s,animateResize:c,style:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=s!==void 0&&s,u=c!==void 0&&c,d;n[7]!==u||n[8]!==i||n[9]!==l?(d=b(`relative flex flex-col overflow-visible`,u?`group/composer isolate border border-transparent`:b(_e,`dark:hover:bg-[color-mix(in_srgb,var(--surface-background),var(--surface-foreground)_11%)] dark:focus-within:bg-[color-mix(in_srgb,var(--surface-background),var(--surface-foreground)_11%)]`),l&&`min-h-0 flex-1`,i),n[7]=u,n[8]=i,n[9]=l,n[10]=d):d=n[10];let f;n[11]===o?f=n[12]:(f={borderRadius:`var(--radius-xl)`,...o},n[11]=o,n[12]=f);let p=u||void 0,m;n[13]===u?m=n[14]:(m=u?(0,P.jsx)(q,{}):null,n[13]=u,n[14]=m);let h;return n[15]!==r||n[16]!==a||n[17]!==t||n[18]!==d||n[19]!==f||n[20]!==p||n[21]!==m?(h=(0,P.jsxs)(`div`,{ref:t,className:d,style:f,...a,"data-composer-animated-resize":p,children:[m,r]}),n[15]=r,n[16]=a,n[17]=t,n[18]=d,n[19]=f,n[20]=p,n[21]=m,n[22]=h):h=n[22],h});ve.displayName=`ChatComposerSurface`;function J(e){return e.stop()}function Y(e){return e.stop()}function ye(e){return e.stop()}var be=M.forwardRef((e,t)=>{let n=(0,N.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,P.jsx)(j,{ref:t,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});be.displayName=`ChatPromptTextarea`;var xe=e=>{let t=(0,N.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=b(`flex shrink-0 items-center gap-2 bg-transparent px-2.5 py-1.5`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,P.jsx)(`div`,{className:a,"data-chat-input-footer":`true`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},Se=(e,t)=>{typeof e==`function`?e(t):e&&(e.current=t)},X=({value:e,attachments:t=[],disabled:n=!1,pending:r=!1,placeholder:i,isMobile:a=!1,onChange:o,onSubmit:s,onStop:c,onAddFiles:l,onRemoveAttachment:u,addFilesLabel:d,removeAttachmentLabel:f,fileAccept:p=`image/*`,sendLabel:g,stopLabel:_,hint:y,leftControls:S,rightControls:C,footerContent:w,inputHeader:T,attachmentContent:ee,highlightedContent:E,highlightRef:D,inputRef:te,textareaProps:k,textLayoutClassName:A,inputClassName:ne,inputOuterClassName:j,inputStyle:N,footerClassName:ie,footerStyle:ae,contentClassName:oe,inputSectionClassName:I,autoResize:R=!0,disableInputWhilePending:le=!0,layout:z=`stacked`,children:ue,className:de,expanded:B=!1,...fe})=>{let{t:pe}=v(),V=z===`inline`,[H,U]=M.useState(!1),[me,W]=M.useState(!1),G=se(),_e=t.length>0||H,q=M.useRef(null),J=M.useRef(null),Y=M.useRef(null),ye=M.useId().replace(/:/g,``),X=h(()=>{if(!R||B||k?.fillContainer){V&&U(!1);return}let e=q.current;if(!e)return;e.style.height=V?`0px`:`auto`;let t=window.getComputedStyle(e),n=Number.parseFloat(t.maxHeight),r=V?Math.max(Number.parseFloat(t.minHeight)||0,(Number.parseFloat(t.lineHeight)||0)+(Number.parseFloat(t.paddingTop)||0)+(Number.parseFloat(t.paddingBottom)||0)):0,i=V?Math.max(e.scrollHeight,r):e.scrollHeight,a=Number.isFinite(n)?Math.min(i,n):i;e.style.height=`${a}px`,e.style.overflowY=Number.isFinite(n)&&i>n?`auto`:`hidden`;let o=a>Math.ceil(r);V&&U(e=>e===o?e:o)});M.useLayoutEffect(()=>{X()},[R,B,V,k?.fillContainer,e,X]),m(V&&R&&!B&&!k?.fillContainer?q:null,X);let Ce=e=>{k?.onKeyDown?.(e),!(e.defaultPrevented||he(e))&&e.key===`Enter`&&!e.shiftKey&&!a&&(e.preventDefault(),!n&&(!r||!le)&&s())},we=e=>{l?.(e.target.files),e.target.value=``},Te=h(()=>{q.current?.blur(),W(!0)}),Z=h(e=>{W(!1),requestAnimationFrame(()=>e?.click())}),Q=h(()=>{W(!1),requestAnimationFrame(()=>{(async()=>{if(!F()){Y.current?.click();return}try{let e=await ce(20);if(e===null){Y.current?.click();return}e.length>0&&l?.(e)}catch(e){console.error(`Native photo pick failed`,e),x.error(pe(`chat.chatInput.toast.attachFileFailed`))}})()})}),$=e.trim().length>0||t.length>0,Ee=t.filter(e=>e.mime.startsWith(`image/`)),De=t.filter(e=>!e.mime.startsWith(`image/`)),Oe=l?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{ref:J,type:`file`,accept:p,multiple:!0,className:`hidden`,onChange:we}),G?(0,P.jsx)(`input`,{ref:Y,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:we}):null,(0,P.jsx)(`button`,{type:`button`,className:`flex size-8 shrink-0 items-center justify-center rounded-md text-foreground outline-none hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>G?Te():J.current?.click(),onMouseDown:a?e=>e.preventDefault():void 0,onPointerDownCapture:a?e=>e.preventDefault():void 0,disabled:n||r,"aria-label":d,children:(0,P.jsx)(O,{name:`attachment-2`,className:`size-[18px]`})})]}):null,ke=!n&&!r&&$,Ae=a?`size-6`:`size-full`,je=r&&c?(0,P.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":_,children:(0,P.jsx)(ge,{className:Ae})}):(0,P.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":ke?`true`:void 0,className:b(`flex size-8 shrink-0 items-center justify-center outline-none`,ke?`rounded-full hover:opacity-80`:`rounded-md text-primary hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-30`),disabled:n||r||!$,"aria-label":g,children:ke?(0,P.jsx)(K,{className:Ae}):(0,P.jsx)(O,{name:r?`loader-4`:`send-plane-2`,className:b(`size-4`,r&&`animate-spin`)})}),Me=r&&c?(0,P.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":_,children:(0,P.jsx)(ge,{className:Ae})}):(0,P.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":`true`,className:b(`flex size-8 shrink-0 items-center justify-center rounded-full outline-none`,ke?`hover:opacity-80`:`cursor-not-allowed opacity-30`),disabled:n||r||!$,"aria-busy":r||void 0,"aria-label":g,onClick:()=>q.current?.focus({preventScroll:!0}),onMouseDown:e=>e.preventDefault(),onPointerDownCapture:a?e=>e.preventDefault():void 0,children:(0,P.jsx)(K,{className:Ae,spinning:r})}),Ne=V?Me:je,Pe=S===void 0?Oe:S;return(0,P.jsxs)(ve,{className:de,expanded:B,...fe,children:[ue,(0,P.jsxs)(`div`,{"data-composer-content":`true`,"data-composer-layout":z,className:b(`relative flex min-h-0`,V?b(`min-h-12 flex-row`,_e?`items-end`:`items-center`):`flex-col`,B&&`flex-1`,oe),children:[V&&Pe?(0,P.jsx)(`div`,{className:`flex h-12 shrink-0 items-center pl-1.5`,"data-composer-inline-attach":`true`,children:Pe}):null,(0,P.jsxs)(`div`,{className:b(`overflow-hidden`,V&&`min-w-0 flex-1`,B&&`flex min-h-0 flex-1 flex-col`,I),children:[T,ee,Ee.length>0?(0,P.jsx)(`div`,{className:`flex gap-2 overflow-x-auto px-3 pt-3`,"data-chat-prompt-attachments":`true`,children:Ee.map(e=>(0,P.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,P.jsx)(`span`,{className:`block size-16`,children:(0,P.jsx)(re,{fill:!0,src:e.url,alt:e.name,className:`size-16 rounded-lg border border-border object-cover`})}),u?(0,P.jsx)(`button`,{type:`button`,className:`absolute -right-1 -top-1 flex size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] shadow-sm hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,P.jsx)(O,{name:`close`,className:`size-3`})}):null]},e.id))}):null,De.length>0?(0,P.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,"data-chat-prompt-file-attachments":`true`,children:De.map(e=>(0,P.jsxs)(`div`,{className:`relative flex max-w-[12rem] items-center gap-1.5 rounded-lg border border-border bg-[var(--surface-elevated)] px-2 py-1`,children:[(0,P.jsx)(O,{name:`file-text`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,P.jsx)(`span`,{className:`min-w-0 truncate typography-micro`,children:e.name}),u?(0,P.jsx)(`button`,{type:`button`,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,P.jsx)(O,{name:`close`,className:`size-3`})}):null]},e.id))}):null,(0,P.jsxs)(`div`,{className:b(`relative overflow-hidden`,V&&b(`flex min-h-12`,H?`items-end`:`items-center`),B&&`flex min-h-0 flex-1 flex-col`),"data-composer-input-shell":`true`,children:[E?(0,P.jsx)(`div`,{ref:D,"aria-hidden":!0,"data-composer-highlight":`true`,className:b(`pointer-events-none absolute inset-0 z-0 rounded-b-none`,A,ne),children:E}):null,(0,P.jsx)(be,{...k,simple:!0,fillContainer:!V&&k?.fillContainer,ref:e=>{q.current=e,Se(te,e)},"data-chat-input":`true`,value:e,onChange:e=>o(e.target.value,e),onKeyDown:Ce,disabled:n||r&&le,placeholder:i,enterKeyHint:a?`enter`:k?.enterKeyHint,outerClassName:b(`ring-0 bg-transparent shadow-none hover:bg-transparent focus-within:ring-0`,V&&`flex-none`,B&&`min-h-0 flex-1`,j),className:b(`relative z-10 resize-none overflow-y-hidden appearance-none border-0 bg-transparent typography-markdown hover:border-transparent md:typography-ui-label`,V?`field-sizing-fixed min-h-12 max-h-32 px-3 py-3 leading-6`:`min-h-[52px] max-h-40 rounded-b-none px-3 pb-2 pt-4`,A,ne,E&&`text-transparent caret-[var(--surface-foreground)]`),style:N,rows:k?.rows??1})]})]}),V?(0,P.jsx)(`div`,{className:b(`flex h-12 shrink-0 items-center pr-1.5`,ie),style:ae,"data-composer-inline-send":`true`,children:C??Ne}):(0,P.jsx)(xe,{className:ie,style:ae,children:w??(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`flex items-center gap-1.5`,children:S??Oe}),y?(0,P.jsx)(`div`,{className:`min-w-0 flex-1 truncate typography-micro text-muted-foreground`,children:y}):(0,P.jsx)(`div`,{className:`flex-1`}),(0,P.jsx)(`div`,{className:`flex items-center gap-1.5`,children:C??Ne})]})})]}),G&&l?(0,P.jsx)(L,{id:`mobile-attach-pick-${ye}`,open:me,onOpenChange:e=>{e||W(!1)},onPickPhotos:Q,onPickFiles:()=>Z(J.current)}):null]})},Ce={dictation:102,mentionFile:100,mentionAgent:100,mentionSession:100,mentionCommand:100,mentionPaste:100,code:90,codeFence:90,link:80,linkUrl:78,heading:70,blockquote:40,listMarker:35,marker:10},we={dictation:`text-foreground underline decoration-current underline-offset-4`,mentionFile:`text-[var(--primary)]`,mentionAgent:`text-[var(--primary)]`,mentionSession:`text-[var(--primary)]`,mentionCommand:`text-[var(--primary)]`,mentionPaste:`text-[var(--primary)]`,code:`rounded-[3px] bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,codeFence:`bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,link:`text-[var(--status-info)] underline`,linkUrl:`text-muted-foreground`,heading:`text-[var(--syntax-keyword)]`,blockquote:`text-muted-foreground`,listMarker:`text-[var(--syntax-keyword)]`,marker:`text-muted-foreground`},Te=`text-foreground`;function Z(e,t){if(!e||t.length===0)return null;let n=e.length,r=new Set([0,n]);for(let e of t)e.start>0&&e.start<n&&r.add(e.start),e.end>0&&e.end<n&&r.add(e.end);let i=[...r].sort((e,t)=>e-t),a=t.map((e,t)=>({range:e,index:t})).filter(e=>e.range.end>e.range.start).sort((e,t)=>e.range.start-t.range.start),o=[],s=[],c=0;for(let t=0;t<i.length-1;t+=1){let n=i[t],r=i[t+1];if(r<=n)continue;for(;c<a.length&&a[c].range.start<=n;)s.push(a[c]),c+=1;for(let e=s.length-1;e>=0;--e)s[e].range.end<=n&&s.splice(e,1);let l=null,u=-1,d=1/0;for(let{range:e,index:t}of s){let n=e.priority??Ce[e.style];(n>u||n===u&&t<d)&&(u=n,d=t,l=e)}let p=l?l.className??we[l.style]:Te,m=e.slice(n,r),h=l?.visual,g=l?.skillName,_=o[o.length-1];_&&_.className===p&&f(_.visual,h)&&_.skillName===g?_.text+=m:o.push({text:m,className:p,visual:h,skillName:g})}return o.length>0?o:null}function Q(e,t){let n=new Set(Array.from(t,e=>e.toLowerCase())),r=[];for(let t of[/(^|\s)\/(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)/gi,/(^|\s)@(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)(?=$|\s|[),.;:!?])/gi]){let i;for(;(i=t.exec(e))!==null;){let e=i[2]??``,t=i[3]||``;if(!n.has(t.toLowerCase()))continue;let a=i.index+(i[1]?.length??0);r.push({start:a,end:a+1+e.length+t.length,name:t})}}return r}function $(e,t,n){if(e===t){let t=n.find(t=>e>t.start&&e<t.end);return t?{start:t.start,end:t.end}:null}let r=n.filter(n=>n.start<t&&n.end>e);return r.length===0?null:{start:Math.min(e,...r.map(e=>e.start)),end:Math.max(t,...r.map(e=>e.end))}}function Ee(e,t,n){let r=Q(e,t),i=Math.max(0,Math.min(n.selectionStart,e.length)),a=Math.max(i,Math.min(n.selectionEnd,e.length)),o=i,s=a;if(i===a)if(n.altKey)if(n.key===`Backspace`){for(;o>0&&/\s/.test(e[o-1]);)--o;for(;o>0&&!/\s/.test(e[o-1]);)--o}else{for(;s<e.length&&/\s/.test(e[s]);)s+=1;for(;s<e.length&&!/\s/.test(e[s]);)s+=1}else n.key===`Backspace`?o=Math.max(0,i-1):s=Math.min(e.length,i+1);if(o===s)return null;let c=r.filter(e=>e.start<s&&e.end>o);if(c.length===0)return null;let l=Math.min(o,...c.map(e=>e.start)),u=Math.max(s,...c.map(e=>e.end));return u<e.length&&/\s/.test(e[u])&&(l===0||/\s/.test(e[l-1]))?u+=1:u===e.length&&l>0&&/\s/.test(e[l-1])&&--l,{text:`${e.slice(0,l)}${e.slice(u)}`,caret:l,removedSkillNames:c.map(e=>e.name)}}function De(e){return e.map(e=>({start:e.start,end:e.end,style:e.kind===`file`?`mentionFile`:e.kind===`session`?`mentionSession`:`mentionAgent`,visual:e.kind===`session`&&e.label?l({trigger:`@`,icon:`chat-thread`,label:e.label},d({trigger:`@`,icon:`chat-thread`,label:e.label})):void 0}))}function Oe(e){let t=(0,N.c)(28),{visual:n,text:r}=e,i=n.trigger.length,a=i+n.label.length,o=a+(n.suffix?.length??0),s;t[0]!==a||t[1]!==i||t[2]!==r?(s=r.slice(i,Math.min(a,r.length)),t[0]=a,t[1]=i,t[2]=r,t[3]=s):s=t[3];let l=s,d;t[4]!==a||t[5]!==o||t[6]!==r?(d=r.slice(a,Math.min(o,r.length)),t[4]=a,t[5]=o,t[6]=r,t[7]=d):d=t[7];let f=d,p;t[8]!==o||t[9]!==r?(p=r.slice(Math.min(o,r.length)),t[8]=o,t[9]=r,t[10]=p):p=t[10];let m=p,h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h={left:c,right:c},t[11]=h):h=t[11];let g=n.icon,_;t[12]===g?_=t[13]:(_=(0,P.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 inline-flex items-center justify-center`,style:h,children:(0,P.jsx)(O,{name:g,className:`${u} shrink-0 text-[var(--primary)]`,"aria-hidden":`true`})}),t[12]=g,t[13]=_);let v;t[14]!==_||t[15]!==n.trigger?(v=(0,P.jsxs)(`span`,{className:`relative inline-block align-baseline text-transparent leading-none`,children:[n.trigger,_]}),t[14]=_,t[15]=n.trigger,t[16]=v):v=t[16];let y;t[17]===l?y=t[18]:(y=(0,P.jsx)(`span`,{children:l}),t[17]=l,t[18]=y);let b;t[19]===f?b=t[20]:(b=f?(0,P.jsx)(`span`,{className:`text-transparent`,children:f}):null,t[19]=f,t[20]=b);let x;t[21]===m?x=t[22]:(x=m?(0,P.jsx)(`span`,{className:`text-transparent`,children:m}):null,t[21]=m,t[22]=x);let S;return t[23]!==x||t[24]!==v||t[25]!==y||t[26]!==b?(S=(0,P.jsxs)(P.Fragment,{children:[v,y,b,x]}),t[23]=x,t[24]=v,t[25]=y,t[26]=b,t[27]=S):S=t[27],S}var ke=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return!1;switch(e.key){case`ArrowUp`:case`PageUp`:case`Home`:return!0;default:return!1}},Ae=(e,t,n)=>{let r=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;r&&r!==e;){if(r instanceof HTMLElement){let e=r.scrollHeight-r.clientHeight;if(e>1&&(n===`up`?r.scrollTop>0:r.scrollTop<e-1))return!0}r=r.parentElement}return!1},je=(e,t)=>Ae(e,t,`up`),Me=(e,t)=>Ae(e,t,`down`),Ne=e=>({text:e.text,references:e.references.map(e=>({...e}))}),Pe=e=>e.map(e=>({...e,range:{...e.range}})),Fe=(e,t)=>e.text===t.text&&JSON.stringify(e.references)===JSON.stringify(t.references),Ie=(e,t,n)=>({document:Ne(e),mentions:Pe(t),selection:{...n}}),Le=()=>({undo:[],redo:[]}),Re=(e,t)=>({undo:[...e.undo,t].slice(-100),redo:[]}),ze=(e,t)=>{let n=e.undo.at(-1);return!n||!Fe(n.after.document,t)?null:{history:{undo:e.undo.slice(0,-1),redo:[...e.redo,n]},snapshot:Ie(n.before.document,n.before.mentions,n.before.selection)}},Be=(e,t)=>{let n=e.redo.at(-1);return!n||!Fe(n.before.document,t)?null:{history:{undo:[...e.undo,n],redo:e.redo.slice(0,-1)},snapshot:Ie(n.after.document,n.after.mentions,n.after.selection)}},Ve=e=>{if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.trunc(e);return t>=0?t:void 0},He=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.summary;return!t||typeof t!=`object`||Array.isArray(t)?null:t},Ue=e=>{let t=Ve(e);return t!==void 0&&t>0?t:void 0};function We(e){let t=He(e);if(!t)return null;let n=Ue(t.additions),r=Ue(t.deletions),i=Ue(t.files)??Ue(t.diffCount);return n===void 0&&r===void 0&&i===void 0?null:{...n===void 0?{}:{additions:n},...r===void 0?{}:{deletions:r},...i===void 0?{}:{files:i}}}function Ge(e){if(!e)return null;let t=[];return e.additions!==void 0&&e.additions>0&&t.push(`+${e.additions}`),e.deletions!==void 0&&e.deletions>0&&t.push(`−${e.deletions}`),t.length>0?t.join(` `):null}function Ke(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.providerID==`string`?t.providerID.trim():``,r=typeof t.modelID==`string`?t.modelID.trim():``;if(n&&r)return`${n}/${r}`;let i=t.model;if(typeof i==`string`&&i.trim())return i.trim();if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i,t=typeof e.providerID==`string`?e.providerID.trim():typeof e.provider==`string`?e.provider.trim():``,n=typeof e.modelID==`string`?e.modelID.trim():typeof e.id==`string`?e.id.trim():``;if(t&&n)return`${t}/${n}`}return null}function qe(e){if(!e||e.trim().length===0)return null;let t=T.getState(),n=t.activeSessions.find(t=>t.id===e)??t.archivedSessions.find(t=>t.id===e)??null;if(!n)return null;let r=w(n);return r?{sessionId:e,directory:r,session:n,fromCache:!t.hasLoaded,source:`memory`}:null}function Je(e){return qe(e)?.directory??null}var Ye=new Map;async function Xe(e,t){let n=e.trim();if(!n)return null;let r=qe(n);if(r)return r;let i=Ye.get(n);if(i)return i;let a=(async()=>{let e=qe(n);if(e)return e;let r=await S(n,{signal:t?.signal});if(r?.directory)return{sessionId:r.id,directory:r.directory,session:null,fromCache:!1,source:`session-index`};if(t?.trySessionGet===!1)return null;try{let e=await s.getSession(n),t=typeof e.directory==`string`&&e.directory.trim()||(typeof e.project?.worktree==`string`?e.project.worktree.trim():``)||null;return t?{sessionId:n,directory:t,session:e,fromCache:!1,source:`session-get`}:null}catch{return null}})().finally(()=>{Ye.get(n)===a&&Ye.delete(n)});return Ye.set(n,a),a}export{L as A,ge as C,V as D,W as E,ce as M,se as N,fe as O,K as S,me as T,Q as _,We as a,Ee as b,Le as c,ze as d,ke as f,Z as g,Oe as h,Ge as i,F as j,le as k,Re as l,je as m,Je as n,Ke as o,Me as p,Xe as r,Ie as s,qe as t,Be as u,De as v,he as w,X as x,$ as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Y as t,j as n,k as r,ot as i}from"./platform-wF65ZFgV.js";import{B as a,ot as o,st as s}from"./vendor-base-ui-z2M4boRm.js";import{fr as c}from"./client-uz8O6TPX.js";import{n as l}from"./vendor-react-P8wFrkcT.js";import{s as u}from"./vendor-tanstack-react-query-B-KblYBV.js";import{D as d,P as f,q as p}from"./runtime-file-resource-CuLP3xp7.js";import{r as m}from"./vendor-reactuses-core-Dyjw5sZR.js";import{r as h}from"./useUIStore-Cfmg-aDQ.js";import{t as g}from"./i18n-RH7UieOS.js";import{Ba as _,In as v,K as y,Or as b,Rn as x,Ua as S,Yn as C,bi as w,hi as T,p as E,vi as D}from"./useMobileNavigationStore-BNtVrnSw.js";import{m as O,n as k,p as A}from"./remoteProjectQueries-CkxdZNw4.js";import{n as j}from"./Icon-DizeYahT.js";import{w as M}from"./useAppFontEffects-CqXrCJVt.js";import{i as N,n as P,t as F}from"./tooltip-D382RCy1.js";import{E as I,G as L,K as R,M as ee,Q as z,W as te,b as B,h as V,p as H}from"./pwa-CXupOTsD.js";import{a as U,i as W}from"./sessionLookup-RcyTTDOy.js";import{_ as G}from"./insertionBoundaries-DZtQt2Ah.js";var K=l(),q=e(s(),1),J=o(),Y=e=>{let t=(0,K.c)(179),{pending:n,totalTokens:r,percentage:i,colorPercentage:a,contextLimit:o,outputLimit:s,size:c,isMobile:l,hideIcon:u,showPercentIcon:d,appearance:f,className:p,valueClassName:m,percentIconClassName:h,onClick:_,pressed:v}=e,y=n!==void 0&&n,b=c===void 0?`default`:c,S=l!==void 0&&l,C=u!==void 0&&u,w=d!==void 0&&d,T=f===void 0?`default`:f,E=v!==void 0&&v,{t:D}=g(),[O,k]=q.useState(!1),A=typeof a==`number`?a:i,M,L,R,z,B,V,H,U,W,G,Y,X,ie,Z,ae,oe,se,ce,le,Q,$;if(t[0]!==T||t[1]!==A||t[2]!==o||t[3]!==S||t[4]!==_||t[5]!==s||t[6]!==y||t[7]!==h||t[8]!==i||t[9]!==D||t[10]!==r){let e=y?0:I(i)??0;G=T===`subtle`;let n=ee(A);Y=G||y?`var(--surface-muted-foreground)`:n===`critical`?`var(--status-error)`:n===`warn`?`var(--status-warning)`:`var(--status-success)`,H=ne;let a;t[32]===y?a=t[33]:(a=e=>y?`text-muted-foreground`:e>=90?`text-status-error`:e>=75?`text-status-warning`:`text-status-success`,t[32]=y,t[33]=a),U=a,z=G?18:20,B=G?2:3,R=(z-B)/2,M=2*Math.PI*R,L=M*(1-e/100),X=typeof s==`number`?Math.max(s,0):0;let c;t[34]!==o||t[35]!==y||t[36]!==i||t[37]!==X||t[38]!==D||t[39]!==r?(Q=y?D(`contextUsage.pending`):`${Math.min(i,999).toFixed(1)}%`,$=y?`—`:H(r),V=H(o),c=y?[D(`contextUsage.pendingDescription`)]:[D(`contextUsage.tooltip.usage`,{percent:Q}),D(`contextUsage.tooltip.usedOfLimit`,{used:$,limit:V}),D(`contextUsage.tooltip.outputLimit`,{tokens:H(X)})],t[34]=o,t[35]=y,t[36]=i,t[37]=X,t[38]=D,t[39]=r,t[40]=V,t[41]=c,t[42]=Q,t[43]=$):(V=t[40],c=t[41],Q=t[42],$=t[43]),le=c,W=!S&&typeof _==`function`,se=`0 0 ${z} ${z}`;let l=G?`h-4 w-4 shrink-0 -rotate-90 text-muted-foreground/70`:`h-3.5 w-3.5 -rotate-90`;t[44]!==h||t[45]!==l?(ce=x(l,h),t[44]=h,t[45]=l,t[46]=ce):ce=t[46],ie=`progressbar`,t[47]===D?Z=t[48]:(Z=D(`contextUsage.aria.label`),t[47]=D,t[48]=Z),t[49]!==y||t[50]!==D?(ae=y?D(`contextUsage.pending`):void 0,t[49]=y,t[50]=D,t[51]=ae):ae=t[51],oe=y?void 0:Math.round(e),t[0]=T,t[1]=A,t[2]=o,t[3]=S,t[4]=_,t[5]=s,t[6]=y,t[7]=h,t[8]=i,t[9]=D,t[10]=r,t[11]=M,t[12]=L,t[13]=R,t[14]=z,t[15]=B,t[16]=V,t[17]=H,t[18]=U,t[19]=W,t[20]=G,t[21]=Y,t[22]=X,t[23]=ie,t[24]=Z,t[25]=ae,t[26]=oe,t[27]=se,t[28]=ce,t[29]=le,t[30]=Q,t[31]=$}else M=t[11],L=t[12],R=t[13],z=t[14],B=t[15],V=t[16],H=t[17],U=t[18],W=t[19],G=t[20],Y=t[21],X=t[22],ie=t[23],Z=t[24],ae=t[25],oe=t[26],se=t[27],ce=t[28],le=t[29],Q=t[30],$=t[31];let ue=z/2,de=z/2,fe;t[52]!==R||t[53]!==B||t[54]!==ue||t[55]!==de?(fe=(0,J.jsx)(`circle`,{cx:ue,cy:de,r:R,fill:`none`,stroke:`var(--interactive-border)`,strokeWidth:B}),t[52]=R,t[53]=B,t[54]=ue,t[55]=de,t[56]=fe):fe=t[56];let pe=z/2,me=z/2,he;t[57]!==M||t[58]!==L||t[59]!==R||t[60]!==B||t[61]!==Y||t[62]!==pe||t[63]!==me?(he=(0,J.jsx)(`circle`,{cx:pe,cy:me,r:R,fill:`none`,stroke:Y,strokeWidth:B,strokeLinecap:`round`,strokeDasharray:M,strokeDashoffset:L,className:`transition-[stroke-dashoffset,stroke] duration-300`}),t[57]=M,t[58]=L,t[59]=R,t[60]=B,t[61]=Y,t[62]=pe,t[63]=me,t[64]=he):he=t[64];let ge;t[65]!==ie||t[66]!==Z||t[67]!==ae||t[68]!==oe||t[69]!==fe||t[70]!==he||t[71]!==se||t[72]!==ce?(ge=(0,J.jsxs)(`svg`,{viewBox:se,className:ce,role:ie,"aria-label":Z,"aria-valuetext":ae,"aria-valuenow":oe,"aria-valuemin":0,"aria-valuemax":100,children:[fe,he]}),t[65]=ie,t[66]=Z,t[67]=ae,t[68]=oe,t[69]=fe,t[70]=he,t[71]=se,t[72]=ce,t[73]=ge):ge=t[73];let _e=ge,ve=E||y?`ml-1 max-w-[14rem] opacity-100`:`ml-0 max-w-0 opacity-0 group-hover:ml-1 group-hover:max-w-[14rem] group-hover:opacity-100 group-focus-visible:ml-1 group-focus-visible:max-w-[14rem] group-focus-visible:opacity-100`,ye;t[74]===ve?ye=t[75]:(ye=x(`inline-flex items-center gap-1.5 overflow-hidden whitespace-nowrap typography-micro font-medium text-foreground transition-[max-width,opacity,margin] duration-200`,ve),t[74]=ve,t[75]=ye);let be;t[76]===Q?be=t[77]:(be=(0,J.jsx)(`span`,{children:Q}),t[76]=Q,t[77]=be);let xe;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,J.jsx)(`span`,{className:`mx-0.5 text-muted-foreground/60`,children:`/`}),t[78]=xe):xe=t[78];let Se;t[79]!==V||t[80]!==$?(Se=(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[$,xe,V]}),t[79]=V,t[80]=$,t[81]=Se):Se=t[81];let Ce;t[82]!==ye||t[83]!==be||t[84]!==Se?(Ce=(0,J.jsxs)(`span`,{className:ye,children:[be,Se]}),t[82]=ye,t[83]=be,t[84]=Se,t[85]=Ce):Ce=t[85];let we=Ce,Te;t[86]!==A||t[87]!==U||t[88]!==C||t[89]!==S||t[90]!==G||t[91]!==y||t[92]!==i||t[93]!==_e||t[94]!==w||t[95]!==we||t[96]!==Q||t[97]!==m?(Te=G?(0,J.jsxs)(J.Fragment,{children:[_e,we]}):(0,J.jsxs)(J.Fragment,{children:[!S&&!C&&(0,J.jsx)(j,{name:`donut-chart`,className:`h-4 w-4 flex-shrink-0`}),(0,J.jsx)(`span`,{className:x(`font-medium inline-flex items-center gap-1.5`,m),children:y?(0,J.jsxs)(J.Fragment,{children:[w&&_e,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:Q})]}):w?(0,J.jsxs)(J.Fragment,{children:[_e,(0,J.jsx)(`span`,{className:`text-foreground`,children:Q})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:U(A),children:Math.min(i,999).toFixed(1)}),`%`]})})]}),t[86]=A,t[87]=U,t[88]=C,t[89]=S,t[90]=G,t[91]=y,t[92]=i,t[93]=_e,t[94]=w,t[95]=we,t[96]=Q,t[97]=m,t[98]=Te):Te=t[98];let Ee=Te,De=G?`gap-0`:`gap-1.5`,Oe=b===`compact`?`typography-micro`:`typography-meta`,ke;t[99]!==p||t[100]!==W||t[101]!==G||t[102]!==E||t[103]!==De||t[104]!==Oe?(ke=x(`app-region-no-drag flex items-center select-none`,De,Oe,W?x(`group rounded-md text-foreground transition-colors`,G?x(`p-1.5 text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50`,E&&`bg-interactive-hover/50 text-foreground`):`px-2 py-1.5 hover:bg-interactive-hover`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`):`text-muted-foreground/60`,p),t[99]=p,t[100]=W,t[101]=G,t[102]=E,t[103]=De,t[104]=Oe,t[105]=ke):ke=t[105];let Ae=ke,je;t[106]!==Ee||t[107]!==W||t[108]!==S||t[109]!==_||t[110]!==E||t[111]!==Ae||t[112]!==D?(je=W?(0,J.jsx)(`button`,{type:`button`,className:Ae,"aria-label":D(`contextUsage.aria.label`),"aria-pressed":E,onClick:_,children:Ee}):(0,J.jsx)(`div`,{className:Ae,"aria-label":D(`contextUsage.aria.label`),onClick:S?()=>k(!0):void 0,children:Ee}),t[106]=Ee,t[107]=W,t[108]=S,t[109]=_,t[110]=E,t[111]=Ae,t[112]=D,t[113]=je):je=t[113];let Me=je;if(S){let e;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>k(!1),t[114]=e):e=t[114];let n;t[115]===D?n=t[116]:(n=D(`contextUsage.mobile.title`),t[115]=D,t[116]=n);let r;t[117]===D?r=t[118]:(r=D(`contextUsage.mobile.usedTokens`),t[117]=D,t[118]=r);let i;t[119]===r?i=t[120]:(i=(0,J.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:r}),t[119]=r,t[120]=i);let a;t[121]===$?a=t[122]:(a=(0,J.jsx)(`span`,{className:`typography-meta text-foreground font-medium`,children:$}),t[121]=$,t[122]=a);let o;t[123]!==i||t[124]!==a?(o=(0,J.jsxs)(`div`,{className:`flex justify-between items-center`,children:[i,a]}),t[123]=i,t[124]=a,t[125]=o):o=t[125];let s;t[126]===D?s=t[127]:(s=D(`contextUsage.mobile.contextLimit`),t[126]=D,t[127]=s);let c;t[128]===s?c=t[129]:(c=(0,J.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:s}),t[128]=s,t[129]=c);let l;t[130]===V?l=t[131]:(l=(0,J.jsx)(`span`,{className:`typography-meta text-foreground font-medium`,children:V}),t[130]=V,t[131]=l);let u;t[132]!==c||t[133]!==l?(u=(0,J.jsxs)(`div`,{className:`flex justify-between items-center`,children:[c,l]}),t[132]=c,t[133]=l,t[134]=u):u=t[134];let d;t[135]===D?d=t[136]:(d=D(`contextUsage.mobile.outputLimit`),t[135]=D,t[136]=d);let f;t[137]===d?f=t[138]:(f=(0,J.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:d}),t[137]=d,t[138]=f);let p;t[139]!==H||t[140]!==X?(p=H(X),t[139]=H,t[140]=X,t[141]=p):p=t[141];let m;t[142]===p?m=t[143]:(m=(0,J.jsx)(`span`,{className:`typography-meta text-foreground font-medium`,children:p}),t[142]=p,t[143]=m);let h;t[144]!==f||t[145]!==m?(h=(0,J.jsxs)(`div`,{className:`flex justify-between items-center`,children:[f,m]}),t[144]=f,t[145]=m,t[146]=h):h=t[146];let g;t[147]===D?g=t[148]:(g=D(`contextUsage.mobile.usage`),t[147]=D,t[148]=g);let _;t[149]===g?_=t[150]:(_=(0,J.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:g}),t[149]=g,t[150]=_);let v;t[151]!==A||t[152]!==U?(v=x(`typography-meta font-semibold`,U(A)),t[151]=A,t[152]=U,t[153]=v):v=t[153];let y;t[154]!==v||t[155]!==Q?(y=(0,J.jsx)(`span`,{className:v,children:Q}),t[154]=v,t[155]=Q,t[156]=y):y=t[156];let b;t[157]!==_||t[158]!==y?(b=(0,J.jsxs)(`div`,{className:`flex justify-between items-center pt-1 border-t border-border/40`,children:[_,y]}),t[157]=_,t[158]=y,t[159]=b):b=t[159];let S;t[160]!==o||t[161]!==u||t[162]!==h||t[163]!==b?(S=(0,J.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:(0,J.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-sidebar/30 px-3 py-2 space-y-1`,children:[o,u,h,b]})}),t[160]=o,t[161]=u,t[162]=h,t[163]=b,t[164]=S):S=t[164];let C;t[165]!==O||t[166]!==n||t[167]!==S?(C=(0,J.jsx)(te,{open:O,onClose:e,title:n,children:S}),t[165]=O,t[166]=n,t[167]=S,t[168]=C):C=t[168];let w;return t[169]!==Me||t[170]!==C?(w=(0,J.jsxs)(J.Fragment,{children:[Me,C]}),t[169]=Me,t[170]=C,t[171]=w):w=t[171],w}if(G)return Me;let Ne;t[172]===Me?Ne=t[173]:(Ne=(0,J.jsx)(N,{asChild:!0,children:Me}),t[172]=Me,t[173]=Ne);let Pe;t[174]===le?Pe=t[175]:(Pe=(0,J.jsx)(P,{children:(0,J.jsx)(`div`,{className:`space-y-0.5`,children:le.map(re)})}),t[174]=le,t[175]=Pe);let Fe;return t[176]!==Ne||t[177]!==Pe?(Fe=(0,J.jsxs)(F,{children:[Ne,Pe]}),t[176]=Ne,t[177]=Pe,t[178]=Fe):Fe=t[178],Fe};function ne(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toFixed(1).replace(/\.0$/,``)}function re(e){return(0,J.jsx)(`p`,{className:`typography-micro leading-tight`,children:e},e)}var X=7,ie=e=>{if(!e)return null;let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Z=e=>{if(!e)return null;let t=e.path.split(/[\\/]/).filter(Boolean);return t[t.length-1]??null},ae=(e,t)=>{let n=(0,K.c)(32),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{scopeProjectId:i}=r,a=i===void 0?null:i,o=D(oe),s=_(se),c=w(),l;n[2]===s?l=n[3]:(l=s.map(ce).filter(le),n[2]=s,n[3]=l);let u=l,d;n[4]===u?d=n[5]:(d=e=>e?u.filter(t=>B(e,t.normalizedPath)).sort(Q)[0]??null:null,n[4]=u,n[5]=d);let f=d,p;bb0:{if(!e){let e;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],n[6]=e):e=n[6],p=e;break bb0}let t;if(n[7]!==o||n[8]!==f||n[9]!==c||n[10]!==a){let e;n[12]!==f||n[13]!==a?(e=e=>!a||f(T(e))?.id===a,n[12]=f,n[13]=a,n[14]=e):e=n[14];let r;n[15]===c?r=n[16]:(r=(e,t)=>H(e,t,c),n[15]=c,n[16]=r),t=Array.from(new Set(o.filter($).filter(ue).filter(e).sort(r).slice(0,X).map(de).filter(fe))),n[7]=o,n[8]=f,n[9]=c,n[10]=a,n[11]=t}else t=n[11];p=t}let m=p,h;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(h=new Map,n[17]=h):h=n[17];let g=q.useRef(h),v;n[18]===m?v=n[19]:(v=e=>{let t=g.current,n=t.size===m.length;if(n){for(let r of m)if(t.get(r)!==(e.directories.get(r)?.status?.current??null)){n=!1;break}}if(n)return t;let r=new Map;return m.forEach(t=>r.set(t,e.directories.get(t)?.status?.current??null)),g.current=r,r},n[18]=m,n[19]=v);let y=G(v),b;bb1:{if(!e){let e;n[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],n[20]=e):e=n[20],b=e;break bb1}let t;if(n[21]!==o||n[22]!==y||n[23]!==f||n[24]!==c||n[25]!==a){let e=new Map;for(let t of o){let n=t.parentID;if(!n||t.time?.archived)continue;let r=e.get(n);r?r.push(t):e.set(n,[t])}e.forEach(e=>{e.sort((e,t)=>H(e,t,c))});let r;n[27]!==f||n[28]!==a?(r=e=>{if(!a)return!0;let t=T(e);return f(t)?.id===a},n[27]=f,n[28]=a,n[29]=r):r=n[29];let i;n[30]===c?i=n[31]:(i=(e,t)=>H(e,t,c),n[30]=c,n[31]=i);let s=o.filter(pe).filter(me).filter(r).sort(i).slice(0,X),l=t=>({session:t,children:(e.get(t.id)??[]).map(e=>l(e)),worktree:null});t=s.map(e=>{let t=T(e),n=f(t),r=Z(n),i=t?y.get(t)??null:null;return{node:l(e),projectId:n?.id??null,groupDirectory:t,secondaryMeta:{projectLabel:r,branchLabel:i&&i!==r?i:null}}}),n[21]=o,n[22]=y,n[23]=f,n[24]=c,n[25]=a,n[26]=t}else t=n[26];b=t}return b};function oe(e){return e.activeSessions}function se(e){return e.projects}function ce(e){return{...e,normalizedPath:ie(e.path)}}function le(e){return e.normalizedPath}function Q(e,t){return(t.normalizedPath?.length??0)-(e.normalizedPath?.length??0)}function $(e){return!e.time?.archived}function ue(e){return!e.parentID}function de(e){return T(e)}function fe(e){return!!e}function pe(e){return!e.time?.archived}function me(e){return!e.parentID}function he(e){let t=(0,K.c)(18),{children:n,variant:r,scopeProjectId:i,align:a}=e,o=r===void 0?`default`:r,s=i===void 0?null:i,c=a===void 0?`start`:a,l=h(_e),u=h(ge),d;t[0]===n?d=t[1]:(d=(0,J.jsx)(z,{asChild:!0,children:n}),t[0]=n,t[1]=d);let f=o===`compact`?`w-[280px]`:`w-[360px]`,p;t[2]===f?p=t[3]:(p=x(`overflow-hidden p-1 max-w-[calc(100vw-32px)]`,f),t[2]=f,t[3]=p);let m;t[4]!==l||t[5]!==s||t[6]!==u||t[7]!==o?(m=l?(0,J.jsx)(ve,{onSelect:()=>u(!1),variant:o,scopeProjectId:s}):null,t[4]=l,t[5]=s,t[6]=u,t[7]=o,t[8]=m):m=t[8];let g;t[9]!==c||t[10]!==p||t[11]!==m?(g=(0,J.jsx)(R,{align:c,sideOffset:6,className:p,children:m}),t[9]=c,t[10]=p,t[11]=m,t[12]=g):g=t[12];let _;return t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==g?(_=(0,J.jsxs)(L,{open:l,onOpenChange:u,modal:!1,children:[d,g]}),t[13]=l,t[14]=u,t[15]=d,t[16]=g,t[17]=_):_=t[17],_}function ge(e){return e.setSessionDropdownOpen}function _e(e){return e.isSessionDropdownOpen}function ve(e){let t=(0,K.c)(7),{onSelect:n,variant:r,scopeProjectId:i}=e,a;t[0]===i?a=t[1]:(a=e=>e.projects.find(t=>t.id===(i??e.activeProjectId)),t[0]=i,t[1]=a);let o=_(a),s;return t[2]!==n||t[3]!==o||t[4]!==i||t[5]!==r?(s=o?.hostId?(0,J.jsx)(Se,{projectId:o.id,hostId:o.hostId,hubId:o.hubId,onSelect:n,variant:r},`${o.hubId}:${o.hostId}:${o.id}`):(0,J.jsx)(ye,{onSelect:n,variant:r,scopeProjectId:i}),t[2]=n,t[3]=o,t[4]=i,t[5]=r,t[6]=s):s=t[6],s}function ye(e){let t=(0,K.c)(27),{onSelect:n,variant:r,scopeProjectId:i}=e,o;t[0]===i?o=t[1]:(o={scopeProjectId:i},t[0]=i,t[1]=o);let s=ae(!0,o),c=E(xe),l=h(be),{t:u}=g(),d;t[2]!==n||t[3]!==c||t[4]!==l?(d=()=>{l(`chat`),n(),c()},t[2]=n,t[3]=c,t[4]=l,t[5]=d):d=t[5];let f=m(d),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=new Set,t[6]=p):p=t[6];let[_,v]=q.useState(p),y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[7]=y):y=t[7];let b=m(y),S,C;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=x(`group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none`,`data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover`),C=(0,J.jsx)(j,{name:`chat-new`,className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),t[8]=S,t[9]=C):(S=t[8],C=t[9]);let w;t[10]===u?w=t[11]:(w=u(`sessions.sidebar.header.actions.newSession`),t[10]=u,t[11]=w);let T;t[12]===w?T=t[13]:(T=(0,J.jsx)(`span`,{className:`truncate text-[14px] font-normal leading-tight text-foreground`,children:w}),t[12]=w,t[13]=T);let D;t[14]!==f||t[15]!==T?(D=(0,J.jsxs)(a,{onClick:f,className:S,children:[C,T]}),t[14]=f,t[15]=T,t[16]=D):D=t[16];let O;t[17]!==_||t[18]!==s||t[19]!==n||t[20]!==u||t[21]!==b||t[22]!==r?(O=s.length===0?(0,J.jsx)(`div`,{className:`px-3 py-4 text-center typography-meta text-muted-foreground`,children:u(`sessions.switcher.empty`)}):s.map(e=>(0,J.jsx)(Te,{item:e,depth:0,variant:r,expandedParents:_,toggleParent:b,closeDropdown:n},e.node.session.id)),t[17]=_,t[18]=s,t[19]=n,t[20]=u,t[21]=b,t[22]=r,t[23]=O):O=t[23];let k;return t[24]!==O||t[25]!==D?(k=(0,J.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`space-y-0.5`,children:[D,O]})}),t[24]=O,t[25]=D,t[26]=k):k=t[26],k}function be(e){return e.setActiveMainTab}function xe(e){return e.openNewSessionDraft}function Se(e){let t=(0,K.c)(16),{projectId:n,hostId:r,hubId:i,onSelect:a,variant:o}=e,s=O(!0),c;t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==s.catalog?.hubId||t[4]!==s.catalog?.projects?(c=!i||i===s.catalog?.hubId?s.catalog?.projects.find(e=>e.id===n&&e.hostId===r):void 0,t[0]=r,t[1]=i,t[2]=n,t[3]=s.catalog?.hubId,t[4]=s.catalog?.projects,t[5]=c):c=t[5];let l=c,{t:u}=g(),[d,f]=q.useState(null),p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=async()=>{try{await k(),f(null)}catch(e){let t=e;f(t instanceof Error?t.message:String(t))}},t[6]=p):p=t[6];let h=m(p),_;return t[7]!==d||t[8]!==a||t[9]!==l||t[10]!==h||t[11]!==s.error?.message||t[12]!==s.registry||t[13]!==u||t[14]!==o?(_=s.registry&&l?(0,J.jsx)(Ce,{registry:s.registry,project:l,onSelect:a,variant:o}):(0,J.jsxs)(`div`,{role:`alert`,className:`px-3 py-4 typography-meta text-muted-foreground`,children:[d??s.error?.message??u(`remoteProjects.host-unavailable`),(0,J.jsx)(v,{size:`xs`,variant:`ghost`,onClick:()=>void h(),children:u(`remoteProjects.retry`)})]}),t[7]=d,t[8]=a,t[9]=l,t[10]=h,t[11]=s.error?.message,t[12]=s.registry,t[13]=u,t[14]=o,t[15]=_):_=t[15],_}function Ce({registry:e,project:t,onSelect:n,variant:r}){let{t:i}=g(),o=d(e,t.hostId),s=A(e,t.hostId),c=_(e=>e.projects),l=S(e=>e.remoteSession),u=h(e=>e.isMobile),p=s.data,y=o?.state===`connected`&&t.remoteState===`ok`&&!p?.stale,b=q.useMemo(()=>{let n=new Set(p?.pinnedSessionIds??[]),r=new Map,i=n=>(r.has(n)||r.set(n,f(c,e.hubId,t.hostId,n,p?.worktrees)?.id===t.id),r.get(n));return(p?.directories??[]).flatMap(({directory:e,sessions:t})=>t.filter(e=>!e.parentID&&!e.time.archived).map(t=>({session:t,directory:t.directory||e}))).filter(({directory:e})=>i(e)).sort((e,t)=>H(e.session,t.session,n)).slice(0,7)},[p,c,t.hostId,t.id,e.hubId]),[x,C]=q.useState(null),w=m((r,a)=>{try{if(f(c,e.hubId,t.hostId,a,p?.worktrees)?.id!==t.id)throw Error(i(`remoteProjects.host-unavailable`));M(t,e,r,a,u),n()}catch(e){C(e instanceof Error?e.message:String(e))}}),T=l?.projectId===t.id&&l.location.hostId===t.hostId&&l.location.hubId===e.hubId?l.location.directory:t.path;return(0,J.jsx)(`div`,{className:`max-h-[60vh] overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,J.jsxs)(a,{onClick:()=>w(null,T),className:`group relative flex w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover`,children:[(0,J.jsx)(j,{name:`chat-new`,className:`h-4 w-4 flex-shrink-0 text-muted-foreground`}),(0,J.jsx)(`span`,{className:`truncate text-[14px] font-normal leading-tight text-foreground`,children:i(`sessions.sidebar.header.actions.newSession`)})]}),y?null:(0,J.jsxs)(`div`,{role:`status`,className:`px-3 typography-meta text-muted-foreground`,children:[i(`remoteProjects.state.${o?.state??`offline`}`),` · `,i(`remoteProjects.unknown`)]}),s.error||x?(0,J.jsxs)(`div`,{role:`alert`,className:`px-3 typography-meta text-destructive`,children:[x??s.error?.message,(0,J.jsx)(v,{size:`xs`,variant:`ghost`,onClick:()=>{C(null),s.refetch()},children:i(`remoteProjects.retry`)})]}):null,!b.length&&p?(0,J.jsx)(`div`,{className:`px-3 py-4 text-center typography-meta text-muted-foreground`,children:i(`sessions.switcher.empty`)}):null,b.map(({session:n,directory:i})=>(0,J.jsx)(we,{registry:e,project:t,projects:c,session:n,directory:i,variant:r,snapshot:p,online:y,navigate:w,selected:l,depth:0,ancestors:[]},`${i}:${n.id}`))]})})}function we({registry:e,project:t,projects:n,session:r,directory:i,variant:a,snapshot:o,online:s,navigate:l,selected:d,depth:h,ancestors:_}){let{t:y}=g(),[b,x]=q.useState(!1),[S,w]=q.useState(30),T=e.resolve({hubId:e.hubId,hostId:t.hostId,directory:i}),E=q.useMemo(()=>({...C(i,void 0,void 0,void 0,T),enabled:!1,staleTime:1/0,gcTime:1/0}),[T,i]),D=u(E,p).data?.current,O=u({queryKey:[...T.queryScope,`navigation-children`,r.id,S],enabled:b&&s,staleTime:3e4,gcTime:1/0,placeholderData:(e,t)=>t&&T.queryScope.every((e,n)=>t.queryKey[n]===e)&&t.queryKey[T.queryScope.length+1]===r.id?e:void 0,queryFn:async({signal:t})=>{let n=[],a,o=!1;for(let s=0;s<Math.ceil(S/30);s++){let s=await T.sdk().session.list({directory:i,parentID:r.id,limit:30,...a?{cursor:a}:{}},{signal:t});if(e.assertCurrent(),T.sdk(),!Array.isArray(s.data))throw Error(`Remote child session list returned no data`);n.push(...s.data.map(c).filter(e=>!e.time?.archived).map(e=>({...e,directory:e.directory||i,time:e.time??{}})));let l=s.cursor?.next||void 0;if(o=!!(l&&l!==a),!o)break;a=l}return{sessions:n,hasMore:o}}},p),k=m(({directory:e,payload:t})=>{e&&e!==i||t&&typeof t==`object`&&`type`in t&&typeof t.type==`string`&&/^(session\.(created|updated|deleted|status)|yuri:session-metadata)$/.test(t.type)&&p.invalidateQueries({queryKey:[...T.queryScope,`navigation-children`,r.id,S],exact:!0})});q.useEffect(()=>{if(b&&s)return e.subscribeEvents(t.hostId,k)},[e,t.hostId,i,b,s,k]);let A=o?.directories.flatMap(e=>e.sessions.filter(e=>e.parentID===r.id).map(t=>({...t,directory:t.directory||e.directory})))??[],j=(O.data?.sessions??A).filter(a=>a.id!==r.id&&!_.includes(a.id)&&f(n,e.hubId,t.hostId,a.directory||i,o?.worktrees)?.id===t.id),M=r.metadata?.yuri?.sessionStatus?.type,N=d?.projectId===t.id&&d.location.hubId===e.hubId&&d.location.hostId===t.hostId&&d.location.directory===i&&d.sessionId===r.id;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ke,{session:r,depth:h,variant:a,secondaryMeta:{projectLabel:t.label??t.path.split(/[\\/]/).filter(Boolean).at(-1),branchLabel:D},hasChildren:!!(r.hasChildren||j.length||h>0),isExpanded:b,onToggleExpand:()=>x(e=>!e),isActive:N,unseenCount:o?.unread?.sessions[r.id]?.unreadCount??0,statusType:s?M??`idle`:`unknown`,handleSelect:()=>l(r.id,i)}),b?(0,J.jsxs)(J.Fragment,{children:[O.error?(0,J.jsxs)(`div`,{role:`alert`,className:`px-3 typography-meta text-destructive`,children:[O.error.message,(0,J.jsx)(v,{size:`xs`,variant:`ghost`,disabled:!s,onClick:()=>void O.refetch(),children:y(`remoteProjects.retry`)})]}):null,j.map(c=>(0,J.jsx)(we,{registry:e,project:t,projects:n,variant:a,snapshot:o,online:s,navigate:l,selected:d,directory:c.directory||i,session:c,depth:h+1,ancestors:[..._,r.id]},c.id)),O.data?.hasMore?(0,J.jsx)(v,{size:`xs`,variant:`ghost`,disabled:!s||O.isFetching,onClick:()=>w(e=>e+30),children:y(`remoteProjects.showMore`)}):null]}):null]})}function Te(e){let t=(0,K.c)(31),{item:n,depth:r,variant:i,expandedParents:a,toggleParent:o,closeDropdown:s}=e,{node:c,secondaryMeta:l}=n,u=c.session,d=c.children.length>0,f;t[0]!==a||t[1]!==u.id?(f=a.has(u.id),t[0]=a,t[1]=u.id,t[2]=f):f=t[2];let p=f,m;t[3]!==d||t[4]!==u.id||t[5]!==o?(m=d?()=>o(u.id):void 0,t[3]=d,t[4]=u.id,t[5]=o,t[6]=m):m=t[6];let h;t[7]!==s||t[8]!==r||t[9]!==d||t[10]!==p||t[11]!==l||t[12]!==u||t[13]!==m||t[14]!==i?(h=(0,J.jsx)(Ee,{session:u,depth:r,variant:i,secondaryMeta:l,hasChildren:d,isExpanded:p,onToggleExpand:m,closeDropdown:s}),t[7]=s,t[8]=r,t[9]=d,t[10]=p,t[11]=l,t[12]=u,t[13]=m,t[14]=i,t[15]=h):h=t[15];let g;t[16]!==s||t[17]!==r||t[18]!==a||t[19]!==d||t[20]!==p||t[21]!==n.groupDirectory||t[22]!==n.projectId||t[23]!==c.children||t[24]!==l||t[25]!==o||t[26]!==i?(g=d&&p?c.children.map(e=>(0,J.jsx)(Te,{item:{node:e,projectId:n.projectId,groupDirectory:n.groupDirectory,secondaryMeta:l},depth:r+1,variant:i,expandedParents:a,toggleParent:o,closeDropdown:s},e.session.id)):null,t[16]=s,t[17]=r,t[18]=a,t[19]=d,t[20]=p,t[21]=n.groupDirectory,t[22]=n.projectId,t[23]=c.children,t[24]=l,t[25]=o,t[26]=i,t[27]=g):g=t[27];let _;return t[28]!==h||t[29]!==g?(_=(0,J.jsxs)(J.Fragment,{children:[h,g]}),t[28]=h,t[29]=g,t[30]=_):_=t[30],_}function Ee(e){let t=(0,K.c)(17),{session:n,depth:r,variant:i,secondaryMeta:a,hasChildren:o,isExpanded:s,onToggleExpand:c,closeDropdown:l}=e,u=E(Oe),d=E(De),f=y(n.id),p=b(n.id),h=u===n.id,g;t[0]!==l||t[1]!==h||t[2]!==n||t[3]!==d?(g=()=>{h||d(n.id,T(n)??null),l()},t[0]=l,t[1]=h,t[2]=n,t[3]=d,t[4]=g):g=t[4];let _=m(g),v=f?.type??`idle`,x;return t[5]!==r||t[6]!==_||t[7]!==o||t[8]!==h||t[9]!==s||t[10]!==c||t[11]!==a||t[12]!==n||t[13]!==v||t[14]!==p||t[15]!==i?(x=(0,J.jsx)(ke,{session:n,depth:r,variant:i,secondaryMeta:a,hasChildren:o,isExpanded:s,onToggleExpand:c,isActive:h,unseenCount:p,statusType:v,handleSelect:_}),t[5]=r,t[6]=_,t[7]=o,t[8]=h,t[9]=s,t[10]=c,t[11]=a,t[12]=n,t[13]=v,t[14]=p,t[15]=i,t[16]=x):x=t[16],x}function De(e){return e.setCurrentSession}function Oe(e){return e.currentSessionId}function ke(e){let t=(0,K.c)(57),{session:n,depth:r,variant:i,secondaryMeta:o,hasChildren:s,isExpanded:c,onToggleExpand:l,isActive:u,unseenCount:d,statusType:f,handleSelect:p}=e,{t:m}=g(),h;t[0]!==n.title||t[1]!==m?(h=n.title?.trim()||m(`sessions.sidebar.session.untitled`),t[0]=n.title,t[1]=m,t[2]=h):h=t[2];let _=h,v;t[3]===n?v=t[4]:(v=W(U(n)),t[3]=n,t[4]=v);let y=v,b=!!n.parentID,S=d>0&&!b,C=f===`busy`||f===`retry`,w=!C&&S,T;t[5]!==n.time?.created||t[6]!==n.time?.updated?(T=n.time?.updated||n.time?.created||Date.now(),t[5]=n.time?.created,t[6]=n.time?.updated,t[7]=T):T=t[7];let E=T,D;t[8]===E?D=t[9]:(D=V(E),t[8]=E,t[9]=D);let O=D,k;t[10]===o?.projectLabel?k=t[11]:(k=o?.projectLabel?.trim()||null,t[10]=o?.projectLabel,t[11]=k);let A=k,M;t[12]===o?.branchLabel?M=t[13]:(M=o?.branchLabel?.trim()||null,t[12]=o?.branchLabel,t[13]=M);let N=M,P=N&&N!==`HEAD`?N:null,F;t[14]===p?F=t[15]:(F=e=>{if(e.target?.closest(`[data-switcher-expand]`)){e.preventDefault();return}p()},t[14]=p,t[15]=F);let I;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(I=x(`group relative flex w-full cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 outline-hidden select-none`,`data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover`),t[16]=I):I=t[16];let L=8+r*12,R;t[17]===L?R=t[18]:(R={paddingLeft:L},t[17]=L,t[18]=R);let ee;t[19]!==s||t[20]!==c||t[21]!==l||t[22]!==m||t[23]!==i?(ee=i===`compact`&&s?(0,J.jsx)(`span`,{role:`button`,tabIndex:-1,"data-switcher-expand":!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),l?.()},className:`inline-flex h-3.5 w-3.5 flex-shrink-0 items-center justify-center rounded text-muted-foreground/70 hover:text-foreground`,"aria-label":m(c?`sessions.sidebar.session.subsessions.collapse`:`sessions.sidebar.session.subsessions.expand`),children:c?(0,J.jsx)(j,{name:`arrow-down-s`,className:`h-3.5 w-3.5`}):(0,J.jsx)(j,{name:`arrow-right-s`,className:`h-3.5 w-3.5`})}):null,t[19]=s,t[20]=c,t[21]=l,t[22]=m,t[23]=i,t[24]=ee):ee=t[24];let z=u?`text-primary`:`text-foreground`,te;t[25]===z?te=t[26]:(te=x(`min-w-0 truncate text-[14px] font-normal leading-tight`,z),t[25]=z,t[26]=te);let B;t[27]!==_||t[28]!==te?(B=(0,J.jsx)(`span`,{className:te,children:_}),t[27]=_,t[28]=te,t[29]=B):B=t[29];let H;t[30]===y?H=t[31]:(H=y?(0,J.jsx)(`span`,{className:`shrink-0 text-[12px] tabular-nums text-muted-foreground`,children:y}):null,t[30]=y,t[31]=H);let G;t[32]!==ee||t[33]!==B||t[34]!==H?(G=(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[ee,B,H]}),t[32]=ee,t[33]=B,t[34]=H,t[35]=G):G=t[35];let q;t[36]!==P||t[37]!==s||t[38]!==c||t[39]!==l||t[40]!==A||t[41]!==m||t[42]!==O||t[43]!==i?(q=i==="default"?(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 truncate text-muted-foreground/70 leading-tight`,style:{fontSize:`calc(var(--text-ui-label) * 0.85)`},children:[s?(0,J.jsx)(`span`,{role:`button`,tabIndex:-1,"data-switcher-expand":!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),l?.()},className:`inline-flex h-3 w-3 flex-shrink-0 items-center justify-center rounded text-muted-foreground/70 hover:text-foreground`,"aria-label":m(c?`sessions.sidebar.session.subsessions.collapse`:`sessions.sidebar.session.subsessions.expand`),children:c?(0,J.jsx)(j,{name:`arrow-down-s`,className:`h-3 w-3`}):(0,J.jsx)(j,{name:`arrow-right-s`,className:`h-3 w-3`})}):null,(0,J.jsx)(`span`,{className:`flex-shrink-0`,children:O}),A?(0,J.jsx)(`span`,{className:`truncate`,children:A}):null,P?(0,J.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-0.5`,children:[(0,J.jsx)(j,{name:`git-branch`,className:`h-3 w-3 flex-shrink-0 text-muted-foreground/70`}),(0,J.jsx)(`span`,{className:`truncate`,children:P})]}):null]}):null,t[36]=P,t[37]=s,t[38]=c,t[39]=l,t[40]=A,t[41]=m,t[42]=O,t[43]=i,t[44]=q):q=t[44];let Y;t[45]!==G||t[46]!==q?(Y=(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[G,q]}),t[45]=G,t[46]=q,t[47]=Y):Y=t[47];let ne;t[48]!==C||t[49]!==w||t[50]!==m?(ne=C||w?(0,J.jsx)(`span`,{className:`flex h-3 w-3 flex-shrink-0 items-center justify-center self-center`,children:C?(0,J.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary animate-busy-pulse`,"aria-label":m(`sessions.sidebar.session.status.active`),title:m(`sessions.sidebar.session.status.active`)}):(0,J.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--status-info)]`,"aria-label":m(`sessions.sidebar.session.status.unread`),title:m(`sessions.sidebar.session.status.unread`)})}):null,t[48]=C,t[49]=w,t[50]=m,t[51]=ne):ne=t[51];let re;return t[52]!==R||t[53]!==Y||t[54]!==ne||t[55]!==F?(re=(0,J.jsxs)(a,{onClick:F,"data-slot":`session-switcher-item`,className:I,style:R,children:[Y,ne]}),t[52]=R,t[53]=Y,t[54]=ne,t[55]=F,t[56]=re):re=t[56],re}var Ae=q.memo(function(e){let t=(0,K.c)(45),{visible:i,position:a}=e,o=a===void 0?`right`:a,{t:s}=g(),[c,l]=q.useState(!1),u,d;if(t[0]===i?(u=t[1],d=t[2]):(u=()=>{if(!i)return;let e=!1;n(`desktop_get_current_window_state`).then(t=>{e||l(!!t?.maximized)}).catch(je);let t=e=>{let t=e.detail;l(!!t?.maximized)};return window.addEventListener(`yuri:window-maximized-changed`,t),()=>{e=!0,window.removeEventListener(`yuri:window-maximized-changed`,t)}},d=[i],t[0]=i,t[1]=u,t[2]=d),(0,q.useEffect)(u,d),!i)return null;let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=r(),t[3]=f):f=t[3];let p=f===`win32`,m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=x(`app-region-no-drag inline-flex h-12 w-11 items-center justify-center text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,p&&`bg-[var(--surface-background)] backdrop-blur-none`),t[4]=m):m=t[4];let h=m,_=o===`left`?`app-region-no-drag -ml-3 mr-2 flex h-12 shrink-0 items-center`:`app-region-no-drag -mr-3 ml-2 flex h-12 shrink-0 items-center`,v;t[5]===_?v=t[6]:(v=x(_,p&&`bg-[var(--surface-background)] backdrop-blur-none`),t[5]=_,t[6]=v);let y=v,b;t[7]===s?b=t[8]:(b=s(`header.windowControls.groupAria`),t[7]=s,t[8]=b);let S;t[9]===s?S=t[10]:(S=s(`header.windowControls.minimize`),t[9]=s,t[10]=S);let C;t[11]===s?C=t[12]:(C=s(`header.windowControls.minimize`),t[11]=s,t[12]=C);let w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,J.jsx)(j,{name:`subtract`,className:`h-4 w-4`}),t[13]=w):w=t[13];let T;t[14]!==C||t[15]!==S?(T=(0,J.jsx)(`button`,{type:`button`,className:h,onClick:Me,title:S,"aria-label":C,children:w}),t[14]=C,t[15]=S,t[16]=T):T=t[16];let E;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>{n(`desktop_toggle_current_window_maximized`).then(e=>l(!!e?.maximized)).catch(Ne)},t[17]=E):E=t[17];let D;t[18]!==c||t[19]!==s?(D=s(c?`header.windowControls.restore`:`header.windowControls.maximize`),t[18]=c,t[19]=s,t[20]=D):D=t[20];let O;t[21]!==c||t[22]!==s?(O=s(c?`header.windowControls.restore`:`header.windowControls.maximize`),t[21]=c,t[22]=s,t[23]=O):O=t[23];let k=c?`fullscreen-exit`:`checkbox-blank`,A;t[24]===k?A=t[25]:(A=(0,J.jsx)(j,{name:k,className:`h-3.5 w-3.5`}),t[24]=k,t[25]=A);let M;t[26]!==D||t[27]!==O||t[28]!==A?(M=(0,J.jsx)(`button`,{type:`button`,className:h,onClick:E,title:D,"aria-label":O,children:A}),t[26]=D,t[27]=O,t[28]=A,t[29]=M):M=t[29];let N;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(N=x(h,`hover:bg-status-error hover:text-status-error-foreground`),t[30]=N):N=t[30];let P;t[31]===s?P=t[32]:(P=s(`header.windowControls.close`),t[31]=s,t[32]=P);let F;t[33]===s?F=t[34]:(F=s(`header.windowControls.close`),t[33]=s,t[34]=F);let I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,J.jsx)(j,{name:`close`,className:`h-4 w-4`}),t[35]=I):I=t[35];let L;t[36]!==P||t[37]!==F?(L=(0,J.jsx)(`button`,{type:`button`,className:N,onClick:Pe,title:P,"aria-label":F,children:I}),t[36]=P,t[37]=F,t[38]=L):L=t[38];let R;return t[39]!==y||t[40]!==T||t[41]!==M||t[42]!==L||t[43]!==b?(R=(0,J.jsxs)(`div`,{className:y,"aria-label":b,children:[T,M,L]}),t[39]=y,t[40]=T,t[41]=M,t[42]=L,t[43]=b,t[44]=R):R=t[44],R});function je(){}function Me(){n(`desktop_minimize_current_window`)}function Ne(){}function Pe(){n(`desktop_close_current_window`)}function Fe(){let e=(0,K.c)(5),n=h(Ie),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=i(),e[0]=r):r=e[0];let a=r,o;e[1]===n?o=e[2]:(o=t(n),e[1]=n,e[2]=o);let s=o,c;return e[3]===s?c=e[4]:(c={usesFramelessChrome:a,side:s},e[3]=s,e[4]=c),c}function Ie(e){return e.desktopWindowControlsPosition}export{Y as i,Ae as n,he as r,Fe as t};
|
|
File without changes
|