var z=Object.defineProperty;var x=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var g=(n,i,a)=>i in n?z(n,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[i]=a,m=(n,i)=>{for(var a in i||(i={}))v.call(i,a)&&g(n,a,i[a]);if(x)for(var a of x(i))I.call(i,a)&&g(n,a,i[a]);return n};import{_ as e,j as t}from"./main.2.8.1.js";import{d as k}from"./react-router-dom.9mCuUg3q.js";import{z as P,a9 as _}from"./Note.BeM7sN-p.js";import{a as L}from"./OmniSendCommonFunc.g-EtP_RS.js";import{t as w}from"./tutorialLinks.kMkIDzcD.js";import{T as j}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function V({omniSendConf:n,setOmniSendConf:i,step:a,setstep:y,loading:r,setLoading:N,setSnackbar:E,isInfo:o}){const[l,f]=k.useState(!1),[b,d]=k.useState({name:"",api_key:""}),{omniSend:s}=w,A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),y(2)},p=c=>{const u=m({},n),h=m({},b);h[c.target.name]="",u[c.target.name]=c.target.value,d(h),i(u)},T=`
    <h4>${e("Step of generate API token:","bit-integrations")}</h4>
    <ul>
      <li>${e("Goto","bit-integrations")} <a href="https://app.omnisend.com/o/my-account/integrations/api-keys">${e("Generate API Token","bit-integrations")}</a></li>
      <li>${e("Copy the <b>Token</b> and paste into <b>API Token</b> field of your authorization form.","bit-integrations")}</li>
      <li>${e("Finally, click <b>Authorize</b> button.","bit-integrations")}</li>
  </ul>
  `;return t.jsxs("div",{className:"btcd-stp-page",style:{width:a===1&&900,height:a===1&&"auto"},children:[t.jsx(j,{title:"Omnisend",youTubeLink:s==null?void 0:s.youTubeLink}),t.jsx(j,{title:"Omnisend",docLink:s==null?void 0:s.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"name",value:n.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:o}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("API Token:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:p,name:"api_key",value:n.api_key,type:"text",placeholder:e("API Token...","bit-integrations"),disabled:o}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:b.api_key}),t.jsxs("small",{className:"d-blk mt-3",children:[e("To Get API Token, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.omnisend.com/o/my-account/integrations/api-keys",target:"_blank",rel:"noreferrer",children:e("OmniSend API Token","bit-integrations")})]}),t.jsx("br",{}),t.jsx("br",{}),!o&&t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>L(n,i,d,f,r,N),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||r.auth,children:[l?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),r.auth&&t.jsx(P,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:A,className:"btn ml-auto btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[e("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),t.jsx(_,{note:T})]})}export{V as default};
