var _=Object.defineProperty;var h=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var x=(e,i,a)=>i in e?_(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,d=(e,i)=>{for(var a in i||(i={}))A.call(i,a)&&x(e,a,i[a]);if(h)for(var a of h(i))z.call(i,a)&&x(e,a,i[a]);return e};import{_ as s,j as t}from"./main.2.8.10.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as I,a9 as w}from"./Note.DalStCGz.js";import{l as T}from"./CopperCRMCommonFunc.CcbCF8cq.js";import{T as E}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function F({copperCRMConf:e,setCopperCRMConf:i,step:a,setStep:j,loading:r,setLoading:y,isInfo:n}){const[l,N]=g.useState(!1),[o,b]=g.useState({api_key:"",api_email:""}),v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},c=m=>{const u=d({},e),p=d({},o);p[m.target.name]="",u[m.target.name]=m.target.value,b(p),i(u)},k=`
  <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(E,{linkKey:"coppercrm"}),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:c,name:"name",value:e.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:n}),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:c,name:"api_email",value:e.api_email,type:"text",placeholder:s("Your Company...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.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:c,name:"api_key",value:e.api_key,type:"text",placeholder:s("API Token...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:o.api_key}),t.jsx("br",{}),t.jsx("br",{}),!n&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>T(e,i,b,N,r,y),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),r.auth&&t.jsx(I,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:v,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(w,{note:k})]})}export{F as default};
