var z=Object.defineProperty;var x=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var h=(e,n,i)=>n in e?z(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,m=(e,n)=>{for(var i in n||(n={}))L.call(n,i)&&h(e,i,n[i]);if(x)for(var i of x(n))S.call(n,i)&&h(e,i,n[i]);return e};import{_ as a,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{B as f}from"./BackIcn._kGL_vVw.js";import{z as _,a9 as w}from"./Note.BeM7sN-p.js";import{i as E}from"./HubspotCommonFunc.B--GaSYa.js";import{t as H}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function J({hubspotConf:e,setHubspotConf:n,step:i,setstep:y,isInfo:r,loading:o,setLoading:N}){const[l,v]=j.useState(!1),[d,p]=j.useState({name:"",api_key:""}),{hubspot:s}=H,b=c=>{const u=m({},e),g=m({},d);g[c.target.name]="",u[c.target.name]=c.target.value,p(g),n(u)},A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},T=`
    <h4>${a("Step of generating Access Token:","bit-integrations")}</h4>
    <ul>
      <li>${a("Login to your HubSpot account, click the <b>Settings</b> icon settings in the main navigation bar..","bit-integrations")}</li>
      <li>${a("In the left sidebar menu, navigate to <b>Integrations > Private App</b>.","bit-integrations")}</li>
      <li>${a("Give name and description and select all necessary scope.","bit-integrations")}</li>
      <li>${a("Then create Access token.","bit-integrations")}</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:i===1&&900,height:i===1&&"auto"},children:[t.jsx(k,{title:"HubSpot",youTubeLink:s==null?void 0:s.youTubeLink}),t.jsx(k,{title:"HubSpot",docLink:s==null?void 0:s.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"name",value:e==null?void 0:e.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Hubspot Access Token:","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:a("Access Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red"},children:d.api_key}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>E(e,p,v,o,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||o.auth,children:[l?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),o.auth&&t.jsx(_,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>A(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[a("Next","bit-integrations"),t.jsx(f,{className:"ml-1 rev-icn"})]})]}),t.jsx(w,{note:T})]})}export{J as default};
