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