import{j as t,_ as a,s as y,d as N}from"./main.2.8.1.js";import{d as m}from"./react-router-dom.9mCuUg3q.js";import{B as k}from"./BackIcn._kGL_vVw.js";import{z as v,y as M}from"./Note.BeM7sN-p.js";import{T as u}from"./TutorialLink.BAFX--T3.js";import{t as S}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function B({formID:w,msLmsConf:n,setMsLmsConf:d,step:o,setStep:h,isLoading:r,setIsLoading:c,setSnackbar:p}){const[i,b]=m.useState(!1),[x,f]=m.useState(!1),{masterStudyLMS:s}=S,g=()=>{c("auth"),N({},"MasterStudyLms_authorize").then(e=>{e!=null&&e.success&&(b(!0),p({show:!0,msg:a("Connected with MasterStudyLMs Successfully","bit-integrations")})),c(!1),f(!0)})},j=e=>{const l=M(n);l[e.target.name]=e.target.value,d(l)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[t.jsx(u,{title:"MasterStudy LMS",youTubeLink:s==null?void 0:s.youTubeLink}),t.jsx(u,{title:"MasterStudy LMS",docLink:s==null?void 0:s.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:n.name,type:"text",placeholder:a("Integration Name...","bit-integrations")}),r==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(v,{size:25,clr:"#022217",className:"mr-2"}),"Checking if MasterStudyLms is active!!!"]}),x&&!i&&!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:"×"}),y(a("%s plugin must be activated to integrate with Bit Integrations","bit-integrations"),"MasterStudyLms")]}),!i&&t.jsx("button",{onClick:g,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:a("Connect","bit-integrations")}),i&&t.jsxs("button",{onClick:()=>h(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!i,children:[a("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]})}export{B as default};
