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.8.10.js";import{u as C,e as y,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as N}from"./SnackMsg.7BjcJK1j.js";import{S as w}from"./Steps.B84Ui3GU.js";import{I as L,s as T}from"./Integrations.BFhED4ck.js";import B from"./SlackAuthorization.BvC02kP6.js";import{h as E}from"./SlackCommonFunc.Csa7yXsB.js";import{S as A}from"./SlackIntegLayout.3rMOHK0Z.js";import{B as D}from"./BackIcn.BFDZx8No.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.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};
