import{j as t,_ as u}from"./main.2.8.10.js";import{u as N,e as T,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as S}from"./BackIcn.BFDZx8No.js";import{S as I}from"./SnackMsg.7BjcJK1j.js";import{I as C,g as k}from"./Integrations.BFhED4ck.js";import v from"./NinjaTablesAuthorization.CElVpmTQ.js";import{N as y,c as d}from"./NinjaTablesIntegLayout.Bg73qeI4.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";function K({formFields:c,setFlow:b,flow:g,allIntegURL:j}){const x=N(),{formID:p}=T(),[n,o]=i.useState(!1),[e,l]=i.useState(1),[h,a]=i.useState({show:!1}),[s,r]=i.useState({name:"Ninja Tables",type:"Ninja Tables",field_map:[{formField:"",columnName:""}],actions:{},mainAction:"",default:{}}),f=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m===3){if(!d(s)){a({show:!0,msg:u("Please select all required options to continue.","bit-integrations")});return}s.name!==""&&l(m)}else l(m)};return t.jsxs("div",{children:[t.jsx(I,{snack:h,setSnackbar:a}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(v,{formID:p,ninjaTablesConf:s,setNinjaTablesConf:r,step:e,nextPage:f,isLoading:n,setIsLoading:o,setSnackbar:a}),t.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[t.jsx(y,{formID:p,formFields:c,ninjaTablesConf:s,setNinjaTablesConf:r,setSnackbar:a,setIsLoading:o,isLoading:n}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>f(3),disabled:!d(s),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[u("Next","bit-integrations"),t.jsx(S,{className:"ml-1 rev-icn"})]})]}),t.jsx(C,{step:e,saveConfig:()=>k(g,b,j,s,x,"","",o),isLoading:n,dataConf:s,setDataConf:r,formFields:c})]})}export{K as default};
