var w=Object.defineProperty;var u=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var x=(n,s,e)=>s in n?w(n,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[s]=e,b=(n,s)=>{for(var e in s||(s={}))y.call(s,e)&&x(n,e,s[e]);if(u)for(var e of u(s))M.call(s,e)&&x(n,e,s[e]);return n};import{j as t,_ as i,d as C}from"./main.2.8.1.js";import{d as p}from"./react-router-dom.9mCuUg3q.js";import{B as z}from"./BackIcn._kGL_vVw.js";import{t as A}from"./tutorialLinks.kMkIDzcD.js";import{z as I}from"./Note.BeM7sN-p.js";import{T as S}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function H({formID:n,mailerPressConf:s,setMailerPressConf:e,step:o,nextPage:j,isLoading:l,setIsLoading:d,setSnackbar:f}){const[c,g]=p.useState(!1),[m,N]=p.useState(!1),{mailerPress:a}=A,v=()=>{d("auth"),C({},"mailer_press_authorize").then(r=>{r!=null&&r.success&&(g(!0),f({show:!0,msg:i("Connected with MailerPress Successfully","bit-integrations")})),d(!1),N(!0)})},k=r=>{const h=b({},s);h[r.target.name]=r.target.value,e(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[a==null?void 0:a.youTubeLink,t.jsx(S,{title:"MailerPress",docLink:a==null?void 0:a.docLink}),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:k,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),l==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(I,{size:25,clr:"#022217",className:"mr-2"}),i("Checking if MailerPress is active!!!","bit-integrations")]}),m&&!c&&!l&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:i("MailerPress is not activated or not installed","bit-integrations")})]})}),m&&c&&!l&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:i("MailerPress is activated","bit-integrations")})]}),t.jsx("button",{onClick:v,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c,children:c?i("Connected","bit-integrations"):i("Connect to MailerPress","bit-integrations")}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>j(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[i("Next","bit-integrations"),t.jsx(z,{className:"ml-1 rev-icn"})]})]})}export{H as default};
