import{h as c,g as I,$ as S,k as _,i as y,j as e,_ as a}from"./main.2.9.0.js";import{u as v,e as N,b as m}from"./react-router.DMwpH23k.js";import{S as k}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as C,I as F,s as E}from"./Integrations.DL8wqGct.js";import{h as u,c as L}from"./ZohoBiginCommonFunc.K2WQPoG_.js";import{Z as $}from"./ZohoBiginIntegLayout.CkLCOMBu.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TabPanel.BxisqkXJ.js";import"./ActionProFeatureLabels.gUp7_RXn.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function U({allIntegURL:f}){const g=v(),{id:B,formID:d}=N(),[t,o]=c(I),[l,h]=c(S),[p,i]=m.useState(!1),[x,s]=m.useState({show:!1}),[n,j]=m.useState(0),b=_(y),w=()=>{if(!L(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if((t==null?void 0:t.module)==="Deals"&&!(t!=null&&t.pLayout)){s({show:!0,msg:a("Please select a layout","bit-integrations")});return}E({flow:l,setFlow:h,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(k,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>u(r,n,t,o),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(C,{entity:l.triggered_entity,setSnackbar:s}),e.jsx($,{tab:n,settab:j,formID:d,handleInput:r=>u(r,n,t,o,d,i,s),isLoading:p,setIsLoading:i,setSnackbar:s}),e.jsx(F,{edit:!0,saveConfig:w,disabled:t.module===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:o,formFields:b}),e.jsx("br",{})]})}export{U as default};
