| 1 |
var w=Object.defineProperty;var k=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var R=(i,t,s)=>t in i?w(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,g=(i,t)=>{for(var s in t||(t={}))E.call(t,s)&&R(i,s,t[s]);if(k)for(var s of k(t))L.call(t,s)&&R(i,s,t[s]);return i};import{u as T,$ as F,r,j as e,_ as a,C as A,F as I,g as M,S as Z}from"./main-96.js";/* empty css */import{c as _}from"./bf-13-42.js";import{t as f}from"./bf-374-48.js";import{T as $}from"./bf-60-114.js";import{A as D}from"./bf-490-110.js";import{i as P}from"./bf-783-72.js";import"./bf-781-46.js";import"./bf-431-60.js";import"./bf-825-45.js";import"./bf-551-68.js";import"./bf-894-52.js";import"./bf-331-47.js";import"./bf-798-54.js";import"./bf-425-69.js";import"./bf-533-49.js";import"./bf-531-50.js";import"./bf-128-51.js";import"./bf-681-53.js";import"./bf-20-55.js";import"./bf-570-115.js";function U({formID:i,crmConf:t,setCrmConf:s,step:z,setstep:C,isLoading:h,setisLoading:p,setSnackbar:u,redirectLocation:x,isInfo:o,authorizedAction:j}){const l=T(F),{siteURL:y}=l,[c,b]=r.useState(!1),[n,d]=r.useState({dataCenter:"",clientId:"",clientSecret:""}),m=v=>{const N=g({},t),S=g({},n);S[v.target.name]="",N[v.target.name]=v.target.value,d(S),s(N)};return r.useEffect(()=>{c&&j()},[c]),e.jsxs(e.Fragment,{children:[e.jsx($,{title:f.zohoCrm.title,youTubeLink:f.zohoCrm.link}),e.jsxs("div",{className:"btcd-stp-page",style:{width:900,height:"100%"},children:[e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Account Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"name",value:t.name,type:"text",placeholder:a("e.g. Marketing — work account"),disabled:o}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Data Center:")})}),e.jsxs("select",{onChange:m,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:o,children:[e.jsx("option",{value:"",children:a("--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:n.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Homepage URL:")})}),e.jsx(A,{value:y,className:"field-key-cpy w-6 ml-0",readOnly:o}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:")})}),e.jsx(A,{value:x||`${l.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:o}),e.jsxs("small",{className:"d-blk mt-5",children:[a("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:a("Zoho API Console")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client id:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"clientId",value:t.clientId,type:"text",placeholder:a("Client id..."),disabled:o}),e.jsx("div",{style:{color:"red"},children:n.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client secret:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:a("Client secret..."),disabled:o}),e.jsx("div",{style:{color:"red"},children:n.clientSecret}),!o&&e.jsxs(e.Fragment,{children:[e.jsx(D,{isAuthorized:c,isLoading:h,handleAuthorize:()=>P(t,s,d,b,p,u)}),e.jsx("br",{})]})]})]})}function de({formFields:i,setIntegration:t,integrations:s,allIntegURL:z}){const C=I(),{formID:h}=M(),[p,u]=r.useState(!1),[x,o]=r.useState(1),[j,l]=r.useState({show:!1}),[y,c]=r.useState(0),[b,n]=r.useState({name:"Zoho CRM API",type:"Zoho CRM",clientId:"",clientSecret:"",module:"",layout:"",field_map:[{formField:"",zohoFormField:""}],relatedlists:[],actions:{}}),d=()=>{setTimeout(()=>{C(z)},1e3)};return r.useEffect(()=>{window.opener&&_("zohoCRM")},[]),e.jsxs("div",{children:[e.jsx(Z,{snack:j,setSnackbar:l}),e.jsx(U,{formID:h,crmConf:b,setCrmConf:n,step:x,setstep:o,isLoading:p,setisLoading:u,setSnackbar:l,authorizedAction:d})]})}export{de as default}; |