import{h as c,$ as j,g as y,k as w,i as I,j as t,_ as s,q as i}from"./main.2.8.10.js";import{u as v,b as r}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{S as _,I as F,s as M}from"./Integrations.BFhED4ck.js";import{h as N,c as p,n as k,a as E}from"./MondayComCommonFunc.BjAE-bJU.js";import{M as L}from"./MondayComIntegLayout.l94q_7Pl.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./FieldMapHelper.DGWtlkLN.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./ProUtilHelpers.CtRYkgop.js";function V({allIntegURL:f}){const g=v(),[m,P]=c(j),[e,n]=c(y),[d,u]=r.useState(!1),[x,b]=r.useState({}),[h,o]=r.useState({show:!1}),l=w(I),C=()=>{if(!p(e)){o({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}const a=e.mainAction;if(k.includes(a)&&!e.selectedBoard){i.error(s("Please select a board","bit-integrations"));return}if(E.includes(a)&&!e.selectedItem){i.error(s("Please select an item","bit-integrations"));return}if(a==="create_column"&&!e.columnType){i.error(s("Please select a column type","bit-integrations"));return}M({flow:m,allIntegURL:f,conf:e,navigate:g,edit:1,setIsLoading:u,setSnackbar:o})};return t.jsxs("div",{style:{width:900,minHeight:500,overflow:"visible"},children:[t.jsx(S,{snack:h,setSnackbar:o}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:a=>N(a,e,n),name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(_,{entity:m.triggered_entity,setSnackbar:o}),t.jsx(L,{formFields:l,mondayComConf:e,setMondayComConf:n,loading:x,setLoading:b,isLoading:d}),t.jsx(F,{edit:!0,saveConfig:C,disabled:!p(e),isLoading:d,dataConf:e,setDataConf:n,formFields:l}),t.jsx("br",{})]})}export{V as default};
