var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var g=(i,e,t)=>e in i?S(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,b=(i,e)=>{for(var t in e||(e={}))w.call(e,t)&&g(i,t,e[t]);if(f)for(var t of f(e))y.call(e,t)&&g(i,t,e[t]);return i};import{_ as r,j as a}from"./main.2.8.10.js";import{u as N,e as _,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as F}from"./SnackMsg.7BjcJK1j.js";import{S as C}from"./Steps.B84Ui3GU.js";import{I as D,s as E}from"./Integrations.BFhED4ck.js";import q from"./TrelloAuthorization.BHiRzbvy.js";import{g as L,s as M,h as P,d as x}from"./TrelloCommonFunc.Wk1l0MJW.js";import{T as A}from"./TrelloIntegLayout.C09y0PMW.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./BackIcn.BFDZx8No.js";import"./TutorialLink.D6K_DiHL.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function se({formFields:i,setFlow:e,flow:t,allIntegURL:h}){const j=N(),{formID:v}=_(),[d,l]=n.useState(!1),[m,p]=n.useState(1),[I,o]=n.useState({show:!1}),u=[{key:"name",label:r("Name","bit-integrations"),required:!0},{key:"desc",label:r("Description","bit-integrations"),required:!1},{key:"due",label:r("Date","bit-integrations"),required:!1}],[s,c]=n.useState({name:"Trello",type:"Trello",clientId:"",listId:"",listName:"",tags:"",pos:"",field_map:L(u),custom_field_map:[{formField:"",trelloFormField:""}],cardFields:u,customFields:[],actions:{}});n.useEffect(()=>{window.opener&&M("trello")},[]);const T=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!x(s)){o({show:!0,msg:r("Please map fields to continue.","bit-integrations")});return}s.listId!==""&&p(3)};return a.jsxs("div",{children:[a.jsx(F,{snack:I,setSnackbar:o}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(C,{step:3,active:m})}),a.jsx(q,{formID:v,trelloConf:s,setTrelloConf:c,step:m,setstep:p,isLoading:d,setIsLoading:l,setSnackbar:o}),a.jsxs("div",{className:"btcd-stp-page",style:b({},m===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(A,{formFields:i,handleInput:k=>P(k,s,c,l,o),trelloConf:s,setTrelloConf:c,isLoading:d,setIsLoading:l,setSnackbar:o}),a.jsxs("button",{onClick:()=>T(),disabled:!(s!=null&&s.listId)||!x(s),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[r("Next","bit-integrations"),"  ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(D,{step:m,saveConfig:()=>E({flow:t,setFlow:e,allIntegURL:h,navigate:j,conf:s,setIsLoading:l,setSnackbar:o}),isLoading:d,dataConf:s,setDataConf:c,formFields:i})]})}export{se as default};
