var z=Object.defineProperty;var p=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var g=(e,i,a)=>i in e?z(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,b=(e,i)=>{for(var a in i||(i={}))T.call(i,a)&&g(e,a,i[a]);if(p)for(var a of p(i))I.call(i,a)&&g(e,a,i[a]);return e};import{_ as s,j as t}from"./main.2.8.1.js";import{d as j}from"./react-router-dom.9mCuUg3q.js";import{z as w,a9 as L}from"./Note.BeM7sN-p.js";import{l as E}from"./CopperCRMCommonFunc.ZVeVjNfY.js";import{t as S}from"./tutorialLinks.kMkIDzcD.js";import{T as y}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function q({copperCRMConf:e,setCopperCRMConf:i,step:a,setStep:k,loading:l,setLoading:N,isInfo:r}){const[o,v]=j.useState(!1),[d,u]=j.useState({api_key:"",api_email:""}),{coppercrm:n}=S,_=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,k(2)},m=c=>{const h=b({},e),x=b({},d);x[c.target.name]="",h[c.target.name]=c.target.value,u(x),i(h)};console.log(e);const A=`
  <h4>${s("Get api secret key","bit-integrations")}</h4>
  <ul>
      <li>${s("First go to your Copper dashboard.","bit-integrations")}</li>
      <li>${s("Then click Settings from Navbar.","bit-integrations")}</li>
      <li>${s('Click "Integrations", Then click "API Keys"',"bit-integrations")}</li>
  </ul>`;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(y,{title:"Copper CRM",youTubeLink:n==null?void 0:n.youTubeLink}),t.jsx(y,{title:"Copper CRM",docLink:n==null?void 0:n.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("bapi_email",{children:s("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,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 Email:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"api_email",value:e.api_email,type:"text",placeholder:s("Your Company...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.api_email}),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:m,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}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>E(e,i,u,v,l,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||l.auth,children:[o?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),l.auth&&t.jsx(w,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:_,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(L,{note:A})]})}export{q as default};
