var v=Object.defineProperty;var p=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var x=(e,a,s)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[a]=s,c=(e,a)=>{for(var s in a||(a={}))A.call(a,s)&&x(e,s,a[s]);if(p)for(var s of p(a))_.call(a,s)&&x(e,s,a[s]);return e};import{j as t,_ as i}from"./main.2.9.0.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as z}from"./Note.NSUdvR3c.js";import{e as I}from"./EmailOctopusCommonFunc.6LiASHxA.js";import{T as w}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function R({emailOctopusConf:e,setEmailOctopusConf:a,step:s,setStep:j,loading:n,setLoading:k,isInfo:r}){const[o,N]=g.useState(!1),[d,m]=g.useState({name:"",auth_token:""}),y=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},b=l=>{const h=c({},e),u=c({},d);u[l.target.name]="",h[l.target.name]=l.target.value,m(u),a(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:s===1&&900,height:s===1&&"auto"},children:[t.jsx(w,{linkKey:"emailOctopus"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:i("API Key:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:b,name:"auth_token",value:e.auth_token,type:"text",placeholder:i("API Token...","bit-integrations"),disabled:r}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.auth_token}),t.jsxs("small",{className:"d-blk mt-3",children:[i("To get API key, please visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://emailoctopus.com/api-documentation",target:"_blank",rel:"noreferrer",children:i("EmailOctopus API keys","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!r&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>I(e,a,m,N,n,k,"authentication"),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||n.auth,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),n.auth&&t.jsx(z,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:y,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{R as default};
