var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var x=(e,s,i)=>s in e?A(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i,m=(e,s)=>{for(var i in s||(s={}))z.call(s,i)&&x(e,i,s[i]);if(u)for(var i of u(s))_.call(s,i)&&x(e,i,s[i]);return e};import{j as t,_ as n}from"./main.2.9.0.js";import{b as g}from"./react-router.DMwpH23k.js";import{y as T}from"./Note.NSUdvR3c.js";import{m as w}from"./MailRelayCommonFunc.DxQAisCI.js";import{T as E}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function D({mailRelayConf:e,setMailRelayConf:s,step:i,setStep:j,loading:r,setLoading:k,isInfo:a}){const[o,N]=g.useState(!1),[c,b]=g.useState({name:"",auth_token:""}),v=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),e!=null&&e.default,j(2)},d=l=>{const p=m({},e),h=m({},c);h[l.target.name]="",p[l.target.name]=l.target.value,b(h),s(p)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:i===1&&900,height:i===1&&"auto"},children:[t.jsx(E,{linkKey:"mailRelay"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:e.name,type:"text",placeholder:n("Integration Name...","bit-integrations"),disabled:a}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("Your Domain Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"domain",value:e.domain,type:"text",placeholder:n("Your Account","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.domain}),t.jsx("small",{className:"d-blk mt-3",children:n("Example: bitapps.ipzmarketing.com","bit-integrations")}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:n("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"auth_token",value:e.auth_token,type:"text",placeholder:n("API Token...","bit-integrations"),disabled:a}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.auth_token}),e.domain&&t.jsxs("small",{className:"d-blk mt-3",children:[n("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:`https://${e.domain}.ipzmarketing.com/admin/api_keys`,target:"_blank",rel:"noreferrer",children:n("MailRelay API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!a&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>w(e,s,b,N,r,k,"authentication"),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||r.auth,children:[o?n("Authorized ✔","bit-integrations"):n("Authorize","bit-integrations"),r.auth&&t.jsx(T,{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:!o,children:[n("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{D as default};
