var E=Object.defineProperty;var y=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var N=(r,t,i)=>t in r?E(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i,m=(r,t)=>{for(var i in t||(t={}))T.call(t,i)&&N(r,i,t[i]);if(y)for(var i of y(t))k.call(t,i)&&N(r,i,t[i]);return r};import{k as C,f as I,j as e,_ as s}from"./main.2.9.0.js";import{b as v}from"./react-router.DMwpH23k.js";import{B as R}from"./BackIcn._8Wofmn2.js";import{a2 as f,y as _}from"./Note.NSUdvR3c.js";import{a as B,r as $}from"./KeapCommonFunc.DRCBVG_Q.js";import{T as D}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function q({formID:r,keapConf:t,setKeapConf:i,step:p,setstep:w,isLoading:b,setIsLoading:h,setSnackbar:n,redirectLocation:z,isInfo:a}){const[l,S]=v.useState(!1),[c,x]=v.useState({clientId:"",clientSecret:""}),u=C(I),d=o=>{const g=m({},t),j=m({},c);j[o.target.name]="",g[o.target.name]=o.target.value,x(j),i(g)},A=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),$(r,t,i,h,n),w(2)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(D,{linkKey:"keap"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations"),disabled:a}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(f,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(f,{value:z||`${u.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:a,setSnackbar:n}),e.jsxs("small",{className:"d-blk mt-5",children:[s("To get Client ID and SECRET , Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://keys.developer.keap.com/my-apps",target:"_blank",rel:"noreferrer",children:s("Get Keap client id and secret","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:s("client ID...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("client Secret...","bit-integrations"),disabled:a}),e.jsx("div",{style:{color:"red",fontSize:"15px"},children:c.clientSecret}),!a&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>B(t,i,x,S,h,n,u),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||b,children:[l?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&e.jsx(_,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:()=>A(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),e.jsx(R,{className:"ml-1 rev-icn"})]})]})]})}export{q as default};
