import{u as b,k,d as m,r as o,h as I,j as t}from"./main-406.js";import{$ as _,g as w,h as F,d as S,_ as l,i as v,I as y,W as n,s as N}from"./bi.394.85.js";import{h as f,c as p}from"./bi.361.883.js";import{C as P}from"./bi.288.884.js";import"./bi.704.707.js";import"./bi.701.708.js";function W({allIntegURL:u}){const g=b();k();const[i,L]=m(_),[e,a]=m(w),[x,E]=o.useState(!1),[h,c]=o.useState({}),[C,s]=o.useState({show:!1}),d=I(F),j=()=>{if(!p(e)){s({show:!0,msg:l("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="task"){if(!e.selectedTeam){n.error("Please select a team");return}if(!e.selectedSpace){n.error("Please select a space");return}if(!e.selectedFolder){n.error("Please select a folder");return}if(!e.selectedList){n.error("Please select a list");return}}N({flow:i,allIntegURL:u,conf:e,navigate:g,edit:1,setLoading:c,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(S,{snack:C,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:l("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>f(r,e,a),name:"name",value:e.name,type:"text",placeholder:l("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:i.triggered_entity,setSnackbar:s}),t.jsx(P,{formID:i.triggered_entity_id,formFields:d,handleInput:r=>f(r,e,a),clickupConf:e,setClickupConf:a,loading:h,setLoading:c,setSnackbar:s}),t.jsx(y,{edit:!0,saveConfig:j,disabled:!p(e),isLoading:x,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{W as default};
