var A=Object.defineProperty;var h=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var g=(e,i,a)=>i in e?A(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,p=(e,i)=>{for(var a in i||(i={}))T.call(i,a)&&g(e,a,i[a]);if(h)for(var a of h(i))z.call(i,a)&&g(e,a,i[a]);return e};import{j as t,_ as s}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as L}from"./Note.BeM7sN-p.js";import{k as w}from"./CapsuleCRMCommonFunc.Bt5E39bP.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import{t as I}from"./tutorialLinks.kMkIDzcD.js";import"./CopyIcn.3gZpHton.js";function G({capsulecrmConf:e,setCapsuleCRMConf:i,step:a,setStep:N,loading:l,setLoading:y,isInfo:r}){const[o,_]=j.useState(!1),[d,c]=j.useState({api_key:"",api_url:""}),{capsulecrm:n}=I,v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,N(2)},b=m=>{const x=p({},e),u=p({},d);u[m.target.name]="",x[m.target.name]=m.target.value,c(u),i(x)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(k,{title:"Capsule CRM",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(k,{title:"Capsule CRM",docLink:n==null?void 0:n.docLink}),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:b,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("Your API URL:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"api_url",value:e.api_url,type:"text",placeholder:s("Your Organisation...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.api_url}),t.jsx("small",{className:"d-blk mt-3",children:s("Example: {name}.capsulecrm.com","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:s("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"api_key",value:e.api_key,type:"text",placeholder:s("API Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.api_key}),e.api_url&&t.jsxs("small",{className:"d-blk mt-3",children:[s("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://${e.api_url}/preferences/tokens`,target:"_blank",rel:"noreferrer",children:s("CapsuleCRM API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(e,i,c,_,l,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||l.auth,children:[o?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),l.auth&&t.jsx(L,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{G as default};
