import{b as c,h as j,$ as w,k,i as I,j as e,_ as o}from"./main.2.8.1.js";import{h as _,u as C,d as l}from"./react-router-dom.9mCuUg3q.js";import{S}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as v,I as y,s as N}from"./Integrations.D2bgBas2.js";import{h as p,c as D}from"./ZohoDeskCommonFunc.gpETZq5N.js";import{Z as F}from"./ZohoDeskIntegLayout.DBOsR8AP.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function H({allIntegURL:f}){const{id:E,formID:r}=_(),g=C(),[t,n]=c(j),[m,h]=c(w),[u,i]=l.useState(!1),[x,s]=l.useState({show:!1}),d=k(I),b=()=>{var a;if(!D(t)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!((a=t.actions)!=null&&a.ticket_owner)){s({show:!0,msg:o("Please select a ticket owner","bit-integrations")});return}N({flow:m,setFlow:h,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-7",onChange:a=>p(a,t,n),name:"name",value:t.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx(v,{entity:m.triggered_entity,setSnackbar:s}),e.jsx(F,{formID:r,formFields:d,handleInput:a=>p(a,t,n,r,i,s),deskConf:t,setDeskConf:n,isLoading:u,setIsLoading:i,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:t.department===""||t.table===""||t.field_map.length<1,dataConf:t,setDataConf:n,formFields:d})]})}export{H as default};
