import"./rolldown-runtime-DIIn1E2Q.js";import{dt as e}from"./vendor-primevue-_eYbXsHY.js";import"./vendor-firebase-D7u00oy9.js";import{F as t,I as n,O as r,R as i,Ut as a,_t as o,et as s,j as c,kt as l}from"./vendor-vue-core-DO0afONr.js";import"./vendor-other-D7fTIduy.js";import"./useFeatureFlags-ChmiVSwD.js";import"./api-BebQfoGK.js";import"./vendor-markdown-Da9QPS2x.js";import"./colorUtil-xHrUTSza.js";import{n as u}from"./vendor-i18n-JbyM4Qz7.js";import"./i18n-dAUEhQVe.js";import"./vendor-reka-ui-D1HCh14_.js";import{t as d}from"./Button-hTbieW3T.js";import{Oi as f,Xi as p}from"./dialogService-Cm1GEBK8.js";import"./formatUtil-Gr6H7233.js";import"./userStore-DMlTsx5E.js";import"./useErrorHandling-DudkVSep.js";import"./extensionStore-P-YqST__.js";import"./useExternalLink-DY6FqhTr.js";import"./vendor-tiptap-CcjHVRxb.js";import"./markdownRendererUtil-PltcX2Bi.js";import"./Popover-BhkpNQxC.js";import"./electronDownloadStore-BYrGQ7mS.js";var m={class:`flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background`},h={class:`flex h-12 items-center justify-between border-b border-border-default px-4`},g={class:`m-0 text-sm font-normal text-base-foreground`},_=[`aria-label`],v={class:`p-4`},y={class:`m-0 text-sm text-muted-foreground`},b={class:`flex items-center justify-end gap-4 p-4`},x=i({__name:`DeleteWorkspaceDialogContent`,props:{workspaceId:{},workspaceName:{}},setup(i){let{t:x}=u(),S=e(),C=p(),w=f(),T=l(!1);function onCancel(){C.closeDialog({key:`delete-workspace`})}async function onDelete(){T.value=!0;try{await w.deleteWorkspace(i.workspaceId),C.closeDialog({key:`delete-workspace`}),window.location.reload()}catch(e){console.error(`[DeleteWorkspaceDialog] Failed to delete workspace:`,e),S.add({severity:`error`,summary:x(`workspacePanel.toast.failedToDeleteWorkspace`),detail:e instanceof Error?e.message:x(`g.unknownError`)})}finally{T.value=!1}}return(e,i)=>(s(),c(`div`,m,[r(`div`,h,[r(`h2`,g,a(e.$t(`workspacePanel.deleteDialog.title`)),1),r(`button`,{class:`focus-visible:ring-secondary-foreground cursor-pointer rounded-sm border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:ring-1 focus-visible:outline-none`,"aria-label":e.$t(`g.close`),onClick:onCancel},i[0]||=[r(`i`,{class:`pi pi-times size-4`},null,-1)],8,_)]),r(`div`,v,[r(`p`,y,a(e.workspaceName?e.$t(`workspacePanel.deleteDialog.messageWithName`,{name:e.workspaceName}):e.$t(`workspacePanel.deleteDialog.message`)),1)]),r(`div`,b,[n(d,{variant:`muted-textonly`,onClick:onCancel},{default:o(()=>[t(a(e.$t(`g.cancel`)),1)]),_:1}),n(d,{variant:`destructive`,size:`lg`,loading:T.value,onClick:onDelete},{default:o(()=>[t(a(e.$t(`g.delete`)),1)]),_:1},8,[`loading`])])]))}});export{x as default};
//# sourceMappingURL=DeleteWorkspaceDialogContent-BmVs3dfK.js.map