import{aM as o,r as i,aJ as e}from"./@ui-core-DKdciH1Z.js";import{e as n,B as c,r as m,ck as x}from"./index-D7KLAbvI.js";import{S as h}from"./StackList-BnoJDftj.js";import{p as l,c as j}from"./persist-C7PD3b0n.js";import{p,c as k}from"./persist-YmwCK4u8.js";import{I as u}from"./Infobox-DUoxxn6u.js";import{s as f}from"./index-C1wOIU40.js";import{L as d}from"./@react-router-DaIuhn3X.js";import"./@reactflow-CJzATMj6.js";import"./@zod-DKyD3xVW.js";import"./@monaco-editor-CSMpaClf.js";import"./Pagination-Bl0X6mOG.js";import"./chevron-right-double-CNOR0jlH.js";import"./SearchField-DEer4oQ6.js";import"./CodeSnippet-Dwuwo3ZI.js";import"./CollapsibleCard-3zV5aMxC.js";import"./resizable-sheet-D7Mw_0Os.js";import"./react-resizable-panels.browser-DzY2Iih7.js";import"./components-Br2ezRib.js";import"./NumberBox-rSe9DK5q.js";import"./ComponentBadge-BKlKYVYF.js";import"./ComponentIcon-BOKrWHiD.js";import"./bar-chart-square-check-Lt3fLSJ-.js";import"./layout-BRN9AeDt.js";import"./transform-Bq7p9csj.js";import"./NestedCollapsible-k41ntPyA.js";import"./eye-off-T0xdenj_.js";import"./eye-0EFEzbgA.js";import"./action-cell-CsLz-mf4.js";import"./sharedSchema-CilfqDZ1.js";import"./index.es-DovV9WG3.js";import"./alert-triangle-DWngjzfY.js";import"./stack-detail-query-IhXZFDdF.js";function w({setHasResumeableStack:a}){const{success:r,data:s}=l(),t=o({...f.stackDeploymentStack({provider:s?.provider||"aws",stack_name:s?.stackName||"",date_start:s?.timestamp}),enabled:r,throwOnError:!0});return i.useEffect(()=>{t.data&&(j(),a(!1))},[t.data]),!r||t.isError?null:t.isPending?e.jsx(n,{className:"h-[70px] w-full"}):e.jsx(u,{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(c,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(d,{to:m.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v({setHasResumeableTerraform:a}){const{success:r,data:s}=p(),t=o({...f.stackDeploymentStack({provider:s?.provider||"aws",stack_name:s?.stackName||"",date_start:s?.timestamp}),enabled:r,throwOnError:!0});return i.useEffect(()=>{t.data&&(k(),a(!1))},[t.data]),!r||t.isError?null:t.isPending?e.jsx(n,{className:"h-[70px] w-full"}):e.jsx(u,{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(c,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(d,{to:m.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function N(){const[a,r]=i.useState(l().success),[s,t]=i.useState(p().success);return!a&&!s?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:r}),s&&e.jsx(v,{setHasResumeableTerraform:t})]})}function se(){const{setTourState:a,tourState:{tourActive:r}}=x();return i.useEffect(()=>{r&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[r]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(N,{}),e.jsx(h,{})]})}export{se as default};
