var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var g=(n,a,i)=>a in n?A(n,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[a]=i,l=(n,a)=>{for(var i in a||(a={}))v.call(a,i)&&g(n,i,a[i]);if(u)for(var i of u(a))T.call(a,i)&&g(n,i,a[i]);return n};import{_ as e,j as t}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{y as P,a9 as z}from"./Note.DalStCGz.js";import{j as I}from"./PipeDriveCommonFunc.Bgp8U4Wc.js";import{T as _}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function K({pipeDriveConf:n,setPipeDriveConf:a,step:i,setstep:j,isLoading:c,setIsLoading:k,isInfo:s}){const[r,y]=x.useState(!1),[b,d]=x.useState({name:"",api_key:""}),N=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),j(2)},m=o=>{const p=l({},n),h=l({},b);h[o.target.name]="",p[o.target.name]=o.target.value,d(h),a(p)},f=`
    <h4>${e("Step of generate API token:","bit-integrations")}</h4>
    <ul>
      <li>${e("Goto","bit-integrations")} <a href="https://app.pipedrive.com/settings/api">${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:i===1&&900,height:i===1&&"auto"},children:[t.jsx(_,{linkKey:"pipeDrive"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"name",value:n.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:s}),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:n.api_key,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:b.api_key}),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://app.pipedrive.com/settings/api",target:"_blank",rel:"noreferrer",children:e("PipeDrive API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!s&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>I(n,d,y,k),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||c,children:[r?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),c&&t.jsx(P,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:N,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(z,{note:f})]})}export{K as default};
