import{k as j,u as w,d as l,r as m,h as k,j as t}from"./main-333.js";import{g as I,$ as _,h as C,d as v,_ as o,i as y,I as N,s as S}from"./bi.636.93.js";import{h as f,c as D}from"./bi.846.798.js";import{Z as F}from"./bi.730.799.js";import"./bi.535.730.js";import"./bi.286.731.js";function A({allIntegURL:p}){const{id:E,formID:r}=j(),g=w(),[e,n]=l(I),[d,h]=l(_),[u,i]=m.useState(!1),[x,s]=m.useState({show:!1}),c=k(C),b=()=>{var a;if(!D(e)){s({show:!0,msg:o("Please map mandatory fields","bit-integrations")});return}if(!((a=e.actions)!=null&&a.ticket_owner)){s({show:!0,msg:o("Please select a ticket owner","bit-integrations")});return}S({flow:d,setFlow:h,allIntegURL:p,conf:e,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:x,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:o("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-7",onChange:a=>f(a,e,n),name:"name",value:e.name,type:"text",placeholder:o("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),t.jsx(y,{entity:d.triggered_entity,setSnackbar:s}),t.jsx(F,{formID:r,formFields:c,handleInput:a=>f(a,e,n,r,i,s),deskConf:e,setDeskConf:n,isLoading:u,setIsLoading:i,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:b,disabled:e.department===""||e.table===""||e.field_map.length<1,dataConf:e,setDataConf:n,formFields:c})]})}export{A as default};
