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