var j=Object.defineProperty;var f=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var u=(e,t,s)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,h=(e,t)=>{for(var s in t||(t={}))v.call(t,s)&&u(e,s,t[s]);if(f)for(var s of f(t))I.call(t,s)&&u(e,s,t[s]);return e};import{j as a,_}from"./main.2.9.0.js";import{u as C,e as y,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as N}from"./SnackMsg.DYSD96P4.js";import{S as w}from"./Steps.BYe8zHkm.js";import{I as L,s as T}from"./Integrations.DL8wqGct.js";import B from"./SlackAuthorization.BVn-YVcj.js";import{h as E}from"./SlackCommonFunc.D8dlseea.js";import{S as A}from"./SlackIntegLayout.BkSxQn7F.js";import{B as D}from"./BackIcn._8Wofmn2.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";function Y({formFields:e,setFlow:t,flow:s,allIntegURL:x}){const S=C(),{formID:g}=y(),[m,l]=c.useState(!1),[n,d]=c.useState(1),[b,i]=c.useState({show:!1}),[o,r]=c.useState({name:"Slack",type:"Slack",parse_mode:"HTML",field_map:[{formField:"",slackFormField:""}],channel_id:"",body:"",actions:{}}),k=p=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),o.name!==""&&o.channel_id&&d(p)};return a.jsxs("div",{children:[a.jsx(N,{snack:b,setSnackbar:i}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(w,{step:3,active:n})}),a.jsx(B,{formID:g,slackConf:o,setSlackConf:r,step:n,setstep:d,isLoading:m,setIsLoading:l,setSnackbar:i}),a.jsxs("div",{className:"btcd-stp-page",style:h({},n===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(A,{formFields:e,handleInput:p=>E(p,o,r),slackConf:o,setSlackConf:r,isLoading:m,setIsLoading:l,setSnackbar:i}),a.jsxs("button",{onClick:()=>k(3),disabled:o.channel_id==="",className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[_("Next","bit-integrations"),a.jsx(D,{className:"ml-1 rev-icn"})]})]}),a.jsx(L,{step:n,saveConfig:()=>T({flow:s,setFlow:t,allIntegURL:x,conf:o,navigate:S,setIsLoading:l,setSnackbar:i}),isLoading:m,dataConf:o,setDataConf:r,formFields:e})]})}export{Y as default};
