import{j as t,_ as s,s as f,b as y}from"./main.2.8.10.js";import{b as m}from"./react-router.DMwpH23k.js";import{B as j}from"./BackIcn.BFDZx8No.js";import{y as N,x as S}from"./Note.DalStCGz.js";import{T as v}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function _({formID:M,msLmsConf:i,setMsLmsConf:l,step:n,setStep:u,isLoading:r,setIsLoading:o,setSnackbar:d}){const[a,h]=m.useState(!1),[p,b]=m.useState(!1),x=()=>{o("auth"),y({},"MasterStudyLms_authorize").then(e=>{e!=null&&e.success&&(h(!0),d({show:!0,msg:s("Connected with MasterStudyLMs Successfully","bit-integrations")})),o(!1),b(!0)})},g=e=>{const c=S(i);c[e.target.name]=e.target.value,l(c)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:n===1&&900,height:n===1&&"auto"},children:[t.jsx(v,{linkKey:"masterStudyLMS"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:g,name:"name",value:i.name,type:"text",placeholder:s("Integration Name...","bit-integrations")}),r==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(N,{size:25,clr:"#022217",className:"mr-2"}),"Checking if MasterStudyLms is active!!!"]}),p&&!a&&!r&&t.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[t.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),f(s("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"MasterStudyLms")]}),!a&&t.jsx("button",{onClick:x,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:s("Connect","bit-integrations")}),a&&t.jsxs("button",{onClick:()=>u(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!a,children:[s("Next","bit-integrations"),t.jsx(j,{className:"ml-1 rev-icn"})]})]})}export{_ as default};
