import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{ft as t}from"./vendor-primevue-DOcVZxnt.js";import"./vendor-firebase-yTFzdAQf.js";import{Dt as n,F as r,I as i,O as a,R as o,Vt as s,et as c,gt as l,j as u}from"./vendor-vue-core-CvBSzfTV.js";import"./vendor-other-ZVm7XS8K.js";import"./useFeatureFlags-CMK9o9Rw.js";import"./api-OgmjiUkn.js";import"./colorUtil-C9tyO6rZ.js";import{n as d}from"./vendor-i18n-B2MApQxA.js";import"./i18n-S80A-Sy1.js";import"./vendor-reka-ui-EFkcZtPy.js";import{t as f}from"./Button-C-kbn1lh.js";import{Xn as p}from"./dialogService-Dp405gae.js";import"./systemStatsStore-BAnEcJS2.js";import"./useErrorHandling-DfKSzlg9.js";import{t as m}from"./dialogStore-BDXSs8Ic.js";import"./userStore-C5cqCkur.js";import"./useCopyToClipboard-_eFTtqIy.js";import"./vendor-tiptap-BZCaYoPl.js";import"./vendor-markdown-Gcn_JH9N.js";import"./markdownRendererUtil-BD0lrBqH.js";import"./useExternalLink-CZSEXO8Q.js";var h={class:`flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background`},g={class:`flex h-12 items-center justify-between border-b border-border-default px-4`},_={class:`m-0 text-sm font-normal text-base-foreground`},v=[`aria-label`],y={class:`px-4 py-4`},b={class:`m-0 text-sm text-muted-foreground`},x={class:`flex items-center justify-end gap-4 px-4 py-4`},S=o({__name:`DeleteWorkspaceDialogContent`,props:{workspaceId:{},workspaceName:{}},setup(e){let{t:o}=d(),S=t(),C=m(),w=p(),T=n(!1);function onCancel(){C.closeDialog({key:`delete-workspace`})}async function onDelete(){T.value=!0;try{await w.deleteWorkspace(e.workspaceId),C.closeDialog({key:`delete-workspace`}),window.location.reload()}catch(e){console.error(`[DeleteWorkspaceDialog] Failed to delete workspace:`,e),S.add({severity:`error`,summary:o(`workspacePanel.toast.failedToDeleteWorkspace`),detail:e instanceof Error?e.message:o(`g.unknownError`),life:5e3})}finally{T.value=!1}}return(e,t)=>(c(),u(`div`,h,[a(`div`,g,[a(`h2`,_,s(e.$t(`workspacePanel.deleteDialog.title`)),1),a(`button`,{class:`cursor-pointer rounded border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-secondary-foreground`,"aria-label":e.$t(`g.close`),onClick:onCancel},t[0]||=[a(`i`,{class:`pi pi-times size-4`},null,-1)],8,v)]),a(`div`,y,[a(`p`,b,s(e.workspaceName?e.$t(`workspacePanel.deleteDialog.messageWithName`,{name:e.workspaceName}):e.$t(`workspacePanel.deleteDialog.message`)),1)]),a(`div`,x,[i(f,{variant:`muted-textonly`,onClick:onCancel},{default:l(()=>[r(s(e.$t(`g.cancel`)),1)]),_:1}),i(f,{variant:`destructive`,size:`lg`,loading:T.value,onClick:onDelete},{default:l(()=>[r(s(e.$t(`g.delete`)),1)]),_:1},8,[`loading`])])]))}});export{S as default};
//# sourceMappingURL=DeleteWorkspaceDialogContent-BAro1Xtz.js.map