getborg 0.0.125 → 0.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +4900 -2407
- package/dist/client/.vite/manifest.json +359 -359
- package/dist/client/assets/{ArrowRight-D8u8fAtz.js → ArrowRight-sXL3WqRj.js} +2 -2
- package/dist/client/assets/{ArrowSquareOut-B_f6YUhV.js → ArrowSquareOut-BXw7kBJ2.js} +2 -2
- package/dist/client/assets/{ArrowsClockwise-DQYZ1Xbo.js → ArrowsClockwise-C2ZJkkb1.js} +2 -2
- package/dist/client/assets/{CaretLeft-CfrkuxuJ.js → CaretLeft-u94enBjz.js} +2 -2
- package/dist/client/assets/{ChatMarkdown-DvWtIvZP.js → ChatMarkdown-PlWZFDnz.js} +5 -5
- package/dist/client/assets/{CircleNotch-BcVOnWaH.js → CircleNotch-DqcpMoTY.js} +2 -2
- package/dist/client/assets/{DesignWorkspace-5_CopTlF.js → DesignWorkspace-DmKoQxKI.js} +3 -3
- package/dist/client/assets/DiffPanel-D77xCxTK.js +2 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-B0GAJHHf.js → DiffWorkerPoolProvider-ClROlLBb.js} +2 -2
- package/dist/client/assets/{DocxPreview-B3Ldhzps.js → DocxPreview-HJVaPJXL.js} +4 -4
- package/dist/client/assets/{FilePreviewPanel-DG9JDM1b.js → FilePreviewPanel-CFCxGnPA.js} +9 -9
- package/dist/client/assets/{HtmlPreview-Cln7r1CE.js → HtmlPreview-CJQuCP2x.js} +2 -2
- package/dist/client/assets/{PdfPreview-C5IVpvDo.js → PdfPreview-BgV8uugr.js} +3 -3
- package/dist/client/assets/{PptxPreview-DgUlZkyA.js → PptxPreview-BVdzk7UG.js} +3 -3
- package/dist/client/assets/PreviewPanel-C8wYTZ3K.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-6b-pnSLs.js +6 -0
- package/dist/client/assets/{PullRequestReactions-DagCwQZQ.js → PullRequestReactions-kdg3iZ85.js} +4 -4
- package/dist/client/assets/{RightPanelResizeHandle-XlC9gY5e.js → RightPanelResizeHandle-kUStdA3L.js} +2 -2
- package/dist/client/assets/{VirtualizedFile-CFgSsBl7.js → VirtualizedFile-DuJYdYdq.js} +2 -2
- package/dist/client/assets/{XlsxPreview-D-aoM4SG.js → XlsxPreview-Bi4rmMAb.js} +3 -3
- package/dist/client/assets/accountData-B88fzgQo.js +16 -0
- package/dist/client/assets/assetUrls-CF9bvkMB.js +2 -0
- package/dist/client/assets/assets-CkgNlvqv.js +2 -0
- package/dist/client/assets/{browserHistoryStore-DKruSW2y.js → browserHistoryStore-DIuEAuCl.js} +3 -3
- package/dist/client/assets/{browserRecording-CZz89Zcp.js → browserRecording-2dQePGOK.js} +2 -2
- package/dist/client/assets/clientAnalytics-BbUHu8ei.js +1 -0
- package/dist/client/assets/{clientPersistenceStorage-CeJLSpQl.js → clientPersistenceStorage-DsdIKJBh.js} +2 -2
- package/dist/client/assets/{combobox-r8GBhxUE.js → combobox-DVmHwJKi.js} +2 -2
- package/dist/client/assets/{composerMentionDrag-3h9AstHI.js → composerMentionDrag-CB6wqaTe.js} +2 -2
- package/dist/client/assets/{designCanvas.logic-BT66Jt7h.js → designCanvas.logic-Ce5c0YLY.js} +4 -4
- package/dist/client/assets/{designOpenFileContext-CThLSHGp.js → designOpenFileContext-B0d1oDHN.js} +2 -2
- package/dist/client/assets/{diffFileContents-Cw_j-FVi.js → diffFileContents-DuZ8MpUA.js} +2 -2
- package/dist/client/assets/{empty--ZI_pbsa.js → empty-d8cb8Ewx.js} +2 -2
- package/dist/client/assets/entities-DI7lpu_V.js +2 -0
- package/dist/client/assets/{followUpQueuePersistence-igYPNSUl.js → followUpQueuePersistence-BL42ySpK.js} +1 -1
- package/dist/client/assets/{index-CaTemWmz.js → index-e-hiL6eh.js} +3 -3
- package/dist/client/assets/{input-DrYFVaUj.js → input-DzNFHo2W.js} +2 -2
- package/dist/client/assets/{lib-D8z7BdAf.js → lib-IA-5-mGB.js} +2 -2
- package/dist/client/assets/{main-C0iNAqq8.css → main-BM6qmGP4.css} +1 -1
- package/dist/client/assets/main-U2I6YwT-.js +169 -0
- package/dist/client/assets/{pdf-C0dNXL7f.js → pdf-Bh3amywC.js} +2 -2
- package/dist/client/assets/{popover-CQHPzmuS.js → popover-DZf7p2yc.js} +2 -2
- package/dist/client/assets/{pptxDocument-DlyhIyQx.js → pptxDocument-Bsm1SylK.js} +2 -2
- package/dist/client/assets/{projectFilesQueryState-BV4ypgkS.js → projectFilesQueryState-DWDFHsif.js} +2 -2
- package/dist/client/assets/queries-B-YwYiCl.js +2 -0
- package/dist/client/assets/{scroll-area-D_qtwL2R.js → scroll-area-C5ps_bkR.js} +46 -46
- package/dist/client/assets/session-BKSQ__kZ.js +68 -0
- package/dist/client/assets/{spinner-K3N_kbJr.js → spinner-BYvweYT_.js} +2 -2
- package/dist/client/assets/textarea-bjEgsW0n.js +2 -0
- package/dist/client/assets/{toggle-Sui8J_p3.js → toggle-D4wtRT7F.js} +2 -2
- package/dist/client/assets/{toggle-group-BDgfPfOF.js → toggle-group-iSglhZY5.js} +2 -2
- package/dist/client/assets/useSettings-BgyJJ6VZ.js +5 -0
- package/dist/client/assets/{useWorkspaceMutationRefresh-ApasU6PB.js → useWorkspaceMutationRefresh-C-GODI1R.js} +2 -2
- package/dist/client/assets/utils-dD8AT1Cf.js +30 -0
- package/dist/client/assets/{xlsxDocument-BTR6qc2R.js → xlsxDocument-C12kQUhH.js} +2 -2
- package/dist/client/index.html +1 -1
- package/dist/service-launcher.mjs +20 -2
- package/dist/sharedChatWorker.mjs +21887 -0
- package/package.json +2 -1
- package/dist/client/assets/DiffPanel-BETQvwD0.js +0 -2
- package/dist/client/assets/PreviewPanel-D9Co2Yoo.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-Can_YY2q.js +0 -6
- package/dist/client/assets/accountData-BKyjOPQm.js +0 -16
- package/dist/client/assets/assetUrls-BKDVxvlE.js +0 -2
- package/dist/client/assets/assets-B29JwqPY.js +0 -2
- package/dist/client/assets/clientAnalytics-D4y5ZOAM.js +0 -1
- package/dist/client/assets/entities-D-MTx85j.js +0 -2
- package/dist/client/assets/main-CZEtfXqq.js +0 -167
- package/dist/client/assets/queries-D_4HUuyY.js +0 -2
- package/dist/client/assets/session-qsdF94mu.js +0 -68
- package/dist/client/assets/textarea-xndIoUCV.js +0 -2
- package/dist/client/assets/useSettings-DD7ohMuP.js +0 -5
- package/dist/client/assets/utils-ClZ5OxbV.js +0 -30
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-BKyjOPQm.js";import{Cn as r,Fn as i,Ln as a,On as o,Zt as s,jn as c,n as l,r as u,wn as d}from"./session-qsdF94mu.js";import{n as f,t as p}from"./assets-B29JwqPY.js";var m=t(),h=e(n(),1);function g(e,t){let n=(0,m.c)(7),r=(0,h.useContext)(d),i=typeof t==`string`?t:t?.label,a=typeof t==`string`?!0:t?.reportFailure??!0,o=typeof t==`string`?!0:t?.reportDefect??!0,c=typeof t==`string`?!1:t?.refresh??!1,l;return n[0]!==i||n[1]!==e||n[2]!==c||n[3]!==r||n[4]!==o||n[5]!==a?(l=t=>{let n=e(t);return s(r,n,{label:i??n.label?.[0]??`atom query`,reportFailure:a,reportDefect:o,refresh:c})},n[0]=i,n[1]=e,n[2]=c,n[3]=r,n[4]=o,n[5]=a,n[6]=l):l=n[6],l}var _=o(i()).pipe(c(`web-asset-url:idle`));function v(e,t){let n=(0,m.c)(12),i=u(e),a;n[0]!==e||n[1]!==t?(a=e===null?_:p.createUrl({environmentId:e,input:{resource:t}}),n[0]=e,n[1]=t,n[2]=a):a=n[2];let o=r(a);if(o._tag===`Failure`){let e;return n[3]===Symbol.for(`react.memo_cache_sentinel`)?(e={_tag:`Failure`},n[3]=e):e=n[3],e}if(i._tag===`None`||o._tag!==`Success`){let e;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(e={_tag:`Loading`},n[4]=e):e=n[4],e}let s;n[5]!==i.value.httpBaseUrl||n[6]!==o.value.relativeUrl?(s=f(i.value.httpBaseUrl,o.value.relativeUrl),n[5]=i.value.httpBaseUrl,n[6]=o.value.relativeUrl,n[7]=s):s=n[7];let c=s,l;return n[8]!==o.value.expiresAt||n[9]!==o.value.sourcePath||n[10]!==c?(l=c===null?{_tag:`Failure`}:{_tag:`Success`,url:c,expiresAt:o.value.expiresAt,...o.value.sourcePath===void 0?{}:{sourcePath:o.value.sourcePath}},n[8]=o.value.expiresAt,n[9]=o.value.sourcePath,n[10]=c,n[11]=l):l=n[11],l}function y(e,t){let n=(0,m.c)(5),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={reportFailure:!1,refresh:!0},n[0]=r):r=n[0];let i=g(p.createUrl,r),a;return n[1]!==i||n[2]!==e||n[3]!==t?(a=async()=>{let n=await i({environmentId:e,input:{resource:t}}),r=l(e);return n._tag===`Failure`||r===null?null:f(r.httpBaseUrl,n.value.relativeUrl)},n[1]=i,n[2]=e,n[3]=t,n[4]=a):a=n[4],a}function b(e){let t=(0,m.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1,refresh:!0},t[0]=n):n=t[0];let r=g(p.createUrl,n),i;return t[1]!==r||t[2]!==e?(i=async t=>{let n=await r({environmentId:e,input:{resource:t}}),i=l(e);if(n._tag===`Failure`||i===null)return null;let a=f(i.httpBaseUrl,n.value.relativeUrl);if(a===null)return null;let o=await fetch(a);return o.ok?o.blob():null},t[1]=r,t[2]=e,t[3]=i):i=t[3],i}function x(e,t){let n=(0,m.c)(8),i=u(e),o;n[0]!==e||n[1]!==t?(o=p.createUrls({environmentId:e,resources:t}),n[0]=e,n[1]=t,n[2]=o):o=n[2];let s=r(o),c;return n[3]!==i._tag||n[4]!==i.value||n[5]!==t||n[6]!==s?(c=i._tag===`None`?t.map(S):s.map(e=>a(e)?f(i.value.httpBaseUrl,e.value.relativeUrl):null),n[3]=i._tag,n[4]=i.value,n[5]=t,n[6]=s,n[7]=c):c=n[7],c}function S(){return null}export{g as a,x as i,y as n,v as r,b as t};
|
|
2
|
-
//# sourceMappingURL=assetUrls-BKDVxvlE.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ga as e,O as t,Za as n,b as r,do as i,go as a,ho as o,jo as s,to as c}from"./accountData-BKyjOPQm.js";import{Fo as l}from"./utils-ClZ5OxbV.js";import{En as u,On as d,i as f,jn as p,kn as m,qt as h}from"./session-qsdF94mu.js";var g=30*6e4,_=5*6e4,v=60*6e4,y=class extends o()(`InvalidAssetCollectionKeyError`,{key:i,cause:c()}){get message(){return`Invalid asset collection atom key: ${JSON.stringify(this.key)}.`}},b=s(a([e,n(t)]));function x(e){try{return b(JSON.parse(e))}catch(t){throw new y({key:e,cause:t})}}function S(e,t){try{return l(e,t)}catch{return null}}function C(e){let t=h(e,{label:`environment-data:assets:create-url`,tag:r.assetsCreateUrl,staleTimeMs:_,idleTtlMs:v,refreshIntervalMs:g}),n=u(e=>{let[n,r]=x(e);return d(e=>r.map(r=>e(t({environmentId:n,input:{resource:r}})))).pipe(m(v),p(`environment-data:assets:create-urls:${e}`))});return{createUrl:t,createUrls:e=>n(JSON.stringify([e.environmentId,e.resources]))}}var w=C(f);export{S as n,w as t};
|
|
2
|
-
//# sourceMappingURL=assets-B29JwqPY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./main-CZEtfXqq.js";export{e as recordPrimaryClientEvent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,v as t}from"./accountData-BKyjOPQm.js";import{dt as n,gt as r,ht as i,mt as a,yo as o}from"./utils-ClZ5OxbV.js";import{Cn as s,Dn as c,On as l,et as u,jn as d,p as f}from"./session-qsdF94mu.js";import{St as p,T as m,it as h,w as g}from"./textarea-xndIoUCV.js";import{H as _}from"./useSettings-DD7ohMuP.js";var v=new Set([`pull-request`]);function y(e,t){return t||!v.has(e)}function b(e,t){return e.filter(e=>y(e.kind,t))}var ee=e(`borgcode:right-panel-state:v2`),x=12,S=e=>e.endsWith(`:pull-requests-panel`),C={isOpen:!1,activeSurfaceId:null,surfaces:[]},w=e=>{switch(e){case`diff`:return{id:`diff`,kind:e};case`files`:return{id:`files`,kind:e};case`file-preview`:return{id:`file-preview`,kind:e,relativePath:null,revealLine:null,revealRequestId:0};case`agents`:return{id:`agents`,kind:e}}},T=e=>e?{id:`browser:${e}`,kind:`preview`,resourceId:e}:{id:`browser:new`,kind:`preview`,resourceId:null},E=(e,t,n)=>({id:`file:${e}`,kind:`file`,relativePath:e,revealLine:t,revealRequestId:n}),te=e=>({id:`terminal:${e}`,kind:`terminal`,resourceId:e,terminalIds:[e],activeTerminalId:e});function ne(e){return`pull-request:${e.environmentId===void 0?``:`${encodeURIComponent(e.environmentId)}:`}${encodeURIComponent(e.projectId)}:${encodeURIComponent(e.repository)}:${e.number}`}function D(e){return{id:ne(e),kind:`pull-request`,...e.environmentId===void 0?{}:{environmentId:e.environmentId},projectId:e.projectId,repository:e.repository,number:e.number}}function re(e,t,n){return e[t]?.state===n.state&&e[t]?.isDraft===n.isDraft?e:{...e,[t]:n}}var O=(e,t,n=!0)=>({isOpen:!0,surfaces:e.surfaces.some(e=>e.id===t.id)?e.surfaces:[...e.surfaces,t],activeSurfaceId:n?t.id:e.activeSurfaceId}),k=(e,t,n)=>{let r=e[t]??C,i=n(r);if(!i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0){if(!(t in e))return e;let{[t]:n,...r}=e;return r}return i===r?e:{...e,[t]:i}};function A(e){return e===void 0||!Number.isFinite(e)?null:Math.max(1,Math.trunc(e))}function j(e){return!e||typeof e!=`object`?{byThreadKey:{}}:{byThreadKey:`byThreadKey`in e&&e.byThreadKey&&typeof e.byThreadKey==`object`?Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!S(e)).map(([e,t])=>{let n=t&&typeof t==`object`?t:null,r=Array.isArray(n?.surfaces)?n.surfaces.flatMap(e=>{let t=e.kind;if(t===`plan`||t===`design`)return[];if(e.kind===`file`){let t=typeof e.revealLine==`number`&&Number.isFinite(e.revealLine)?Math.max(1,Math.trunc(e.revealLine)):null,n=typeof e.revealRequestId==`number`&&Number.isSafeInteger(e.revealRequestId)&&e.revealRequestId>=0?e.revealRequestId:0;return[{...e,revealLine:t,revealRequestId:n}]}if(e.kind===`pull-request`){if(typeof e.projectId!=`string`||typeof e.repository!=`string`||typeof e.number!=`number`||!Number.isSafeInteger(e.number)||e.number<1)return[];let{environmentId:t,...n}=e;return[D({...n,...typeof t==`string`?{environmentId:t}:{}})]}if(e.kind!==`terminal`)return[e];if(!(`resourceId`in e)||typeof e.resourceId!=`string`||e.id!==`terminal:${e.resourceId}`)return[];let n=`terminalIds`in e&&Array.isArray(e.terminalIds)?[...new Set(e.terminalIds.filter(e=>typeof e==`string`))]:[e.resourceId],r=`activeTerminalId`in e&&typeof e.activeTerminalId==`string`&&n.includes(e.activeTerminalId)?e.activeTerminalId:n[0]??e.resourceId;return[{...e,terminalIds:n.length>0?n:[e.resourceId],activeTerminalId:r}]}):[],i=n?.activeSurfaceId,a=r.some(e=>e.id===i)?i??null:i===`pull-request`?r.find(e=>e.kind===`pull-request`)?.id??null:null,o=r.length>0&&(typeof n?.isOpen==`boolean`?n.isOpen:a!==null);return[e,{isOpen:o,surfaces:r,activeSurfaceId:a??(o?r[0]?.id??null:null)}]})):{}}}var M=r()(i(e=>({byThreadKey:{},open:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>n===`preview`?O(e,e.surfaces.find(e=>e.kind===`preview`)??T(null)):O(e,w(n)))})),openBrowser:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=T(n),r=n?e.surfaces.filter(e=>e.id!==`browser:new`):e.surfaces;return O({...e,surfaces:r},t)})})),selectFilePreview:(t,n,r)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.kind===`file-preview`),i={id:`file-preview`,kind:`file-preview`,relativePath:n,revealLine:A(r),revealRequestId:(t?.kind===`file-preview`?t.revealRequestId:0)+1};return O({...e,surfaces:e.surfaces.map(e=>e.kind===`file-preview`?i:e)},i)})})),openPullRequest:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>O(e,D(n)))})),openFile:(t,n,r)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.filter(e=>e.kind!==`files`),i=`file:${n}`,a=t.find(e=>e.id===i&&e.kind===`file`),o=E(n,A(r),(a?.revealRequestId??0)+1);return{isOpen:!0,activeSurfaceId:o.id,surfaces:a?t.map(e=>e.id===o.id?o:e):[...t,o]}})})),openTerminal:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>O(e,te(n)))})),splitTerminal:(t,n,r,i=`horizontal`)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>({...e,isOpen:!0,activeSurfaceId:n,surfaces:e.surfaces.map(e=>{if(e.id!==n||e.kind!==`terminal`)return e;let{splitDirection:t,...a}=e;return{...a,terminalIds:e.terminalIds.includes(r)?e.terminalIds:[...e.terminalIds,r],activeTerminalId:r,...i===`vertical`?{splitDirection:`vertical`}:{}}})}))})),activateTerminal:(t,n,r)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>({...e,activeSurfaceId:n,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`&&e.terminalIds.includes(r)?{...e,activeTerminalId:r}:e)}))})),closeTerminal:(t,n,r)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.id===n&&e.kind===`terminal`);if(!t||t.kind!==`terminal`)return e;let i=t.terminalIds.filter(e=>e!==r);if(i.length===0){let t=e.surfaces.findIndex(e=>e.id===n),r=e.surfaces.filter(e=>e.id!==n),i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:e.activeSurfaceId===n?i?.id??null:e.activeSurfaceId}}return{...e,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`?{...e,terminalIds:i,activeTerminalId:e.activeTerminalId===r?i.at(-1)??i[0]:e.activeTerminalId}:e)}})})),activateSurface:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>e.surfaces.some(e=>e.id===n)?{...e,isOpen:!0,activeSurfaceId:n}:e)})),closeSurface:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0)return e;let r=e.surfaces.filter(e=>e.id!==n);if(e.activeSurfaceId!==n)return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r};let i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:i?.id??null}})})),closeOtherSurfaces:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.id===n);return!t||e.surfaces.length===1?e:{...e,isOpen:!0,surfaces:[t],activeSurfaceId:t.id}})})),closeSurfacesToRight:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0||t===e.surfaces.length-1)return e;let r=e.surfaces.slice(0,t+1),i=r.some(t=>t.id===e.activeSurfaceId);return{...e,surfaces:r,activeSurfaceId:i?e.activeSurfaceId:n}})})),closeAllSurfaces:t=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>e.surfaces.length===0?e:{...e,isOpen:!1,surfaces:[],activeSurfaceId:null})})),reconcileBrowserSurfaces:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=new Set(n.map(e=>`browser:${e}`)),r=e.surfaces.filter(e=>e.kind!==`preview`),i=e.surfaces.filter(e=>e.kind===`preview`&&e.id!==`browser:new`&&t.has(e.id)),a=new Set(i.map(e=>e.id)),o=n.filter(e=>!a.has(`browser:${e}`)).map(e=>T(e)),s=[...r,...i,...o],c=s.some(t=>t.id===e.activeSurfaceId),l=s.find(e=>e.kind===`preview`);return{...e,surfaces:s,activeSurfaceId:c?e.activeSurfaceId:l?.id??s[0]?.id??null}})})),reconcileFileSurfaces:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{if(n)return e;let t=e.surfaces.filter(e=>e.kind!==`files`&&e.kind!==`file`);if(t.length===e.surfaces.length)return e;let r=t.some(t=>t.id===e.activeSurfaceId);return{...e,isOpen:t.length>0?e.isOpen:!1,surfaces:t,activeSurfaceId:r?e.activeSurfaceId:t.at(-1)?.id??null}})})),show:t=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>e.isOpen?e:{...e,isOpen:!0})})),close:t=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>e.isOpen?{...e,isOpen:!1}:e)})),toggleVisibility:t=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>({...e,isOpen:!e.isOpen}))})),toggle:(t,n)=>e(e=>({byThreadKey:k(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(t=>t.id===e.activeSurfaceId);return e.isOpen&&t?.kind===n?{...e,isOpen:!1}:n===`preview`?O(e,e.surfaces.find(e=>e.kind===`preview`)??T(null)):O(e,w(n))})})),removeThread:t=>e(e=>{let n=o(t);if(!(n in e.byThreadKey))return e;let{[n]:r,...i}=e.byThreadKey;return{byThreadKey:i}})}),{name:ee,version:x,storage:a(()=>n(typeof window<`u`?window.localStorage:void 0)),partialize:e=>({byThreadKey:Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!S(e)))}),migrate:j}));function N(e,t){return t?e[o(t)]??C:C}function P(e,t){let n=N(e,t);return n.isOpen?n.surfaces.find(e=>e.id===n.activeSurfaceId)?.kind??null:null}function F(e,t){return N(e,t).isOpen?I(e,t):null}function I(e,t){let n=N(e,t);return n.surfaces.find(e=>e.id===n.activeSurfaceId)??null}var L=t(),R=Object.freeze([]),z=Object.freeze([]),B=Object.freeze([]),V=Object.freeze([]),H=Object.freeze([]),U=l(null).pipe(d(`web-project:empty`));l(R).pipe(d(`web-project-refs:empty`));var W=l(z).pipe(d(`web-thread-refs:empty`)),G=l(null).pipe(d(`web-thread-shell:empty`)),K=l(null).pipe(d(`web-thread-detail:empty`)),q=l(`empty`).pipe(d(`web-thread-status:empty`));l(B).pipe(d(`web-thread-messages:empty`)),l(V).pipe(d(`web-thread-activities:empty`)),l(H).pipe(d(`web-thread-proposed-plans:empty`)),l(null).pipe(d(`web-thread-session:empty`));var J=l(null).pipe(c,d(`web-active-environment-id`));function Y(){return s(J)}function X(e){f.set(J,e)}function ie(){return s(m.threadRefsAtom)}function ae(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?W:m.environmentThreadRefsAtom(e),t[0]=e,t[1]=n),s(n)}function oe(){return s(h.projectsAtom)}function se(){return s(_)}function ce(){return s(m.threadShellsAtom)}function le(){return s(p)}function ue(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=m.threadShellsForProjectRefsAtom(e),t[0]=e,t[1]=n),s(n)}function de(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?U:h.projectAtom(e),t[0]=e,t[1]=n),s(n)}function Z(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?G:m.threadShellAtom(e),t[0]=e,t[1]=n),s(n)}function Q(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?K:g.detailAtom(e),t[0]=e,t[1]=n),s(n)}function fe(e){let t=(0,L.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?q:g.statusAtom(e),t[0]=e,t[1]=n),s(n)}function pe(e,t){return e!==null&&(!t.waitForShell||t.shellExists)?e:null}function me(e,t){let n=(0,L.c)(7),r=Z(e),i=r!==null,a=t?.waitForShell===!0,o;n[0]!==e||n[1]!==i||n[2]!==a?(o=pe(e,{shellExists:i,waitForShell:a}),n[0]=e,n[1]=i,n[2]=a,n[3]=o):o=n[3];let s=Q(o),c;return n[4]!==s||n[5]!==r?(c=u(s,r),n[4]=s,n[5]=r,n[6]=c):c=n[6],c}function he(e){return f.get(h.projectAtom(e))}function ge(e){return f.get(m.threadShellAtom(e))}function $(e){return f.get(_).get(e)?.environment.capabilities.threadSettlement===!0}function _e(e){return f.get(_).get(e)?.environment.capabilities.threadSnooze===!0}function ve(e){return f.get(_).get(e)?.environment.capabilities.threadPublish===!0}function ye(e){return f.get(_).get(e)?.environment.capabilities.threadPinning===!0}function be(e){return f.get(_).get(e)?.environment.capabilities.threadTitleRegeneration===!0}function xe(e){return f.get(_).get(e)?.environment.capabilities.threadPinReorder===!0}function Se(e){return f.get(m.environmentThreadRefsAtom(e))}function Ce(){return f.get(m.threadShellsAtom)}export{re as A,ue as C,F as D,P as E,b as M,I as O,ce as S,y as T,se as _,_e as a,ie as b,he as c,X as d,Y as f,oe as g,de as h,$ as i,M as j,N as k,ge as l,ae as m,ye as n,be as o,le as p,ve as r,Se as s,xe as t,Ce as u,me as v,fe as w,Z as x,Q as y};
|
|
2
|
-
//# sourceMappingURL=entities-D-MTx85j.js.map
|