var _=Object.defineProperty;var h=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var u=(e,i,a)=>i in e?_(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,c=(e,i)=>{for(var a in i||(i={}))v.call(i,a)&&u(e,a,i[a]);if(h)for(var a of h(i))A.call(i,a)&&u(e,a,i[a]);return e};import{j as t,_ as s}from"./main.2.8.10.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as z}from"./Note.DalStCGz.js";import{k as T}from"./CapsuleCRMCommonFunc.D9ryrj0F.js";import{T as w}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function Y({capsulecrmConf:e,setCapsuleCRMConf:i,step:a,setStep:j,loading:n,setLoading:k,isInfo:r}){const[l,N]=g.useState(!1),[o,b]=g.useState({api_key:"",api_url:""}),y=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},d=m=>{const p=c({},e),x=c({},o);x[m.target.name]="",p[m.target.name]=m.target.value,b(x),i(p)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(w,{linkKey:"capsulecrm"}),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:d,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:d,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:o.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:d,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:o.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:()=>T(e,i,b,N,n,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||n.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),n.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:y,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{Y as default};
