3 lines
5.3 KiB
JavaScript
3 lines
5.3 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./confirm-dialog-Bsc2vyOH.js","./control-ui-core-Br5DB0Zj.js","./rolldown-runtime-DkW27tQK.js","./control-ui-foundation-CeFMP1Ly.js","./control-ui-core-pH6nakZ-.js","./lit-runtime-BEtFSUCp.js","./control-ui-core-DGVkFhVB.js","./gateway-runtime-DUNO4Mi1.js","./control-ui-core-C8H8-RSs.css","./control-ui-boot-Cdpgu1Gm.js","./control-ui-boot-wpHCbPL9.js","./control-ui-boot-gfE6fZcA.js","./config-runtime-C4gfjhZc.js","./control-ui-boot-CKTkvwFZ.js","./control-ui-boot-BPFwXC8p.js","./control-ui-boot-DdPrPuw0.js","./control-ui-boot-9_2QGLIL.js","./control-ui-boot-J-x6DHHT.js","./control-ui-boot-B1lcIXow.js","./control-ui-boot-Clhp68JE.js","./control-ui-boot-D1DWJlBr.js","./control-ui-boot-CQvujP8f.js","./control-ui-boot-BW_XZcbY.js","./control-ui-boot-__AsqpzJ.css","./markdown-runtime-BcrsAQtF.js","./session-placement-move-dialog-BUC6yPYf.js","./new-session-Df5ycn44.js","./new-session-C99rZtoz.css","./draft-cloud-machine-state-B3618rsh.js"])))=>i.map(i=>d[i]);
|
|
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{Nr as t,Pr as n}from"./control-ui-foundation-CeFMP1Ly.js";import{Ba as r,Dc as i,Va as a,bc as o}from"./control-ui-core-pH6nakZ-.js";import{Jt as s,Ut as c}from"./control-ui-core-DGVkFhVB.js";import{Ht as l,qt as u}from"./control-ui-core-Br5DB0Zj.js";import{Es as d,Ts as f,ws as p}from"./control-ui-boot-Cdpgu1Gm.js";import{Jn as m,Kn as h,Vn as g,qn as _}from"./control-ui-boot-D1DWJlBr.js";import{n as v,t as y}from"./device-placement-CSrN9cIf.js";async function b(e,t,n){let r=await h(e);return{profiles:t?r.profiles:[],devices:v(r.environments,n)}}async function x(e){let n=e.client,r=e.row.placement;if(!n||e.movingKey===e.row.key||e.row.placementMove!==void 0&&e.row.placementMove.error===void 0||r?.state!==`active`)return;let o=a(e.gatewaySnapshot,{method:`sessions.move`,requiredScope:`operator.write`});if(!o.allowed){e.publishError(o.reason);return}let s=i(e.row.key)?.agentId,l=r.runner?.kind===`device`&&r.runner.status===`offline`,d;if(l){let{showConfirmDialog:n}=await t(async()=>{let{showConfirmDialog:e}=await import(`./confirm-dialog-Bsc2vyOH.js`);return{showConfirmDialog:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url);d=await n({message:u(`sessionsView.continueOnGatewayConfirm`,{session:e.row.label||e.row.key}),confirmLabel:u(`sessionsView.continueOnGatewayAction`),danger:!0})?{kind:`gateway`}:null}else{let{showSessionPlacementMoveDialog:r}=await t(async()=>{let{showSessionPlacementMoveDialog:e}=await import(`./session-placement-move-dialog-BUC6yPYf.js`);return{showSessionPlacementMoveDialog:e}},__vite__mapDeps([25,2,4,3,5,6,1,7,8,20,10,11,9,12,13,14,15,16,17,18,19,21,22,23,24,26,27,28]),import.meta.url),i=e.row.agentRuntime;d=await r({sessionLabel:e.row.label||e.row.key,activeRun:e.row.hasActiveRun===!0,deviceDisabledReason:i&&!i.devicePlacement?u(`newSession.deviceRuntimeUnsupported`):void 0,profileDisabledReason:e=>i?.cloudPlacementSupported===!1?u(`newSession.cloudRuntimeUnsupported`,{runtime:i.id}):i?.cloudPlacementExecutionMode&&!_(e,i.cloudPlacementExecutionMode)?u(`newSession.cloudProfileRuntimeUnsupported`,{runtime:i.id}):void 0,loadCatalog:async()=>await b(n,c(e.gatewaySnapshot.hello?.auth??null),i?.devicePlacement)})}if(d){if(!e.isCurrent(n,e.connectionGeneration)){e.publishError(u(`sessionsView.actionUnavailable`));return}e.onMovingChange(e.row.key);try{await n.request(`sessions.move`,{key:e.row.key,...s?{agentId:s}:{},expected:{generation:r.generation,environmentId:r.environmentId,ownerEpoch:r.activeOwnerEpoch},target:d,...l?{abandonSource:!0}:{}}),e.isCurrent(n,e.connectionGeneration)&&await e.refreshReplacement(s)}catch(t){e.isCurrent(n,e.connectionGeneration)&&(await e.refreshReplacement(s).catch(()=>void 0),e.publishError(t))}finally{e.onMovingChange(null),e.requestUpdate()}}}async function S(e){let n=e.client,r=e.connectionGeneration,o=d(e.row.placement),s=e.reclaimingKey===e.row.key,c=e.row.placement,l=c?.state===`active`&&c.runner?.kind===`device`&&c.runner.status===`offline`;if(!n||s||l||o?.blocksActiveRun&&e.row.hasActiveRun===!0||o?.method!==`sessions.reclaim`)return;let p=a(e.gatewaySnapshot,{method:`sessions.reclaim`,requiredScope:`operator.write`});if(!p.allowed){e.publishError(p.reason);return}let{showConfirmDialog:m}=await t(async()=>{let{showConfirmDialog:e}=await import(`./confirm-dialog-Bsc2vyOH.js`);return{showConfirmDialog:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),h=c?.state===`active`&&c.runner?.kind===`device`;if(!await m({message:u(h?`sessionsView.stopDeviceWorkerConfirm`:`sessionsView.stopCloudWorkerConfirm`,{session:e.row.label||e.row.key}),confirmLabel:u(h?`sessionsView.stopDeviceWorkerConfirmAction`:`sessionsView.stopCloudWorkerConfirmAction`),danger:!0}))return;if(!e.isCurrent(n,r)){e.publishError(u(`sessionsView.actionUnavailable`));return}let g=i(e.row.key)?.agentId;e.onReclaimingChange(e.row.key);try{await f(n,{key:e.row.key,...g?{agentId:g}:{}}),e.isCurrent(n,r)&&await e.refreshReplacement(g)}catch(t){e.isCurrent(n,r)&&e.publishError(t)}finally{e.onReclaimingChange(null),e.requestUpdate()}}function C(){return(C=e((()=>{s(),p(),l(),r(),o(),g(),y(),m(),n()})))()}C();export{x as moveChatPanePlacement,S as reclaimChatPanePlacement};
|
|
//# sourceMappingURL=chat-pane-placement.runtime-CS9vR24w.js.map
|