import{b as d,$ as I,h as _,k as w,i as C,j as t,_ as o}from"./main.2.8.1.js";import{u as F,h as S,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as N,s as k}from"./Integrations.D2bgBas2.js";import{h as m,c}from"./AirtableCommonFunc.3JRgSmMJ.js";import{A}from"./AirtableIntegLayout.Bh9Um9fp.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function K({allIntegURL:f}){const p=F(),{id:E}=S(),[i,L]=d(I),[e,a]=d(_),[g,u]=r.useState(!1),[b,x]=r.useState({auth:!1,customFields:!1,bases:!1,tables:!1,airtableFields:!0}),[h,s]=r.useState({show:!1}),l=w(C),j=()=>{if(!c(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}k({flow:i,allIntegURL:f,conf:e,navigate:p,edit:1,setIsLoading:u,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:h,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>m(n,e,a),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(y,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(A,{formID:i.triggered_entity_id,formFields:l,handleInput:n=>m(n,e,a),airtableConf:e,setAirtableConf:a,loading:b,setLoading:x,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:j,disabled:!c(e),isLoading:g,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{K as default};
