var k=Object.defineProperty,P=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var x=(t,e,i)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,b=(t,e)=>{for(var i in e||(e={}))E.call(e,i)&&x(t,i,e[i]);if(y)for(var i of y(e))S.call(e,i)&&x(t,i,e[i]);return t},g=(t,e)=>P(t,z(e));var A=(t,e,i)=>new Promise((p,s)=>{var l=r=>{try{u(i.next(r))}catch(n){s(n)}},h=r=>{try{u(i.throw(r))}catch(n){s(n)}},u=r=>r.done?p(r.value):Promise.resolve(r.value).then(l,h);u((i=i.apply(t,e)).next())});import{_ as a,j as o}from"./main.2.9.0.js";import{b as I}from"./react-router.DMwpH23k.js";import{S as N,I as d,G as T,E as $,A as v}from"./StepPage.6Rz8L_er.js";import{a9 as w}from"./Note.NSUdvR3c.js";import{h as j,b as F,g as G}from"./MoosendCommonFunc.h8eAwVpN.js";import{T as _}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";import"./Integrations.DL8wqGct.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function Y({moosendConf:t,setMoosendConf:e,step:i,setStep:p,loading:s,setLoading:l,isInfo:h}){const[u,r]=I.useState(!1),[n,c]=I.useState({name:"",authKey:""}),f=()=>A(null,null,function*(){setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),p(2),l(g(b({},s),{page:!0})),(yield G(t,e))&&l(g(b({},s),{page:!1}))}),K=`
  <h4>${a("Step of get API Key:","bit-integrations")}</h4>
  <ul>
    <li>${a("First login on account.","bit-integrations")}</li>
    <li>${a("Goto Settings and click on <b>API Key</b>","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 o.jsxs(N,{step:i,stepNo:1,style:{width:900,height:"auto"},children:[o.jsx(_,{linkKey:"moosend"}),o.jsxs("div",{className:"mt-2",children:[o.jsx(d,{label:a("Integration Name","bit-integrations"),name:"name",placeholder:a("Integration Name...","bit-integrations"),value:t.name,onchange:m=>j(m,t,e,n,c)}),o.jsx(d,{label:a("API key","bit-integrations"),name:"authKey",placeholder:a("API key...","bit-integrations"),value:t.authKey,onchange:m=>j(m,t,e,n,c)}),o.jsx(T,{url:"https://moosend.com/",info:a("To get API key, please visit","bit-integrations")}),o.jsx($,{error:n.authKey}),!h&&o.jsx(v,{onclick:()=>F(t,c,r,s,l),nextPage:f,auth:u,loading:s.auth})]}),o.jsx(w,{note:K})]})}export{Y as default};
