File: /var/www/html/wordpress/wp-content/plugins/bit-integrations/assets/bi.250.399.js
var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var b=(o,e,s)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,g=(o,e)=>{for(var s in e||(e={}))M.call(e,s)&&b(o,s,e[s]);if(f)for(var s of f(e))A.call(e,s)&&b(o,s,e[s]);return o};import{u as w,o as N,r as l,j as a}from"./main-685.js";import"./bi.451.455.js";import{_ as i}from"./bi.878.0.js";import{S as _}from"./bi.674.13.js";import{S as z}from"./bi.347.1012.js";import{I as D,s as E}from"./bi.776.3.js";import{M as T,h as F}from"./bi.16.922.js";import P from"./bi.291.251.js";import"./bi.327.9.js";import"./bi.601.11.js";import"./bi.825.14.js";import"./bi.788.791.js";import"./bi.703.796.js";function $({formFields:o,setFlow:e,flow:s,allIntegURL:d,isInfo:h,edit:x}){const v=w(),{formID:S}=N(),[n,u]=l.useState(!1),[r,p]=l.useState(1),[y,c]=l.useState({show:!1}),j=[{key:"1",label:i("Course complete for the user","bit-integrations")},{key:"2",label:i("Lesson complete for the user","bit-integrations")},{key:"3",label:i("Quiz complete for the user","bit-integrations")},{key:"4",label:i("Reset user course","bit-integrations")},{key:"5",label:i("Reset user lesson","bit-integrations")}],[t,m]=l.useState({name:"MasterStudyLms",type:"MasterStudyLms",mainAction:"",field_map:[{formField:"",msLmsFormField:""}],allActions:j,actions:{}}),I=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t.mainAction!==""&&p(3)};function L(){switch(t.mainAction){case"1":return t.courseId===void 0;case"4":return t.courseId===void 0;case"2":return t.lessonId===void 0;case"5":return t.lessonId===void 0;case"3":return t.quizId===void 0;default:return!1}}return a.jsxs("div",{children:[a.jsx(_,{snack:y,setSnackbar:c}),a.jsx("div",{className:"txt-center mt-2",children:a.jsx(z,{step:3,active:r})}),a.jsx(P,{formID:S,msLmsConf:t,setMsLmsConf:m,step:r,setStep:p,isLoading:n,setIsLoading:u,setSnackbar:c}),a.jsxs("div",{className:"btcd-stp-page",style:g({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(T,{formFields:o,handleInput:k=>F(k,t,m),msLmsConf:t,setMsLmsConf:m,isLoading:n,setIsLoading:u,setSnackbar:c,allIntegURL:d,isInfo:h,edit:x}),a.jsxs("button",{onClick:()=>I(),disabled:!t.mainAction||n||L(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[i("Next","bit-integrations")," ",a.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),a.jsx(D,{step:r,saveConfig:()=>E({flow:s,setFlow:e,allIntegURL:d,navigate:v,conf:t,setIsLoading:u,setSnackbar:c}),isLoading:n,dataConf:t,setDataConf:m,formFields:o})]})}export{$ as default};