var _=Object.defineProperty;var h=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var x=(i,n,s)=>n in i?_(i,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[n]=s,c=(i,n)=>{for(var s in n||(n={}))f.call(n,s)&&x(i,s,n[s]);if(h)for(var s of h(n))T.call(n,s)&&x(i,s,n[s]);return i};import{_ as e,j as t}from"./main.2.9.0.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as v,a9 as w}from"./Note.NSUdvR3c.js";import{T as z}from"./TutorialLink.CFG7bS5c.js";import{f as P}from"./FreshSalesCommonFunc.lCFC6xwJ.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function R({freshSalesConf:i,setFreshSalesConf:n,step:s,setstep:j,isLoading:d,setIsLoading:k,isInfo:a}){const[r,y]=g.useState(!1),[o,b]=g.useState({name:"",api_key:""}),A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),j(2)},m=l=>{const p=c({},i),u=c({},o);u[l.target.name]="",p[l.target.name]=l.target.value,b(u),n(p)},N=`
    <h4>${e("Step of generate API token:","bit-integrations")}</h4>
    <ul>
      <li>${e("Goto","bit-integrations")} <a href="https://www.myfreshworks.com/crm/sales/personal-settings/api-settings">${e("Generate API Token","bit-integrations")}</a></li>
      <li>${e("Copy the <b>Token</b> and paste into <b>API Token</b> field of your authorization form.","bit-integrations")}</li>
      <li>${e("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(z,{linkKey:"freshSales"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Bundle Alias(Your Account URL):","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"bundle_alias",value:i.bundle_alias,type:"text",placeholder:e("Your Account Url...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.bundle_alias}),t.jsx("small",{className:"d-blk mt-3",children:e("Example: name.myfreshworks.com/crm/sales","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"api_key",value:i.api_key,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.api_key}),i.bundle_alias&&t.jsxs("small",{className:"d-blk mt-3",children:[e("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://${i.bundle_alias}/personal-settings/api-settings`,target:"_blank",rel:"noreferrer",children:e("FreshSales API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!a&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>P(i,b,y,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||d,children:[r?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),d&&t.jsx(v,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(w,{note:N})]})}export{R as default};
