var A=Object.defineProperty;var N=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(r,s,n)=>s in r?A(r,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[s]=n,b=(r,s)=>{for(var n in s||(s={}))C.call(s,n)&&y(r,n,s[n]);if(N)for(var n of N(s))E.call(s,n)&&y(r,n,s[n]);return r};import{r as v,j as e}from"./main-406.js";import{B as I}from"./bi.46.744.js";import{_ as i,X as k,L as S}from"./bi.394.85.js";import{e as R,r as _}from"./bi.189.732.js";import{T as w,t as B}from"./bi.150.760.js";function F({formID:r,mailChimpConf:s,setMailChimpConf:n,step:x,setstep:f,isLoading:m,setIsLoading:h,setSnackbar:l,redirectLocation:z,isInfo:a}){const[o,T]=v.useState(!1),[d,g]=v.useState({dataCenter:"",clientId:"",clientSecret:""}),{mailchimp:t}=B,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),f(2),_(n,h,l)},c=u=>{const p=b({},s),j=b({},d);j[u.target.name]="",p[u.target.name]=u.target.value,g(j),n(p)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:x===1&&900,height:x===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(w,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(w,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:s.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:a}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(k,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:l}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(k,{value:z||`${window.location.href}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:l}),e.jsxs("small",{className:"d-blk mt-5",children:[i("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://us7.admin.mailchimp.com/account/oauth2/",target:"_blank",rel:"noreferrer",children:i("Mail Chimp API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientId",value:s.clientId,type:"text",placeholder:i("Client id...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientSecret",value:s.clientSecret,type:"text",placeholder:i("Client secret...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:d.clientSecret}),!a&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R("mailChimp","mChimp",s,n,g,T,h,l),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||m,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),m&&e.jsx(S,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:L,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!o,children:[i("Next","bit-integrations"),e.jsx(I,{className:"ml-1 rev-icn"})]})]})]})}export{F as default};
