import{r as i,j as e}from"./@radix-DeK6qiuw.js";import{S as o,f as n,r as c,aG as d}from"./index-CCOPpudF.js";import{S as h}from"./StackList-WvuKQusZ.js";import{p as m,c as j}from"./persist-Coz7ZWvz.js";import{p as l,c as k}from"./persist-GjC8PZoC.js";import{I as p}from"./Infobox-Cx4xGoXR.js";import{s as u}from"./index-CEV4Cvaf.js";import{a as f}from"./@tanstack-DT5WLu9C.js";import{L as x}from"./@react-router-B3Z5rLr2.js";import"./@reactflow-CK0KJUen.js";import"./plus-tf1V2hTJ.js";import"./refresh-BjOeWlEq.js";import"./SearchField-lp1KgU4e.js";import"./dots-horizontal-otGBOSDJ.js";import"./chevron-right-double-D7ojK9Co.js";import"./url-CkvKAnwF.js";import"./index-Uu49AX48.js";import"./CopyButton-LNcWaa14.js";import"./copy-C8XQA2Ug.js";import"./DisplayDate-CDMUcQHS.js";import"./InlineAvatar-DiGOWNKF.js";import"./CodeSnippet-JzR8CEtw.js";import"./CollapsibleCard-DQW_ktMO.js";import"./chevron-down-6JyMkfjR.js";import"./components-Br2ezRib.js";import"./NumberBox-Dtp3J6g5.js";import"./ComponentBadge-D_g62Wv8.js";import"./stack-detail-query-OPEW-cDJ.js";import"./layout-BtHBmE4w.js";import"./rocket-DjT2cDvG.js";import"./DialogItem-Bxf8FuAT.js";import"./trash-arLUMWMS.js";import"./AlertDialogDropdownItem-DezXKmDf.js";import"./sharedSchema-CQb14VSr.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function S({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(S,{setHasResumeableTerraform:r})]})}function re(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{re as default};
