import{r,j as e}from"./main-406.js";import{B as k}from"./bi.46.744.js";import{_ as n,L as y,b as p,A as w}from"./bi.394.85.js";import{T as h,t as L}from"./bi.150.760.js";function M({formID:z,propovoiceCrmConf:i,setPropovoiceCrmConf:d,step:l,setStep:m,isLoading:c,setIsLoading:o,setSnackbar:b}){const[a,x]=r.useState(!1),[g,f]=r.useState(!1),{propovoiceCrm:t}=L,j=()=>{o("auth"),p({},"propovoice_authorize").then(s=>{s!=null&&s.success&&(x(!0),b({show:!0,msg:n("Connected with Propovoice CRM Successfully","bit-integrations")})),o(!1),f(!0)})},N=s=>{const u=w(i);u[s.target.name]=s.target.value,d(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(h,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(h,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:N,name:"name",value:i.name,type:"text",placeholder:n("Integration Name...","bit-integrations")}),c==="auth"&&e.jsxs("div",{className:"flx mt-5",children:[e.jsx(y,{size:25,clr:"#022217",className:"mr-2"}),"Checking if Propovoice CRM is active!!!"]}),g&&!a&&!c&&e.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[e.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),"Propovoice CRM plugin must be activated to integrate with Bit Integrations."]}),!a&&e.jsx("button",{onClick:j,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:n("Connect","bit-integrations")}),a&&e.jsxs("button",{onClick:()=>m(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!a,children:[n("Next","bit-integrations"),e.jsx(k,{className:"ml-1 rev-icn"})]})]})}export{M as default};
