var S=Object.defineProperty;var f=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var u=(s,t,e)=>t in s?S(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,h=(s,t)=>{for(var e in t||(t={}))C.call(t,e)&&u(s,e,t[e]);if(f)for(var e of f(t))D.call(t,e)&&u(s,e,t[e]);return s};import{j as a,_ as I}from"./main.2.9.0.js";import{u as _,e as k,b as c}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{S as y}from"./SnackMsg.DYSD96P4.js";import{S as N}from"./Steps.BYe8zHkm.js";import{I as T,s as w}from"./Integrations.DL8wqGct.js";import L from"./DiscordAuthorization.CHc_QKv9.js";import{h as B}from"./DiscordCommonFunc.BDp4a1Lk.js";import{D as E}from"./DiscordIntegLayout.1hRaMIFy.js";import{B as A}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";/* empty css                */function Z({formFields:s,setFlow:t,flow:e,allIntegURL:x}){const g=_(),{formID:v}=k(),[m,d]=c.useState(!1),[r,l]=c.useState(1),[b,i]=c.useState({show:!1}),[o,n]=c.useState({name:"Discord",type:"Discord",accessToken:"",parse_mode:"HTML",field_map:[{formField:"",discordFormField:""}],server_id:"",channel_id:"",body:"",actions:{}}),j=p=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),o.name!==""&&o.selectedChannel&&o.selectedServer&&l(p)};return a.jsxs("div",{children:[a.jsx(y,{snack:b,setSnackbar:i}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(N,{step:3,active:r})}),a.jsx(L,{formID:v,discordConf:o,setDiscordConf:n,step:r,setstep:l,isLoading:m,setIsLoading:d,setSnackbar:i}),a.jsxs("div",{className:"btcd-stp-page",style:h({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(E,{formFields:s,handleInput:p=>B(p,o,n),discordConf:o,setDiscordConf:n,isLoading:m,setIsLoading:d,setSnackbar:i}),a.jsxs("button",{onClick:()=>j(3),disabled:o.selectedChannel===""||o.selectedServer==="",className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[I("Next","bit-integrations"),a.jsx(A,{className:"ml-1 rev-icn"})]})]}),a.jsx(T,{step:r,saveConfig:()=>w({flow:e,setFlow:t,allIntegURL:x,conf:o,navigate:g,setIsLoading:d,setSnackbar:i}),isLoading:m,dataConf:o,setDataConf:n,formFields:s})]})}export{Z as default};
