import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-B5XNUjey.js";import{r as o}from"./vendor-react-CUXIiAnY.js";import{p as g}from"./vendor-ux-BX9dSNUy.js";import{a as h}from"./page-header-Cgwo2np-.js";import{ac as j}from"./index-Dijoh4El.js";import{A as b}from"./config-CwbUhIlW.js";import{S as k}from"./step-actions-nHHLzUFh.js";import{S}from"./layout-CZo9vMzc.js";import"./vendor-utils-CFxoplqC.js";import"./vendor-hooks-U4TTuKG0.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./isURL-wZZwzwyC.js";import"./section-BkMzBpvM.js";import"./required-B0Gua-D1.js";import"./form-wrapper-dz0PgYyA.js";import"./form-text-input-CbjI2VZQ.js";import"./edit.svg-Dz9cVo7r.js";import"./wait-connect-CCXiMHZY.js";import"./get-safe-url-pZvXlaJu.js";import"./index-BsA1v5Kx.js";import"./index-DBs9Ljax.js";import"./use-mobile-Dwc30NoL.js";import"./content-layout-B5NObRcH.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=j(),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(b,{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};
