var z=Object.defineProperty;var x=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=(i,n,s)=>n in i?z(i,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[n]=s,d=(i,n)=>{for(var s in n||(n={}))v.call(n,s)&&g(i,s,n[s]);if(x)for(var s of x(n))w.call(n,s)&&g(i,s,n[s]);return i};import{_ as e,j as t}from"./main.2.8.1.js";import{d as k}from"./react-router-dom.9mCuUg3q.js";import{t as f}from"./tutorialLinks.kMkIDzcD.js";import{z as P,a9 as I}from"./Note.BeM7sN-p.js";import{T as j}from"./TutorialLink.BAFX--T3.js";import{f as L}from"./FreshSalesCommonFunc.pSo9D8KC.js";import"./CopyIcn.3gZpHton.js";function C({freshSalesConf:i,setFreshSalesConf:n,step:s,setstep:y,isLoading:b,setIsLoading:A,isInfo:r}){const[o,N]=k.useState(!1),[l,m]=k.useState({name:"",api_key:""}),{freshSales:a}=f,T=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},u=c=>{const p=d({},i),h=d({},l);h[c.target.name]="",p[c.target.name]=c.target.value,m(h),n(p)},_=`
    <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(j,{title:"Freshsales",youTubeLink:a==null?void 0:a.youTubeLink}),t.jsx(j,{title:"Freshsales",docLink:a==null?void 0:a.docLink}),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:u,name:"bundle_alias",value:i.bundle_alias,type:"text",placeholder:e("Your Account Url...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.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:u,name:"api_key",value:i.api_key,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:l.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",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>L(i,m,N,A),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||b,children:[o?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),b&&t.jsx(P,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:T,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(I,{note:_})]})}export{C as default};
