@openchambery/web 2.0.1 → 2.0.2
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/{AssistantView-ByGdaGiF.js → AssistantView-CWviBCAP.js} +3 -3
- package/dist/assets/{DiagramView-PB0pBILb.js → DiagramView-Cm7xDZ5t.js} +1 -1
- package/dist/assets/{MarkdownRenderer-H1MIHXzt.js → MarkdownRenderer-CJ5t5GCJ.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-CZ8GeckU.js → MarkdownRendererImpl-De4VmTtg.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-BKE6YZ2N.js → MarkstreamRendererImpl-B0zZVAuv.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-D9KkIrWy.js → MobileDetailNavigation-BOuvF4sv.js} +1 -1
- package/dist/assets/{MobileShareBridge-1yCjq-60.js → MobileShareBridge-Brsf5H1u.js} +1 -1
- package/dist/assets/MobileTabPageHeader-BLlFC_jN.js +2 -0
- package/dist/assets/{MultiRunWindow-YCFM6or1.js → MultiRunWindow-BUdK_rVf.js} +1 -1
- package/dist/assets/SettingsView-LnqgjCmk.js +25 -0
- package/dist/assets/{SettingsWindow-jOZ7L6K8.js → SettingsWindow-AfOCGfXC.js} +1 -1
- package/dist/assets/{TerminalView-CI-KsDdH.js → TerminalView-Csox-OUH.js} +1 -1
- package/dist/assets/{ToolOutputDialog-izZjgkkg.js → ToolOutputDialog-DYnLpM-I.js} +1 -1
- package/dist/assets/{appThemeRegistry-MiWlVk4e.js → appThemeRegistry-Dh7evuFT.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-Bn0f83D3.js → fileMentionTouchSelection-DGcKhwNg.js} +1 -1
- package/dist/assets/{gitApi-DpwH7xTg.js → gitApi-DJiNTnOw.js} +1 -1
- package/dist/assets/{insertionBoundaries-Cst5Z6Cd.js → insertionBoundaries-BZ4y7_dO.js} +1 -1
- package/dist/assets/{main-Dkzuy7EG.js → main-C5K1b2p3.js} +7 -7
- package/dist/assets/{main-CEs8ipuu.js → main-D10YD-D5.js} +2 -2
- package/dist/assets/{mcpQueries-BBpCJgvK.js → mcpQueries-om4qg52L.js} +1 -1
- package/dist/assets/{miniChat-CR7k42bZ.js → miniChat-YtAlWDXn.js} +2 -2
- package/dist/assets/{mobile-rvypjUpd.js → mobile-Bix-1h3p.js} +2 -2
- package/dist/assets/{multirun-DqmJk0mh.js → multirun-Cl0qI_UR.js} +1 -1
- package/dist/assets/{projectMeta-BhKfv5cj.js → projectMeta-ClpG1g5k.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BLay6f9j.js → renderElectronMiniChatApp-knc9ALFK.js} +2 -2
- package/dist/assets/{renderMobileApp-BrikirqO.js → renderMobileApp-DvPGytV9.js} +7 -7
- package/dist/assets/{runtimeConfig-DjKsteH0.js → runtimeConfig-CkGIFPXV.js} +1 -1
- package/dist/assets/runtimeEndpointReset-BFrS_Yci.js +148 -0
- package/dist/assets/{sessionChangeSummary-Cgq9RPUq.js → sessionChangeSummary-DYAsA6Bi.js} +1 -1
- package/dist/assets/{sessionLookup-BiE36BTy.js → sessionLookup-Bc8f5Scn.js} +1 -1
- package/dist/assets/{src-BZ0tISrf.css → src-Cp_AK_QO.css} +1 -1
- package/dist/assets/{useAppFontEffects-CWzjhjXr.js → useAppFontEffects-CU_CeyJe.js} +34 -34
- package/dist/assets/{useDesktopWindowControlsLayout-Dtqco-Um.js → useDesktopWindowControlsLayout-D5pQxhEz.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DNbDaaNV.js → useEffectiveDirectory-Cn5YmSaO.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-DYKC2swj.js → useMobileNavigationStore-Bww4SOiv.js} +19 -19
- package/dist/assets/{useSessionAutoCleanup-BI0xQcio.js → useSessionAutoCleanup--P_vAP6v.js} +1 -1
- package/dist/assets/{useWorkerHighlightedLines-BoyYALWC.js → useWorkerHighlightedLines-DOkM0xy4.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/mini-chat.html +3 -3
- package/dist/mobile.html +3 -3
- package/package.json +1 -1
- package/server/lib/session-index/DOCUMENTATION.md +10 -4
- package/server/lib/session-index/service.js +19 -2
- package/server/lib/session-index/service.test.js +52 -0
- package/server/lib/session-index/sync-runtime.js +3 -17
- package/server/lib/session-index/sync-runtime.test.js +29 -0
- package/server/lib/session-metadata/DOCUMENTATION.md +6 -4
- package/dist/assets/MobileSurface-Dqn3OPVX.js +0 -2
- package/dist/assets/SettingsView-CbiuXtYG.js +0 -25
- package/dist/assets/runtimeEndpointReset-DbfaE3dL.js +0 -148
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-workbox-window-qnW0Nbv7.js","assets/rolldown-runtime-C0FnF6B9.js","assets/renderMobileApp-
|
|
2
|
-
import{n as e,t}from"./runtimeConfig-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-workbox-window-qnW0Nbv7.js","assets/rolldown-runtime-C0FnF6B9.js","assets/renderMobileApp-DvPGytV9.js","assets/runtime-auth-D66yq6ie.js","assets/runtime-switch-BJM2k_uH.js","assets/runtime-fetch-CiqQd__Y.js","assets/persistence-CwHY3fDg.js","assets/vendor-zustand-DzRqcymP.js","assets/vendor-base-ui-CnHfUmDN.js","assets/useUIStore-DNkuudYO.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/platform-Bxaalnc8.js","assets/vendor-opencode-client-MF2GBrFx.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/capgoAdapter-DCowZ2ab.js","assets/types-BuiqMmh_.js","assets/vendor-pierre-diffs-DX7XTPG3.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/vendor-sonner-DVzioF3d.js","assets/vendor-reactuses-core-Dq5ocTF8.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-CcOoDLE1.js","assets/store-l_X_jQNz.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/MobileShareBridge-Brsf5H1u.js","assets/MobileDetailNavigation-BOuvF4sv.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/useMobileNavigationStore-Bww4SOiv.js","assets/useAssistantUIStore-CXj8c_tt.js","assets/vendor-zod-Dzk5kdUU.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/Icon-BE2hkaYc.js","assets/dialog-Csvrld51.js","assets/AgentAvatar-DGyF86jy.js","assets/gitApi-DJiNTnOw.js","assets/useAppFontEffects-CU_CeyJe.js","assets/desktopHosts-BsbquPqS.js","assets/desktopRelayRestore-yyvjztgj.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-ClpG1g5k.js","assets/input-C6Y7mytw.js","assets/tooltip-CBHR50fA.js","assets/OverlayScrollbar-CVgW_Z9B.js","assets/textarea-DUjc3iDJ.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup--P_vAP6v.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/useThemeSystem-DMzWVJaW.js","assets/dropdown-menu.styles-ayLWk2gf.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-DM5h1i18.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/sessionChangeSummary-DYAsA6Bi.js","assets/insertionBoundaries-BZ4y7_dO.js","assets/fileMentionTouchSelection-DGcKhwNg.js","assets/appThemeRegistry-Dh7evuFT.js","assets/MarkdownRenderer-CJ5t5GCJ.js","assets/markdownHeightCache-DhLhFBWX.js","assets/dualLimitLru-D8Sphgua.js","assets/url-CEnO45_n.js","assets/markdown-worker-bS5OgGO3.js","assets/useEffectiveDirectory-Cn5YmSaO.js","assets/FadeInOnReveal-B_a083XJ.js","assets/imageSource-BpUsiwFd.js","assets/relay-image-stream-D2XooXKZ.js","assets/useWorkerHighlightedLines-DOkM0xy4.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-CKKp4p3Y.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/vendor-legendapp-list-WE32lwNk.js","assets/useFontPreferences-DGbTdGy3.js","assets/terminalApi-DSJOXNRQ.js","assets/MobileTabPageHeader-BLlFC_jN.js","assets/mcpQueries-om4qg52L.js","assets/collapsible-CSa0Ndgm.js","assets/vendor-codemirror-commands-C9DCaJ0C.js","assets/vendor-codemirror-search-D2SOgzph.js","assets/vendor-replit-codemirror-vim-CEibx3EP.js","assets/projectActions-CWvNGKfA.js","assets/runtimeEndpointReset-BFrS_Yci.js","assets/sessionLookup-Bc8f5Scn.js","assets/context-menu-DoTwmMb5.js","assets/vendor-cron-parser-CCD11YFT.js","assets/runtimeEndpointReset-D_vfNOQz.css","assets/SettingsView-LnqgjCmk.js","assets/vendor-yaml-C9KlJAlj.js","assets/vendor-qrcode-DAuVxiQR.js","assets/vendor-dijkstrajs-DztKuCwY.js","assets/AssistantView-CWviBCAP.js","assets/assistant-attachment-cache-sG8YQsVs.js","assets/fileQueries-B0hhXD86.js","assets/src-Cp_AK_QO.css","assets/main-C5K1b2p3.js","assets/useDesktopWindowControlsLayout-D5pQxhEz.js","assets/diagram-CZKDkADZ.js","assets/vendor-react-drawio-ECtEwvbc.js","assets/multirun-Cl0qI_UR.js","assets/vendor-zumer-snapdom-yq9vlCKr.js","assets/vendor-html-to-image-BDMm2v6d.js","assets/main-qSeeJRW1.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,t}from"./runtimeConfig-CkGIFPXV.js";import{o as n}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */var r=`true`,i=`false`,a=r===`true`,o=i===`true`;function s(e={}){let{immediate:t=!1,onNeedReload:r,onNeedRefresh:i,onOfflineReady:s,onRegistered:c,onRegisteredSW:l,onRegisterError:u}=e,d,f,p,m=async(e=!0)=>{await f,a||p?.()};async function h(){if(`serviceWorker`in navigator){if(d=await n(async()=>{let{Workbox:e}=await import(`./vendor-workbox-window-qnW0Nbv7.js`).then(e=>e.t);return{Workbox:e}},__vite__mapDeps([0,1])).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{u?.(e)}),!d)return;if(p=()=>{d?.messageSkipWaiting()},!o)if(a)d.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(r?r():window.location.reload())}),d.addEventListener(`installed`,e=>{e.isUpdate||s?.()});else{let e=!1,t=()=>{e=!0,d?.addEventListener(`controlling`,e=>{e.isUpdate&&(r?r():window.location.reload())}),i?.()};d.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&s?.():n.isExternal?t():!e&&s?.():n.isUpdate||s?.()}),d.addEventListener(`waiting`,t)}d.register({immediate:t}).then(e=>{l?l(`/sw.js`,e):c?.(e)}).catch(e=>{u?.(e)})}}return f=h(),m}window.__OPENCHAMBER_RUNTIME_APIS__=t();var c=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches,l=(()=>{let e=new URLSearchParams(window.location.search).get(`surface`);if(e===`mobile`)return`mobile`;if(e===`desktop`)return`desktop`;let t=Math.min(window.innerWidth||0,window.screen?.width||window.innerWidth||0),n=navigator.maxTouchPoints||0;return t>0&&t<=760&&(n>0||c())?`mobile`:`desktop`})();window.__OPENCHAMBER_SURFACE__=l;var u=()=>!(!(`serviceWorker`in navigator)||!window.isSecureContext||window.location.protocol!==`http:`&&window.location.protocol!==`https:`||document.prerendering||String(document.visibilityState)===`prerender`),d=e=>{let t=!1,n=()=>{t||u()&&(t=!0,e())},r=()=>{setTimeout(n,0)};document.readyState===`complete`?r():window.addEventListener(`load`,r,{once:!0}),(document.prerendering||String(document.visibilityState)===`prerender`)&&document.addEventListener(`visibilitychange`,n,{once:!0})},f=()=>{d(()=>{try{s({onRegisterError(e){console.warn(`[PWA] service worker registration skipped:`,e)}})}catch(e){console.warn(`[PWA] service worker registration skipped:`,e)}})},p=`openchamber.dev.module-reload`,m=(e,t)=>{console.error(`[openchamber] failed to load ${t}:`,e)};l===`mobile`?n(async()=>{let{renderMobileApp:e}=await import(`./renderMobileApp-DvPGytV9.js`);return{renderMobileApp:e}},__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112])).then(({renderMobileApp:e})=>{try{sessionStorage.removeItem(p)}catch{}e(window.__OPENCHAMBER_RUNTIME_APIS__??t())}).catch(e=>m(e,`renderMobileApp`)):e().then(()=>n(()=>import(`./main-C5K1b2p3.js`),__vite__mapDeps([113,1,3,4,5,6,7,8,9,10,11,12,48,13,14,15,38,92,50,18,19,20,21,22,23,24,25,26,27,29,30,31,32,33,34,35,37,39,28,40,41,42,43,44,46,47,49,45,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,17,94,95,96,97,98,99,114,100,101,102,103,104,115,116,117,118,119,120,112]))).then(()=>{try{sessionStorage.removeItem(p)}catch{}}).catch(e=>m(e,`desktop main`)),f();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{i as t}from"./runtime-switch-BJM2k_uH.js";import{n}from"./runtime-fetch-CiqQd__Y.js";import{d as r,f as i}from"./persistence-CwHY3fDg.js";import{Ct as a,Nt as o}from"./platform-Bxaalnc8.js";import{n as s}from"./vendor-react-DLPElpoQ.js";import{s as c}from"./vendor-tanstack-react-query-D7pys_c9.js";import{to as l}from"./useMobileNavigationStore-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{i as t}from"./runtime-switch-BJM2k_uH.js";import{n}from"./runtime-fetch-CiqQd__Y.js";import{d as r,f as i}from"./persistence-CwHY3fDg.js";import{Ct as a,Nt as o}from"./platform-Bxaalnc8.js";import{n as s}from"./vendor-react-DLPElpoQ.js";import{s as c}from"./vendor-tanstack-react-query-D7pys_c9.js";import{to as l}from"./useMobileNavigationStore-Bww4SOiv.js";var u=e({mcpConfigsQueryOptions:()=>v,mcpStatusQueryOptions:()=>y,normalizeMcpDirectory:()=>f,readMcpConfigsSnapshot:()=>S,readMcpStatusSnapshot:()=>C,refreshMcpConfigsQuery:()=>w,refreshMcpStatusQuery:()=>T,resolveMcpConfigQueryDirectory:()=>p,useMcpConfigsQuery:()=>b,useMcpStatusQuery:()=>x}),d=s(),f=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.replace(/\\/g,`/`);return n.length>1?n.replace(/\/+$/,``):n},p=()=>{let e=l.getState().getActiveProject?.();return f(e?.path)??f(o.getDirectory())},m=(e,n=t())=>i.mcp.configs(e,n),h=(e,n=t())=>i.mcp.status(e,n),g=e=>e?o.getScopedApiClient(e):o.getApiClient(),_=e=>e?{location:{directory:e}}:void 0,v=(e=p(),r=t())=>{let i=f(e);return{queryKey:m(i,r),queryFn:async({signal:e})=>{let t=i?`?directory=${encodeURIComponent(i)}`:``,r=await n(`/api/config/mcp${t}`,{headers:i?{"x-opencode-directory":i}:void 0,signal:e});if(!r.ok)throw Error(`Failed to load MCP configs`);let a=await r.json();if(!Array.isArray(a))throw Error(`Invalid MCP configs response`);return a},staleTime:5e3,retry:2}},y=(e,n=t())=>{let r=f(e);return{queryKey:h(r,n),queryFn:async()=>{let e=await g(r).mcp.list(_(r));if(!Array.isArray(e.data))throw Error(`v2 mcp.list returned no data`);let t={};for(let n of e.data)n?.name&&(t[n.name]=n.status);return t},staleTime:2e3,retry:1}},b=(e,t)=>{let n=(0,d.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let i=r,a=l(E),s,u;if(n[2]!==a||n[3]!==e){let t=e===void 0?f(a)??f(o.getDirectory()):f(e);u=c,s=v(t),n[2]=a,n[3]=e,n[4]=s,n[5]=u}else s=n[4],u=n[5];let p;return n[6]!==i.enabled||n[7]!==s?(p={...s,enabled:i.enabled},n[6]=i.enabled,n[7]=s,n[8]=p):p=n[8],u(p)},x=(e,t)=>{let n=(0,d.c)(10),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let i=r,o=a(D),s=e===void 0?o:e,l,u,p;if(n[2]!==i.enabled||n[3]!==s){let e=f(s);l=i.enabled!==!1&&!!e,p=c,u=y(e),n[2]=i.enabled,n[3]=s,n[4]=l,n[5]=u,n[6]=p}else l=n[4],u=n[5],p=n[6];let m;return n[7]!==l||n[8]!==u?(m={...u,enabled:l},n[7]=l,n[8]=u,n[9]=m):m=n[9],p(m)},S=(e=r,n=p(),i=t())=>e.getQueryData(m(f(n),i))??[],C=(e=r,n,i=t())=>e.getQueryData(h(f(n),i))??{},w=async(e,n,r)=>{let i=f(n);return t()===r?e.fetchQuery({...v(i,r),staleTime:0}):S(e,i,r)},T=async(e,n,r)=>{let i=f(n);return t()===r?e.fetchQuery({...y(i,r),staleTime:0}):C(e,i,r)};function E(e){return e.getActiveProject?.()?.path??null}function D(e){return e.currentDirectory}export{w as a,b as c,C as i,x as l,f as n,T as o,S as r,p as s,u as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-
|
|
2
|
-
import{t as e}from"./runtimeConfig-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-knc9ALFK.js","assets/rolldown-runtime-C0FnF6B9.js","assets/persistence-CwHY3fDg.js","assets/runtime-switch-BJM2k_uH.js","assets/runtime-auth-D66yq6ie.js","assets/runtime-fetch-CiqQd__Y.js","assets/vendor-zustand-DzRqcymP.js","assets/vendor-base-ui-CnHfUmDN.js","assets/useUIStore-DNkuudYO.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/platform-Bxaalnc8.js","assets/vendor-opencode-client-MF2GBrFx.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/vendor-reactuses-core-Dq5ocTF8.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-CcOoDLE1.js","assets/store-l_X_jQNz.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/useMobileNavigationStore-Bww4SOiv.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/vendor-sonner-DVzioF3d.js","assets/useAssistantUIStore-CXj8c_tt.js","assets/vendor-zod-Dzk5kdUU.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/Icon-BE2hkaYc.js","assets/useAppFontEffects-CU_CeyJe.js","assets/desktopHosts-BsbquPqS.js","assets/desktopRelayRestore-yyvjztgj.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-pierre-diffs-DX7XTPG3.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/dialog-Csvrld51.js","assets/AgentAvatar-DGyF86jy.js","assets/gitApi-DJiNTnOw.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-ClpG1g5k.js","assets/input-C6Y7mytw.js","assets/tooltip-CBHR50fA.js","assets/OverlayScrollbar-CVgW_Z9B.js","assets/textarea-DUjc3iDJ.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup--P_vAP6v.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/useThemeSystem-DMzWVJaW.js","assets/dropdown-menu.styles-ayLWk2gf.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-DM5h1i18.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/sessionChangeSummary-DYAsA6Bi.js","assets/insertionBoundaries-BZ4y7_dO.js","assets/fileMentionTouchSelection-DGcKhwNg.js","assets/appThemeRegistry-Dh7evuFT.js","assets/MarkdownRenderer-CJ5t5GCJ.js","assets/markdownHeightCache-DhLhFBWX.js","assets/dualLimitLru-D8Sphgua.js","assets/url-CEnO45_n.js","assets/markdown-worker-bS5OgGO3.js","assets/useEffectiveDirectory-Cn5YmSaO.js","assets/FadeInOnReveal-B_a083XJ.js","assets/imageSource-BpUsiwFd.js","assets/relay-image-stream-D2XooXKZ.js","assets/useWorkerHighlightedLines-DOkM0xy4.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-CKKp4p3Y.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/vendor-legendapp-list-WE32lwNk.js","assets/useFontPreferences-DGbTdGy3.js","assets/terminalApi-DSJOXNRQ.js","assets/useDesktopWindowControlsLayout-D5pQxhEz.js","assets/src-Cp_AK_QO.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./runtimeConfig-CkGIFPXV.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderElectronMiniChatApp:e}=await import(`./renderElectronMiniChatApp-knc9ALFK.js`);return{renderElectronMiniChatApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89])).then(({renderElectronMiniChatApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-
|
|
2
|
-
import{t as e}from"./runtimeConfig-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-DvPGytV9.js","assets/rolldown-runtime-C0FnF6B9.js","assets/runtime-auth-D66yq6ie.js","assets/runtime-switch-BJM2k_uH.js","assets/runtime-fetch-CiqQd__Y.js","assets/persistence-CwHY3fDg.js","assets/vendor-zustand-DzRqcymP.js","assets/vendor-base-ui-CnHfUmDN.js","assets/useUIStore-DNkuudYO.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/platform-Bxaalnc8.js","assets/vendor-opencode-client-MF2GBrFx.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/capgoAdapter-DCowZ2ab.js","assets/types-BuiqMmh_.js","assets/vendor-pierre-diffs-DX7XTPG3.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/vendor-sonner-DVzioF3d.js","assets/vendor-reactuses-core-Dq5ocTF8.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/button-CcOoDLE1.js","assets/store-l_X_jQNz.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/MobileShareBridge-Brsf5H1u.js","assets/MobileDetailNavigation-BOuvF4sv.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/useMobileNavigationStore-Bww4SOiv.js","assets/useAssistantUIStore-CXj8c_tt.js","assets/vendor-zod-Dzk5kdUU.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/Icon-BE2hkaYc.js","assets/dialog-Csvrld51.js","assets/AgentAvatar-DGyF86jy.js","assets/gitApi-DJiNTnOw.js","assets/useAppFontEffects-CU_CeyJe.js","assets/desktopHosts-BsbquPqS.js","assets/desktopRelayRestore-yyvjztgj.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-ClpG1g5k.js","assets/input-C6Y7mytw.js","assets/tooltip-CBHR50fA.js","assets/OverlayScrollbar-CVgW_Z9B.js","assets/textarea-DUjc3iDJ.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup--P_vAP6v.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/useThemeSystem-DMzWVJaW.js","assets/dropdown-menu.styles-ayLWk2gf.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-DM5h1i18.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/sessionChangeSummary-DYAsA6Bi.js","assets/insertionBoundaries-BZ4y7_dO.js","assets/fileMentionTouchSelection-DGcKhwNg.js","assets/appThemeRegistry-Dh7evuFT.js","assets/MarkdownRenderer-CJ5t5GCJ.js","assets/markdownHeightCache-DhLhFBWX.js","assets/dualLimitLru-D8Sphgua.js","assets/url-CEnO45_n.js","assets/markdown-worker-bS5OgGO3.js","assets/useEffectiveDirectory-Cn5YmSaO.js","assets/FadeInOnReveal-B_a083XJ.js","assets/imageSource-BpUsiwFd.js","assets/relay-image-stream-D2XooXKZ.js","assets/useWorkerHighlightedLines-DOkM0xy4.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-CKKp4p3Y.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/vendor-legendapp-list-WE32lwNk.js","assets/useFontPreferences-DGbTdGy3.js","assets/terminalApi-DSJOXNRQ.js","assets/MobileTabPageHeader-BLlFC_jN.js","assets/mcpQueries-om4qg52L.js","assets/collapsible-CSa0Ndgm.js","assets/vendor-codemirror-commands-C9DCaJ0C.js","assets/vendor-codemirror-search-D2SOgzph.js","assets/vendor-replit-codemirror-vim-CEibx3EP.js","assets/projectActions-CWvNGKfA.js","assets/runtimeEndpointReset-BFrS_Yci.js","assets/sessionLookup-Bc8f5Scn.js","assets/context-menu-DoTwmMb5.js","assets/vendor-cron-parser-CCD11YFT.js","assets/runtimeEndpointReset-D_vfNOQz.css","assets/SettingsView-LnqgjCmk.js","assets/vendor-yaml-C9KlJAlj.js","assets/vendor-qrcode-DAuVxiQR.js","assets/vendor-dijkstrajs-DztKuCwY.js","assets/AssistantView-CWviBCAP.js","assets/assistant-attachment-cache-sG8YQsVs.js","assets/fileQueries-B0hhXD86.js","assets/src-Cp_AK_QO.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./runtimeConfig-CkGIFPXV.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderMobileApp:e}=await import(`./renderMobileApp-DvPGytV9.js`);return{renderMobileApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{rn as t}from"./persistence-CwHY3fDg.js";import{a as n,r}from"./vendor-zustand-DzRqcymP.js";import{nt as i,rt as a}from"./vendor-base-ui-CnHfUmDN.js";import{Ct as o,Ln as s,Nt as c,Un as l}from"./platform-Bxaalnc8.js";import{n as u}from"./useUIStore-DNkuudYO.js";import{n as d}from"./vendor-react-DLPElpoQ.js";import{n as f}from"./vendor-reactuses-core-Dq5ocTF8.js";import{f as p,i as m,r as h,t as g,y as _}from"./button-CcOoDLE1.js";import{Dr as v,Ea as y,Qn as b,Zn as x,d as S,dr as C,jr as w,pa as T,to as E,tr as D,u as O,wa as k}from"./useMobileNavigationStore-DYKC2swj.js";import{n as A}from"./Icon-BE2hkaYc.js";import{n as j}from"./gitApi-DpwH7xTg.js";import{A as ee,D as te,O as M,S as ne,_ as re,a as N,b as ie,f as ae,g as P,h as oe,i as F,m as se,n as ce,v as I,x as le,y as L}from"./projectMeta-BhKfv5cj.js";import{t as R}from"./input-C6Y7mytw.js";import{i as z,n as B,t as V}from"./tooltip-CBHR50fA.js";import{o as ue}from"./OverlayScrollbar-CVgW_Z9B.js";import{n as H}from"./useRuntimeAPIs-DSLXJybW.js";import{r as de,t as U}from"./textarea-DUjc3iDJ.js";import{D as fe,a as W,b as G,c as K,f as q,h as J,l as Y,o as X,p as pe,r as me,w as he,y as ge}from"./insertionBoundaries-Cst5Z6Cd.js";import{n as _e,r as ve,t as ye}from"./collapsible-CSa0Ndgm.js";var Z=e(a(),1),be=d(),xe=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Se=/^g[1-9]\d*$/,Q=(e,t,n,r,i)=>{if(!xe.test(e)||t!==void 0&&!Se.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},Ce=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return Q(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Se.test(e)?Q(n,e,r,i,void 0):Q(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Q(n,void 0,i,a,o):Q(n,r,i,a,o)},we=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},Te=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};l(e.id,n),S.getState().markSessionAsOpenChamberCreated(e.id),v.getState().upsertSession(i);try{s().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},je=()=>{let e=E.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let l=s.path,u=await j(l)&&t.isolateRuns!==!1,d=Ee(n),f=u?await ae(l):void 0,p=u?await Y(l):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),x=r.length>1?`g${e+1}`:void 0,w=_>1?Oe(d,`${y}/${v}`):Oe(d,y),T=x?`${x}/${w}`:w,E=we({groupSlug:d,runGroup:x,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await c.withDirectory(l,()=>c.createSession({title:E}));Ae(e,l),m.push({sessionId:e.id,worktreePath:l,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await K(s,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await b(s)&&await C(e.path);let r=await c.withDirectory(e.path,()=>c.createSession({title:E}));Ae(r,e.path),S.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&D(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await O({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,be.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=h(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(M,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(A,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Ie=e=>{let t=(0,be.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:d,dropdownSide:f,dropdownClassName:m,containerClassName:_,triggerIcon:v}=e,b=c===void 0||c,x=f===void 0?`top`:f,{t:S}=p(),C=T(Le),w=T(Re),E=u(ze),D=u(Be),{favoriteModelsList:O,recentModelsList:k}=te(),j=u(Ve),ee=u(He),[M,N]=Z.useState(!1),[ae,P]=Z.useState(``),[F,ce]=Z.useState(null),I=Z.useRef(null),L=Z.useRef(null),R=l===1,z=l===void 0||n.length<l||R,B;if(t[0]!==n){B=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;B.set(t,(B.get(t)||0)+1)}t[0]=n,t[1]=B}else B=t[1];let V=B,ue;t[2]===n?ue=t[3]:(ue=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=ue);let H=ue,de,U;t[4]!==x||t[5]!==M?(de=()=>{if(!M||!L.current)return;let e=L.current.getBoundingClientRect();if(x===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ce(Math.max(160,Math.min(320,t)));return}let t=L.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ce(Math.max(150,Math.min(300,r)))},U=[x,M],t[4]=x,t[5]=M,t[6]=de,t[7]=U):(de=t[6],U=t[7]),Z.useEffect(de,U);let fe,W;t[8]!==z||t[9]!==M?(fe=()=>{!z&&M&&(N(!1),P(``))},W=[z,M],t[8]=z,t[9]=M,t[10]=fe,t[11]=W):(fe=t[10],W=t[11]),Z.useEffect(fe,W);let G,K;t[12]===M?(G=t[13],K=t[14]):(G=()=>{if(!M)return;let e=e=>{I.current&&!I.current.contains(e.target)&&(N(!1),P(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},K=[M],t[12]=M,t[13]=G,t[14]=K),Z.useEffect(G,K);let q;t[15]!==R||t[16]!==r||t[17]!==a||t[18]!==n.length?(q=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:y(e.model,e.modelID)||e.modelID,instanceId:Pe()};R&&n.length>0&&a?a(0,t):r(t),R&&(N(!1),P(``))},t[15]=R,t[16]=r,t[17]=a,t[18]=n.length,t[19]=q):q=t[19];let J=q,Y;t[20]===S?Y=t[21]:(Y=S(`multirun.modelMultiSelect.search.placeholder`),t[20]=S,t[21]=Y);let X;t[22]===S?X=t[23]:(X=S(`multirun.modelMultiSelect.search.noResults`),t[22]=S,t[23]=X);let pe;t[24]===S?pe=t[25]:(pe=S(`multirun.modelMultiSelect.sections.favorites`),t[24]=S,t[25]=pe);let me;t[26]===S?me=t[27]:(me=S(`multirun.modelMultiSelect.sections.recent`),t[26]=S,t[27]=me);let he;t[28]===S?he=t[29]:(he=S(`multirun.modelMultiSelect.keyboard.hint`),t[28]=S,t[29]=he);let ge;t[30]===S?ge=t[31]:(ge=S(`settings.agents.modelSelector.actions.favorite`),t[30]=S,t[31]=ge);let _e;t[32]===S?_e=t[33]:(_e=S(`settings.agents.modelSelector.actions.unfavorite`),t[32]=S,t[33]=_e);let ve;t[34]===S?ve=t[35]:(ve=S(`chat.modelControls.provider`),t[34]=S,t[35]=ve);let ye;t[36]===S?ye=t[37]:(ye=S(`chat.modelControls.capabilities`),t[36]=S,t[37]=ye);let xe;t[38]===S?xe=t[39]:(xe=S(`chat.modelControls.capability.toolCalling`),t[38]=S,t[39]=xe);let Se;t[40]===S?Se=t[41]:(Se=S(`chat.modelControls.capability.reasoning`),t[40]=S,t[41]=Se);let Q;t[42]===S?Q=t[43]:(Q=S(`chat.modelControls.modality.image`),t[42]=S,t[43]=Q);let Ce;t[44]===S?Ce=t[45]:(Ce=S(`chat.modelControls.modality.video`),t[44]=S,t[45]=Ce);let we;t[46]===S?we=t[47]:(we=S(`chat.modelControls.modality.audio`),t[46]=S,t[47]=we);let Te;t[48]===S?Te=t[49]:(Te=S(`chat.modelControls.costPerMillion`),t[48]=S,t[49]=Te);let Ee;t[50]===S?Ee=t[51]:(Ee=S(`chat.modelControls.costInput`),t[50]=S,t[51]=Ee);let De;t[52]===S?De=t[53]:(De=S(`chat.modelControls.costOutput`),t[52]=S,t[53]=De);let Oe;t[54]!==Y||t[55]!==X||t[56]!==pe||t[57]!==me||t[58]!==he||t[59]!==ge||t[60]!==_e||t[61]!==ve||t[62]!==ye||t[63]!==xe||t[64]!==Se||t[65]!==Q||t[66]!==Ce||t[67]!==we||t[68]!==Te||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:Y,noResults:X,favorites:pe,recent:me,keyboardHint:he,favorite:ge,unfavorite:_e,provider:ve,capabilities:ye,capabilityToolCalling:xe,capabilityReasoning:Se,modalityImage:Q,modalityVideo:Ce,modalityAudio:we,costPerMillion:Te,costInput:Ee,costOutput:De},t[54]=Y,t[55]=X,t[56]=pe,t[57]=me,t[58]=he,t[59]=ge,t[60]=_e,t[61]=ve,t[62]=ye,t[63]=xe,t[64]=Se,t[65]=Q,t[66]=Ce,t[67]=we,t[68]=Te,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===_?Ae=t[73]:(Ae=h(`relative`,_),t[72]=_,t[73]=Ae);let je;t[74]===d?je=t[75]:(je=h(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),t[74]=d,t[75]=je);let Me=!z,Ie;t[76]===M?Ie=t[77]:(Ie=()=>{N(!M)},t[76]=M,t[77]=Ie);let We;t[78]===v?We=t[79]:(We=v??(0,$.jsx)(A,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=v,t[79]=We);let Ge;t[80]!==s||t[81]!==S?(Ge=s??S(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=S,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(g,{ref:L,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==F||t[90]!==z||t[91]!==m||t[92]!==x||t[93]!==O||t[94]!==w||t[95]!==J||t[96]!==j||t[97]!==D||t[98]!==M||t[99]!==ke||t[100]!==V||t[101]!==ee||t[102]!==C||t[103]!==k||t[104]!==ae||t[105]!==E?(qe=M?(0,$.jsx)(`div`,{className:h(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,x===`top`?`bottom-full mb-1`:`top-full mt-1`,m),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(ne,{providers:C,providerOrder:ee,favoriteModels:O,recentModels:k,getMetadata:w,hiddenModels:j,searchQuery:ae,onSearchQueryChange:P,onSelect:J,labels:ke,selectionCount:e=>V.get(`${e.providerID}:${e.modelID}`)||0,disabled:!z,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:F?`${F}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:M,isFavorite:e=>D(e.providerID,e.modelID),onToggleFavorite:e=>E(e.providerID,e.modelID),onEscape:()=>{N(!1),P(``)}})}):null,t[89]=F,t[90]=z,t[91]=m,t[92]=x,t[93]=O,t[94]=w,t[95]=J,t[96]=j,t[97]=D,t[98]=M,t[99]=ke,t[100]=V,t[101]=ee,t[102]=C,t[103]=k,t[104]=ae,t[105]=E,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:I,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==H||t[112]!==V||t[113]!==i||t[114]!==a||t[115]!==C||t[116]!==n||t[117]!==b||t[118]!==S?(Ye=b&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=V.get(n)||1,o=H(e),s=C.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(se,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(ie,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(A,{name:`brain-ai-3`,className:h(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(le,{placeholder:S(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?S(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(oe,{fitContent:!0,children:[(0,$.jsx)(re,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:S(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=H,t[112]=V,t[113]=i,t[114]=a,t[115]=C,t[116]=n,t[117]=b,t[118]=S,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==S?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?S(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):S(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=S,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(re,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,be.c)(30),{git:n}=H(),r=q(e),i=G(e),a=J(e),o=pe(e),s=ge(Ye),c=ge(Je),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),Z.useEffect(l,u);let d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=d):d=t[12];let f=r?.all,p;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==f?(p=[e,n,i,f,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=f,t[18]=p):p=t[18],Z.useEffect(d,p);let m=a||i===!0&&o,h;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],h=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),h=e}let g=h,_;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],_=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),_=e}let v=_,y;bb2:{if(!e){y=null;break bb2}if(i!==null){y=i;break bb2}if(m){y=null;break bb2}y=r?.all?!0:null}let b=y,x;return t[25]!==b||t[26]!==m||t[27]!==g||t[28]!==v?(x={localBranches:g,remoteBranches:v,isLoading:m,isGitRepository:b},t[25]=b,t[26]=m,t[27]=g,t[28]=v,t[29]=x):x=t[29],x}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=p(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=Z.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return Z.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await ae(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(W),{sourceBranch:o,shouldClearSavedSourceBranch:s}=X({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(W),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(se,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(ie,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(le,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(oe,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(P,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(re,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(L,{}),c.length>0&&(0,$.jsxs)(P,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(re,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,be.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=p(),l=T(Qe),u=T($e),d=T(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let m=f,g;t[2]===m?g=t[3]:(g=m.filter(tt),t[2]=m,t[3]=g);let _=g,v,y;t[4]!==m.length||t[5]!==u?(v=()=>{m.length===0&&u()},y=[m.length,u],t[4]=m.length,t[5]=u,t[6]=v,t[7]=y):(v=t[6],y=t[7]),Z.useEffect(v,y);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==_||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&_.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&_.some(e=>e.name===t)){r(t);return}let i=_[0]?.name;i&&r(i)},x=[d,a,r,_,n],t[8]=d,t[9]=a,t[10]=r,t[11]=_,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),Z.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=h(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let E;t[19]===w?E=t[20]:(E=(0,$.jsx)(le,{placeholder:w}),t[19]=w,t[20]=E);let D;t[21]!==o||t[22]!==C||t[23]!==E?(D=(0,$.jsx)(ie,{id:o,size:`lg`,className:C,children:E}),t[21]=o,t[22]=C,t[23]=E,t[24]=D):D=t[24];let O;t[25]===_?O=t[26]:(O=_.length>0&&(0,$.jsx)(P,{children:_.map(nt)}),t[25]=_,t[26]=O);let k;t[27]!==s||t[28]!==O?(k=(0,$.jsx)(oe,{fitContent:!0,portalToBody:s,children:O}),t[27]=s,t[28]=O,t[29]=k):k=t[29];let A;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==D||t[34]!==k?(A=(0,$.jsxs)(se,{value:S,onValueChange:r,disabled:a,children:[D,k]}),t[30]=a,t[31]=r,t[32]=S,t[33]=D,t[34]=k,t[35]=A):A=t[35],A};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return k(e.mode)}function nt(e){return(0,$.jsx)(re,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,be.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(A,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(V,{children:[r,(0,$.jsx)(B,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,be.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},st=e=>{let t=m(e.path),n=e.icon?F[e.icon]:null,r=e.color?ce[e.color]:void 0,i=(0,$.jsx)(A,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(N,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=p(),[s,c]=Z.useState(``),[l,u]=Z.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,m]=Z.useState(``),[v,y]=Z.useState([]),[b,C]=Z.useState(!1),[T,D]=Z.useState([]),[O,k]=Z.useState(!1),[j,te]=Z.useState(!1),[M,ne]=Z.useState(!0),N=Z.useRef(null),ae=o(e=>e.currentDirectory??null),P=Z.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),F=E(e=>e.activeProjectId),ce=E(e=>e.setActiveProjectIdOnly),I=E(e=>e.projects),[L,H]=Z.useState(()=>F??null);Z.useEffect(()=>{if(F){H(F);return}!L&&I.length>0&&H(I[0].id)},[F,I,L]);let U=Z.useMemo(()=>L?I.find(e=>e.id===L)??null:null,[I,L]),fe=U?.path??ae,W=f(e=>{H(e),e!==F&&ce(e)}),G=Z.useMemo(()=>{if(U?.path)return{id:U.id,path:U.path};let e=ae??P;return e?{id:`path:${e}`,path:e}:null},[U,ae,P]),[K]=Z.useState(()=>typeof window<`u`&&t()),q=Z.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=ue(),Y=Z.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__OPENCHAMBER_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),X=Z.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),pe=Z.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),me=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await _()}),he=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),ge=!!r;Z.useEffect(()=>{if(ge)return window.addEventListener(`keydown`,he,!0),()=>window.removeEventListener(`keydown`,he,!0)},[ge]);let[be,xe]=Z.useState(``),{isLoading:Se,isGitRepository:Q}=We(fe),Ce=Z.useRef(!1),we=Q===!0,Te=we&&M;Z.useEffect(()=>{if(Q===!1){Ce.current=!0,ne(!1);return}Q===!0&&Ce.current&&(Ce.current=!1,ne(!0))},[Q]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);Z.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),Z.useEffect(()=>{if(!G)return;let e=!1;return te(!0),(async()=>{try{let t=await x(G);e||D(t)}catch{}finally{e||te(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>rt){w.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});y(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),w.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&w.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),N.current&&(N.current.value=``)},Fe=e=>{y(t=>t.filter(t=>t.id!==e))},Ie=Z.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){C(!0),Oe();try{L&&L!==F&&ce(L);let e=v.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=T.filter(e=>e.trim().length>0),i=t.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Te?be:void 0,isolateRuns:Te,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&S.getState().setCurrentSession(o.firstSessionId),n?.())}finally{C(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&fe&&!Se&&(Q===!1||!Te||be)),ze=T.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:me,className:h(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,X,pe),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(A,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(B,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(de,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),I.length>0?(0,$.jsxs)(se,{value:L??void 0,onValueChange:W,children:[(0,$.jsx)(ie,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:U?(0,$.jsx)(le,{children:st(U)}):(0,$.jsx)(le,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(oe,{fitContent:!0,children:I.map(e=>(0,$.jsx)(re,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:fe,value:be,onChange:xe,disabled:!Te,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(ee,{checked:M,onChange:ne,disabled:!we,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:m,id:`multirun-agent`})]})]}),(0,$.jsxs)(ye,{open:O,onOpenChange:k,children:[(0,$.jsxs)(ve,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(A,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(A,{name:`arrow-down-s`,className:h(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,O&&`rotate-180`)})]}),(0,$.jsx)(_e,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:j?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[T.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(R,{value:e,onChange:e=>{let n=[...T];n[t]=e.target.value,D(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>D(T.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(A,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>D([...T,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(A,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:N,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>N.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(A,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(B,{children:a(`multirun.launcher.attachments.tooltip`)})]}),v.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(A,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(A,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(A,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(A,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Te&&Q!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(A,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(g,{type:`submit`,size:`sm`,disabled:!Re||b,children:b?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,be.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=p(),[c,l]=Z.useState(!1),[u,d]=Z.useState(``),[m,h]=Z.useState(!1),[g,_]=Z.useState(``),v=Z.useRef(null),y=Z.useRef(null),b=Z.useRef(null),x;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(x=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=x):x=t[3];let S=f(x),C;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(C=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=C):C=t[7];let w=f(C),T;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(T=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=T):T=t[11];let E=f(T),D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{rn as t}from"./persistence-CwHY3fDg.js";import{a as n,r}from"./vendor-zustand-DzRqcymP.js";import{nt as i,rt as a}from"./vendor-base-ui-CnHfUmDN.js";import{Ct as o,Ln as s,Nt as c,Un as l}from"./platform-Bxaalnc8.js";import{n as u}from"./useUIStore-DNkuudYO.js";import{n as d}from"./vendor-react-DLPElpoQ.js";import{n as f}from"./vendor-reactuses-core-Dq5ocTF8.js";import{f as p,i as m,r as h,t as g,y as _}from"./button-CcOoDLE1.js";import{Dr as v,Ea as y,Qn as b,Zn as x,d as S,dr as C,jr as w,pa as T,to as E,tr as D,u as O,wa as k}from"./useMobileNavigationStore-Bww4SOiv.js";import{n as A}from"./Icon-BE2hkaYc.js";import{n as j}from"./gitApi-DJiNTnOw.js";import{A as ee,D as te,O as M,S as ne,_ as re,a as N,b as ie,f as ae,g as P,h as oe,i as F,m as se,n as ce,v as I,x as le,y as L}from"./projectMeta-ClpG1g5k.js";import{t as R}from"./input-C6Y7mytw.js";import{i as z,n as B,t as V}from"./tooltip-CBHR50fA.js";import{o as ue}from"./OverlayScrollbar-CVgW_Z9B.js";import{n as H}from"./useRuntimeAPIs-DSLXJybW.js";import{r as de,t as U}from"./textarea-DUjc3iDJ.js";import{D as fe,a as W,b as G,c as K,f as q,h as J,l as Y,o as X,p as pe,r as me,w as he,y as ge}from"./insertionBoundaries-BZ4y7_dO.js";import{n as _e,r as ve,t as ye}from"./collapsible-CSa0Ndgm.js";var Z=e(a(),1),be=d(),xe=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Se=/^g[1-9]\d*$/,Q=(e,t,n,r,i)=>{if(!xe.test(e)||t!==void 0&&!Se.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},Ce=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return Q(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Se.test(e)?Q(n,e,r,i,void 0):Q(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Q(n,void 0,i,a,o):Q(n,r,i,a,o)},we=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},Te=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};l(e.id,n),S.getState().markSessionAsOpenChamberCreated(e.id),v.getState().upsertSession(i);try{s().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},je=()=>{let e=E.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let l=s.path,u=await j(l)&&t.isolateRuns!==!1,d=Ee(n),f=u?await ae(l):void 0,p=u?await Y(l):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),x=r.length>1?`g${e+1}`:void 0,w=_>1?Oe(d,`${y}/${v}`):Oe(d,y),T=x?`${x}/${w}`:w,E=we({groupSlug:d,runGroup:x,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await c.withDirectory(l,()=>c.createSession({title:E}));Ae(e,l),m.push({sessionId:e.id,worktreePath:l,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await K(s,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await b(s)&&await C(e.path);let r=await c.withDirectory(e.path,()=>c.createSession({title:E}));Ae(r,e.path),S.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&D(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await O({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,be.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=h(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(M,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(A,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Ie=e=>{let t=(0,be.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:d,dropdownSide:f,dropdownClassName:m,containerClassName:_,triggerIcon:v}=e,b=c===void 0||c,x=f===void 0?`top`:f,{t:S}=p(),C=T(Le),w=T(Re),E=u(ze),D=u(Be),{favoriteModelsList:O,recentModelsList:k}=te(),j=u(Ve),ee=u(He),[M,N]=Z.useState(!1),[ae,P]=Z.useState(``),[F,ce]=Z.useState(null),I=Z.useRef(null),L=Z.useRef(null),R=l===1,z=l===void 0||n.length<l||R,B;if(t[0]!==n){B=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;B.set(t,(B.get(t)||0)+1)}t[0]=n,t[1]=B}else B=t[1];let V=B,ue;t[2]===n?ue=t[3]:(ue=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=ue);let H=ue,de,U;t[4]!==x||t[5]!==M?(de=()=>{if(!M||!L.current)return;let e=L.current.getBoundingClientRect();if(x===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ce(Math.max(160,Math.min(320,t)));return}let t=L.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ce(Math.max(150,Math.min(300,r)))},U=[x,M],t[4]=x,t[5]=M,t[6]=de,t[7]=U):(de=t[6],U=t[7]),Z.useEffect(de,U);let fe,W;t[8]!==z||t[9]!==M?(fe=()=>{!z&&M&&(N(!1),P(``))},W=[z,M],t[8]=z,t[9]=M,t[10]=fe,t[11]=W):(fe=t[10],W=t[11]),Z.useEffect(fe,W);let G,K;t[12]===M?(G=t[13],K=t[14]):(G=()=>{if(!M)return;let e=e=>{I.current&&!I.current.contains(e.target)&&(N(!1),P(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},K=[M],t[12]=M,t[13]=G,t[14]=K),Z.useEffect(G,K);let q;t[15]!==R||t[16]!==r||t[17]!==a||t[18]!==n.length?(q=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:y(e.model,e.modelID)||e.modelID,instanceId:Pe()};R&&n.length>0&&a?a(0,t):r(t),R&&(N(!1),P(``))},t[15]=R,t[16]=r,t[17]=a,t[18]=n.length,t[19]=q):q=t[19];let J=q,Y;t[20]===S?Y=t[21]:(Y=S(`multirun.modelMultiSelect.search.placeholder`),t[20]=S,t[21]=Y);let X;t[22]===S?X=t[23]:(X=S(`multirun.modelMultiSelect.search.noResults`),t[22]=S,t[23]=X);let pe;t[24]===S?pe=t[25]:(pe=S(`multirun.modelMultiSelect.sections.favorites`),t[24]=S,t[25]=pe);let me;t[26]===S?me=t[27]:(me=S(`multirun.modelMultiSelect.sections.recent`),t[26]=S,t[27]=me);let he;t[28]===S?he=t[29]:(he=S(`multirun.modelMultiSelect.keyboard.hint`),t[28]=S,t[29]=he);let ge;t[30]===S?ge=t[31]:(ge=S(`settings.agents.modelSelector.actions.favorite`),t[30]=S,t[31]=ge);let _e;t[32]===S?_e=t[33]:(_e=S(`settings.agents.modelSelector.actions.unfavorite`),t[32]=S,t[33]=_e);let ve;t[34]===S?ve=t[35]:(ve=S(`chat.modelControls.provider`),t[34]=S,t[35]=ve);let ye;t[36]===S?ye=t[37]:(ye=S(`chat.modelControls.capabilities`),t[36]=S,t[37]=ye);let xe;t[38]===S?xe=t[39]:(xe=S(`chat.modelControls.capability.toolCalling`),t[38]=S,t[39]=xe);let Se;t[40]===S?Se=t[41]:(Se=S(`chat.modelControls.capability.reasoning`),t[40]=S,t[41]=Se);let Q;t[42]===S?Q=t[43]:(Q=S(`chat.modelControls.modality.image`),t[42]=S,t[43]=Q);let Ce;t[44]===S?Ce=t[45]:(Ce=S(`chat.modelControls.modality.video`),t[44]=S,t[45]=Ce);let we;t[46]===S?we=t[47]:(we=S(`chat.modelControls.modality.audio`),t[46]=S,t[47]=we);let Te;t[48]===S?Te=t[49]:(Te=S(`chat.modelControls.costPerMillion`),t[48]=S,t[49]=Te);let Ee;t[50]===S?Ee=t[51]:(Ee=S(`chat.modelControls.costInput`),t[50]=S,t[51]=Ee);let De;t[52]===S?De=t[53]:(De=S(`chat.modelControls.costOutput`),t[52]=S,t[53]=De);let Oe;t[54]!==Y||t[55]!==X||t[56]!==pe||t[57]!==me||t[58]!==he||t[59]!==ge||t[60]!==_e||t[61]!==ve||t[62]!==ye||t[63]!==xe||t[64]!==Se||t[65]!==Q||t[66]!==Ce||t[67]!==we||t[68]!==Te||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:Y,noResults:X,favorites:pe,recent:me,keyboardHint:he,favorite:ge,unfavorite:_e,provider:ve,capabilities:ye,capabilityToolCalling:xe,capabilityReasoning:Se,modalityImage:Q,modalityVideo:Ce,modalityAudio:we,costPerMillion:Te,costInput:Ee,costOutput:De},t[54]=Y,t[55]=X,t[56]=pe,t[57]=me,t[58]=he,t[59]=ge,t[60]=_e,t[61]=ve,t[62]=ye,t[63]=xe,t[64]=Se,t[65]=Q,t[66]=Ce,t[67]=we,t[68]=Te,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===_?Ae=t[73]:(Ae=h(`relative`,_),t[72]=_,t[73]=Ae);let je;t[74]===d?je=t[75]:(je=h(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),t[74]=d,t[75]=je);let Me=!z,Ie;t[76]===M?Ie=t[77]:(Ie=()=>{N(!M)},t[76]=M,t[77]=Ie);let We;t[78]===v?We=t[79]:(We=v??(0,$.jsx)(A,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=v,t[79]=We);let Ge;t[80]!==s||t[81]!==S?(Ge=s??S(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=S,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(g,{ref:L,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==F||t[90]!==z||t[91]!==m||t[92]!==x||t[93]!==O||t[94]!==w||t[95]!==J||t[96]!==j||t[97]!==D||t[98]!==M||t[99]!==ke||t[100]!==V||t[101]!==ee||t[102]!==C||t[103]!==k||t[104]!==ae||t[105]!==E?(qe=M?(0,$.jsx)(`div`,{className:h(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,x===`top`?`bottom-full mb-1`:`top-full mt-1`,m),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(ne,{providers:C,providerOrder:ee,favoriteModels:O,recentModels:k,getMetadata:w,hiddenModels:j,searchQuery:ae,onSearchQueryChange:P,onSelect:J,labels:ke,selectionCount:e=>V.get(`${e.providerID}:${e.modelID}`)||0,disabled:!z,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:F?`${F}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:M,isFavorite:e=>D(e.providerID,e.modelID),onToggleFavorite:e=>E(e.providerID,e.modelID),onEscape:()=>{N(!1),P(``)}})}):null,t[89]=F,t[90]=z,t[91]=m,t[92]=x,t[93]=O,t[94]=w,t[95]=J,t[96]=j,t[97]=D,t[98]=M,t[99]=ke,t[100]=V,t[101]=ee,t[102]=C,t[103]=k,t[104]=ae,t[105]=E,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:I,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==H||t[112]!==V||t[113]!==i||t[114]!==a||t[115]!==C||t[116]!==n||t[117]!==b||t[118]!==S?(Ye=b&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=V.get(n)||1,o=H(e),s=C.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(se,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(ie,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(A,{name:`brain-ai-3`,className:h(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(le,{placeholder:S(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?S(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(oe,{fitContent:!0,children:[(0,$.jsx)(re,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:S(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=H,t[112]=V,t[113]=i,t[114]=a,t[115]=C,t[116]=n,t[117]=b,t[118]=S,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==S?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?S(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):S(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=S,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(re,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,be.c)(30),{git:n}=H(),r=q(e),i=G(e),a=J(e),o=pe(e),s=ge(Ye),c=ge(Je),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),Z.useEffect(l,u);let d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=d):d=t[12];let f=r?.all,p;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==f?(p=[e,n,i,f,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=f,t[18]=p):p=t[18],Z.useEffect(d,p);let m=a||i===!0&&o,h;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],h=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),h=e}let g=h,_;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],_=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),_=e}let v=_,y;bb2:{if(!e){y=null;break bb2}if(i!==null){y=i;break bb2}if(m){y=null;break bb2}y=r?.all?!0:null}let b=y,x;return t[25]!==b||t[26]!==m||t[27]!==g||t[28]!==v?(x={localBranches:g,remoteBranches:v,isLoading:m,isGitRepository:b},t[25]=b,t[26]=m,t[27]=g,t[28]=v,t[29]=x):x=t[29],x}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=p(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=Z.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return Z.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await ae(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(W),{sourceBranch:o,shouldClearSavedSourceBranch:s}=X({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(W),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(se,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(ie,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(le,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(oe,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(P,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(re,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(L,{}),c.length>0&&(0,$.jsxs)(P,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(re,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,be.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=p(),l=T(Qe),u=T($e),d=T(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let m=f,g;t[2]===m?g=t[3]:(g=m.filter(tt),t[2]=m,t[3]=g);let _=g,v,y;t[4]!==m.length||t[5]!==u?(v=()=>{m.length===0&&u()},y=[m.length,u],t[4]=m.length,t[5]=u,t[6]=v,t[7]=y):(v=t[6],y=t[7]),Z.useEffect(v,y);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==_||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&_.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&_.some(e=>e.name===t)){r(t);return}let i=_[0]?.name;i&&r(i)},x=[d,a,r,_,n],t[8]=d,t[9]=a,t[10]=r,t[11]=_,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),Z.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=h(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let E;t[19]===w?E=t[20]:(E=(0,$.jsx)(le,{placeholder:w}),t[19]=w,t[20]=E);let D;t[21]!==o||t[22]!==C||t[23]!==E?(D=(0,$.jsx)(ie,{id:o,size:`lg`,className:C,children:E}),t[21]=o,t[22]=C,t[23]=E,t[24]=D):D=t[24];let O;t[25]===_?O=t[26]:(O=_.length>0&&(0,$.jsx)(P,{children:_.map(nt)}),t[25]=_,t[26]=O);let k;t[27]!==s||t[28]!==O?(k=(0,$.jsx)(oe,{fitContent:!0,portalToBody:s,children:O}),t[27]=s,t[28]=O,t[29]=k):k=t[29];let A;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==D||t[34]!==k?(A=(0,$.jsxs)(se,{value:S,onValueChange:r,disabled:a,children:[D,k]}),t[30]=a,t[31]=r,t[32]=S,t[33]=D,t[34]=k,t[35]=A):A=t[35],A};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return k(e.mode)}function nt(e){return(0,$.jsx)(re,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,be.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(A,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(V,{children:[r,(0,$.jsx)(B,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,be.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},st=e=>{let t=m(e.path),n=e.icon?F[e.icon]:null,r=e.color?ce[e.color]:void 0,i=(0,$.jsx)(A,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(N,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=p(),[s,c]=Z.useState(``),[l,u]=Z.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,m]=Z.useState(``),[v,y]=Z.useState([]),[b,C]=Z.useState(!1),[T,D]=Z.useState([]),[O,k]=Z.useState(!1),[j,te]=Z.useState(!1),[M,ne]=Z.useState(!0),N=Z.useRef(null),ae=o(e=>e.currentDirectory??null),P=Z.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),F=E(e=>e.activeProjectId),ce=E(e=>e.setActiveProjectIdOnly),I=E(e=>e.projects),[L,H]=Z.useState(()=>F??null);Z.useEffect(()=>{if(F){H(F);return}!L&&I.length>0&&H(I[0].id)},[F,I,L]);let U=Z.useMemo(()=>L?I.find(e=>e.id===L)??null:null,[I,L]),fe=U?.path??ae,W=f(e=>{H(e),e!==F&&ce(e)}),G=Z.useMemo(()=>{if(U?.path)return{id:U.id,path:U.path};let e=ae??P;return e?{id:`path:${e}`,path:e}:null},[U,ae,P]),[K]=Z.useState(()=>typeof window<`u`&&t()),q=Z.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=ue(),Y=Z.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__OPENCHAMBER_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),X=Z.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),pe=Z.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),me=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await _()}),he=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),ge=!!r;Z.useEffect(()=>{if(ge)return window.addEventListener(`keydown`,he,!0),()=>window.removeEventListener(`keydown`,he,!0)},[ge]);let[be,xe]=Z.useState(``),{isLoading:Se,isGitRepository:Q}=We(fe),Ce=Z.useRef(!1),we=Q===!0,Te=we&&M;Z.useEffect(()=>{if(Q===!1){Ce.current=!0,ne(!1);return}Q===!0&&Ce.current&&(Ce.current=!1,ne(!0))},[Q]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);Z.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),Z.useEffect(()=>{if(!G)return;let e=!1;return te(!0),(async()=>{try{let t=await x(G);e||D(t)}catch{}finally{e||te(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>rt){w.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});y(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),w.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&w.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),N.current&&(N.current.value=``)},Fe=e=>{y(t=>t.filter(t=>t.id!==e))},Ie=Z.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){C(!0),Oe();try{L&&L!==F&&ce(L);let e=v.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=T.filter(e=>e.trim().length>0),i=t.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Te?be:void 0,isolateRuns:Te,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&S.getState().setCurrentSession(o.firstSessionId),n?.())}finally{C(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&fe&&!Se&&(Q===!1||!Te||be)),ze=T.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:me,className:h(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,X,pe),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(A,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(B,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(de,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),I.length>0?(0,$.jsxs)(se,{value:L??void 0,onValueChange:W,children:[(0,$.jsx)(ie,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:U?(0,$.jsx)(le,{children:st(U)}):(0,$.jsx)(le,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(oe,{fitContent:!0,children:I.map(e=>(0,$.jsx)(re,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:fe,value:be,onChange:xe,disabled:!Te,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(ee,{checked:M,onChange:ne,disabled:!we,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:m,id:`multirun-agent`})]})]}),(0,$.jsxs)(ye,{open:O,onOpenChange:k,children:[(0,$.jsxs)(ve,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(A,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(A,{name:`arrow-down-s`,className:h(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,O&&`rotate-180`)})]}),(0,$.jsx)(_e,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:j?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[T.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(R,{value:e,onChange:e=>{let n=[...T];n[t]=e.target.value,D(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>D(T.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(A,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>D([...T,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(A,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:N,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(V,{children:[(0,$.jsx)(z,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>N.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(A,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(B,{children:a(`multirun.launcher.attachments.tooltip`)})]}),v.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(A,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(A,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(A,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(A,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Te&&Q!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(A,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(g,{type:`submit`,size:`sm`,disabled:!Re||b,children:b?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,be.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=p(),[c,l]=Z.useState(!1),[u,d]=Z.useState(``),[m,h]=Z.useState(!1),[g,_]=Z.useState(``),v=Z.useRef(null),y=Z.useRef(null),b=Z.useRef(null),x;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(x=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=x):x=t[3];let S=f(x),C;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(C=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=C):C=t[7];let w=f(C),T;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(T=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=T):T=t[11];let E=f(T),D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
2
2
|
`),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){_(e.substring(1,i)),h(!0),l(!1);return}}h(!1);let n=e.substring(0,t),r=n.lastIndexOf(`@`);if(r!==-1){let e=r>0?n[r-1]:null,t=n.substring(r+1);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
3
3
|
`)?(d(t),l(!0)):l(!1);return}l(!1)},t[12]=D):D=t[12];let O=f(D),k;t[13]!==n.id||t[14]!==a?(k=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=k):k=t[15];let j=f(k),ee;t[16]!==n.prompt||t[17]!==j||t[18]!==O?(ee=e=>{let t=n.prompt,r=v.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=e.relativePath&&e.relativePath.trim().length>0?e.relativePath.trim():e.path||e.name,o=me(t,i===-1?r:i,r,`@${a}`);j(o.text),l(!1),d(``),requestAnimationFrame(()=>{let e=v.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),O(o.text,o.caret)})},t[16]=n.prompt,t[17]=j,t[18]=O,t[19]=ee):ee=t[19];let te=f(ee),M;t[20]!==n.prompt||t[21]!==j||t[22]!==O?(M=e=>{let t=n.prompt,r=v.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=me(t,i===-1?r:i,r,`@${e}`);j(a.text),l(!1),d(``),requestAnimationFrame(()=>{let e=v.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),O(a.text,a.caret)})},t[20]=n.prompt,t[21]=j,t[22]=O,t[23]=M):M=t[23];let ne=f(M),re;t[24]!==j||t[25]!==O?(re=e=>{let t=`/${e.name} `;j(t),h(!1),_(``),requestAnimationFrame(()=>{let e=v.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),O(t,t.length)})},t[24]=j,t[25]=O,t[26]=re):re=t[26];let N=f(re),ie;t[27]!==m||t[28]!==c?(ie=e=>{if(m&&b.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),b.current.handleKeyDown(e.key);return}c&&y.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),y.current.handleKeyDown(e.key))},t[27]=m,t[28]=c,t[29]=ie):ie=t[29];let ae=f(ie),P=r+1,oe;t[30]!==s||t[31]!==P?(oe=s(`multirun.launcher.groups.groupLabel`,{index:P}),t[30]=s,t[31]=P,t[32]=oe):oe=t[32];let F;t[33]===oe?F=t[34]:(F=(0,$.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:oe}),t[33]=oe,t[34]=F);let se;t[35]!==i||t[36]!==n.id||t[37]!==o||t[38]!==s?(se=i&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(n.id),className:`inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10`,"aria-label":s(`multirun.launcher.groups.removeGroup`),children:(0,$.jsx)(A,{name:`close`,className:`h-3.5 w-3.5`})}),t[35]=i,t[36]=n.id,t[37]=o,t[38]=s,t[39]=se):se=t[39];let ce;t[40]!==F||t[41]!==se?(ce=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[F,se]}),t[40]=F,t[41]=se,t[42]=ce):ce=t[42];let I;t[43]===s?I=t[44]:(I=s(`multirun.launcher.groups.prompt.label`),t[43]=s,t[44]=I);let le;t[45]===I?le=t[46]:(le=(0,$.jsx)(ot,{required:!0,children:I}),t[45]=I,t[46]=le);let L=n.prompt,R;t[47]!==j||t[48]!==O?(R=e=>{let t=e.target.value;j(t);let n=e.target.selectionStart??t.length;O(t,n)},t[47]=j,t[48]=O,t[49]=R):R=t[49];let z;t[50]===s?z=t[51]:(z=s(`multirun.launcher.groups.prompt.placeholder`),t[50]=s,t[51]=z);let B;t[52]!==n.prompt||t[53]!==ae||t[54]!==R||t[55]!==z?(B=(0,$.jsx)(U,{ref:v,value:L,onChange:R,onKeyDown:ae,placeholder:z,className:`typography-meta min-h-[80px] max-h-[200px] resize-none overflow-y-auto field-sizing-content`,required:!0}),t[52]=n.prompt,t[53]=ae,t[54]=R,t[55]=z,t[56]=B):B=t[56];let V;t[57]!==g||t[58]!==N||t[59]!==m?(V=m?(0,$.jsx)(he,{ref:b,searchQuery:g,onCommandSelect:N,onClose:()=>h(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[57]=g,t[58]=N,t[59]=m,t[60]=V):V=t[60];let ue;t[61]!==ne||t[62]!==te||t[63]!==u||t[64]!==c?(ue=c?(0,$.jsx)(fe,{ref:y,searchQuery:u,onFileSelect:te,onAgentSelect:ne,onSkillSelect:e=>ne(e.name),onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[61]=ne,t[62]=te,t[63]=u,t[64]=c,t[65]=ue):ue=t[65];let H;t[66]!==B||t[67]!==V||t[68]!==ue?(H=(0,$.jsxs)(`div`,{className:`relative`,children:[B,V,ue]}),t[66]=B,t[67]=V,t[68]=ue,t[69]=H):H=t[69];let de;t[70]!==le||t[71]!==H?(de=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[le,H]}),t[70]=le,t[71]=H,t[72]=de):de=t[72];let W;t[73]===s?W=t[74]:(W=s(`multirun.launcher.models.info`,{max:it}),t[73]=s,t[74]=W);let G;t[75]===W?G=t[76]:(G=(0,$.jsx)(at,{children:W}),t[75]=W,t[76]=G);let K;t[77]===s?K=t[78]:(K=s(`multirun.launcher.models.label`),t[77]=s,t[78]=K);let q;t[79]!==G||t[80]!==K?(q=(0,$.jsx)(ot,{required:!0,info:G,children:K}),t[79]=G,t[80]=K,t[81]=q):q=t[81];let J;t[82]!==n.models||t[83]!==S||t[84]!==w||t[85]!==E?(J=(0,$.jsx)(Ie,{selectedModels:n.models,onAdd:S,onRemove:w,onUpdate:E,minModels:1,maxModels:it}),t[82]=n.models,t[83]=S,t[84]=w,t[85]=E,t[86]=J):J=t[86];let Y;t[87]!==q||t[88]!==J?(Y=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[q,J]}),t[87]=q,t[88]=J,t[89]=Y):Y=t[89];let X;return t[90]!==ce||t[91]!==de||t[92]!==Y?(X=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[ce,de,Y]}),t[90]=ce,t[91]=de,t[92]=Y,t[93]=X):X=t[93],X};export{Te as a,Pe as i,Ze as n,Ce as o,Ie as r,ct as t};
|