var K=Object.defineProperty,P=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var I=(t,e,i)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,g=(t,e)=>{for(var i in e||(e={}))E.call(e,i)&&I(t,i,e[i]);if(y)for(var i of y(e))$.call(e,i)&&I(t,i,e[i]);return t},b=(t,e)=>P(t,z(e));var A=(t,e,i)=>new Promise((c,u)=>{var s=o=>{try{p(i.next(o))}catch(r){u(r)}},l=o=>{try{p(i.throw(o))}catch(r){u(r)}},p=o=>o.done?c(o.value):Promise.resolve(o.value).then(s,l);p((i=i.apply(t,e)).next())});import{_ as a,j as n}from"./main.2.8.10.js";import{b as x}from"./react-router.DMwpH23k.js";import{S as N,I as d,E as S,G as T,A as v}from"./StepPage.Dcszwd6s.js";import{a9 as _}from"./Note.DalStCGz.js";import{h as f,c as w,a as G}from"./MailercloudCommonFunc.BCv3ecKj.js";import{T as B}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";import"./Integrations.BFhED4ck.js";import"./SnackMsg.7BjcJK1j.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";function Y({mailercloudConf:t,setMailercloudConf:e,step:i,setStep:c,isInfo:u,loading:s,setLoading:l}){const[p,o]=x.useState(!1),[r,h]=x.useState({name:"",authKey:""}),j=()=>A(null,null,function*(){setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),c(2),l(b(g({},s),{page:!0})),(yield G(t,e))&&l(b(g({},s),{page:!1}))}),k=`
  <h4>${a("Step of get API Key:","bit-integrations")}</h4>
  <ul>
    <li>${a("Goto Account and click on","bit-integrations")} <a href="https://app.mailercloud.com/account/api-integrations" target='_blank'>${a("Integration","bit-integrations")}</a></li>
    <li>${a("Click on API Integrations .","bit-integrations")}</li>
    <li>${a("Copy the <b>API Key</b> and paste into <b>API Key</b> field of your authorization form.","bit-integrations")}</li>
    <li>${a("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
</ul>
`;return n.jsxs(N,{step:i,stepNo:1,style:{width:900,height:"auto"},children:[n.jsx(B,{linkKey:"mailercloud"}),n.jsxs("div",{className:"mt-2",children:[n.jsx(d,{label:a("Integration Name","bit-integrations"),name:"name",placeholder:a("Integration Name...","bit-integrations"),value:t.name,onchange:m=>f(m,t,e,r,h)}),n.jsx(d,{label:a("API key","bit-integrations"),name:"authKey",placeholder:a("API key...","bit-integrations"),value:t.authKey,onchange:m=>f(m,t,e,r,h)}),n.jsx(S,{error:r.authKey}),n.jsx(T,{url:"https://app.mailercloud.com/account/api-integrations",info:a("To get API key, please visit","bit-integrations")}),!u&&n.jsx(v,{onclick:()=>w(t,h,o,s,l),nextPage:j,auth:p,loading:s.auth})]}),n.jsx(_,{note:k})]})}export{Y as default};
