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