conductor-oss 0.62.7 → 0.62.8
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/node_modules/@conductor-oss/core/package.json +1 -1
- package/package.json +5 -5
- package/web/.next/standalone/node_modules/nanoid/package.json +1 -1
- package/web/.next/standalone/package.json +1 -1
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +8 -8
- package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +15 -14
- package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-up/[[...sign-up]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +8 -8
- package/web/.next/standalone/packages/web/.next/server/chunks/1725.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/3303.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/4191.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/5658.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/5734.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/5790.js +2 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/6108.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/6472.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/6744.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/7714.js +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/7801.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/8352.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/9516.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/9930.js +4 -4
- package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/20038.fe65f7c2f63cf380.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/29450-e298fd3b74f528a5.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{34443.6226599113ecee07.js → 34443.3021c37fce5f1966.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/35493-405b96c4dd41e057.js +1 -0
- package/web/.next/{static/chunks/37785-4c70b81506dde54c.js → standalone/packages/web/.next/static/chunks/37785-1fc09b3ce0839b64.js} +2 -2
- package/web/.next/{static/chunks/41696.3e691c667c1e7b81.js → standalone/packages/web/.next/static/chunks/41696.849ce60671c3fc20.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/47369.a4f0b46515a89877.js +3 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/70008.848fd401840c9bce.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/76892-8dd4340687959250.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/81132.46e0113f762baba4.js +3 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/86597-1974bd2fdc101983.js +2 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/8798.be1c2bcbdf30d3d0.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/88545.638d04d05b4cb291.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/90036.6d4c9823456768d7.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/bridge/connect/page-c4fcd887291e892d.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/{layout-993567520eb26e1e.js → layout-42a934e328610863.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/page-5cdcce90b0cebb55.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/{page-340961e7cd9d63cc.js → page-1f3578abecf4fb64.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-bfd73815fe1dcf5e.js +9 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a4f528b6782ed85c.js +9 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/unlock/page-f95ae641f875a271.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/webpack-3ea5ad7ca9f32ed6.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/css/576f84ed441998c8.css +1 -0
- package/web/.next/static/chunks/20038.fe65f7c2f63cf380.js +1 -0
- package/web/.next/static/chunks/29450-e298fd3b74f528a5.js +1 -0
- package/web/.next/static/chunks/{34443.6226599113ecee07.js → 34443.3021c37fce5f1966.js} +1 -1
- package/web/.next/static/chunks/35493-405b96c4dd41e057.js +1 -0
- package/web/.next/{standalone/packages/web/.next/static/chunks/37785-4c70b81506dde54c.js → static/chunks/37785-1fc09b3ce0839b64.js} +2 -2
- package/web/.next/{standalone/packages/web/.next/static/chunks/41696.3e691c667c1e7b81.js → static/chunks/41696.849ce60671c3fc20.js} +1 -1
- package/web/.next/static/chunks/47369.a4f0b46515a89877.js +3 -0
- package/web/.next/static/chunks/70008.848fd401840c9bce.js +1 -0
- package/web/.next/static/chunks/76892-8dd4340687959250.js +1 -0
- package/web/.next/static/chunks/81132.46e0113f762baba4.js +3 -0
- package/web/.next/static/chunks/86597-1974bd2fdc101983.js +2 -0
- package/web/.next/static/chunks/8798.be1c2bcbdf30d3d0.js +1 -0
- package/web/.next/static/chunks/88545.638d04d05b4cb291.js +1 -0
- package/web/.next/static/chunks/90036.6d4c9823456768d7.js +1 -0
- package/web/.next/static/chunks/app/bridge/connect/page-c4fcd887291e892d.js +1 -0
- package/web/.next/static/chunks/app/{layout-993567520eb26e1e.js → layout-42a934e328610863.js} +1 -1
- package/web/.next/static/chunks/app/page-5cdcce90b0cebb55.js +1 -0
- package/web/.next/static/chunks/app/sessions/[id]/{page-340961e7cd9d63cc.js → page-1f3578abecf4fb64.js} +1 -1
- package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-bfd73815fe1dcf5e.js +9 -0
- package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a4f528b6782ed85c.js +9 -0
- package/web/.next/static/chunks/app/unlock/page-f95ae641f875a271.js +1 -0
- package/web/.next/static/chunks/webpack-3ea5ad7ca9f32ed6.js +1 -0
- package/web/.next/static/css/576f84ed441998c8.css +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/3775.js +0 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/694.js +0 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/724.js +0 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/8603.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/10215.e1adc6807da4cf05.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/20038.0f95f26ad144c136.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/29450-96ee8b2fdf605b68.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/35493-8c8d75766e944f01.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/39816.fa63b43ee1cbe027.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/47369.5011bd3d9e80106a.js +0 -3
- package/web/.next/standalone/packages/web/.next/static/chunks/76892-5f15bcc6649e7bd4.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/81132.8a9aaf302240ef27.js +0 -3
- package/web/.next/standalone/packages/web/.next/static/chunks/84271-9f5b4aa5a9c11bd9.js +0 -2
- package/web/.next/standalone/packages/web/.next/static/chunks/95381.bf3263b4d34504c7.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/bridge/connect/page-a21257f88cf5a928.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/page-06b5663e85e5e30e.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4ad311894518c4e8.js +0 -9
- package/web/.next/standalone/packages/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a8639099a42a668b.js +0 -9
- package/web/.next/standalone/packages/web/.next/static/chunks/app/unlock/page-4f87395d3035a5bf.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/webpack-ce72c10ddc4a34ce.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/css/5443e6375caddb6b.css +0 -1
- package/web/.next/static/chunks/10215.e1adc6807da4cf05.js +0 -1
- package/web/.next/static/chunks/20038.0f95f26ad144c136.js +0 -1
- package/web/.next/static/chunks/29450-96ee8b2fdf605b68.js +0 -1
- package/web/.next/static/chunks/35493-8c8d75766e944f01.js +0 -1
- package/web/.next/static/chunks/39816.fa63b43ee1cbe027.js +0 -1
- package/web/.next/static/chunks/47369.5011bd3d9e80106a.js +0 -3
- package/web/.next/static/chunks/76892-5f15bcc6649e7bd4.js +0 -1
- package/web/.next/static/chunks/81132.8a9aaf302240ef27.js +0 -3
- package/web/.next/static/chunks/84271-9f5b4aa5a9c11bd9.js +0 -2
- package/web/.next/static/chunks/95381.bf3263b4d34504c7.js +0 -1
- package/web/.next/static/chunks/app/bridge/connect/page-a21257f88cf5a928.js +0 -1
- package/web/.next/static/chunks/app/page-06b5663e85e5e30e.js +0 -1
- package/web/.next/static/chunks/app/sign-in/[[...sign-in]]/page-4ad311894518c4e8.js +0 -9
- package/web/.next/static/chunks/app/sign-up/[[...sign-up]]/page-a8639099a42a668b.js +0 -9
- package/web/.next/static/chunks/app/unlock/page-4f87395d3035a5bf.js +0 -1
- package/web/.next/static/chunks/webpack-ce72c10ddc4a34ce.js +0 -1
- package/web/.next/static/css/5443e6375caddb6b.css +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_ssgManifest.js +0 -0
- /package/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_buildManifest.js +0 -0
- /package/web/.next/static/{dg_PQxcnntSl1TuuRZaFW → uj1a_PBVefvWUi6yVk4E5}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95381],{28017:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]])},88742:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(39789).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},95381:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>eS,SettingsDialog:()=>eH});var a=r(54568),s=r(7620);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(null,arguments)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}var o=["aria-hidden","aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"],i={small:16,medium:32,large:64};function d(e,t,r,a,d){var c,x,p=e["aria-hidden"],v=e["aria-label"],m=e["aria-labelledby"],u=e.tabIndex,h=e.className,b=e.fill,g=e.size,k=void 0===g?16:g,f=e.verticalAlign,j=e.id,y=e.title,N=e.style,w=function(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,o),C=i[k]||k,S=(c=d,x=C,c.map(function(e){return parseInt(e,10)}).reduce(function(e,t){return t<=x?t:e},c[0])),A=a[S].width,E=A/S*C,H=a[S].path,P=v||m,R=void 0===p?P?void 0:"true":p;return s.createElement("svg",n({ref:t,"data-component":"Octicon"},w,{"aria-hidden":R,tabIndex:u,focusable:u>=0?"true":"false","aria-label":v,"aria-labelledby":m,className:"".concat(r," ").concat(void 0===h?"":h).trim(),role:P&&"true"!==R?"img":void 0,viewBox:"0 0 ".concat(A," ").concat(S),width:E,height:C,fill:void 0===b?"currentColor":b,id:j,display:"inline-block",overflow:"visible",style:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){var a,s;a=t,s=r[t],(a=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(a))in e?Object.defineProperty(e,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[a]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({verticalAlign:void 0===f?"text-bottom":f},N)}),y?s.createElement("title",null,y):null,H)}var c=["16","24"],x={16:{width:16,path:s.createElement("path",{d:"M6.766 11.328c-2.063-.25-3.516-1.734-3.516-3.656 0-.781.281-1.625.75-2.188-.203-.515-.172-1.609.063-2.062.625-.078 1.468.25 1.968.703.594-.187 1.219-.281 1.985-.281.765 0 1.39.094 1.953.265.484-.437 1.344-.765 1.969-.687.218.422.25 1.515.046 2.047.5.593.766 1.39.766 2.203 0 1.922-1.453 3.375-3.547 3.64.531.344.89 1.094.89 1.954v1.625c0 .468.391.734.86.547C13.781 14.359 16 11.53 16 8.03 16 3.61 12.406 0 7.984 0 3.563 0 0 3.61 0 8.031a7.88 7.88 0 0 0 5.172 7.422c.422.156.828-.125.828-.547v-1.25c-.219.094-.5.156-.75.156-1.031 0-1.64-.562-2.078-1.609-.172-.422-.36-.672-.719-.719-.187-.015-.25-.093-.25-.187 0-.188.313-.328.625-.328.453 0 .844.281 1.25.86.313.452.64.655 1.031.655s.641-.14 1-.5c.266-.265.47-.5.657-.656"})},24:{width:24,path:s.createElement("path",{d:"M10.226 17.284c-2.965-.36-5.054-2.493-5.054-5.256 0-1.123.404-2.336 1.078-3.144-.292-.741-.247-2.314.09-2.965.898-.112 2.111.36 2.83 1.01.853-.269 1.752-.404 2.853-.404 1.1 0 1.999.135 2.807.382.696-.629 1.932-1.1 2.83-.988.315.606.36 2.179.067 2.942.72.854 1.101 2 1.101 3.167 0 2.763-2.089 4.852-5.098 5.234.763.494 1.28 1.572 1.28 2.807v2.336c0 .674.561 1.056 1.235.786 4.066-1.55 7.255-5.615 7.255-10.646C23.5 6.188 18.334 1 11.978 1 5.62 1 .5 6.188.5 12.545c0 4.986 3.167 9.12 7.435 10.669.606.225 1.19-.18 1.19-.786V20.63a2.9 2.9 0 0 1-1.078.224c-1.483 0-2.359-.808-2.987-2.313-.247-.607-.517-.966-1.034-1.033-.27-.023-.359-.135-.359-.27 0-.27.45-.471.898-.471.652 0 1.213.404 1.797 1.235.45.651.921.943 1.483.943.561 0 .92-.202 1.437-.719.382-.381.674-.718.944-.943"})}},p=s.forwardRef(function(e,t){return d(e,t,"octicon octicon-mark-github",x,c)});p.displayName="MarkGithubIcon";var v=["16","24"],m={16:{width:16,path:s.createElement("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"})},24:{width:24,path:s.createElement(s.Fragment,null,s.createElement("path",{d:"M3 2.75A2.75 2.75 0 0 1 5.75 0h14.5a.75.75 0 0 1 .75.75v20.5a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h5.25v-4H6A1.5 1.5 0 0 0 4.5 18v.75c0 .716.43 1.334 1.05 1.605a.75.75 0 0 1-.6 1.374A3.251 3.251 0 0 1 3 18.75ZM19.5 1.5H5.75c-.69 0-1.25.56-1.25 1.25v12.651A2.989 2.989 0 0 1 6 15h13.5Z"}),s.createElement("path",{d:"M7 18.25a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v5.01a.25.25 0 0 1-.397.201l-2.206-1.604a.25.25 0 0 0-.294 0L7.397 23.46a.25.25 0 0 1-.397-.2v-5.01Z"}))}},u=s.forwardRef(function(e,t){return d(e,t,"octicon octicon-repo",m,v)});u.displayName="RepoIcon";var h=["16","24"],b={16:{width:16,path:s.createElement("path",{d:"M4 4a4 4 0 0 1 8 0v2h.25c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25v-5.5C2 6.784 2.784 6 3.75 6H4Zm8.25 3.5h-8.5a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25ZM10.5 6V4a2.5 2.5 0 1 0-5 0v2Z"})},24:{width:24,path:s.createElement("path",{d:"M6 9V7.25C6 3.845 8.503 1 12 1s6 2.845 6 6.25V9h.5a2.5 2.5 0 0 1 2.5 2.5v8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-8A2.5 2.5 0 0 1 5.5 9Zm-1.5 2.5v8a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-13a1 1 0 0 0-1 1Zm3-4.25V9h9V7.25c0-2.67-1.922-4.75-4.5-4.75-2.578 0-4.5 2.08-4.5 4.75Z"})}},g=s.forwardRef(function(e,t){return d(e,t,"octicon octicon-lock",b,h)});g.displayName="LockIcon";var k=["16","24"],f={16:{width:16,path:s.createElement("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:s.createElement(s.Fragment,null,s.createElement("path",{d:"M15 4.75a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM2.5 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 6.5Z"}),s.createElement("path",{d:"M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z"}),s.createElement("path",{d:"M17.5 8.75v-1H19v1a3.75 3.75 0 0 1-3.75 3.75h-7a1.75 1.75 0 0 0-1.75 1.75H5A3.25 3.25 0 0 1 8.25 11h7a2.25 2.25 0 0 0 2.25-2.25Z"}))}},j=s.forwardRef(function(e,t){return d(e,t,"octicon octicon-git-branch",f,k)});j.displayName="GitBranchIcon";var y=r(76196),N=r(52353),w=r(20487),C=r(39789);let S=(0,C.A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);var A=r(58212),E=r(38724),H=r(19755),P=r(83328),R=r(15255),M=r(43508),$=r(46277),U=r(28017),D=r(77024),B=r(13932),O=r(1173),L=r(38874),F=r(76839),_=r(37812),I=r(88742),Z=r(61201);let T=(0,C.A)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),q=(0,C.A)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var z=r(5739),G=r(33866),V=r(72410),W=r(31404),J=r(85626),Y=r(53989);r(51164);var X=r(66423),K=r(83342);let Q=(0,C.A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);function ee(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function et(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function er({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function ea({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",children:t||"U"})}function es({profile:e,loading:t,error:r,onRefresh:s}){if(t)return(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(L.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:s,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(F.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let n=e?.displayName??"Unknown user",l=e?.email??"Not available",o=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(ea,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:l}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:et(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:ee(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:s,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(F.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(er,{label:"Display Name",value:n}),(0,a.jsx)(er,{label:"Email",value:l}),(0,a.jsx)(er,{label:"GitHub Username",value:o,href:e?.githubProfileUrl??null}),(0,a.jsx)(er,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(er,{label:"Auth Provider",value:ee(e?.provider??null)}),(0,a.jsx)(er,{label:"Access Role",value:et(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)(K.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(Q,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${ee(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(p,{size:14}),"Open GitHub Profile"]})]})]})}var en=r(88272);let el="claude-code";function eo(e){let t=(0,G.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function ei(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function ed(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function ec(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}function ex(e,t,r){let a=t?.trim();if(a)return a;let s=ec(e);if(s)return s;let n=r?.trim();return n||"workspace"}function ep(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let ev=[{id:"profile",label:"Profile",icon:S,implemented:!0},{id:"general",label:"General",icon:A.A,implemented:!0},{id:"repositories",label:"Repositories",icon:E.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:H.A,implemented:!0},{id:"projects",label:"Projects",icon:P.A,implemented:!1},{id:"agents",label:"Agents",icon:R.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:M.A,implemented:!1},{id:"preferences",label:"Preferences",icon:$.A,implemented:!1}],em=[{id:"preferences",label:"Preferences",icon:$.A,implemented:!0},{id:"repositories",label:"Repository",icon:E.A,implemented:!0}],eu=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],eh=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function eb(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function eg(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function ek(e,t){let r=eb(e),a=eb(r.trustedHeaders),s=eb(r.roles),n=eb(t),l=r.defaultRole,o=n.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===l||"admin"===l||"operator"===l?l:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:eg(s.viewers),operators:eg(s.operators),admins:eg(s.admins),viewerDomains:eg(s.viewerDomains),operatorDomains:eg(s.operatorDomains),adminDomains:eg(s.adminDomains)},current:{authenticated:!0===n.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof n.email&&n.email.trim().length>0?n.email.trim():null,provider:"string"==typeof n.provider&&n.provider.trim().length>0?n.provider.trim():null}}}function ef(e,t){let r=(0,y.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,y.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let ej="block h-4 w-4 shrink-0";function ey(e){return JSON.stringify(e)}let eN={obsidian:{kind:"icon",icon:N.mWn,className:`${ej} text-[#8b5cf6]`},vscode:{kind:"icon",icon:w.$$9,className:`${ej} text-[#22a3f5]`},notion:{kind:"icon",icon:N.i4$,className:`${ej} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ej} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ej} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:A.A,className:`${ej} text-[var(--vk-text-muted)]`}};function ew({editorId:e}){let t=eN[e];if(!t)return(0,a.jsx)(U.A,{className:`${ej} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function eC({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:l=!1}){if(!(0,y.Zz)(e))return null;let o=(0,y.yM)(e),i=(0,en.Ik)(e,t,r),d=(0,en.xb)(s)??s.catalogModel,c=(0,en.iL)(e,t,r,d),x=ef(e,t);return o?(0,a.jsxs)("div",{className:l?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===i.length,onChange:a=>{let l=a.target.value,o=(0,en.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,en.YS)(e,t,r,l)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===i.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),i.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[x?`Filtered for ${x}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),c.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:c.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=(0,en.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,en.YS)(e,t,r,o)})},placeholder:(0,en.ZA)(e,r),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function eS({open:e,onClose:t,onCreate:r,creating:n,error:l,defaultAgent:o,agentOptions:i,modelAccess:d,runtimeModelCatalogs:c,bridgeId:x}){let[v,m]=(0,s.useState)("git"),[h,b]=(0,s.useState)("source"),[k,f]=(0,s.useState)(""),[N,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[A,E]=(0,s.useState)(""),[H,P]=(0,s.useState)(""),[R,M]=(0,s.useState)("main"),[$,U]=(0,s.useState)(o),[I,Z]=(0,s.useState)((0,en.Z3)()),[T,q]=(0,s.useState)(!0),[V,J]=(0,s.useState)(!0),[Y,K]=(0,s.useState)([]),[Q,ee]=(0,s.useState)(!1),[et,er]=(0,s.useState)(!1),[ea,es]=(0,s.useState)(null),[ev,em]=(0,s.useState)(""),[eu,eh]=(0,s.useState)(""),[eb,eg]=(0,s.useState)(!1),[ek,ef]=(0,s.useState)("local"),[ej,ey]=(0,s.useState)([]),[eN,ew]=(0,s.useState)(!1),[eE,eH]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&(m("git"),b("source"),f(""),w(!1),S(""),E(""),P(""),M("main"),J(!0),q(!0),U(o),Z((0,en.Z3)()),K([]),er(!1),es(null),em(""),eh(""),ey([]),eH(null),ew(!1),eg(!1),ef("local"))},[o,e]),(0,s.useEffect)(()=>{e&&Z(e=>{let t=(0,en.c0)($,d,c,(0,en.xb)(e)??null,(0,en.aB)(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[$,d,e,c]),(0,s.useEffect)(()=>{if(!e)return;let t="git"===v?C.trim().length>0:A.trim().length>0;"source"===h||t||b("source")},[C,A,v,e,h]);let eP=(0,s.useMemo)(()=>{let e;return 0===(e=ev.trim().toLowerCase()).length?Y:Y.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ev,Y]),eR=(0,s.useMemo)(()=>{let e=Y.find(e=>e.httpsUrl===eu);return e||(C.trim()?Y.find(e=>e.httpsUrl===C.trim())??null:null)},[C,Y,eu]),eM=(0,s.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ev),[ev]),e$=(0,s.useMemo)(()=>{let e;return(e=ev.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ev]),eU=(0,s.useMemo)(()=>ep(eR?.updatedAt),[eR]),eD=(0,s.useMemo)(()=>{let e=eM??e$;return!!e&&e.toLowerCase()!==C.trim().toLowerCase()},[C,eM,e$]),eB="git"===v?C.trim().length>0:A.trim().length>0,eO=(0,s.useMemo)(()=>{let e=ei(k);return e||("git"===v?ei(ex(C,eR?.name)):ei(ed(A)??"workspace"))},[C,A,v,k,eR?.name]),eL=(0,s.useMemo)(()=>ex(C,eR?.name,eO),[eO,C,eR?.name]),eF=(0,s.useMemo)(()=>{if(0===H.trim().length)return"";let e=H.trim().replace(/[\\/]+$/,""),t=eL.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eL,H]),e_=(0,s.useMemo)(()=>"git"===v?eR?.fullName??C.trim():ed(A)??A.trim(),[C,A,v,eR]),eI=(0,s.useMemo)(()=>"git"===v?eR?.description?.trim()||C.trim():A.trim(),[C,A,v,eR]),eZ=(0,s.useMemo)(()=>{let e=[...new Set(i)];0===e.length&&e.push(o||el);let t=new Map(G.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,z.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,z.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:eo(e).localeCompare(eo(r))})},[i,o]);(0,s.useEffect)(()=>{eZ.includes($)||U(eZ[0]??el)},[$,eZ]);let eT=async(e=!1)=>{ee(!0),es(null);try{let t=await fetch((0,W.S)(`/api/github/repos${e?"?refresh=true":""}`,x)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);K(Array.isArray(r?.repos)?r.repos:[])}catch(e){K([]),es(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{er(!0),ee(!1)}};(0,s.useEffect)(()=>{!e||"git"!==v||Q||et||eT()},[et,Q,v,e]);let eq=async e=>{let t=e?.gitUrl??("git"===v?C.trim():""),r=e?.path??("local"===v?A.trim():"");if(0===t.length&&0===r.length)return void eH("git"===v?"Choose or paste a repository first.":"Select a local repository path first.");ew(!0),eH(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,W.S)(`/api/workspaces/branches?${e.toString()}`,x)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let n=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];ey(n);let l="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():n[0]??null;l&&(0===R.trim().length||!n.includes(R))&&M(l)}catch(e){ey([]),eH(e instanceof Error?e.message:"Failed to load branches")}finally{ew(!1)}},ez=async e=>{eh(e);let t=Y.find(t=>t.httpsUrl===e);t&&(S(t.httpsUrl),em(t.fullName),M(t.defaultBranch||"main"),N||f(ei(t.name)||k),await eq({gitUrl:t.httpsUrl}),b("details"))},eG=async()=>{let e=eM??e$;if(!e)return;let t=Y.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await ez(t.httpsUrl);if(eh(""),S(e),M("main"),ey([]),eH(null),!N){let t=ec(e);t&&f(ei(t))}await eq({gitUrl:e}),b("details")},eV=e=>{ef(e),eg(!0)},eW=e=>{m(e),b("source"),ey([]),eH(null)};if(!e)return null;let eJ=eB&&R.trim().length>0;async function eY(e){if(e.preventDefault(),"review"!==h||!eJ||n)return;let t="git"===v?{mode:v,projectId:eO||void 0,agent:$,agentModel:(0,en.xb)(I)??"",agentReasoningEffort:(0,en.aB)(I)??"",defaultBranch:R.trim(),useWorktree:T,gitUrl:C.trim(),path:eF||void 0}:{mode:v,projectId:eO||void 0,agent:$,agentModel:(0,en.xb)(I)??"",agentReasoningEffort:(0,en.aB)(I)??"",defaultBranch:R.trim(),useWorktree:T,path:A.trim(),initializeGit:V};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:`fixed ${X.Rn} z-[80] flex items-start justify-center overflow-y-auto bg-black/65 px-0 py-0 sm:items-center sm:px-3 sm:py-3`,onClick:()=>{n||eb||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eY,onClick:e=>e.stopPropagation(),className:`flex ${X.yq} ${X.w1} w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-w-[860px] sm:rounded-[10px] sm:border`,children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"source"===h?"Step 1 of 3":"details"===h?"Step 2 of 3":"Step 3 of 3"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===h?"Start with the repository or folder you want Conductor to manage.":"details"===h?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===v?"Repository":"Folder"},{id:"details",label:"Project"},{id:"review",label:"Review"}].map(e=>{let t=h===e.id,r="source"===e.id?"source"!==h&&eB:"details"===e.id&&"review"===h;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(D.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:n,"aria-label":"Close dialog",className:"inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,a.jsx)(B.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eW("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===v?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(p,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eW("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===v?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(O.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===v?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(u,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{er(!1),eT(!0)},disabled:Q,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:Q?(0,a.jsx)(L.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(p,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ev,onChange:e=>em(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eD&&(e.preventDefault(),eG())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),eD?(0,a.jsxs)("button",{type:"button",onClick:()=>{eG()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(u,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eM?"this GitHub repository":"pasted repository URL"]})]}):null,Q&&0===Y.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,ea?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:ea}),(0,a.jsx)("button",{type:"button",onClick:()=>{er(!1),eT(!0)},className:"mt-2 inline-flex items-center rounded-[6px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!ea&&eP.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eP.map(e=>{let t=ep(e.updatedAt),r=eR?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{ez(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(u,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[e.private?(0,a.jsx)(g,{className:"h-3 w-3"}):(0,a.jsx)(p,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(j,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(D.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,Q||ea||0!==eP.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ev.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(O.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eV("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(O.A,{className:"h-4 w-4"}),A.trim().length>0?"Choose another folder":"Choose folder"]}),A.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:A})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),l?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:l}):null]}):"details"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===v?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:e_}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eI}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===v?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[eR?.private?(0,a.jsx)(g,{className:"h-3 w-3"}):(0,a.jsx)(p,{className:"h-3 w-3"}),eR?eR.private?"Private":"Public":"Manual URL"]}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(j,{className:"h-3 w-3"}),R||"main"]}),eR?.ownerLogin?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eR.ownerLogin}):null,eU?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:eU}):null]}):(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:k,onChange:e=>{f(e.target.value),w(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:R,onChange:e=>M(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eq()},disabled:eN,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:eN?(0,a.jsx)(L.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(F.A,{className:"h-3.5 w-3.5"})})]}),ej.length>0?(0,a.jsx)("select",{value:R,onChange:e=>M(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ej.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,eE?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:eE}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",eo($)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:T?"Worktree isolation on":"Runs on selected branch"}),"local"===v?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:V?"Auto-init git if needed":"Do not init git"}):null]}),(0,y.Zz)($)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(eC,{compact:!0,agent:$,modelAccess:d,runtimeModelCatalogs:c,selection:I,onChange:Z})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(_.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:$,onChange:e=>U(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eZ.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:eo(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:T,onChange:e=>q(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===v?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:V,onChange:e=>J(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:H,readOnly:!0,onClick:()=>eV("clone"),placeholder:"Leave empty to use Conductor's default repo location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eV("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(O.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eF?`Conductor will create ${eF}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),l?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:l}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:eO||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:eO||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:k.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:e_}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eI})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===v?eF||"Conductor default repo location":A}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===v?eF?`The repository will be cloned into ${eF}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:R.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:eo($)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:T?"Worktree enabled":"Runs on selected branch"})]}),(0,en.xb)(I)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,en.xb)(I)})]}):null,(0,en.aB)(I)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,en.aB)(I)})]}):null,"local"===v?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:V?"Enabled if needed":"Disabled"})]}):null]})]})]}),l?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:l}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:n,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==v||eB?eB&&!n&&b("details"):eV("local")},disabled:"git"===v&&!eB||n,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==v||eB?"Continue":"Choose folder"})]}):"details"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),disabled:n,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eB&&0!==R.trim().length&&!n&&b("review")},disabled:!eJ||n,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Review"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("details"),disabled:n,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!eJ||n,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})}),(0,a.jsx)(eA,{open:eb,bridgeId:x,initialPath:"clone"===ek?H:A,title:"local"===ek?"Select Local Repository":"Select Clone Parent Folder",description:"local"===ek?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>eg(!1),onSelect:e=>{if(eg(!1),e){if("clone"===ek)return void P(e);if(E(e),!N){let t=ed(e);t&&f(ei(t))}eq({path:e}),b("details")}}})]})}function eA({open:e,bridgeId:t,initialPath:r,title:n,description:l,onClose:o,onSelect:i}){let[d,c]=(0,s.useState)(""),[x,p]=(0,s.useState)(r??""),[v,m]=(0,s.useState)([]),[u,h]=(0,s.useState)(""),[b,g]=(0,s.useState)(!1),[k,f]=(0,s.useState)(null),[j,y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!e)return;h(""),p(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";g(!0),f(null),fetch((0,W.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);c("string"==typeof t?.currentPath?t.currentPath:""),m(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{f(e instanceof Error?e.message:"Failed to load directory"),m([])}).finally(()=>{g(!1)})},[r,e]);let N=(0,s.useMemo)(()=>{if(0===u.trim().length)return v;let e=u.trim().toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e))},[v,u]),w=async e=>{g(!0),f(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,W.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let n="string"==typeof s?.currentPath?s.currentPath:"";c(n),m(Array.isArray(s?.entries)?s.entries:[]),p(n)}catch(e){f(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},C=async()=>{y(!0);try{let e=await fetch((0,W.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;p(r.path),w(r.path)}catch{}finally{y(!1)}};return e?(0,a.jsx)("div",{className:`fixed ${X.Rn} z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0`,onClick:()=>{o(),i(null)},role:"presentation",children:(0,a.jsxs)("div",{className:`flex ${X.Cf} w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]`,onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:x,onChange:e=>p(e.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{w(x)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{w()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,a.jsx)("button",{type:"button",onClick:()=>{if(!d)return;let e=d.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(d)||"/"===e)return;let t=e.split("/").filter(Boolean),r=d.match(/^([A-Za-z]):[/\\]/);w(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,a.jsxs)("button",{type:"button",disabled:j,onClick:()=>{C()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[j?(0,a.jsx)(L.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(O.A,{className:"h-3 w-3"}),j?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:d||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(I.A,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:u,onChange:e=>h(e.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:b?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:k}):0===N.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:N.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&w(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(O.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{let e=x.trim().length>0?x.trim():d;o(),i(e||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function eE({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[n,l]=(0,s.useState)(!1);async function o(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void o(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[n?(0,a.jsx)(D.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(Z.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:n?r:t})]})}function eH({open:e,mode:t,creating:r,error:n,current:l,projectCount:o,agentOptions:i,agentStates:d,runtimeModelCatalogs:c,onRepositoriesChanged:x,onOnboardingComplete:p,onOpenAgentSetup:v,onClose:m,onSave:u,bridgeId:h}){var b,g;let k,[f,j]=(0,s.useState)("preferences"),[N,w]=(0,s.useState)(l.codingAgent),[C,S]=(0,s.useState)(l.ide),[A,E]=(0,s.useState)(l.markdownEditor),[H,P]=(0,s.useState)(l.markdownEditorPath??""),[R,M]=(0,s.useState)(()=>l.filesystemBrowseRoots.join("\n")),[$,U]=(0,s.useState)(!0===l.allowHomeBrowse),[_,I]=(0,s.useState)(l.modelAccess),[Z,K]=(0,s.useState)(l.notifications.soundEnabled),[Q,ee]=(0,s.useState)(l.notifications.soundFile),[et,er]=(0,s.useState)([]),[ea,ei]=(0,s.useState)(!1),[ed,ec]=(0,s.useState)(!1),[ex,ep]=(0,s.useState)(null),[eb,eg]=(0,s.useState)(""),[ej,eN]=(0,s.useState)(null),[eS,eP]=(0,s.useState)((0,en.Z3)()),[eR,eM]=(0,s.useState)([]),[e$,eU]=(0,s.useState)(!1),[eD,eB]=(0,s.useState)(null),[eO,eL]=(0,s.useState)(!1),[eF,e_]=(0,s.useState)(!1),[eI,eZ]=(0,s.useState)(!1),[eT,eq]=(0,s.useState)(()=>ek(null)),[ez,eG]=(0,s.useState)(!1),[eV,eW]=(0,s.useState)(!1),[eJ,eY]=(0,s.useState)(null),[eX,eK]=(0,s.useState)(null),[eQ,e0]=(0,s.useState)(!1),[e1,e2]=(0,s.useState)(null),e5=r||ed||eV;function e3(e){return{...e,agentPermissions:"skip"===e.agentPermissions?"skip":"default",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e4(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e7(e){ei(!0),ep(null);try{let t=await fetch((0,W.S)("/api/repositories",h)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];er(a);let s=a[0]?.id??"",n=e&&a.some(t=>t.id===e)?e:eb&&a.some(e=>e.id===eb)?eb:s;eg(n)}catch(e){er([]),eg(""),eN(null),eP((0,en.Z3)()),ep(e instanceof Error?e.message:"Failed to load repositories")}finally{ei(!1)}}async function e6(e,t){let r=(e??ej?.path??"").trim();if(0===r.length){eB("Select a repository path first."),eM([]);return}eU(!0),eB(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,W.S)(`/api/workspaces/branches?${e.toString()}`,h)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let n=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eM(n);let l=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():n[0]??"");if(!l)return;eN(e=>!e||e.defaultBranch.trim().length>0&&n.includes(e.defaultBranch)?e:{...e,defaultBranch:l})}catch(e){eM([]),eB(e instanceof Error?e.message:"Failed to detect branches")}finally{eU(!1)}}async function e8(){if(!ej||ed||0===ej.repo.trim().length||0===ej.path.trim().length)return!1;ec(!0),ep(null);try{let e=await fetch((0,W.S)("/api/repositories",h),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:ej.id,displayName:ej.displayName,repo:ej.repo,path:ej.path,agent:ej.agent,agentPermissions:ej.agentPermissions,agentModel:(0,en.xb)(eS)??"",agentReasoningEffort:(0,en.aB)(eS)??"",defaultWorkingDirectory:ej.defaultWorkingDirectory,defaultBranch:ej.defaultBranch,devServerScript:ej.devServerScript,devServerCwd:ej.devServerCwd,devServerUrl:ej.devServerUrl,devServerPort:ej.devServerPort,devServerHost:ej.devServerHost,devServerPath:ej.devServerPath,devServerHttps:ej.devServerHttps,setupScript:ej.setupScript,runSetupInParallel:ej.runSetupInParallel,cleanupScript:ej.cleanupScript,archiveScript:ej.archiveScript,copyFiles:ej.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return er(e=>e.map(e=>e.id===r.id?r:e)),eN(e3(r)),eg(r.id),eB(null),await e6(r.path,r.defaultBranch),x&&await x(),!0}catch(e){return ep(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{ec(!1)}}async function e9(){eG(!0),eY(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eq(ek(t?.access,t?.current))}catch(e){eq(ek(null)),eY(e instanceof Error?e.message:"Failed to load organization settings")}finally{eG(!1)}}async function te(){e0(!0),e2(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}eK(t)}catch(e){eK(null),e2(e instanceof Error?e.message:"Failed to load profile")}finally{e0(!1)}}async function tt(){if(eV)return!1;eW(!0),eY(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:eT.requireAuth||eT.trustedHeaders.enabled,defaultRole:eT.defaultRole,trustedHeaders:{enabled:eT.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:eT.trustedHeaders.emailHeader,jwtHeader:eT.trustedHeaders.jwtHeader,teamDomain:eT.trustedHeaders.teamDomain,audience:eT.trustedHeaders.audience},roles:{viewers:e4(eT.roles.viewers),operators:e4(eT.roles.operators),admins:e4(eT.roles.admins),viewerDomains:e4(eT.roles.viewerDomains),operatorDomains:e4(eT.roles.operatorDomains),adminDomains:e4(eT.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eq(ek(t?.access,t?.current)),!0}catch(e){return eY(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{eW(!1)}}(0,s.useEffect)(()=>{e&&(j("onboarding"===t?"preferences":"general"),w(l.codingAgent),S(l.ide),E(l.markdownEditor),P(l.markdownEditorPath??""),M(l.filesystemBrowseRoots.join("\n")),U(!0===l.allowHomeBrowse),I(l.modelAccess),K(l.notifications.soundEnabled),ee(l.notifications.soundFile),eM([]),eB(null),ep(null),eP((0,en.Z3)()),eY(null),eK(null),e2(null))},[t,e]),(0,s.useEffect)(()=>{e&&("settings"===t||"repositories"===f)&&e7()},[f,t,e]),(0,s.useEffect)(()=>{e&&"onboarding"!==t&&e9()},[t,e]),(0,s.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===f&&te()},[f,t,e]),(0,s.useEffect)(()=>{if(!e)return;if(!eb){eN(null),eP((0,en.Z3)());return}let t=et.find(e=>e.id===eb);if(!t)return;let r=(0,G.a6)(t.agent,N||el);eN(e3({...t,agent:r})),eP((0,en.c0)(r,_,c,t.agentModel,t.agentReasoningEffort)),eM([]),eB(null),t.path.trim().length>0&&e6(t.path,t.defaultBranch)},[N,_,e,et,c,eb]);let tr="onboarding"===t&&o>0,ta=(0,s.useMemo)(()=>"onboarding"===t?tr?em:em.filter(e=>"preferences"===e.id):ev.filter(e=>e.implemented),[t,tr]),ts=ta.find(e=>e.id===f)??ta[0]??ev[0],tn="onboarding"===t,tl="preferences"===ts.id,to="profile"===ts.id,ti="general"===ts.id,td="agents"===ts.id,tc=tl||ti||td,tx="repositories"===ts.id,tp="organization"===ts.id,tv=ta.findIndex(e=>e.id===ts.id)+1,tm=ta.some(e=>"repositories"===e.id),tu="admin"===eT.current.role,th=(0,s.useMemo)(()=>{let e=new Set((0,G.Ge)(i));N.trim().length>0&&(0,G.iQ)(N)&&e.add(N),0===e.size&&e.add(el);let t=new Map(G.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,z.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,z.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:eo(e).localeCompare(eo(r))})},[i,N]);(0,s.useEffect)(()=>{0!==th.length&&(N&&th.includes(N)||w((0,G.a6)(N,th[0]??el)))},[N,th]);let tb=d[(0,z.q)(N)]??null;if(!e)return null;let tg=N.trim().length>0&&C.trim().length>0&&A.trim().length>0,tk=!!ej&&ej.displayName.trim().length>0&&ej.repo.trim().length>0&&ej.path.trim().length>0&&ej.defaultBranch.trim().length>0,tf=tu&&!ez&&(!eT.trustedHeaders.enabled||eT.trustedHeaders.teamDomain.trim().length>0&&eT.trustedHeaders.audience.trim().length>0),tj=tx?ex:tp?eJ:to?e1:n,ty=ej?(b={...ej,agentModel:(0,en.xb)(eS)??"",agentReasoningEffort:(0,en.aB)(eS)??""},g={ide:C,markdownEditor:A},k=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${ey(b.path)}`,`--project-id ${ey(b.id)}`,`--display-name ${ey(b.displayName)}`,`--agent ${ey(b.agent||"claude-code")}`,`--ide ${ey(g.ide)}`,`--markdown-editor ${ey(g.markdownEditor)}`],b.repo.trim().length>0&&k.push(`--repo ${ey(b.repo.trim())}`),b.defaultBranch.trim().length>0&&k.push(`--default-branch ${ey(b.defaultBranch.trim())}`),b.agentModel.trim().length>0&&k.push(`--model ${ey(b.agentModel.trim())}`),b.agentReasoningEffort.trim().length>0&&k.push(`--reasoning-effort ${ey(b.agentReasoningEffort.trim())}`),b.defaultWorkingDirectory.trim().length>0&&k.push(`--default-working-directory ${ey(b.defaultWorkingDirectory.trim())}`),k.join(" ")):"";async function tN(e,t){let a,s;if(!tg||r)return!1;let n=await u((a=Z?Q??eh[0]?.id??"abstract-sound-4":null,s=R.split(/\n+/g).map(e=>e.trim()).filter(Boolean),{onboardingAcknowledged:!!e||l.onboardingAcknowledged,codingAgent:N.trim(),ide:C.trim(),markdownEditor:A.trim(),markdownEditorPath:(H??"").trim(),filesystemBrowseRoots:s,allowHomeBrowse:$,modelAccess:_,notifications:{soundEnabled:Z,soundFile:a}}),t);return n&&t?.openAgentSetup!==!1&&tb&&!tb.ready&&v(N),n}async function tw(){if(!ea){if(!tm){if(!await tN(!0,{closeDialog:!0}))return;p?.({needsProject:0===o});return}await tN(!1,{closeDialog:!1})&&j("repositories")}}async function tC(){(!tx||await e8())&&await tN(!0,{closeDialog:!0})&&p?.({needsProject:!1})}async function tS(){await tN(!0,{closeDialog:!0,openAgentSetup:!1})&&p?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:`fixed ${X.Rn} z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-6`,onClick:()=>{e5||"onboarding"===t||eO||eF||eI||m()},role:"presentation",children:(0,a.jsxs)("div",{className:`flex ${X.yq} ${X.w1} w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(90vh,820px)] sm:max-w-[1180px] sm:rounded-[6px] sm:border sm:flex-row`,onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tn?"Setup":"Settings"})}),(0,a.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:ta.map(e=>{let t=e.icon,r=ts.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>j(e.id),disabled:e5,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${r?"bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tn?tl?"Choose your preferences":"Review repository defaults":ts.label}),tn&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",tv," of ",ta.length]})]}),(0,a.jsx)("button",{type:"button",onClick:m,disabled:e5||"onboarding"===t,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,a.jsx)(B.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 pb-8 sm:px-6 sm:py-4 sm:pb-8",children:tc?(0,a.jsxs)("div",{className:"space-y-5",children:[tn&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using terminals and boards immediately."})}),(tl||td)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:th.map(e=>{let t=N===e,r=d[(0,z.q)(e)]??null,s=ef(e,_),n=(0,en.Ik)(e,_,c),l=n.slice(0,3),o=n.length-l.length,i=(0,Y.f)(r),x=(0,Y.y)(s);return(0,a.jsxs)("div",{className:`flex min-h-full flex-col gap-3 rounded-[4px] border px-3 py-3 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(V.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:eo(e)}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:i}),x?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:x}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,G.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[l.map(t=>(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:t.label},`${e}-${t.id}`)),o>0?(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",o," more"]}):null,0===l.length?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,y.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"mt-auto flex shrink-0 items-center gap-2 self-start",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{w(e),v(e)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>w(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(D.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,a.jsx)("div",{className:"grid gap-3",children:th.filter(e=>{let t=(0,y.yM)(e);return(0,y.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,y.yM)(e);if(!t)return null;let r=(0,y.Tk)(e,_)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,y.yM)(e))&&I(e=>({...e,[a.accessKey]:r})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(tl||ti)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:eu.map(e=>{let t=A===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>E(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(ew,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(D.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==A&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:H??"",readOnly:!0,onClick:()=>e_(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>e_(!0),disabled:e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,a.jsx)(O.A,{className:"h-4 w-4"})}),(H??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>P(""),disabled:e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Extra Filesystem Roots"}),(0,a.jsx)("textarea",{value:R,onChange:e=>M(e.target.value),placeholder:"One absolute path per line\n/Applications\n/Users/Shared\n/mnt/projects",rows:5,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eZ(!0),disabled:e5,className:"inline-flex h-9 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:[(0,a.jsx)(O.A,{className:"h-4 w-4"}),"Add folder"]}),(0,a.jsx)("button",{type:"button",onClick:()=>M(""),disabled:e5||0===R.trim().length,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear list"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor exposes the current workspace, configured project roots, and any extra roots listed here by default. Add another root only when the operator folder picker should expose that explicit location on this machine."})]})}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:$,onChange:e=>U(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent"}),(0,a.jsxs)("span",{className:"block",children:[(0,a.jsx)("span",{className:"block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Allow full home-directory browse"}),(0,a.jsx)("span",{className:"mt-1 block text-[12px] text-[var(--vk-text-muted)]",children:"Off by default. Enable this only when operator or admin sessions need to browse the full local home directory. Viewer sessions never get this access."}),(0,a.jsxs)("span",{className:"mt-1 block text-[11px] text-[var(--vk-text-dim)]",children:["Saved as ",(0,a.jsx)("code",{children:"preferences.allowHomeBrowse"})," in ",(0,a.jsx)("code",{children:"conductor.yaml"}),"."]})]})]})})]}),(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[eh.map(e=>{let t=Z&&Q===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{K(!0),ee(e.id),(0,J.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(T,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(D.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>K(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!Z?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(q,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!Z&&(0,a.jsx)(D.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):to?(0,a.jsx)(es,{profile:eX,loading:eQ,error:e1,onRefresh:()=>{te()}}):tx?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:tn?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:tn?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===t||et.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:eb,onChange:e=>eg(e.target.value),disabled:ea||0===et.length||e5,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===et.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),et.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),ea&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),tn&&1===et.length&&ej&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[ej.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:ej.path})]})]}),ej&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx --yes --registry=https://registry.npmjs.org conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",ej.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",ej.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",ej.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:ty})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,a.jsx)(eE,{value:ty,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:ej.displayName,onChange:e=>eN(t=>t?{...t,displayName:e.target.value}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:ej.repo,onChange:e=>eN(t=>t?{...t,repo:e.target.value}:t),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:ej.agent,onChange:e=>{let t=e.target.value;eN(e=>e?{...e,agent:t}:e),eP((0,en.c0)(t,_,c,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:th.map(e=>(0,a.jsx)("option",{value:e,children:eo(e)},e))}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,y.Zz)(ej.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(eC,{agent:ej.agent,modelAccess:_,runtimeModelCatalogs:c,selection:eS,onChange:eP})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:ej.agentPermissions,onChange:e=>eN(t=>t?{...t,agentPermissions:"skip"===e.target.value?"skip":"default"}:t),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,a.jsx)("option",{value:"default",children:"Agent default (approval prompts when supported)"}),(0,a.jsx)("option",{value:"skip",children:"Automatic mode (bypasses agent approval prompts)"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository. Automatic mode grants the selected agent broad local execution authority and should only be used in trusted workspaces."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ej.path,readOnly:!0,onClick:()=>eL(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eL(!0),disabled:e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,a.jsx)(O.A,{className:"h-4 w-4"})})]}),!ej.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),ej.pathHealth.exists&&!ej.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),ej.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=ej.pathHealth.suggestedPath??"";e&&(eN(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e6(e))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:ej.defaultWorkingDirectory,onChange:e=>eN(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:ej.defaultBranch,onChange:e=>eN(t=>t?{...t,defaultBranch:e.target.value}:t),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{e6()},disabled:e$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:e$?(0,a.jsx)(L.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(F.A,{className:"h-3.5 w-3.5"})})]}),eR.length>0&&(0,a.jsx)("select",{value:ej.defaultBranch,onChange:e=>eN(t=>t?{...t,defaultBranch:e.target.value}:t),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eR.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eD&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eD})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:ej.devServerScript,onChange:e=>eN(t=>t?{...t,devServerScript:e.target.value}:t),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:ej.devServerCwd,onChange:e=>eN(t=>t?{...t,devServerCwd:e.target.value}:t),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:ej.devServerUrl,onChange:e=>eN(t=>t?{...t,devServerUrl:e.target.value}:t),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:ej.devServerPort,onChange:e=>eN(t=>t?{...t,devServerPort:e.target.value}:t),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:ej.devServerHost,onChange:e=>eN(t=>t?{...t,devServerHost:e.target.value}:t),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:ej.devServerPath,onChange:e=>eN(t=>t?{...t,devServerPath:e.target.value}:t),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ej.devServerHttps,onChange:e=>eN(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:ej.setupScript,onChange:e=>eN(t=>t?{...t,setupScript:e.target.value}:t),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:ej.runSetupInParallel,onChange:e=>eN(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:ej.cleanupScript,onChange:e=>eN(t=>t?{...t,cleanupScript:e.target.value}:t),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:ej.archiveScript,onChange:e=>eN(t=>t?{...t,archiveScript:e.target.value}:t),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:ej.copyFiles,onChange:e=>eN(t=>t?{...t,copyFiles:e.target.value}:t),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):tp?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),ez?(0,a.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(L.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eT.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eT.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:eT.current.provider??"Local only"})]})]}),!tu&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eT.requireAuth,onChange:e=>eq(t=>({...t,requireAuth:e.target.checked})),disabled:!tu||eV||eT.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:eT.defaultRole,onChange:e=>eq(t=>({...t,defaultRole:e.target.value})),disabled:!tu||eV,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eT.trustedHeaders.enabled,onChange:e=>eq(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tu||eV,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:eT.trustedHeaders.emailHeader,onChange:e=>eq(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tu||eV,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:eT.trustedHeaders.jwtHeader,onChange:e=>eq(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tu||eV,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:eT.trustedHeaders.teamDomain,onChange:e=>eq(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tu||eV,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:eT.trustedHeaders.audience,onChange:e=>eq(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tu||eV,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,a.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,a.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:eT.roles[t],onChange:e=>eq(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tu||eV,placeholder:r,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:ts.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>j("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,a.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[tj&&(0,a.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:tj}),!tj&&tc&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tn?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tj&&tx&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tn?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!tj&&tp&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."}),!tj&&to&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!tn&&(0,a.jsx)("button",{type:"button",onClick:m,disabled:e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),tn&&tx&&(0,a.jsx)("button",{type:"button",onClick:()=>j("preferences"),disabled:e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),tc&&!tn&&(0,a.jsx)("button",{type:"button",onClick:()=>{tN(l.onboardingAcknowledged,{closeDialog:!0})},disabled:!tg||r,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),tx&&!tn&&(0,a.jsx)("button",{type:"button",onClick:()=>{e8()},disabled:!tk||ed||ea,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:ed?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),tp&&!tn&&(0,a.jsx)("button",{type:"button",onClick:()=>{tt()},disabled:!tf||eV,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:eV?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),tn&&(0,a.jsx)("button",{type:"button",onClick:()=>{tS()},disabled:!tg||e5,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Skip for now"}),tn&&(0,a.jsx)("button",{type:"button",onClick:()=>{tl?tw():tC()},disabled:tl?!tg||r||ea:!tk||e5,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:e5||tl&&ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),tl&&ea?"Loading...":"Saving..."]}):tl&&tm?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(eA,{open:eO,bridgeId:h,initialPath:ej?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eL(!1),onSelect:e=>{eL(!1),e&&(eN(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e6(e))}}),(0,a.jsx)(eA,{open:eF,bridgeId:h,initialPath:H??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>e_(!1),onSelect:e=>{e_(!1),null!==e&&P(e)}}),(0,a.jsx)(eA,{open:eI,bridgeId:h,title:"Add Filesystem Root",description:"Choose an extra folder root that should stay visible in the filesystem browser on this machine.",onClose:()=>eZ(!1),onSelect:e=>{eZ(!1),null!==e&&M(t=>{let r=t.split(/\n+/g).map(e=>e.trim()).filter(Boolean);return r.includes(e)?r.join("\n"):[...r,e].join("\n")})}})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51063],{31410:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},52915:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},69902:(e,t,s)=>{"use strict";s.d(t,{PublicPageShell:()=>n,PublicPanel:()=>d,PublicSection:()=>l});var a=s(54568),r=s(82175),i=s(46916);function n({children:e,className:t}){return(0,a.jsx)("main",{className:"h-[100dvh] overflow-x-hidden overflow-y-auto bg-[var(--bg-canvas)] text-[var(--text-strong)]",children:(0,a.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-6xl flex-col px-6 py-8 sm:px-8 sm:py-10",children:[(0,a.jsxs)("header",{className:"flex items-center gap-3 border-b border-[var(--border-soft)] pb-6",children:[(0,a.jsx)("img",{src:"/icon.svg",alt:"Conductor icon",width:40,height:40,className:"h-10 w-10 rounded-[10px] border border-[var(--border-soft)] bg-[var(--bg-panel)] p-1.5"}),(0,a.jsx)(r.default,{src:"/brand/conductor-wordmark-dark.png",alt:"Conductor",width:320,height:62,priority:!0,className:"h-auto w-[168px] sm:w-[220px]"})]}),(0,a.jsx)("div",{className:(0,i.cn)("flex-1 py-10 sm:py-12",t),children:e})]})})}function d({children:e,className:t}){return(0,a.jsx)("section",{className:(0,i.cn)("surface-card rounded-[var(--radius-lg)] border border-[var(--border-soft)] bg-[var(--bg-panel)]",t),children:e})}function l({eyebrow:e,title:t,description:s,children:r,className:n}){return(0,a.jsxs)("div",{className:(0,i.cn)("space-y-4",n),children:[e?(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-[var(--text-muted)]",children:e}):null,(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h1",{className:"text-3xl font-semibold tracking-[-0.02em] text-[var(--text-strong)] sm:text-4xl",children:t}),s?(0,a.jsx)("p",{className:"max-w-2xl text-base leading-7 text-[var(--text-muted)] sm:text-lg",children:s}):null]}),r]})}},82767:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,65587,23)),Promise.resolve().then(s.bind(s,69902)),Promise.resolve().then(s.bind(s,91591))},91591:(e,t,s)=>{"use strict";s.d(t,{default:()=>P});var a=s(54568),r=s(7620),i=s(65587),n=s.n(i),d=s(25010),l=s(94110),c=s(38874),o=s(31410),m=s(56961),x=s(61201),v=s(52915),h=s(37812),p=s(2937),u=s(54314),g=s(93035),b=s(13932),f=s(15321),j=s(63582),k=s(69902),w=s(61782),N=s(76081),y=s(44522),_=s(11984),C=s(46916),$=s(26167),A=s(61369),S=s(31404),I=s(15115),E=s(77522);function R(e){return`${e.hostname} \xb7 ${e.os}/${e.arch}${(0,I.wj)(e.last_status?.version)}`}function z({children:e,className:t,id:s}){return(0,a.jsx)("section",{id:s,className:(0,C.cn)("rounded-[24px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-6","shadow-[0_18px_36px_rgba(0,0,0,0.2)]",t),children:e})}function U({children:e}){return(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-[var(--vk-text-muted)]",children:e})}function M({children:e}){return(0,a.jsx)("div",{className:"rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-1.5 text-xs text-[var(--vk-text-muted)]",children:e})}function O({title:e,description:t,command:s,children:r,footer:i}){return(0,a.jsxs)("div",{className:"rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-5",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-[var(--vk-text-strong)]",children:e}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:t}),r,(0,a.jsx)("pre",{className:"mt-4 overflow-x-auto whitespace-pre-wrap break-all rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-3 font-mono text-sm leading-6 text-[var(--vk-text-normal)]",children:s}),i?(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:i}):null]})}function P({initialClaimToken:e=null,initialSelectedDeviceId:t=null,dashboardUrl:s,relayUrl:i,installScriptUrl:L,installPowerShellUrl:T}){let[F,B]=(0,r.useState)([]),[W,q]=(0,r.useState)(null),[D,G]=(0,r.useState)(null),[J,V]=(0,r.useState)(!0),[Y,H]=(0,r.useState)(!1),[K,Q]=(0,r.useState)(null),[X,Z]=(0,r.useState)(null),[ee,et]=(0,r.useState)(null),[es,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(!1),[en,ed]=(0,r.useState)(null),[el,ec]=(0,r.useState)(null),[eo,em]=(0,r.useState)(e?"pending":"idle"),[ex,ev]=(0,r.useState)(!1),[eh,ep]=(0,r.useState)("unix"),[eu,eg]=(0,r.useState)(null),[eb,ef]=(0,r.useState)(null),[ej,ek]=(0,r.useState)(null),[ew,eN]=(0,r.useState)(t),[ey,e_]=(0,r.useState)({deviceId:null,phase:"idle",message:null}),[eC,e$]=(0,r.useState)({deviceId:null,kind:null,status:"idle",message:null}),eA=(0,r.useRef)(new Set),eS=!!i?.trim(),eI="windows"===eh?T:L,eE=(0,r.useMemo)(()=>(0,A.$y)(eI,s,i,eh),[s,i,eI,eh]),eR=(0,r.useMemo)(()=>(0,A.G7)(eI,eh),[eI,eh]),ez=(0,r.useMemo)(()=>(0,A.hI)(s,i,eh),[s,i,eh]),eU=(0,r.useMemo)(()=>(0,A.zd)(W,i,eh),[W,i,eh]),eM=F.filter(e=>e.connected),eO=(0,r.useMemo)(()=>eb?F.find(e=>e.device_id===eb.deviceId)??null:null,[eb,F]),eP=(0,r.useMemo)(()=>ej?F.find(e=>e.device_id===ej)??null:null,[F,ej]),eL=(0,r.useMemo)(()=>F.find(e=>e.device_id===ew)??eO??eP??eM[0]??F[0]??null,[eO,eM,F,eP,ew]),eT=(0,r.useMemo)(()=>(0,A.Y8)(eL?.os),[eL?.os]),eF="windows"===eT?T:L,eB=(0,r.useMemo)(()=>(0,A.$y)(eF,s,i,eT),[s,T,L,i,eT,eF]),eW=(0,r.useMemo)(()=>(0,A.hI)(s,i,eT),[s,i,eT]),eq=(0,r.useMemo)(()=>(eO?.connected?eO:null)??(eP?.connected?eP:null)??(eL?.connected?eL:null)??eM[0]??null,[eO,eM,eP,eL]),eD=eq?`/?bridge=${encodeURIComponent(eq.device_id)}`:null,eG=eL?(0,A.kw)(eL.device_id):null,eJ=!!eL&&"running"===eC.status&&eC.deviceId===eL?.device_id,eV=eJ&&"repair"===eC.kind,eY=eJ&&"restart"===eC.kind,eH=!!eL&&(eC.deviceId===eL?.device_id&&(0,_.Az)(eC.message)||ey.deviceId===eL?.device_id&&(0,_.Az)(ey.message));(0,r.useEffect)(()=>{"u">typeof navigator&&ep(navigator.userAgent.toLowerCase().includes("windows")?"windows":"unix")},[]),(0,r.useEffect)(()=>{eN(e=>e&&(0===F.length||F.some(t=>t.device_id===e))?e:t&&(0===F.length||F.some(e=>e.device_id===t))?t:eO?.device_id??eP?.device_id??eM[0]?.device_id??F[0]?.device_id??null)},[eO,eM,F,t,eP]),(0,r.useEffect)(()=>{let e=()=>{ek((0,y.Tr)()?.deviceId??null)};return e(),window.addEventListener("focus",e),window.addEventListener("storage",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("storage",e)}},[]);let eK=(0,r.useCallback)(async()=>{if(!eS){V(!1),B([]),et(null);return}V(!0);try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load devices (${e.status})`);B((0,I.oH)(t?.devices)),et(null)}catch(e){B([]),et(e instanceof Error?e.message:"Failed to load paired devices.")}finally{V(!1)}},[eS]),eQ=(0,r.useCallback)(async()=>{if(e){if(!eS){em("idle"),eg("Bridge relay URL is not configured.");return}em("pending"),eg(null);try{let t=await fetch("/api/bridge/devices/claims/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({claim_token:e})}),s=await t.json().catch(()=>null);if(!t.ok||!s?.paired||!s.device_id||!s.device_name)throw Error(s?.error??`Failed to pair this laptop (${t.status})`);ef({deviceId:s.device_id,deviceName:s.device_name}),(0,y.m7)({deviceId:s.device_id,deviceName:s.device_name}),ek(s.device_id),em("paired"),await eK()}catch(e){em("idle"),eg(e instanceof Error?e.message:"Failed to complete the laptop claim.")}}},[e,eS,eK]);async function eX(){if(!eS)return void et("Bridge relay URL is not configured.");H(!0),Z(null);try{let e=await fetch("/api/bridge/devices/code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json().catch(()=>null);if(!e.ok||!t?.code)throw Error(t?.error??`Failed to create pairing code (${e.status})`);q(t.code),G(t.expires_in??null),et(null)}catch(e){et(e instanceof Error?e.message:"Failed to create pairing code.")}finally{H(!1)}}async function eZ(e,t){try{await navigator.clipboard.writeText(e),Z(t),et(null)}catch(e){Z(null),et(e instanceof Error?e.message:"Failed to copy command.")}}async function e0(e){if(eS){Q(e);try{let t=await fetch(`/api/bridge/devices/${encodeURIComponent(e)}`,{method:"DELETE"}),s=await t.json().catch(()=>null);if(!t.ok)throw Error(s?.error??`Failed to revoke device (${t.status})`);await eK()}catch(e){et(e instanceof Error?e.message:"Failed to revoke device.")}finally{Q(null)}}}async function e4(e){if(eS){e$({deviceId:e.device_id,kind:"restart",status:"running",message:`Restarting the bridge service on ${e.device_name}.`});try{let t=await (0,$.b)(e.device_id);e$({deviceId:e.device_id,kind:"restart",status:"completed",message:`${t} Waiting for ${e.device_name} to reconnect.`}),[2e3,5e3,1e4,2e4,35e3].forEach(e=>{window.setTimeout(()=>{eK()},e)})}catch(t){e$({deviceId:e.device_id,kind:"restart",status:"failed",message:t instanceof Error?t.message:`Failed to restart ${e.device_name}.`})}}}async function e1(e){if(eS){e$({deviceId:e.device_id,kind:"repair",status:"running",message:`Reinstalling the bridge service on ${e.device_name}.`});try{let t=(0,A.pj)(s,(0,A.Y8)(e.os)),a=await (0,$.E)(e.device_id,t);e$({deviceId:e.device_id,kind:"repair",status:"completed",message:a}),window.setTimeout(()=>{eK()},2e3)}catch(t){e$({deviceId:e.device_id,kind:"repair",status:"failed",message:t instanceof Error?t.message:`Failed to repair ${e.device_name}.`})}}}async function e2(e){eS&&(await (0,y.jV)(e,e_),window.setTimeout(()=>{eK()},2e3))}async function e3(){if(!eS){ea(!0),ei(!1),ed("Bridge relay URL is not configured.");return}ea(!0),ei(!0),ed(null),ec(null);try{var e;let t=eM[0];if(!t)throw Error("Connect a laptop first, then reopen the device terminal test.");let s=await fetch((0,S.S)("/api/sessions",t.device_id),{cache:"no-store"}),a=await s.json().catch(()=>null);if(!s.ok){let e=a&&!Array.isArray(a)?a.error:null;throw Error(e??`Failed to load sessions (${s.status})`)}let r=(e=Array.isArray(a)?a:a?.sessions??[]).find(e=>!E.C.has(e.status))??e[0]??null;if(!r)throw Error("Create or resume a session first, then reopen the bridge terminal test.");ec(r)}catch(e){ed(e instanceof Error?e.message:"Failed to load a session for bridge testing.")}finally{ei(!1)}}return(0,r.useEffect)(()=>{eS?eK():V(!1)},[eS,eK]),(0,r.useEffect)(()=>{if(e){if(!eS){em("idle"),eg("Bridge relay URL is not configured.");return}eQ()}},[eQ,e,eS]),(0,r.useEffect)(()=>{let e=(eO?.connected?eO:null)??(eP?.connected?eP:null)??(eL?.connected?eL:null);!e||eA.current.has(e.device_id)||(eA.current.add(e.device_id),(0,y.jV)(e,e_))},[eo,eO,eP,eL]),(0,r.useEffect)(()=>{!eP||eP.connected||ey.message||e_({deviceId:eP.device_id,phase:"checking",message:`Waiting for ${eP.device_name} to come online so Conductor can finish checking its package version.`})},[ey.message,eP]),(0,r.useEffect)(()=>{let t=!!ej&&!eP?.connected,s=!!ew&&!eL?.connected;if(!e&&("paired"!==eo||0!==eM.length)&&!t&&!s)return;let a=window.setInterval(()=>{eK()},4e3);return()=>{window.clearInterval(a)}},[eo,eM.length,e,ej,eP?.connected,eK,eL?.connected,ew]),(0,r.useEffect)(()=>{!eS||e||W||Y||!ex||eX()},[Y,e,W,eS,ex]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k.PublicPageShell,{className:"py-8 sm:py-10",children:(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-5",children:[(0,a.jsx)(z,{children:(0,a.jsxs)("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"max-w-3xl",children:[(0,a.jsx)(U,{children:"Conductor Bridge"}),(0,a.jsx)("h1",{className:"mt-3 text-3xl font-semibold tracking-[-0.03em] text-[var(--vk-text-strong)] sm:text-4xl",children:"Connect a laptop"}),(0,a.jsx)("p",{className:"mt-3 text-base leading-7 text-[var(--vk-text-muted)]",children:"Pair one machine, keep the bridge daemon running on it, and use it from the normal Conductor dashboard."}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,a.jsxs)(M,{children:[F.length," paired"]}),(0,a.jsxs)(M,{children:[eM.length," online"]}),(0,a.jsx)(M,{children:eq?`${eq.device_name} ready`:eL?`${eL.device_name} selected`:"No device selected"})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 lg:justify-end",children:[eD?(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:eD,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open ",eq?.device_name??"device"]})}):(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)("a",{href:"#bridge-setup",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Set up this laptop"]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eS,onClick:()=>{eK()},children:[(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Refresh"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eS||er||0===eM.length,onClick:()=>{e3()},children:[er?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(o.A,{className:"h-4 w-4"}),"Test connection"]})]})]})}),eS?null:(0,a.jsxs)(z,{className:"border-[color:color-mix(in_srgb,var(--vk-orange)_34%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] shadow-none",children:[(0,a.jsx)(U,{children:"Bridge relay"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Bridge relay URL is not configured"}),(0,a.jsxs)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:["Set ",(0,a.jsx)("code",{children:"CONDUCTOR_BRIDGE_RELAY_URL"})," to enable paired-device refresh, claims, and bridge management on this page."]})]}),eq?(0,a.jsx)(z,{className:"border-[rgba(24,197,143,0.32)] bg-[rgba(24,197,143,0.08)] shadow-none",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(U,{children:"Ready to use"}),(0,a.jsxs)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:[eq.device_name," is online"]}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Continue into the dashboard with this laptop selected, or open a live bridge test."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:eD??"/",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open dashboard"]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"lg",disabled:!eS||er,onClick:()=>{e3()},children:[(0,a.jsx)(o.A,{className:"h-4 w-4"}),"Open terminal test"]})]})]})}):null,ee?(0,a.jsx)("div",{className:"rounded-[20px] border border-[color:color-mix(in_srgb,var(--vk-red)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-5 py-4 text-sm text-[var(--vk-red)]",children:ee}):null,e?(0,a.jsxs)(z,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"max-w-3xl",children:[(0,a.jsx)(U,{children:"Device-first pairing"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"paired"===eo?"This laptop is paired":"Finishing this laptop claim"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"paired"===eo?"The local command can now finish the handshake on the same machine. This page will keep refreshing until the laptop reports online.":"Conductor is binding the currently-running machine to your account and returning device credentials to that local command."})]}),eb?(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"lg",children:(0,a.jsxs)(n(),{href:`/?bridge=${encodeURIComponent(eb.deviceId)}`,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Open ",eb.deviceName]})}):null]}),(0,a.jsx)("div",{className:"mt-5 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4 text-sm text-[var(--vk-text-muted)]",children:"pending"===eo?(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Waiting for the local command to receive its one-time device credentials."]}):"paired"===eo&&eb?(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(m.A,{className:"mt-0.5 h-4 w-4 text-[var(--vk-green)]"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"font-medium text-[var(--vk-text-strong)]",children:[eb.deviceName," is now paired."]}),(0,a.jsx)("div",{className:"mt-1",children:eO?.connected?"This laptop is online and ready to use.":"Conductor is still waiting for this laptop to come online. If you closed the setup terminal, rerun the hosted installer or `conductor-bridge connect` and keep that terminal open until the device reports online."}),ey.message?(0,a.jsxs)("div",{className:(0,C.cn)("mt-2 flex flex-wrap items-center gap-2 text-xs leading-5","failed"===ey.phase?"text-[var(--vk-red)]":"skipped"===ey.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,y.qv)(ey.phase)}),(0,a.jsx)("span",{children:ey.message})]}):null]})]}):eu?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-[var(--vk-red)]",children:eu}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{eQ()},children:[(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Retry claim"]})]}):null})]}):null,(0,a.jsxs)("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1.08fr)_minmax(0,0.92fr)]",children:[(0,a.jsxs)(z,{id:"bridge-setup",children:[(0,a.jsx)(U,{children:"Setup"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Connect this laptop"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Most users only need one command. Choose the shell for this laptop, then run the hosted bridge installer. It installs the bridge, opens the browser, and pairs the current laptop to this dashboard without requiring the full Conductor CLI first."}),(0,a.jsx)("div",{className:"mt-5 flex flex-wrap gap-2",children:[{value:"unix",label:"macOS / Linux"},{value:"windows",label:"Windows PowerShell"}].map(e=>(0,a.jsx)("button",{type:"button",className:(0,C.cn)("rounded-full border px-3 py-1.5 text-xs font-medium transition-colors",eh===e.value?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_14%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"),onClick:()=>{ep(e.value)},children:e.label},e.value))}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(O,{title:"Recommended command",description:"windows"===eh?"Run this in Windows PowerShell on the laptop you want to pair.":"Run this in Terminal on the laptop you want to pair.",command:eE,footer:(0,a.jsxs)(N.$,{type:"button",variant:"primary",size:"md",onClick:()=>{eZ(eE,"setup")},children:["setup"===X?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"setup"===X?"Setup command copied":"Copy setup command"]})})}),(0,a.jsxs)("ol",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 1"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Run the command in Terminal on macOS or Linux, or in PowerShell on Windows."})]}),(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 2"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Finish sign-in in the browser tab the command opens."})]}),(0,a.jsxs)("li",{className:"rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"Step 3"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-normal)]",children:"Leave the bridge daemon running so the laptop stays available."})]})]}),(0,a.jsxs)("div",{className:"mt-5 rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left",onClick:()=>{ev(e=>!e)},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-[var(--vk-text-strong)]",children:"Advanced options"}),(0,a.jsx)("div",{className:"mt-1 text-sm text-[var(--vk-text-muted)]",children:"Use these only if the default setup flow is not right for your case."})]}),ex?(0,a.jsx)(v.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}):(0,a.jsx)(h.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"})]}),ex?(0,a.jsxs)("div",{className:"space-y-4 border-t border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsx)(O,{title:"Install only",description:"Install the bridge now, then connect later from a new shell.",command:eR,footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{eZ(eR,"install")},children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"install"===X?"Install command copied":"Copy install command"]})}),(0,a.jsx)(O,{title:"Already installed",description:"Use this when the bridge is already installed on the laptop.",command:ez,footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{eZ(ez,"connect")},children:[(0,a.jsx)(x.A,{className:"h-4 w-4"}),"connect"===X?"Connect command copied":"Copy connect command"]})}),(0,a.jsx)(O,{title:"Manual fallback",description:"Use a one-time code only if the browser claim flow cannot finish on the same machine.",command:eU,children:(0,a.jsx)("div",{className:"mt-4 rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"One-time code"}),(0,a.jsx)("div",{className:"mt-3 font-mono text-4xl font-semibold tracking-[0.18em] text-[var(--vk-text-strong)]",children:W??"------"}),(0,a.jsx)("div",{className:"mt-3 text-sm text-[var(--vk-text-muted)]",children:W?`Valid for about ${Math.max(1,Math.round((D??600)/60))} minutes.`:"Generate a code to reveal the manual pair command."})]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:Y||!eS,onClick:()=>{eX()},children:[Y?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),W?"Generate new code":"Generate code"]})]})}),footer:(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:!W||!eS,onClick:()=>{eZ(eU,"manual")},children:["manual"===X?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"manual"===X?"Manual command copied":"Copy manual command"]})})]}):null]})]}),(0,a.jsxs)(z,{children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(U,{children:"Devices"}),(0,a.jsx)("h2",{className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Paired devices"}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Pick a laptop below, then continue into the dashboard with that device selected."})]}),(0,a.jsxs)(M,{children:[F.length," total"]})]}),eL?(0,a.jsx)("div",{className:"mt-5 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("div",{className:"text-base font-semibold text-[var(--vk-text-strong)]",children:eL.device_name}),(0,a.jsx)(j.J,{connected:eL.connected,title:`${eL.device_name} is ${eL.connected?"online":"offline"}`})]}),(0,a.jsx)("div",{className:"text-sm text-[var(--vk-text-muted)]",children:R(eL)}),ey.message&&ey.deviceId===eL.device_id?(0,a.jsxs)("div",{className:(0,C.cn)("flex flex-wrap items-center gap-2 text-xs leading-5","failed"===ey.phase?"text-[var(--vk-red)]":"skipped"===ey.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,y.qv)(ey.phase)}),(0,a.jsx)("span",{children:ey.message})]}):null,eC.message&&eC.deviceId===eL.device_id?(0,a.jsx)("div",{className:(0,C.cn)("text-xs leading-5","failed"===eC.status?"text-[var(--vk-red)]":"completed"===eC.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:eC.message}):null,eH?(0,a.jsx)(f.i,{deviceId:eL.device_id,deviceName:eL.device_name,deviceOs:eL.os,dashboardUrl:s,installScriptUrl:L,installPowerShellUrl:T,relayUrl:i}):null,eL.connected?(0,a.jsxs)("div",{className:"flex w-full flex-wrap gap-2",children:[(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:eJ||(0,y.xv)(ey,eL.device_id),onClick:()=>{e1(eL)},children:[eV?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Repair bridge"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:(0,y.xv)(ey,eL.device_id)||eJ,onClick:()=>{e2(eL)},children:[(0,y.xv)(ey,eL.device_id)?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(u.A,{className:"h-4 w-4"}),(0,y.xv)(ey,eL.device_id)?"Updating...":"Update Conductor"]}),(0,a.jsx)(N.$,{asChild:!0,variant:"primary",size:"md",children:(0,a.jsxs)(n(),{href:`/?bridge=${encodeURIComponent(eL.device_id)}`,children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),"Continue with ",eL.device_name]})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:eJ||(0,y.xv)(ey,eL.device_id),onClick:()=>{e4(eL)},children:[eY?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Restart service"]})]}):(0,a.jsxs)("div",{className:"w-full rounded-[16px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-[var(--vk-text-strong)]",children:[eL.device_name," is offline"]}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--vk-text-muted)]",children:"Open the same laptop and run the reconnect command below. If Conductor Bridge is missing or broken on that machine, use the full setup command instead."}),(0,a.jsx)("pre",{className:"mt-3 overflow-x-auto whitespace-pre-wrap break-all rounded-[14px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-3 font-mono text-sm leading-6 text-[var(--vk-text-normal)]",children:eW}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,a.jsxs)(N.$,{type:"button",variant:"primary",size:"md",onClick:()=>{eZ(eW,"connect")},children:["connect"===X?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"connect"===X?"Reconnect command copied":"Copy reconnect command"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",onClick:()=>{eZ(eB,"setup")},children:["setup"===X?(0,a.jsx)(m.A,{className:"h-4 w-4"}):(0,a.jsx)(x.A,{className:"h-4 w-4"}),"setup"===X?"Setup command copied":"Copy full setup command"]}),eG?(0,a.jsx)(N.$,{asChild:!0,variant:"outline",size:"md",children:(0,a.jsxs)(n(),{href:eG,children:[(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Reopen recovery steps"]})}):null]})]})]})}):null,(0,a.jsx)("div",{className:"mt-5 space-y-3",children:J?(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-4 text-sm text-[var(--vk-text-muted)]",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Loading paired devices..."]}):F.length>0?F.map(e=>{let t=eL?.device_id===e.device_id,s=(0,y.xv)(ey,e.device_id),r="running"===eC.status&&eC.deviceId===e.device_id,i=r&&"repair"===eC.kind,d=r&&"restart"===eC.kind;return(0,a.jsx)("div",{className:(0,C.cn)("rounded-[18px] border bg-[var(--vk-bg-main)] p-4",t?"border-[var(--vk-orange)]":"border-[var(--vk-border)]"),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[(0,a.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:()=>{eN(e.device_id)},children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("div",{className:"truncate text-base font-medium text-[var(--vk-text-strong)]",children:e.device_name}),(0,a.jsx)(j.J,{connected:e.connected,title:`${e.device_name} is ${e.connected?"online":"offline"}`}),t?(0,a.jsx)("span",{className:"rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-1 text-[11px] text-[var(--vk-text-muted)]",children:"Selected"}):null]}),(0,a.jsx)("div",{className:"mt-2 text-sm text-[var(--vk-text-muted)]",children:R(e)}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-[var(--vk-text-muted)]",children:["Relay: ",e.last_status?.hostname??e.hostname,(0,I.wj)(e.last_status?.version)]}),ey.message&&ey.deviceId===e.device_id?(0,a.jsxs)("div",{className:(0,C.cn)("mt-2 flex flex-wrap items-center gap-2 text-xs leading-5","failed"===ey.phase?"text-[var(--vk-red)]":"skipped"===ey.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,a.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,y.qv)(ey.phase)}),(0,a.jsx)("span",{children:ey.message})]}):null,eC.message&&eC.deviceId===e.device_id?(0,a.jsx)("div",{className:(0,C.cn)("mt-2 text-xs leading-5","failed"===eC.status?"text-[var(--vk-red)]":"completed"===eC.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:eC.message}):null]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center gap-2 xl:w-auto xl:justify-end",children:[e.connected?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.$,{asChild:!0,variant:t?"primary":"outline",size:"md",children:(0,a.jsx)(n(),{href:`/?bridge=${encodeURIComponent(e.device_id)}`,children:t?"Continue":"Open"})}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:r||s,onClick:()=>{eN(e.device_id),e1(e)},children:[i?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(p.A,{className:"h-4 w-4"}),"Repair"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:s||r,onClick:()=>{eN(e.device_id),e2(e)},children:[s?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(u.A,{className:"h-4 w-4"}),s?"Updating...":"Update"]}),(0,a.jsxs)(N.$,{type:"button",variant:"outline",size:"md",disabled:r||s,onClick:()=>{eN(e.device_id),e4(e)},children:[d?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(l.A,{className:"h-4 w-4"}),"Restart"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-xs text-[var(--vk-text-muted)]",children:"Offline"}),(0,a.jsx)(N.$,{asChild:!0,variant:t?"primary":"outline",size:"md",children:(0,a.jsx)(n(),{href:(0,A.kw)(e.device_id),onClick:()=>{eN(e.device_id)},children:"Reconnect"})})]}),(0,a.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",disabled:K===e.device_id,onClick:()=>{e0(e.device_id)},"aria-label":`Revoke ${e.device_name}`,children:K===e.device_id?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(g.A,{className:"h-4 w-4"})})]})]})},e.device_id)}):(0,a.jsx)("div",{className:"rounded-[18px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-4 py-6 text-sm text-[var(--vk-text-muted)]",children:"No laptops have been paired yet. Run the setup command on the laptop you want to use."})})]})]})]})}),es?(0,a.jsxs)("div",{className:"fixed inset-0 z-[85] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",children:[(0,a.jsx)("button",{type:"button",className:"absolute inset-0","aria-label":"Close bridge terminal test",onClick:()=>{ea(!1)}}),(0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"bridge-test-title",className:"relative z-10 flex max-h-[92vh] w-full max-w-6xl flex-col overflow-hidden rounded-[24px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_28px_80px_rgba(0,0,0,0.4)]",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 border-b border-[var(--vk-border)] px-5 py-5 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.24em] text-[var(--vk-text-muted)]",children:"Bridge terminal test"}),(0,a.jsx)("h2",{id:"bridge-test-title",className:"mt-2 text-xl font-semibold text-[var(--vk-text-strong)]",children:"Live session over Conductor Bridge"}),(0,a.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-[var(--vk-text-muted)]",children:el?`${el.projectId}${el.branch?` \xb7 ${el.branch}`:""}`:"Open a session here to verify terminal input and output through the bridge."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(j.J,{connected:eM.length>0,title:`${eM.length} connected device${1===eM.length?"":"s"}`}),(0,a.jsx)(N.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{ea(!1)},"aria-label":"Close bridge test modal",children:(0,a.jsx)(b.A,{className:"h-4 w-4"})})]})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col px-5 py-5",children:[0===eM.length?(0,a.jsx)("div",{className:"mb-4 rounded-[18px] border border-[color:color-mix(in_srgb,var(--vk-red)_28%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_10%,transparent)] px-4 py-3 text-sm text-[var(--vk-text-muted)]",children:"No paired bridge reports as online right now. Reconnect a laptop to test the live terminal path."}):null,er?(0,a.jsx)("div",{className:"flex min-h-[360px] flex-1 items-center justify-center rounded-[20px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-sm text-[var(--vk-text-muted)]",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}),"Preparing a session for the bridge test..."]})}):en?(0,a.jsx)("div",{className:"rounded-[20px] border border-[color:color-mix(in_srgb,var(--vk-red)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-red)_12%,transparent)] px-5 py-4 text-sm text-[var(--vk-red)]",children:en}):el?(0,a.jsx)("div",{className:"min-h-[420px] flex-1 overflow-hidden rounded-[20px] border border-[var(--vk-border)] bg-[#060404]",children:(0,a.jsx)(w.SessionTerminal,{sessionId:el.id,projectId:el.projectId,bridgeId:el.bridgeId,sessionState:el.status,pendingInsert:null})}):(0,a.jsx)("div",{className:"rounded-[20px] border border-dashed border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-5 py-10 text-sm text-[var(--vk-text-muted)]",children:"No session is available for bridge testing yet."})]})]})]}):null]})}},93035:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(39789).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])}},e=>{e.O(0,[63357,65587,82746,68782,76509,84271,61782,587,61968,77358],()=>e(e.s=82767)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58974],{12529:(e,t,r)=>{Promise.resolve().then(r.bind(r,86660))},51164:(e,t,r)=>{"use strict";r.d(t,{v:()=>c});var a=r(76196);let n=["pro","max","api"],s=["chatgpt","api"],l=["default"],i=["oauth","api"],o=["oauth","api"];function d(e,t,r){return"string"==typeof e&&t.includes(e)?e:r}function c(e){let t=!e||"object"!=typeof e||Array.isArray(e)?{}:{...e},r=(0,a.Zp)();return{amp:d(t.amp,l,r.amp),claudeCode:d(t.claudeCode,n,r.claudeCode),codex:d(t.codex,s,r.codex),cursorCli:d(t.cursorCli,l,r.cursorCli),droid:d(t.droid,l,r.droid),gemini:d(t.gemini,i,r.gemini),githubCopilot:d(t.githubCopilot,l,r.githubCopilot),opencode:d(t.opencode,l,r.opencode),pi:d(t.pi,l,r.pi),qwenCode:d(t.qwenCode,o,r.qwenCode),ccr:d(t.ccr,l,r.ccr)}}},53989:(e,t,r)=>{"use strict";function a(e){return e?.checking?"Checking install":e?.installed?e.ready?"CLI ready":!1===e.configured?"Auth needed":"Setup needed":"Install needed"}function n(e){let t=e?.trim();return t?`Access: ${t}`:null}r.d(t,{f:()=>a,y:()=>n})},85905:(e,t,r)=>{"use strict";r.d(t,{P:()=>s});var a=r(31404);function n(e){return e&&"object"==typeof e?e:null}async function s({files:e,projectId:t,taskRef:r,bridgeId:l,preferAbsolute:i=!0}){if(!e.length)return[];let o=t.trim();if(!o)throw Error("Project id is required to upload attachments");let d=new FormData;d.append("projectId",o);let c=r?.trim();for(let t of(c&&d.append("taskRef",c),e))d.append("files",t);let x=await fetch((0,a.S)("/api/attachments",l),{method:"POST",body:d}),p=await x.json().catch(()=>null);if(!x.ok){let t=1===e.length?e[0]?.name??"attachment":`${e.length} attachments`;throw Error(p?.error??`Failed to upload ${t}`)}let u=(Array.isArray(p?.files)?p.files:p?[p]:[]).map(e=>(function(e,t){let r=n(e);if(!r)return null;let a=n(r.attachment);for(let e of t?[r.absolutePath,r.path,r.filePath,a?.absolutePath,a?.path,a?.filePath]:[r.path,r.absolutePath,r.filePath,a?.path,a?.absolutePath,a?.filePath])if("string"==typeof e&&e.trim().length>0)return e.trim();return null})(e,i)).filter(e=>!!e);if(0===u.length)throw Error("Attachment upload succeeded but did not return a usable file path");return u}},86660:(e,t,r)=>{"use strict";r.d(t,{default:()=>eb});var a=r(54568),n=r(42925),s=r(79748),l=r(7620),i=r(45492);r(76196);var o=r(52353),d=r(20487),c=r(58212),x=r(38724),p=r(19755),u=r(83328),m=r(15255),h=r(43508),v=r(46277),b=r(67107),f=r(38874),g=r(13932),j=r(68179),k=r(97337),w=r(5966),y=r(37812),N=r(77024),S=r(49731),A=r(95947),C=r(1173),I=r(5739),E=r(33866),$=r(35821),M=r(95106),P=r(38513),L=r(86011),B=r(22153),O=r(46012),U=r(862),_=r(12060),q=r(63582),W=r(86181),F=r(72410),R=r(85905),D=r(79290),T=r(31404),V=r(84527),z=r(15115),G=r(83770),H=r(10926);function Z(e){return e.map(e=>(0,H.C0)(e)).filter(e=>null!==e)}var J=r(67506),X=r(76050),K=r(53989),Q=r(51164),Y=r(88272);let ee="claude-code",et="conductor-board-dispatcher-panel-width";function er(e){let t=e?.trim();return t&&t.length>0?t:null}function ea(e,t){return Math.min(Math.min(720,Math.max(320,Math.floor(.55*(Number.isFinite(t)&&t>0?t:720)))),Math.max(320,Math.round(e)))}let en=(0,n.default)(()=>Promise.all([r.e(35493),r.e(42354)]).then(r.bind(r,35493)).then(e=>e.SessionDetail),{loadableGenerated:{webpack:()=>[35493]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading session..."})}),es=(0,n.default)(()=>Promise.all([r.e(29450),r.e(51478)]).then(r.bind(r,29450)).then(e=>e.WorkspaceSidebarPanel),{loadableGenerated:{webpack:()=>[29450]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading workspace panel..."})}),el=(0,n.default)(()=>r.e(41696).then(r.bind(r,41696)).then(e=>e.WorkspaceOverview),{loadableGenerated:{webpack:()=>[41696]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading workspace..."})}),ei=(0,n.default)(()=>r.e(39816).then(r.bind(r,39816)).then(e=>e.WorkspaceKanban),{loadableGenerated:{webpack:()=>[39816]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading board..."})}),eo=(0,n.default)(()=>Promise.all([r.e(39526),r.e(97734),r.e(47369),r.e(20038)]).then(r.bind(r,44838)).then(e=>e.ProjectDispatcherPanel),{loadableGenerated:{webpack:()=>[44838]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading dispatcher..."})}),ed=(0,n.default)(()=>Promise.all([r.e(77401),r.e(39526),r.e(97734),r.e(17139),r.e(81132)]).then(r.bind(r,81132)).then(e=>e.ProjectNotesWorkspace),{loadableGenerated:{webpack:()=>[81132]},loading:()=>(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading notes workspace..."})}),ec=(0,n.default)(()=>Promise.all([r.e(83342),r.e(95381)]).then(r.bind(r,95381)).then(e=>e.NewWorkspaceDialog),{loadableGenerated:{webpack:()=>[95381]},loading:()=>null}),ex=(0,n.default)(()=>Promise.all([r.e(83342),r.e(95381)]).then(r.bind(r,95381)).then(e=>e.SettingsDialog),{loadableGenerated:{webpack:()=>[95381]},loading:()=>null});function ep(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function eu(e){return e.issueId?.trim()||e.taskRef?.trim()||e.id}function em(e){let[t]=e.split(" - ");return(t??e).trim()}function eh(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function ev(e,t){let r=eh(e),a=eh(r.notifications),n=a.soundFile,s="string"==typeof r.codingAgent&&r.codingAgent.trim().length>0?r.codingAgent.trim():t,l=(0,E.a6)(s,t),i="string"==typeof r.ide&&r.ide.trim().length>0?r.ide.trim():"vscode",o="string"==typeof r.markdownEditor&&r.markdownEditor.trim().length>0?r.markdownEditor.trim():"obsidian",d="string"==typeof r.markdownEditorPath?r.markdownEditorPath.trim():"",c=Array.isArray(r.filesystemBrowseRoots)?r.filesystemBrowseRoots.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean):[],x=!0===r.allowHomeBrowse;return{onboardingAcknowledged:!0===r.onboardingAcknowledged,codingAgent:l,ide:i,markdownEditor:o,markdownEditorPath:d,filesystemBrowseRoots:c,allowHomeBrowse:x,modelAccess:(0,Q.v)(r.modelAccess),notifications:{soundEnabled:!1!==a.soundEnabled,soundFile:null===n?null:"string"==typeof n&&n.trim().length>0?n.trim():"abstract-sound-4"}}}function eb({requiresPairedDeviceScope:e=!1}){let t=(0,s.useRouter)(),r=(0,s.usePathname)(),n=(0,s.useSearchParams)(),i=(0,l.useMemo)(()=>er(n.get("project")),[n]),o=(0,l.useMemo)(()=>er(n.get("session")),[n]),d=(0,l.useMemo)(()=>{var e;return"board"===(e=n.get("view"))?"board":"notes"===e?"notes":"direct"},[n]),c=(0,l.useMemo)(()=>er(n.get("bridge")),[n]),[x,p]=(0,l.useState)(c??""),h=(0,H.C0)(x),v=(0,l.useMemo)(()=>(0,H.DW)(o)?.bridgeId??null,[o]),j=c??v,k=h??v,[w,y]=(0,l.useState)([]),[N,S]=(0,l.useState)("loading"),[A,C]=(0,l.useState)(null),F=!!(0,J.y)()&&null===A,R=(0,l.useMemo)(()=>w.filter(e=>e.connected),[w]),K=(0,l.useMemo)(()=>R.map(e=>e.bridgeId),[R]),eu=(0,l.useMemo)(()=>(function({requiresPairedDeviceScope:e,effectiveBridgeId:t,connectedBridgeIds:r,bridgeInventoryStatus:a}){if(!e)return!1;let n=(0,H.C0)(t);return!!n&&("loading"===a||"ready"===a&&!Z(r).includes(n))})({requiresPairedDeviceScope:e,effectiveBridgeId:k,connectedBridgeIds:K,bridgeInventoryStatus:N}),[N,K,k,e]);(0,l.useMemo)(()=>(function({requiresPairedDeviceScope:e,effectiveBridgeId:t,connectedBridgeIds:r,bridgeInventoryStatus:a}){if(!e)return!0;let n=(0,H.C0)(t);return!!n&&"ready"===a&&Z(r).includes(n)})({requiresPairedDeviceScope:e,effectiveBridgeId:k,connectedBridgeIds:K,bridgeInventoryStatus:N}),[N,K,k,e]);let em=(0,l.useMemo)(()=>!e||!!k,[k,e]),{projects:eh,loading:eg,error:ej,recovering:ek,refresh:ew}=(0,P.U)(k,{enabled:em}),{agents:ey,loading:eN}=(0,B._)(k,{enabled:em}),{mobileSidebarOpen:eS,desktopSidebarOpen:eA,toggleSidebar:eC,closeSidebarOnMobile:eI,syncSidebarForViewport:eE}=(0,O.T)({initialDesktopOpen:!1}),e$=eS||eA,eM=!o||e$,{sessions:eP,loading:eL,error:eB,refresh:eO}=(0,M.t)(i,{enabled:eM&&em,bridgeId:k}),[eU,e_]=(0,l.useState)(""),[eq,eW]=(0,l.useState)(""),[eF,eR]=(0,l.useState)((0,Y.Z3)()),[eD,eT]=(0,l.useState)(!1),[eV,ez]=(0,l.useState)(null),[eG,eH]=(0,l.useState)(null),[eZ,eJ]=(0,l.useState)(!1),[eX,eK]=(0,l.useState)(!1),[eQ,eY]=(0,l.useState)(null),[e0,e1]=(0,l.useState)(null),[e3,e4]=(0,l.useState)(!0),[e2,e5]=(0,l.useState)(!1),[e6,e9]=(0,l.useState)(null),[e8,e7]=(0,l.useState)(!1),[te,tt]=(0,l.useState)(!1),[tr,ta]=(0,l.useState)(()=>o?[o]:[]),[tn,ts]=(0,l.useState)(!1),[tl,ti]=(0,l.useState)(!1),[to,td]=(0,l.useState)(()=>o?"chat":"board"),[tc,tx]=(0,l.useState)(!1),[tp,tu]=(0,l.useState)(405),[tm,th]=(0,l.useState)(!1),tv=(0,l.useRef)(null),tb=(0,l.useRef)(i);(0,l.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{ts((0,W.k$)())};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),(0,l.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia(D.In):null,t=()=>{ti(e?.matches??window.innerWidth>=1280)};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),(0,l.useEffect)(()=>{if("board"!==d||null===i){tb.current=i,td("board");return}let e=tb.current!==i;(tb.current=i,o)?td("chat"):e&&td("board")},[i,o,d]),(0,l.useEffect)(()=>{try{let e=window.localStorage.getItem(et),t=e?Number.parseInt(e,10):NaN;Number.isFinite(t)&&tu(ea(t,window.innerWidth))}catch{}let e=()=>{tu(e=>ea(e,window.innerWidth))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,l.useEffect)(()=>{if(!tm)return;let e=e=>{let t=window.innerWidth;tu(ea(t-e.clientX,t))},t=()=>{th(!1)};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t),document.body.style.userSelect="",document.body.style.cursor="";try{window.localStorage.setItem(et,String(tp))}catch{}}},[tm,tp]),(0,l.useEffect)(()=>{if(!F){y([]),S("ready"),e&&t.replace("/bridge/connect");return}let r=!1,a=window.innerWidth<768,n=eu?a?8e3:4e3:a?3e4:15e3;async function s(){try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){if((0,G.Xt)(t?.error)){r||(C(t?.error??null),y([]),S("ready"));return}throw Error(`Failed to fetch bridges: ${e.status}`)}r||(C(null),y((0,z.oH)(t?.devices).map(e=>({bridgeId:e.device_id,hostname:e.last_status?.hostname??e.hostname,os:`${e.last_status?.os??`${e.os}/${e.arch}`}${(0,z.wj)(e.last_status?.version)}`,capabilities:[],connected:e.connected,status:e.connected?"connected":"offline",connectedAt:"",lastSeenAt:""}))),S("ready"))}catch{r||(y([]),S("error"))}}s();let l=window.setInterval(()=>{s()},n);return()=>{r=!0,window.clearInterval(l)}},[F,eu,e,t]),(0,l.useEffect)(()=>{let t=function({requiresPairedDeviceScope:e,requestedBridgeId:t,selectedBridgeId:r,connectedBridgeIds:a}){let n=(0,H.C0)(t),s=(0,H.C0)(r),l=Z(a);return e?n||(0===l.length?"":s&&l.includes(s)?s:l[0]??""):s&&l.includes(s)?s:""}({requiresPairedDeviceScope:e,requestedBridgeId:j,selectedBridgeId:x,connectedBridgeIds:K});t!==x&&p(t)},[K,j,e,x]),(0,l.useEffect)(()=>{!e||k||"ready"!==N||R.length>0||t.replace("/bridge/connect")},[N,R.length,k,e,t]),(0,l.useEffect)(()=>{p(c??"")},[c]);let tf=(0,l.useMemo)(()=>new Map(eP.map(e=>[e.id,e])),[eP]),{session:tg,loading:tj,error:tk}=(0,$.w)(o,null,{enabled:!!o&&em,bridgeId:k}),tw=eV??ej??eB??tk??e6,ty=(0,l.useMemo)(()=>{let e=new Map;for(let t of eP){let r=e.get(t.projectId);r?r.push(t):e.set(t.projectId,[t])}return e},[eP]),tN=(0,l.useCallback)((e,a="push")=>{let s=new URLSearchParams(n.toString()),l=(e,t)=>{let r="string"==typeof t?t.trim():"";r.length>0?s.set(e,r):s.delete(e)};"projectId"in e&&l("project",e.projectId),"sessionId"in e&&l("session",e.sessionId),"workspaceView"in e&&("board"===e.workspaceView?s.set("view","board"):"notes"===e.workspaceView?s.set("view","notes"):s.delete("view")),"tab"in e&&(e.tab&&"dispatcher"!==e.tab?s.set("tab",e.tab):s.delete("tab")),"bridgeId"in e&&l("bridge",e.bridgeId),s.has("project")||s.delete("view"),s.has("session")||s.delete("tab");let i=s.toString(),o=i.length>0?`${r}?${i}`:r;"replace"===a?t.replace(o,{scroll:!1}):t.push(o,{scroll:!1})},[r,t,n]);(0,l.useEffect)(()=>{let e=(0,H.C0)(x);(c??null)!==e&&tN({bridgeId:e},"replace")},[c,tN,x]),(0,l.useEffect)(()=>{if(!eg&&!ej){if(0===eh.length){null!==i&&tN({projectId:null,workspaceView:null},"replace");return}null===i||eh.some(e=>e.id===i)||tN({projectId:o?null:eh[0]?.id??null,workspaceView:o?null:d},"replace")}},[ej,eg,tN,eh,i,o,d]),(0,l.useEffect)(()=>{if(o){if(eM){if(eL||eB)return;eP.some(e=>e.id===o)||tN({sessionId:null,tab:null},"replace");return}!tj&&(tg||tN({sessionId:null,tab:null},"replace"))}},[eP,tN,eM,o,tj,tg,eB,eL]),(0,l.useEffect)(()=>{o?ta(e=>[o,...e.filter(e=>e!==o)].slice(0,1)):ta([])},[o]),(0,l.useEffect)(()=>{o&&tv.current&&tv.current!==o&&(tv.current=null)},[o]),(0,l.useEffect)(()=>{o&&eM&&!eL&&!eB&&ta(e=>e.filter(e=>e===o||tf.has(e)))},[eM,o,tf,eB,eL]);let tS=(0,l.useMemo)(()=>tg,[tg]),tA=(0,l.useMemo)(()=>eh.find(e=>e.id===i)??null,[eh,i]),tC=(0,l.useMemo)(()=>i?ty.get(i)??[]:[],[i,ty]),tI=(0,l.useMemo)(()=>tS??(o?tf.get(o)??null:null),[tS,o,tf]),tE=(0,l.useMemo)(()=>{let e=n.get("tab");return"overview"!==e&&"preview"!==e&&"diff"!==e&&"dispatcher"!==e&&"terminal"===(0,X.tK)(tI)},[tI,n]),t$=!!o&&tE&&tn,tM=(0,l.useMemo)(()=>tA&&("board"===d||"notes"===d)?[tA.id,tA.defaultBranch||"main"].filter(Boolean).join(" \xb7 "):tS?[tS.projectId,tS.branch].filter(Boolean).join(" \xb7 "):tA?[tA.id,tA.defaultBranch||"main"].filter(Boolean).join(" \xb7 "):"All Projects",[tA,tS,d]),tP=(0,l.useMemo)(()=>k?w.find(e=>e.bridgeId===k)??null:null,[w,k]),tL=tP?`Device \xb7 ${tP.hostname}`:eu?"Device \xb7 Reconnecting":e?"Scope \xb7 Paired device required":"Scope \xb7 Local backend",tB=tP?`Showing projects and sessions from ${tP.hostname}.`:eu?"Waiting for the selected laptop to reconnect before loading dashboard data.":e?"Hosted dashboard access must target a connected laptop.":"Showing projects and sessions from the local backend because no paired laptop is selected.",tO=tP?"border-[rgba(24,197,143,0.35)] bg-[rgba(24,197,143,0.12)] text-[var(--vk-green)]":eu?"border-[color:color-mix(in_srgb,var(--vk-accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":e?"border-[rgba(255,143,122,0.24)] bg-[rgba(255,143,122,0.08)] text-[var(--vk-red)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-muted)]",tU=(0,l.useMemo)(()=>{let e=Array.isArray(ey)?ey:[],t=new Set;for(let e of E.pN)t.add(e.name);for(let r of e)r.name&&t.add(r.name);for(let e of eh)e.agent&&t.add(e.agent);e0?.codingAgent&&t.add(e0.codingAgent),eq&&t.add(eq),0===t.size&&t.add(e0?.codingAgent||ee);let r=(0,E.Ge)(t);return 0===r.length&&r.push((0,E.a6)(e0?.codingAgent||ee,ee)),r},[ey,e0?.codingAgent,eh,eq]),t_=(0,l.useMemo)(()=>{let e={};for(let t of E.pN)e[(0,I.q)(t.name)]={name:t.name,checking:eN,ready:!1,installed:!1,configured:!1,homepage:t.homepage,description:t.description,installHint:t.installHint??null,installUrl:t.installUrl??t.homepage??null,setupUrl:t.setupUrl??t.homepage??null};for(let t of Array.isArray(ey)?ey:[]){if(!t.name)continue;let r=(0,I.q)(t.name),a=(0,E.h7)(t.name);e[(0,I.q)(t.name)]={name:a?.name??t.name,checking:!1,ready:!0===t.ready,installed:!1!==t.installed,configured:!0===t.configured,homepage:"string"==typeof t.homepage?t.homepage:a?.homepage??e[r]?.homepage??null,description:"string"==typeof t.description?t.description:a?.description??e[r]?.description??null,installHint:"string"==typeof t.installHint?t.installHint:a?.installHint??e[r]?.installHint??null,installUrl:"string"==typeof t.installUrl?t.installUrl:a?.installUrl??e[r]?.installUrl??null,setupUrl:"string"==typeof t.setupUrl?t.setupUrl:a?.setupUrl??e[r]?.setupUrl??null}}return e},[ey,eN]),tq=(0,l.useMemo)(()=>{let e={};for(let t of Array.isArray(ey)?ey:[])t.name&&t.runtimeModelCatalog&&(e[(0,I.q)(t.name)]=t.runtimeModelCatalog);return e},[ey]),tW=(0,l.useCallback)(e=>{let t=t_[(0,I.q)(e)],r=(0,E.h7)(e),a=t?.installed?t?.setupUrl??r?.setupUrl??t?.homepage??r?.homepage:t?.installUrl??r?.installUrl??t?.setupUrl??r?.setupUrl??t?.homepage??r?.homepage;a&&window.open(a,"_blank","noopener,noreferrer")},[t_]);async function tF(t,r){e5(!0),e9(null);try{if(e&&!k)throw Error("Pair or reconnect a laptop before saving preferences.");let a=await fetch((0,T.S)("/api/preferences",k),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await a.json().catch(()=>null);if(!a.ok)throw Error(n?.error??n?.reason??`Failed to save preferences: ${a.status}`);let s=ev(n?.preferences,t.codingAgent||ee);return e1(s),eW(s.codingAgent),r?.closeDialog!==!1&&e7(!1),!0}catch(e){return e9(e instanceof Error?e.message:"Failed to save preferences"),!1}finally{e5(!1)}}(0,l.useEffect)(()=>{let e=!1;return async function(){if(!em){e||(e1(null),e9(null),e4(!1));return}e4(!0);try{let t=await fetch((0,T.S)("/api/preferences",k)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??r?.reason??`Failed to load preferences: ${t.status}`);if(e)return;let a=ev(r?.preferences,ee);e1(a),e9(null)}catch(t){if(e)return;e1(ev(null,ee)),e9(t instanceof Error?t.message:"Failed to load preferences")}finally{e||e4(!1)}}(),()=>{e=!0}},[k,em]),(0,l.useEffect)(()=>{e0&&(eq||eW(e0.codingAgent))},[e0,eq]),(0,l.useEffect)(()=>{if(!e3){if(!e0||e&&!k)return void e7(!1);e0.onboardingAcknowledged||e7(!0)}},[k,e0,e3,e]),(0,l.useEffect)(()=>{if(0!==tU.length&&(!eq||!tU.includes(eq))){let e=e0?.codingAgent||ee;eW(tU.includes(e)?e:tU[0]??ee)}},[tU,e0?.codingAgent,eq]),(0,l.useEffect)(()=>{let e=(0,E.a6)(eq||tA?.agent||e0?.codingAgent||ee,ee),t=tA&&(0,I.q)(tA.agent)===(0,I.q)(e)?tA.agentModel:null,r=tA&&(0,I.q)(tA.agent)===(0,I.q)(e)?tA.agentReasoningEffort:null;eR((0,Y.c0)(e,e0?.modelAccess??(0,Q.v)(null),tq,t,r))},[e0?.modelAccess,e0?.codingAgent,tq,eq,tA]);let tR=(0,l.useCallback)(()=>{e&&!k?eH("Pair or reconnect a laptop before adding a workspace."):(eH(null),eY(null),ez(null),eJ(!0),eE())},[k,e,eE]);(0,l.useEffect)(()=>{te&&!e8&&(tt(!1),tR())},[te,e8]),(0,l.useEffect)(()=>{(!e||k)&&eH(null)},[k,e]);let tD=(0,l.useCallback)(async t=>{let r=eU.trim(),a=(0,Y.xb)(eF),n=(0,Y.aB)(eF),s=t?.bridgeId??k??null;if(e&&!s)return ez("Pair or reconnect a laptop before launching an agent session."),!1;let l=t?.projectId??i??eh[0]?.id;if(!l)return ez("No project is configured in conductor.yaml"),!1;let o=(0,E.a6)(eq||ee,ee),d=t_[(0,I.q)(o)]??null;if(d?.checking)return ez(`${ep(o)} is still checking installation status. Try again in a moment.`),!1;if(d&&!d.ready)return ez(d.installed?`${ep(o)} is not ready yet. Finish setup or authentication and try again.`:`${ep(o)} is not installed on this machine yet. Open setup and try again.`),tW(o),!1;eT(!0),ez(null);try{let e=await fetch((0,T.S)("/api/sessions",s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:l,prompt:r,...t?.issueId?.trim()?{issueId:t.issueId.trim()}:{},agent:o,...t?.branch?{branch:t.branch}:{},...t?.baseBranch?{baseBranch:t.baseBranch}:{},..."boolean"==typeof t?.useWorktree?{useWorktree:t.useWorktree}:{},...t?.permissionMode?{permissionMode:t.permissionMode}:{},...a?{model:a}:{},...n?{reasoningEffort:n}:{},...t?.attachments&&t.attachments.length>0?{attachments:t.attachments}:{}})}),i=await e.json().catch(()=>null);if(!e.ok)throw Error(i?.error??`Failed to create workspace: ${e.status}`);if(!i?.session?.id)throw Error("Session created but response is missing session id");return e_(""),eE(),tv.current=i.session.id,await eO(),tN({projectId:l,sessionId:i.session.id,tab:null,bridgeId:s},"push"),!0}catch(e){return ez(e instanceof Error?e.message:"Failed to create workspace"),!1}finally{eT(!1)}},[t_,eF,tN,tW,eh,eU,eO,eq,k,i,e,eE]),tT=(0,l.useCallback)(async e=>{(await (0,V.J)(e,{bridgeId:k}),o===e)?tN({projectId:null,sessionId:null,workspaceView:null,tab:null},"replace"):k&&eO()},[k,tN,eO,o]),tV=(0,l.useCallback)(async t=>{if(e&&!k)return void eY("Pair or reconnect a laptop before adding a workspace.");eK(!0),eY(null);try{let e=await fetch((0,T.S)("/api/workspaces",k),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await e.json().catch(()=>null);if(!e.ok)throw Error(r?.error??`Failed to add workspace: ${e.status}`);let a=r?.project?.id;if(!a)throw Error("Workspace created but response is missing project id");await ew(),e_(""),eE(),eJ(!1),tN({projectId:a,sessionId:null,workspaceView:"direct",tab:null,bridgeId:k??null},"push")}catch(e){eY(e instanceof Error?e.message:"Failed to add workspace")}finally{eK(!1)}},[k,tN,ew,e,eE]),tz=!e3&&!!e0&&(!e||!!k)&&!e0.onboardingAcknowledged,tG=e0??ev(null,eq||ee),tH=(0,E.a6)(eq||tG.codingAgent||ee,ee),tZ=i??tg?.projectId??null;(0,L.Q)({enabled:!e3,projectId:tZ,preferences:tG.notifications,bridgeId:k});let tJ=(0,l.useCallback)(e=>{tN({projectId:e,sessionId:null,workspaceView:e?d:null,tab:null},"push"),eW((0,E.a6)(e0?.codingAgent||ee,ee)),td("board"),eI()},[eI,tN,e0?.codingAgent,d]),tX=(0,l.useCallback)((e,t)=>{var r,a;let n,s=tf.get(e)??null;tN((r=i??null,a=t?.tab,n={projectId:s?.projectId??r??null,sessionId:e,tab:a??(0,X.tK)(s)},"board"===d||"notes"===d?{...n,workspaceView:"direct"}:n),"push"),eI()},[eI,tN,i,tf,d]),tK=(0,l.useCallback)(()=>{e&&!k?t.push("/bridge/connect"):e7(!0)},[k,e,t]),tQ=(0,l.useCallback)(()=>{eX||eJ(!1)},[eX]),tY=(0,l.useCallback)(()=>{e2||tz||(e7(!1),e9(null))},[tz,e2]),t0=(0,l.useCallback)(()=>{tx(e=>!e)},[]),t1=(0,l.useCallback)(async e=>{let t=encodeURIComponent(e),r=await fetch((0,T.S)(`/api/repositories/${t}`,k),{method:"DELETE"});(404===r.status||405===r.status)&&(r=await fetch((0,T.S)(`/api/repositories?id=${t}`,k),{method:"DELETE"}));let a=await r.json().catch(()=>null);if(!r.ok)throw Error(a?.error??`Failed to unlink project (${r.status})`);await ew()},[k,ew]),t3=(0,l.useMemo)(()=>e$?(0,a.jsx)(es,{projects:eh,projectsLoading:eg,projectsError:ej,projectsRecovering:ek,selectedProjectId:i,onSelectProject:tJ,onUnlinkProject:t1,sessions:eP,selectedSessionId:o,onSelectSession:tX,onArchiveSession:tT,onCreateWorkspace:tR}):null,[eP,ej,eg,ek,tT,tJ,tX,t1,tR,eh,i,o,e$]),t4=(0,l.useMemo)(()=>{let t=tA?(0,a.jsxs)("div",{role:"group","aria-label":"Project workspace view",className:"hidden w-fit rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px xl:inline-flex",children:[(0,a.jsx)("button",{type:"button","aria-pressed":"direct"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"direct"},"replace"),className:`min-h-[31px] rounded-[2px] px-3 text-[13px] ${"direct"===d?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Direct launch"}),(0,a.jsx)("button",{type:"button","aria-pressed":"board"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"board"},"replace"),className:`min-h-[31px] rounded-[2px] px-3 text-[13px] ${"board"===d?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"}),(0,a.jsx)("button",{type:"button","aria-pressed":"notes"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"notes"},"replace"),className:`min-h-[31px] rounded-[2px] px-3 text-[13px] ${"notes"===d?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Notes"})]}):null;return"board"===d?(0,a.jsx)(ei,{projectId:i,bridgeId:k,defaultAgent:tH,agentOptions:tU,projectSessions:tC,projectLabel:tA?.id??i,headerAccessory:t,onOpenSession:tX}):"notes"===d&&i?(0,a.jsx)(ed,{projectId:i,bridgeId:k,sessions:tC,selectedSessionId:o}):(0,a.jsx)(ef,{prompt:eU,setPrompt:e_,selectedAgent:tH,setSelectedAgent:eW,agentStates:t_,modelSelection:eF,setModelSelection:eR,modelAccess:tG.modelAccess,runtimeModelCatalogs:tq,agentOptions:tU,projects:eh,bridges:w,selectedBridgeId:x,setSelectedBridgeId:p,requiresPairedDeviceScope:e,selectedProjectId:i,onSelectProject:tJ,projectLabel:i??"All projects",hasProject:eh.length>0,creating:eD,error:tw,onOpenAddWorkspace:tR,onOpenAgentSetup:tW,onCreate:tD})},[tU,t_,w,eD,tD,eF,tW,tR,eh,tC,tA,o,tX,eU,tH,tG.modelAccess,e,tq,x,i,e_,tw,d,tN]),t2=(0,l.useMemo)(()=>{if(!tA)return t4;let e=({fullWidth:e=!1,compact:t=!1}={})=>(0,a.jsxs)("div",{role:"group","aria-label":"Project workspace view",className:`inline-flex ${e?"w-full":"w-fit"} rounded-[6px] border border-[var(--vk-border)] ${t?"p-0.5":"p-1"}`,children:[(0,a.jsx)("button",{type:"button","aria-pressed":"direct"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"direct"},"replace"),className:`${t?"min-h-[30px] px-3 text-[12px]":"min-h-[32px] px-3 text-[13px]"} flex-1 rounded-[4px] ${"direct"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Direct launch"}),(0,a.jsx)("button",{type:"button","aria-pressed":"board"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"board"},"replace"),className:`${t?"min-h-[30px] px-3 text-[12px]":"min-h-[32px] px-3 text-[13px]"} flex-1 rounded-[4px] ${"board"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"}),(0,a.jsx)("button",{type:"button","aria-pressed":"notes"===d,onClick:()=>tN({projectId:tA.id,workspaceView:"notes"},"replace"),className:`${t?"min-h-[30px] px-3 text-[12px]":"min-h-[32px] px-3 text-[13px]"} flex-1 rounded-[4px] ${"notes"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Notes"})]});if("board"===d){let t={"--dispatcher-panel-width":`${tp}px`},r=!tl,n=!r||"board"===to,s=!r||"chat"===to,l=r&&null===o,i=tl&&tc&&null===o,c=null!==o||!tc;return(0,a.jsxs)("div",{style:t,className:"relative flex h-full min-h-0 flex-1 flex-col overflow-hidden",children:[r&&n?(0,a.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 xl:hidden",children:(0,a.jsxs)("div",{className:"flex flex-col gap-1.5",children:[e({fullWidth:!0,compact:!0}),l?(({fullWidth:e=!1,compact:t=!1}={})=>(0,a.jsxs)("div",{className:`inline-flex ${e?"w-full":"w-fit"} rounded-[6px] border border-[var(--vk-border)] ${t?"p-0.5":"p-1"}`,children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{td("board"),tN({projectId:tA.id,workspaceView:"board"},"replace")},"aria-pressed":"board"===d&&"board"===to,className:`inline-flex flex-1 items-center justify-center rounded-[4px] font-medium transition-colors ${t?"min-h-[30px] gap-1 px-2.5 text-[11px]":"min-h-[34px] gap-1.5 px-3 text-[12px]"} ${"board"===d&&"board"===to?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(u.A,{className:`${t?"h-3 w-3":"h-3.5 w-3.5"} shrink-0`}),(0,a.jsx)("span",{children:"Board"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{td("chat"),tN({projectId:tA.id,workspaceView:"board"},"replace")},"aria-pressed":"board"===d&&"chat"===to,className:`inline-flex flex-1 items-center justify-center rounded-[4px] font-medium transition-colors ${t?"min-h-[30px] gap-1 px-2.5 text-[11px]":"min-h-[34px] gap-1.5 px-3 text-[12px]"} ${"board"===d&&"chat"===to?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(m.A,{className:`${t?"h-3 w-3":"h-3.5 w-3.5"} shrink-0`}),(0,a.jsx)("span",{children:"Dispatcher"})]})]}))({fullWidth:!0,compact:!0}):null]})}):null,(0,a.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden xl:flex-row",children:[(0,a.jsx)("div",{className:`${n?"block":"hidden"} min-h-0 min-w-0 flex-1 overflow-hidden xl:block`,children:t4}),c?(0,a.jsx)("div",{className:"absolute bottom-0 right-[var(--dispatcher-panel-width)] top-0 z-20 hidden w-2 translate-x-1/2 cursor-col-resize xl:block",onMouseDown:e=>{e.preventDefault(),th(!0)},"aria-hidden":"true",children:(0,a.jsx)("div",{className:"mx-auto h-full w-px bg-transparent transition-colors hover:bg-[var(--vk-border)]"})}):null,(0,a.jsxs)("div",{className:`${s?"flex":"hidden xl:flex"} ${i?"flex-1 min-h-0 xl:h-auto xl:max-h-none xl:w-[56px] xl:flex-none xl:min-h-0":"flex-1 min-h-[min(360px,50dvh)] xl:w-[var(--dispatcher-panel-width)] xl:flex-none xl:min-h-0"} flex-col overflow-hidden border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] xl:border-l xl:border-t-0`,children:[r&&s&&null!==o?(0,a.jsx)("div",{className:"flex items-center border-b border-[var(--vk-border)] px-3 py-2 xl:hidden",children:(0,a.jsxs)("button",{type:"button",onClick:()=>td("board"),className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-1 text-[12px] font-medium text-[var(--vk-text-muted)] transition-colors hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-strong)]",children:[(0,a.jsx)(b.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,a.jsx)("span",{children:"Back to board"})]})}):null,o?tI?(0,a.jsx)("div",{className:"relative min-h-0 h-full min-w-0 flex-1 overflow-hidden",children:tr.map(e=>{let t=e===o,r=t?tI:tf.get(e)??null;return r&&r.projectId===tA.id?(0,a.jsx)("div",{"aria-hidden":!t,className:t?"relative z-10 h-full min-w-0":"pointer-events-none absolute inset-0 overflow-hidden opacity-0 select-none",children:(0,a.jsx)(en,{sessionId:e,initialSession:r,bridgeId:k,active:t,suppressPreviewAutoOpen:t&&tv.current===e,immersiveMobileMode:t&&t$})},e):null})}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center bg-[var(--vk-bg-panel)] text-[13px] text-[var(--vk-text-muted)]",children:"Loading session workspace..."}):(0,a.jsx)(eo,{projectId:tA.id,bridgeId:k,defaultAgent:tH,modelAccess:tG.modelAccess,runtimeModelCatalogs:tq,collapsed:i,onToggleCollapsed:t0,onBackToBoard:r&&"chat"===to?()=>td("board"):void 0})]})]})]})}return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[(0,a.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/70 px-3 py-3 sm:px-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Project Workspace"}),(0,a.jsxs)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-strong)]",children:[tA.id," \xb7 ",tA.defaultBranch||"main"]})]}),(0,a.jsx)("div",{className:"hidden xl:inline-flex",children:e()}),(0,a.jsx)("div",{className:"xl:hidden",children:e({fullWidth:!0,compact:!0})})]})}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:t4})]})},[to,tc,tp,tI,k,t0,t$,tr,tN,tH,tA,tC,o,tf,tl,t4,d]),t5=(0,l.useMemo)(()=>eu?(0,a.jsx)("div",{className:"flex h-full min-h-0 flex-1 items-center justify-center bg-[var(--vk-bg-main)] px-4",children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-5 py-5 text-center shadow-[0_18px_50px_rgba(0,0,0,0.18)]",children:[(0,a.jsx)("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full border border-[color:color-mix(in_srgb,var(--vk-accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]",children:(0,a.jsx)(f.A,{className:"h-5 w-5 animate-spin"})}),(0,a.jsx)("h2",{className:"mt-4 text-[18px] font-medium text-[var(--vk-text-strong)]",children:"Reconnecting paired laptop"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] leading-6 text-[var(--vk-text-muted)]",children:"Waiting for the selected laptop to report online before loading its projects and sessions."})]})}):o&&(null===i||"board"!==d&&"notes"!==d)?(0,a.jsx)("div",{className:"relative min-h-0 h-full min-w-0 flex-1 overflow-hidden",children:tr.map(e=>{let t=e===o,r=t?tS:tf.get(e)??null;return(0,a.jsx)("div",{"aria-hidden":!t,className:t?"relative z-10 h-full min-w-0":"pointer-events-none absolute inset-0 overflow-hidden opacity-0 select-none",children:(0,a.jsx)(en,{sessionId:e,initialSession:r,bridgeId:k,active:t,suppressPreviewAutoOpen:t&&tv.current===e,immersiveMobileMode:t&&t$,onOpenSidebar:eC})},e)})}):null!==i?(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:t2}):(0,a.jsx)("div",{className:"flex h-full min-h-0 w-full flex-1 overflow-hidden",children:(0,a.jsx)(el,{projects:eh,projectsLoading:eg,projectsError:ej,projectsRecovering:ek,sessions:eP,onCreateWorkspace:tR,onSelectSession:tX})}),[eP,ej,eg,ek,tr,t2,tS,o,tX,tR,eh,i,tf,eu,eC,d]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(U.G,{mobileSidebarOpen:eS,desktopSidebarOpen:eA,onToggleSidebar:eC,hideMobileSidebarToggle:t$,sidebar:t3,children:[t$?null:(0,a.jsx)(_.V,{title:tM,onOpenPreferences:tK,rightContent:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium ${tO}`,title:tB,children:tL}),(0,a.jsx)(q.J,{})]})}),(0,a.jsxs)("div",{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden ${t$?"bg-[#060404]":""}`,children:[eG?(0,a.jsx)("div",{className:"border-b border-[var(--vk-red)]/35 bg-[color:color-mix(in_srgb,var(--vk-red)_12%,var(--vk-bg-panel))] px-3 py-2 text-[13px] text-[var(--vk-red)] sm:px-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("p",{className:"min-w-0 flex-1",children:eG}),(0,a.jsx)("button",{type:"button",onClick:()=>eH(null),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-[4px] text-[var(--vk-red)]/80 hover:bg-[var(--vk-red)]/10 hover:text-[var(--vk-red)]","aria-label":"Dismiss workspace action error",children:(0,a.jsx)(g.A,{className:"h-4 w-4"})})]})}):null,t5]})]}),eZ?(0,a.jsx)(ec,{open:eZ,onClose:tQ,onCreate:tV,creating:eX,error:eQ,defaultAgent:tH,agentOptions:tU,modelAccess:tG.modelAccess,runtimeModelCatalogs:tq,bridgeId:k}):null,e8||tz?(0,a.jsx)(ex,{open:e8,mode:tz?"onboarding":"settings",creating:e2,error:e6,current:tG,projectCount:eh.length,agentOptions:tU,agentStates:t_,runtimeModelCatalogs:tq,onRepositoriesChanged:ew,onOnboardingComplete:({needsProject:e})=>{e&&tt(!0)},onOpenAgentSetup:tW,onClose:tY,onSave:tF,bridgeId:k}):null]})}c.A,x.A,p.A,u.A,m.A,h.A,v.A,v.A,x.A,[{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"antigravity",label:"Antigravity"},{id:"custom",label:"Custom"}].filter(e=>"custom"!==e.id),c.A,o.mWn,d.$$9,o.i4$,c.A;let ef=(0,l.memo)(function({prompt:e,setPrompt:t,selectedAgent:r,setSelectedAgent:n,agentStates:s,modelSelection:o,setModelSelection:d,modelAccess:c,runtimeModelCatalogs:x,agentOptions:p,projects:u,bridges:m,selectedBridgeId:b,setSelectedBridgeId:$,requiresPairedDeviceScope:M,selectedProjectId:P,onSelectProject:L,projectLabel:B,hasProject:O,creating:U,error:_,onOpenAddWorkspace:q,onOpenAgentSetup:W,onCreate:D}){let V=(0,l.useMemo)(()=>{let e=new Map(E.BO.map((e,t)=>[e,t]));return[...p].sort((t,r)=>{let a=e.get((0,I.q)(t))??Number.MAX_SAFE_INTEGER,n=e.get((0,I.q)(r))??Number.MAX_SAFE_INTEGER;return a!==n?a-n:ep(t).localeCompare(ep(r))})},[p]),z=ep(r),G=s[(0,I.q)(r)]??null,H=(0,l.useMemo)(()=>[...u].sort((e,t)=>e.id.localeCompare(t.id)),[u]),Z=P??H[0]?.id??null,J=(0,l.useMemo)(()=>H.find(e=>e.id===Z)??null,[Z,H]),X=(0,l.useMemo)(()=>m.filter(e=>e.connected),[m]),Q=(0,l.useMemo)(()=>!b||X.some(e=>e.bridgeId===b),[X,b]),[ee,et]=(0,l.useState)([]),[er,ea]=(0,l.useState)(!1),[en,es]=(0,l.useState)(""),[el,ei]=(0,l.useState)(""),[eo,ed]=(0,l.useState)([]),[ec,ex]=(0,l.useState)(!1),[eh,ev]=(0,l.useState)(!1),[eb,ef]=(0,l.useState)(!1),[eg,ej]=(0,l.useState)(!1),[ek,ew]=(0,l.useState)("default"),[ey,eN]=(0,l.useState)([]),[eS,eA]=(0,l.useState)(!1),[eC,eI]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(!J){et([]),es(""),ea(!1);return}et([]),es(J.defaultBranch.trim()||"main"),ea(!1)},[J]),(0,l.useEffect)(()=>{if(!Z){ed([]),ei(""),ex(!1);return}ed([]),ei(""),ex(!1)},[Z]);let eE=(0,l.useCallback)(async()=>{if(!J)return;let e=J.defaultBranch.trim()||"main";if(!J.path?.trim()){et([e]),es(t=>t.trim().length>0?t:e);return}ea(!0);try{let t=new URLSearchParams({path:J.path}),r=await fetch((0,T.S)(`/api/workspaces/branches?${t.toString()}`,b)),a=await r.json().catch(()=>null),n=Array.isArray(a?.branches)?a.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[],s="string"==typeof a?.defaultBranch&&a.defaultBranch.trim().length>0?a.defaultBranch.trim():e,l=n.length>0?n:[s];et(l),es(e=>e.trim().length>0&&l.includes(e)?e:s)}catch{et([e]),es(e)}finally{ea(!1)}},[b,J]),e$=(0,l.useCallback)(async()=>{if(Z){ex(!0);try{let e=await fetch((0,T.S)(`/api/boards?projectId=${encodeURIComponent(Z)}`,b)),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load tasks: ${e.status}`);let r=(Array.isArray(t?.columns)?t.columns:[]).flatMap(e=>Array.isArray(e.tasks)?e.tasks:[]),a=new Set,n=r.filter(e=>{let t=eu(e);return!(!t||a.has(t))&&(a.add(t),!0)});ed(n),ei(e=>n.some(t=>eu(t)===e)?e:"")}catch{ed([]),ei("")}finally{ex(!1)}}},[Z,b]);(0,l.useEffect)(()=>{!eb||er||ee.length>0||eE()},[er,eb,ee.length,eE]),(0,l.useEffect)(()=>{!eh||ec||eo.length>0||e$()},[eo.length,e$,ec,eh]);let eM=(0,l.useMemo)(()=>(0,Y.Ik)(r,c,x),[c,x,r]),eP=(0,l.useMemo)(()=>eo.find(e=>eu(e)===el)??null,[eo,el]),eL=(0,Y.xb)(o)??"",eB=(0,l.useMemo)(()=>{let e=new Set,t=[],a=eL.trim();for(let r of eM)e.has(r.id)||(e.add(r.id),t.push(r));return a&&!e.has(a)&&(e.add(a),t.unshift({id:a,label:function(e,t){let r=t.trim(),a=(0,I.q)(e);if(!r)return r;if("claude-code"===a){let e=r.toLowerCase();if("opus"===e)return"Claude Opus";if("sonnet"===e)return"Claude Sonnet";if("haiku"===e)return"Claude Haiku";let t=e.match(/^claude-(sonnet|opus|haiku)-(\d+)-(\d+)(?:-\d{8})?$/);if(t){let e=t[1];return`Claude ${e[0]?.toUpperCase()+e.slice(1)} ${t[2]}.${t[3]}`}}return r.split(/[-_]+/g).filter(Boolean).map(e=>"gpt"===e.toLowerCase()?"GPT":/^\d+(?:\.\d+)?$/.test(e)?e:e[0]?.toUpperCase()+e.slice(1)).join("-")}(r,a),description:"Current selected model.",access:[]})),t},[eM,r,eL]),eO=(0,l.useMemo)(()=>!G||G.ready||eL?eL?eB.find(e=>e.id===eL)?.label??eL:"Default":"Setup required",[eB,G,eL]),eU=(0,l.useMemo)(()=>(0,Y.iL)(r,c,x,eL),[c,x,r,eL]),e_=(0,Y.aB)(o)??"",eq=(0,l.useMemo)(()=>{let e=eU.find(e=>e.id===e_);return e?e.label:e_||(eU[0]?.label??"Default")},[eU,e_]),eW="z-50 min-w-[240px] max-w-[calc(100vw-32px)] rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.35)] sm:max-w-none",eF=`${eW} max-h-[min(360px,50vh)] overflow-y-auto`,eR="flex min-h-[44px] cursor-default items-center gap-2 rounded-[3px] px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)] sm:min-h-[36px]",eD=[{id:"default",label:"Default",icon:v.A},{id:"auto",label:"Auto",icon:j.A},{id:"ask",label:"Ask",icon:k.A},{id:"plan",label:"Plan",icon:w.A}],eT=eD.find(e=>e.id===ek)??eD[0],eV="launchpad-attachment-input",ez=U||eS,eG=e=>{let t=e.repo?.trim();if(t){let e=t.split("/").filter(Boolean),r=e[e.length-1]?.replace(/\.git$/i,"");if(r)return r}return e.id},eH=J?eG(J):null,eZ=J?`${eH} \xb7 ${en||J.defaultBranch||"main"}`:O?B:"Select project",eJ=eP?.taskRef?.trim()||eP?.issueId?.trim()||eP?.id||"",eX=eP?em(eP.text):"Choose a task, bug, or issue from this project's board",eK=J?.id??Z??null,eQ=(0,l.useCallback)(e=>{let t=Array.from(e.currentTarget.files??[]);if(e.currentTarget.value="",!t.length)return;let r=new Set(ey.map(e=>`${e.name}:${e.size}:${e.lastModified}`)),a=t.filter(e=>!r.has(`${e.name}:${e.size}:${e.lastModified}`));a.length>0&&eN(e=>[...e,...a]),eI(null)},[ey]),eY=(0,l.useCallback)(e=>{eN(t=>t.filter((t,r)=>r!==e))},[]),e0=(0,l.useCallback)(async()=>{let e;if(eI(null),!eK||!J)return D({projectId:eK??void 0,...eg?{baseBranch:en||J?.defaultBranch||void 0}:{branch:en||J?.defaultBranch||void 0},issueId:el.trim()||void 0,bridgeId:b||void 0,useWorktree:eg,permissionMode:ek});eA(!0),eI(null);try{ey.length>0&&(e=await (0,R.P)({files:ey,projectId:J.id,taskRef:el.trim()||void 0,bridgeId:b||void 0}))}catch(e){return eI(e instanceof Error?e.message:"Failed to upload attachment"),!1}finally{eA(!1)}let t=await D({projectId:eK??void 0,...eg?{baseBranch:en||J.defaultBranch||void 0}:{branch:en||J.defaultBranch||void 0},issueId:el.trim()||void 0,bridgeId:b||void 0,useWorktree:eg,permissionMode:ek,...e&&e.length>0?{attachments:e}:{}});return t&&(eN([]),eI(null)),t},[el,eK,D,ek,en,J,J?.defaultBranch,b,ey,eg]);return(0,l.useEffect)(()=>{eN([]),eI(null)},[eK]),(0,a.jsx)("section",{className:"flex h-full min-h-0 items-start justify-center overflow-auto bg-[var(--vk-bg-main)] px-3 py-4 sm:items-center sm:px-6 sm:py-6",children:(0,a.jsxs)("div",{className:"w-full max-w-[768px]",children:[(0,a.jsx)("h1",{className:"pb-4 text-center text-[30px] font-medium leading-[34px] tracking-[-0.7px] text-[var(--vk-text-strong)] sm:text-[36px] sm:leading-[40px] sm:tracking-[-0.9px]",children:"What would you like to work on?"}),b?null:(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(h.A,{className:"mt-0.5 h-[14px] w-[14px] shrink-0"}),(0,a.jsx)("span",{children:M?"Pair or reconnect a laptop to browse workspaces and launch coding agents from the web dashboard.":"Showing projects and sessions from the local backend. Pair a laptop and select it here to browse that device instead."})]}),(0,a.jsxs)("div",{className:"mx-auto w-full rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-b border-[var(--vk-border)] px-2 pb-[9px] pt-2 sm:flex-row sm:items-center",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:flex-1",children:[(0,a.jsx)(F.N,{seed:{label:r},className:"h-[25px] w-[25px] shrink-0 border-none bg-transparent"}),(0,a.jsxs)(i.bL,{children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-[31px] min-w-0 max-w-full items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] data-[state=open]:bg-[var(--vk-bg-hover)] sm:max-w-[280px]","aria-label":"Select agent",children:[(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate pr-1 text-left",children:z}),(0,a.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",sideOffset:6,className:eF,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Agents"}),V.map(e=>{let t=e===r,l=s[(0,I.q)(e)]??null;return(0,a.jsxs)(i.q7,{onSelect:()=>n(e),className:eR,children:[(0,a.jsx)(F.N,{seed:{label:e},className:"h-6 w-6 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{children:ep(e)}),l?.ready?null:(0,a.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--vk-text-muted)]",children:(0,K.f)(l)})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:t?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e)})]})})]})]}),(0,a.jsxs)(i.bL,{onOpenChange:ev,children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",disabled:!Z,className:"flex h-[31px] w-full min-w-0 items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-left disabled:cursor-not-allowed disabled:opacity-50 sm:w-[240px] sm:shrink-0","aria-label":"Select task",children:[(0,a.jsx)("span",{className:`min-w-0 flex-1 truncate text-[14px] leading-[21px] ${eJ?"text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)]"}`,children:eJ||"No task"}),(0,a.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"end",side:"bottom",sideOffset:6,className:eF,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Tasks"}),(0,a.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:eX}),(0,a.jsxs)(i.q7,{onSelect:()=>ei(""),className:eR,children:[(0,a.jsx)("span",{children:"No linked task"}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:el?null:(0,a.jsx)(N.A,{className:"h-4 w-4"})})]}),ec?(0,a.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Loading board tasks..."}):eo.length>0?eo.map(e=>{let t=eu(e),r=em(e.text),n=[e.type,e.priority].filter(Boolean).join(" \xb7 ");return(0,a.jsxs)(i.q7,{onSelect:()=>ei(t),className:`${eR} min-w-[320px] items-start`,children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate",children:e.taskRef?.trim()||r}),(0,a.jsxs)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:[e.taskRef?.trim()?r:t,n?` \xb7 ${n}`:""]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:el===t?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},t)}):(0,a.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"No existing tasks were found for this project."})]})})]})]}),(0,a.jsx)("div",{className:"rounded-[3.5px]",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-2",children:[(0,a.jsxs)("div",{className:"relative w-full",children:[(0,a.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),placeholder:"Optional launch prompt. Leave empty to open the native CLI.",rows:1,className:"min-h-[24px] w-full resize-none bg-transparent pr-16 text-[16px] leading-[24px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,a.jsxs)("label",{htmlFor:eV,className:`absolute right-[18px] top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] ${eK?"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]":"cursor-not-allowed opacity-50"}`,children:[(0,a.jsx)("input",{id:eV,type:"file",accept:"*/*",multiple:!0,onChange:eQ,disabled:!eK||ez,className:"hidden"}),(0,a.jsx)(S.A,{className:"h-[14px] w-[14px]"})]}),(0,a.jsx)("button",{type:"button","aria-label":"Preview",className:"absolute right-0 top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,a.jsx)(A.A,{className:"h-[14px] w-[14px]"})})]}),ey.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ey.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1 rounded-[999px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-1 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)("span",{className:"max-w-[160px] truncate",title:e.name,children:e.name}),(0,a.jsx)("button",{type:"button","aria-label":`Remove attachment ${e.name}`,onClick:()=>eY(t),className:"inline-flex h-[14px] w-[14px] items-center justify-center rounded-full text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,a.jsx)(g.A,{className:"h-3 w-3"})})]},`${e.name}-${e.size}-${e.lastModified}-${t}`))}):null,(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-1 gap-y-2",children:[(0,a.jsxs)(i.bL,{children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsx)("button",{type:"button",className:"inline-flex h-[29px] w-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]","aria-label":"Select workspace or project",children:(0,a.jsx)(v.A,{className:"h-[15px] w-[15px]"})})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",sideOffset:6,className:eF,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Projects"}),H.map(e=>{let t=eG(e),r=e.id!==t?e.id:e.path?.trim()||e.repo?.trim()||null;return(0,a.jsxs)(i.q7,{onSelect:()=>L(e.id),className:`${eR} min-w-[280px] items-start`,children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate",children:t}),r?(0,a.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:r}):null]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:e.id===Z?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id)}),(0,a.jsx)(i.wv,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,a.jsxs)(i.q7,{onSelect:q,className:eR,children:[(0,a.jsx)(C.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:"Add Workspace"})]})]})})]}),eU.length>0?(0,a.jsxs)(i.bL,{children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button","aria-label":"Select reasoning effort",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,a.jsx)("span",{children:eq}),(0,a.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",sideOffset:6,className:eW,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Reasoning"}),eU.map(e=>(0,a.jsxs)(i.q7,{onSelect:()=>d({...o,reasoningEffort:e.id}),className:eR,children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:e_===e.id?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id))]})})]}):null,(0,a.jsxs)(i.bL,{children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,a.jsx)("span",{children:eO}),(0,a.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",sideOffset:6,className:eW,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)(i.q7,{onSelect:()=>d((0,Y.c0)(r,c,x,J?.agentModel,J?.agentReasoningEffort)),className:eR,children:[(0,a.jsx)("span",{children:"Default"}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:eL?null:(0,a.jsx)(N.A,{className:"h-4 w-4"})})]}),eB.map(e=>(0,a.jsxs)(i.q7,{onSelect:()=>{var t;let a;return t=e.id,a=(0,Y.iL)(r,c,x,t),void d({catalogModel:t,customModel:"",reasoningEffort:a.some(e=>e.id===o.reasoningEffort)?o.reasoningEffort:(0,Y.YS)(r,c,x,t)})},className:eR,children:[(0,a.jsx)("span",{children:e.label}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:eL===e.id?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id)),0===eB.length?(0,a.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Models will appear here after the selected agent is installed and its runtime catalog is detected."}):null,G&&!G.ready?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.wv,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>W(r),className:"flex w-full items-center rounded-[3px] px-3 py-2 text-left text-[13px] text-[var(--vk-orange)] transition hover:bg-[var(--vk-bg-hover)]",children:G.installed?"Open setup":"Open install guide"})]}):null]})})]}),(0,a.jsxs)(i.bL,{children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)("span",{children:eT.label}),(0,a.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",sideOffset:6,className:eW,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Permissions"}),eD.map(({id:e,label:t,icon:r})=>(0,a.jsxs)(i.q7,{onSelect:()=>ew(e),className:eR,children:[(0,a.jsx)(r,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:t}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:ek===e?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e))]})})]}),X.length>0?(0,a.jsxs)("label",{className:"inline-flex h-[29px] max-w-[260px] items-center gap-[6px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)(h.A,{className:"h-[14px] w-[14px] text-[var(--vk-text-muted)]"}),(0,a.jsxs)("select",{value:b,onChange:e=>$(e.target.value),className:"min-w-0 flex-1 bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none",children:[M?null:(0,a.jsx)("option",{value:"",children:"Local backend"}),X.map(e=>(0,a.jsxs)("option",{value:e.bridgeId,children:[e.hostname," \xb7 ",e.os]},e.bridgeId))]})]}):(0,a.jsxs)("div",{className:"inline-flex h-[29px] items-center gap-[6px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:[(0,a.jsx)(h.A,{className:"h-[14px] w-[14px]"}),(0,a.jsx)("span",{children:b&&!Q?"Waiting for selected device":M?"No device connected":"Local backend"})]}),(0,a.jsxs)(i.bL,{onOpenChange:ef,children:[(0,a.jsx)(i.l9,{asChild:!0,children:(0,a.jsx)("button",{type:"button",disabled:!J,className:"inline-flex min-h-[29px] max-w-[320px] items-center justify-center truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:text-[var(--vk-text-strong)] disabled:cursor-not-allowed disabled:opacity-50",children:eZ})}),(0,a.jsx)(i.ZL,{children:(0,a.jsxs)(i.UC,{align:"start",side:"bottom",sideOffset:6,avoidCollisions:!1,className:eF,children:[(0,a.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Branch"}),eH?(0,a.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:eH}):null,er?(0,a.jsx)("div",{className:"px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:"Loading branches..."}):ee.map(e=>(0,a.jsxs)(i.q7,{onSelect:()=>es(e),className:eR,children:[(0,a.jsx)("span",{children:e}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:en===e?(0,a.jsx)(N.A,{className:"h-4 w-4"}):null})]},e))]})})]})]}),(0,a.jsx)("div",{className:"flex w-full justify-end sm:w-auto",children:(0,a.jsx)("button",{type:"button",onClick:e0,disabled:ez||!Z,className:"inline-flex min-h-[29px] items-center justify-center rounded-[3px] bg-[var(--vk-bg-hover)] px-[8px] py-[6.5px] text-[16px] leading-[16px] text-[var(--vk-text-strong)] transition-colors hover:bg-[var(--vk-bg-active)] disabled:cursor-not-allowed disabled:opacity-50",children:ez?(0,a.jsx)(f.A,{className:"h-4 w-4 animate-spin"}):"Launch"})})]}),G&&!G.ready?(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-[13px] text-[var(--vk-text-strong)]",children:[z," is not ready on this machine."]}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:G.installed?"Finish login or local setup to load models and start streaming sessions.":"Install the CLI first, then its models and authentication state will appear here."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>W(r),className:"inline-flex h-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)]",children:G.installed?"Open setup":"Open install"})]})}):null,(0,a.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:eg,onChange:e=>ej(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Use worktree isolation",(0,a.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"If unchecked, the session runs directly on the selected branch in the local repo."})]})]})]})})]}),_&&(0,a.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:_}),eC&&(0,a.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:eC})]})})})}},e=>{e.O(0,[3036,80691,63357,65587,82746,76509,62184,97331,84271,76892,32379,587,61968,77358],()=>e(e.s=12529)),_N_E=e.O()}]);
|