var _=Object.defineProperty;var j=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var C=(i,a,n)=>a in i?_(i,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[a]=n,m=(i,a)=>{for(var n in a||(a={}))I.call(a,n)&&C(i,n,a[n]);if(j)for(var n of j(a))$.call(a,n)&&C(i,n,a[n]);return i};import{k as R,g as L,_ as e,j as t}from"./main.2.8.1.js";import{d as f}from"./react-router-dom.9mCuUg3q.js";import{B as E}from"./BackIcn._kGL_vVw.js";import{a2 as y,z as F,a9 as B}from"./Note.BeM7sN-p.js";import{c as P}from"./ConstantContactCommonFunc.Cu4wmXsh.js";import{t as U}from"./tutorialLinks.kMkIDzcD.js";import{T as N}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function Q({constantContactConf:i,setConstantContactConf:a,step:n,setstep:k,isLoading:b,setIsLoading:v,setSnackbar:r,redirectLocation:z,isInfo:s}){const h=R(L),[l,S]=f.useState(!1),{constantContact:o}=U,[c,g]=f.useState({dataCenter:"",clientId:"",clientSecret:""}),A="account_read account_update contact_data offline_access campaign_data",w=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),k(2)},d=p=>{const u=m({},i),x=m({},c);x[p.target.name]="",u[p.target.name]=p.target.value,g(x),a(u)},T=`
  <h4>${e("Step of get API Key(Client Id) And Client Secret:","bit-integrations")}</h4>
  <ul>
    <li>${e("Goto","bit-integrations")} <a href="https://app.constantcontact.com/pages/dma/portal/?_ga=2.91540634.1868552181.1667660766-5cc88792-fd06-40a8-9b8c-e27659667215">${e("Constant Contact Application","bit-integrations")}</a></li>
    <li>${e("Then create a new application.","bit-integrations")}</li>
    <li>${e("Select  <b>(Authorization Code Flow and Implicit Flow)</b> and <b>(Rotating Refresh Tokens or Long Lived Refresh Tokens).</b>","bit-integrations")}</li>
    <li>${e("Copy the <b>Authorized Redirect URIs</b> from here and paste it into the Constant Contact application form.","bit-integrations")}</li> 
    <li>${e("Then generate <b>Client Secret</b> from the Constant Contact application","bit-integrations")}</li>
    <li>${e("Copy the <b>Client Id</b> and <b>Client Secret</b> from Constant Contact application and paste into this 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:n===1&&900,height:n===1&&"auto"},children:[t.jsx(N,{title:"Constant Contact",youTubeLink:o==null?void 0:o.youTubeLink}),t.jsx(N,{title:"Constant Contact",docLink:o==null?void 0:o.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:d,name:"name",value:i.name,type:"text",placeholder:e("Integration Name...","bit-integrations"),disabled:s}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Homepage URL:","bit-integrations")})}),t.jsx(y,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:s,setSnackbar:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(y,{value:z||`${h.api}/redirect`,setSnackbar:r,className:"field-key-cpy w-6 ml-0",readOnly:s}),t.jsxs("small",{className:"d-blk mt-5",children:[e("To get Client ID and SECRET , Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://app.constantcontact.com/pages/dma/portal/?_ga=2.91540634.1868552181.1667660766-5cc88792-fd06-40a8-9b8c-e27659667215",target:"_blank",rel:"noreferrer",children:e("Constant Contact Application","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Client id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:i.clientId,type:"text",placeholder:e("client ID...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:e("Client secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:i.clientSecret,type:"text",placeholder:e("client Secret...","bit-integrations"),disabled:s}),t.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientSecret}),!s&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>P("constantContact","cContact",A,i,a,g,S,v,r,h),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||b.auth,children:[l?e("Authorized ✔","bit-integrations"):e("Authorize","bit-integrations"),b.auth&&t.jsx(F,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:w,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[e("Next","bit-integrations"),t.jsx(E,{className:"ml-1 rev-icn"})]})]}),t.jsx(B,{note:T})]})}export{Q as default};
