var C=Object.defineProperty;var b=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var N=(a,t,l)=>t in a?C(a,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[t]=l,c=(a,t)=>{for(var l in t||(t={}))L.call(t,l)&&N(a,l,t[l]);if(b)for(var l of b(t))_.call(t,l)&&N(a,l,t[l]);return a};import{u as $,r as g,j as e,_ as r,C as w,d_ as E,$ as I}from"./main-40.js";import{t as z}from"./bf-892-199.js";import{T as O}from"./bf-679-136.js";import{A as P}from"./bf-541-403.js";import{N as U}from"./bf-504-404.js";import{c as B,r as V}from"./bf-414-336.js";/* empty css          */import"./bf-860-126.js";import"./bf-132-75.js";import"./bf-141-80.js";import"./bf-586-70.js";function Y({formID:a,analyticsConf:t,setAnalyticsConf:l,step:m,setStep:A,isLoading:k,setisLoading:h,setSnackbar:p,redirectLocation:R,isInfo:i}){const x=$(I),{siteURL:T}=x,[u,S]=g.useState(!1),[s,d]=g.useState({dataCenter:"",clientId:"",clientSecret:"",ownerEmail:""}),y=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!E(t.ownerEmail)){d({ownerEmail:E(t.ownerEmail)?"":r("Email is invalid")});return}A(2),V(a,t,l,h,p)},n=o=>{const j=c({},t),v=c({},s);v[o.target.name]="",j[o.target.name]=o.target.value,d(v),l(j)};return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:z.zohoAnalytics.title,youTubeLink:z.zohoAnalytics.link}),e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"100%"},children:[e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Integration Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"name",value:t.name,type:"text",placeholder:r("Integration Name..."),disabled:i}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Data Center:")})}),e.jsxs("select",{onChange:n,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:i,children:[e.jsx("option",{value:"",children:r("--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:s.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Homepage URL:")})}),e.jsx(w,{value:T,className:"field-key-cpy w-6 ml-0",readOnly:i}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Authorized Redirect URIs:")})}),e.jsx(w,{value:R||`${x.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:i}),e.jsxs("small",{className:"d-blk mt-5",children:[r("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:r("Zoho API Console")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Client id:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"clientId",value:t.clientId,type:"text",placeholder:r("Client id..."),disabled:i}),e.jsx("div",{style:{color:"red"},children:s.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Client secret:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:r("Client secret..."),disabled:i}),e.jsx("div",{style:{color:"red"},children:s.clientSecret}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:r("Zoho Analytics Owner Email:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:n,name:"ownerEmail",value:t.ownerEmail,type:"email",placeholder:r("Owner Email"),disabled:i}),e.jsx("div",{style:{color:"red"},children:s.ownerEmail}),!i&&e.jsxs(e.Fragment,{children:[e.jsx(P,{isAuthorized:u,isLoading:k,handleAuthorize:()=>B(t,l,d,S,h,p)}),e.jsx("br",{}),e.jsx(U,{nextPageHandler:()=>y(),disabled:!u})]})]})]})}export{Y as default};
