var A=Object.defineProperty;var c=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var g=(e,n,a)=>n in e?A(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,h=(e,n)=>{for(var a in n||(n={}))L.call(n,a)&&g(e,a,n[a]);if(c)for(var a of c(n))T.call(n,a)&&g(e,a,n[a]);return e};import{r as j,j as t}from"./main-406.js";import{_ as s,L as z}from"./bi.394.85.js";import{k as w}from"./bi.476.873.js";import{T as k,t as I}from"./bi.150.760.js";function f({capsulecrmConf:e,setCapsuleCRMConf:n,step:a,setStep:y,loading:o,setLoading:N,isInfo:r}){const[l,_]=j.useState(!1),[d,m]=j.useState({api_key:"",api_url:""}),{capsulecrm:i}=I,v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,y(2)},b=x=>{const p=h({},e),u=h({},d);u[x.target.name]="",p[x.target.name]=x.target.value,m(u),n(p)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[(i==null?void 0:i.youTubeLink)&&t.jsx(k,{title:i==null?void 0:i.title,youTubeLink:i==null?void 0:i.youTubeLink}),(i==null?void 0:i.docLink)&&t.jsx(k,{title:i==null?void 0:i.title,docLink:i==null?void 0:i.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,n,m,_,o,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||o.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),o.auth&&t.jsx(z,{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:!l,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{f as default};
