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