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