import{j as t,_ as w}from"./main.2.8.1.js";import{u as C,h as j,d as r}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as b}from"./BackIcn._kGL_vVw.js";import{S}from"./SnackMsg.S8DrwLlT.js";import{S as v}from"./Steps.1hz7v9Vj.js";import{I as P,s as I}from"./Integrations.D2bgBas2.js";import N from"./WPCoursewareAuthorization.Ko-CIhrP.js";import{W}from"./WPCoursewareIntegLayout.WurFqk9d.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";function R({formFields:c,setFlow:d,flow:f,allIntegURL:g}){const h=C(),{formID:m}=j(),[p,i]=r.useState(!1),[e,u]=r.useState(1),[x,o]=r.useState({show:!1}),[s,n]=r.useState({name:"WP Courseware",type:"WP Courseware",field_map:[{formField:"",wpCoursewareField:""}],default:{},action:"",course:[],actions:{}}),l=a=>{(a===2&&s.name!==""||a===3&&s.action!==""&&s.course.length>0)&&u(a),document.getElementById("btcd-settings-wrp").scrollTop=0};return t.jsxs("div",{children:[t.jsx(S,{snack:x,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(v,{step:3,active:e})}),t.jsx(N,{formID:m,wpCoursewareConf:s,setWPCoursewareConf:n,step:e,nextPage:l,isLoading:p,setIsLoading:i,setSnackbar:o}),t.jsx("div",{className:"btcd-stp-page",style:{overflow:e===2&&"initial",width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"200px"},children:t.jsx(W,{formID:m,formFields:c,wpCoursewareConf:s,setWPCoursewareConf:n,setIsLoading:i,setSnackbar:o})}),t.jsx(P,{step:e,saveConfig:()=>I({flow:f,setFlow:d,allIntegURL:g,conf:s,navigate:h,setIsLoading:i,setSnackbar:o}),isLoading:p,dataConf:s,setDataConf:n,formFields:c}),t.jsx("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"200px"},children:t.jsxs("button",{onClick:()=>l(3),disabled:s.action===""||s.course.length===0,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[w("Next","bit-integrations"),t.jsx(b,{className:"ml-1 rev-icn"})]})})]})}export{R as default};
