import{h as d,$ as j,g as k,k as I,i as S,j as t,_ as s,q as n}from"./main.2.9.0.js";import{u as _,e as w,b as l}from"./react-router.DMwpH23k.js";import{S as F}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as v,I as y,s as N}from"./Integrations.DL8wqGct.js";import{h as m,c as p}from"./ClickupCommonFunc.Cx2auaOU.js";import{C as P}from"./ClickupIntegLayout.Db_fSl7N.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function Q({allIntegURL:f}){const g=_(),{id:L}=w(),[o,E]=d(j),[e,i]=d(k),[u,$]=l.useState(!1),[x,b]=l.useState({}),[h,a]=l.useState({show:!1}),c=I(S),C=()=>{if(!p(e)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="task"){if(!e.selectedTeam){n.error(s("Please select a team","bit-integrations"));return}if(!e.selectedSpace){n.error(s("Please select a space","bit-integrations"));return}if(!e.selectedFolder){n.error(s("Please select a folder","bit-integrations"));return}if(!e.selectedList){n.error(s("Please select a list","bit-integrations"));return}}N({flow:o,allIntegURL:f,conf:e,navigate:g,edit:1,setSnackbar:a})};return t.jsxs("div",{style:{width:900},children:[t.jsx(F,{snack:h,setSnackbar:a}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>m(r,e,i),name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(v,{entity:o.triggered_entity,setSnackbar:a}),t.jsx(P,{formID:o.triggered_entity_id,formFields:c,handleInput:r=>m(r,e,i),clickupConf:e,setClickupConf:i,loading:x,setLoading:b,setSnackbar:a}),t.jsx(y,{edit:!0,saveConfig:C,disabled:!p(e),isLoading:u,dataConf:e,setDataConf:i,formFields:c}),t.jsx("br",{})]})}export{Q as default};
