import{j as t,_ as l}from"./main.2.8.10.js";import{u as D,e as I,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as S}from"./BackIcn.BFDZx8No.js";import{S as w}from"./SnackMsg.7BjcJK1j.js";import{I as k,g as v}from"./Integrations.BFhED4ck.js";import N from"./WeDocsAuthorization.CCFuN8wL.js";import{c as u}from"./WeDocsCommonFunc.hEQZYNgP.js";import{W as y}from"./WeDocsIntegLayout.DDNSgsfC.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function K({formFields:f,setFlow:g,flow:x,allIntegURL:b}){const h=D(),{formID:c}=I(),[n,a]=i.useState(!1),[s,m]=i.useState(1),[j,o]=i.useState({show:!1}),[e,p]=i.useState({name:"weDocs",type:"weDocs",field_map:[],weDocsFields:[],actions:{},mainAction:"",selectedDocumentationId:"",selectedSectionId:"",documentations:[],sections:[]}),d=r=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),r===3){if(!u(e)){o({show:!0,msg:l("Please complete all required fields to continue.","bit-integrations")});return}e.name!==""&&m(r);return}m(r)};return t.jsxs("div",{children:[t.jsx(w,{snack:j,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(N,{formID:c,weDocsConf:e,setWeDocsConf:p,step:s,nextPage:d,isLoading:n,setIsLoading:a,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"500px"},children:[t.jsx(y,{formID:c,formFields:f,weDocsConf:e,setWeDocsConf:p,setSnackbar:o,setIsLoading:a,isLoading:n}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>d(3),disabled:!e.mainAction||!u(e),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),t.jsx(S,{className:"ml-1 rev-icn"})]})]}),t.jsx(k,{step:s,saveConfig:()=>v(x,g,b,e,h,"","",a),isLoading:n})]})}export{K as default};
