var E=Object.defineProperty;var v=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var g=(i,t,a)=>t in i?E(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,c=(i,t)=>{for(var a in t||(t={}))S.call(t,a)&&g(i,a,t[a]);if(v)for(var a of v(t))P.call(t,a)&&g(i,a,t[a]);return i};import{u as I,r as N,j as e,_ as l,C as y,$ as L}from"./main-40.js";import{t as z}from"./bf-892-199.js";import{T as $}from"./bf-679-136.js";import{A as U}from"./bf-541-403.js";import{N as _}from"./bf-504-404.js";import{m as B,f as D}from"./bf-277-353.js";/* empty css          */import"./bf-860-126.js";import"./bf-132-75.js";import"./bf-141-80.js";import"./bf-586-70.js";function X({formID:i,projectsConf:t,setProjectsConf:a,step:o,setstep:A,isLoading:w,setisLoading:m,setSnackbar:h,redirectLocation:k,isInfo:s}){const x=I(L),{siteURL:R}=x,[u,T]=N.useState(!1),[r,p]=N.useState({dataCenter:"",clientId:"",clientSecret:""}),C=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),A(2),D(i,t,a,m,h)},n=d=>{const j=c({},t),b=c({},r);b[d.target.name]="",j[d.target.name]=d.target.value,p(b),a(j)};return e.jsxs(e.Fragment,{children:[e.jsx($,{title:z.zohoProjects.title,youTubeLink:z.zohoProjects.link}),e.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"100%"},children:[e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Integration Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"name",value:t.name,type:"text",placeholder:l("Integration Name..."),disabled:s}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Data Center:")})}),e.jsxs("select",{onChange:n,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:s,children:[e.jsx("option",{value:"",children:l("--Select a data center--")}),e.jsx("option",{value:"com",children:"zoho.com"}),e.jsx("option",{value:"eu",children:"zoho.eu"}),e.jsx("option",{value:"com.cn",children:"zoho.com.cn"}),e.jsx("option",{value:"in",children:"zoho.in"}),e.jsx("option",{value:"com.au",children:"zoho.com.au"})]}),e.jsx("div",{style:{color:"red"},children:r.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Homepage URL:")})}),e.jsx(y,{value:R,className:"field-key-cpy w-6 ml-0",readOnly:s}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Authorized Redirect URIs:")})}),e.jsx(y,{value:k||`${x.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:s}),e.jsxs("small",{className:"d-blk mt-5",children:[l("To get Client ID and SECRET , Please Visit")," ",e.jsx("a",{className:"btcd-link",href:`https://api-console.zoho.${(t==null?void 0:t.dataCenter)||"com"}/`,target:"_blank",rel:"noreferrer",children:l("Zoho API Console")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Client id:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"clientId",value:t.clientId,type:"text",placeholder:l("Client id..."),disabled:s}),e.jsx("div",{style:{color:"red"},children:r.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:l("Client secret:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:l("Client secret..."),disabled:s}),e.jsx("div",{style:{color:"red"},children:r.clientSecret}),!s&&e.jsxs(e.Fragment,{children:[e.jsx(U,{isAuthorized:u,isLoading:w,handleAuthorize:()=>B(t,a,p,T,m,h)}),e.jsx("br",{}),e.jsx(_,{nextPageHandler:()=>C(),disabled:!u})]})]})]})}export{X as default};
