import{h as d,$ as I,g as _,k as w,i as C,j as t,_ as n}from"./main.2.9.0.js";import{u as F,e as S,b as r}from"./react-router.DMwpH23k.js";import{S as v}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as y,I as N,s as k}from"./Integrations.DL8wqGct.js";import{h as m,c}from"./AirtableCommonFunc.DMC83CSS.js";import{A}from"./AirtableIntegLayout.CyhxLroN.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function O({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:n("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:n("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>m(o,e,a),name:"name",value:e.name,type:"text",placeholder:n("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:o=>m(o,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{O as default};
