import{j as t,al as d,R as p,aT as x,X as u}from"./vendor-mui-core-CDEc-eG6.js";import{r as o}from"./vendor-react-DX7tU9aY.js";import{b4 as g}from"./vendor-ux-bFYdDLNG.js";import{a as h}from"./page-header-CEL5h6do.js";import{V as b}from"./index-DGZk149v.js";import{A as j}from"./config-CinJV-4R.js";import{S as k}from"./step-actions-DiRyepq4.js";import{S}from"./layout-D7JBXyAe.js";import"./vendor-utils-_C9URqjS.js";import"./vendor-hooks-BrgYeCrj.js";import"./vendor-arcblock-DY2miJjh.js";import"./isURL-CpQHQuaa.js";import"./isIP-BBY240SU.js";import"./section-CC2BHD5s.js";import"./required-BO8emcue.js";import"./form-wrapper-BqPFgoVY.js";import"./form-text-input-C3xqzm2t.js";import"./edit.svg-BGhTyO6h.js";import"./wait-connect-D16c5vpx.js";import"./get-safe-url-B1bR9jl-.js";import"./index-jIvFgWDS.js";import"./index-DBs9Ljax.js";import"./use-mobile-DUKvJoqs.js";import"./content-layout-D49-hpq6.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=b(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(j,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
  height: 100%;
  overflow-y: auto;

  .form-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
  }
`;export{y as default};
