| 1 |
var E=Object.defineProperty;var S=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var k=(n,t,a)=>t in n?E(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,g=(n,t)=>{for(var a in t||(t={}))R.call(t,a)&&k(n,a,t[a]);if(S)for(var a of S(t))L.call(t,a)&&k(n,a,t[a]);return n};import{u as T,$ as F,r as o,j as e,_ as s,C as A,F as O,g as Z,S as I}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{d as P}from"./bf-563-97.js";import"./bf-825-45.js";import"./bf-781-46.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:n,creatorConf:t,setCreatorConf:a,step:C,setStep:N,isLoading:h,setisLoading:p,setSnackbar:u,redirectLocation:x,isInfo:r,authorizedAction:j}){const i=T(F),{siteURL:v}=i,[l,b]=o.useState(!1),[c,w]=o.useState({dataCenter:"",clientId:"",clientSecret:"",ownerEmail:""}),d=m=>{const z=g({},t),y=g({},c);y[m.target.name]="",z[m.target.name]=m.target.value,w(y),a(z)};return o.useEffect(()=>{l&&j()},[l]),e.jsxs(e.Fragment,{children:[e.jsx($,{title:f.zohoCreator.title,youTubeLink:f.zohoCreator.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:s("Account Name:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:t.name,type:"text",placeholder:s("e.g. Marketing — work account"),disabled:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Data Center:")})}),e.jsxs("select",{onChange:d,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:r,children:[e.jsx("option",{value:"",children:s("--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:c.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:")})}),e.jsx(A,{value:v,className:"field-key-cpy w-6 ml-0",readOnly:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:")})}),e.jsx(A,{value:x||`${i.zohoRedirectURL}`,className:"field-key-cpy w-6 ml-0",readOnly:r}),e.jsxs("small",{className:"d-blk mt-5",children:[s("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:s("Zoho API Console")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client id:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:t.clientId,type:"text",placeholder:s("Client id..."),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Client secret:")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:s("Client secret..."),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Owner Name (Your Zoho Creator screen name):")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:m=>d(m),name:"accountOwner",value:t.accountOwner,type:"text",placeholder:s("Your Zoho Creator screen name..."),disabled:r}),e.jsx("div",{style:{color:"red"},children:c.accountOwner}),!r&&e.jsxs(e.Fragment,{children:[e.jsx(D,{isAuthorized:l,isLoading:h,handleAuthorize:()=>P(t,a,w,b,p,u)}),e.jsx("br",{})]})]})]})}function ce({formFields:n,setIntegration:t,integrations:a,allIntegURL:C}){const N=O(),{formID:h}=Z(),[p,u]=o.useState(!1),[x,r]=o.useState(1),[j,i]=o.useState({show:!1}),[v,l]=o.useState({name:"Zoho Creator API",type:"Zoho Creator",clientId:"",clientSecret:"",accountOwner:"",field_map:[{formField:"",zohoFormField:""}],actions:{}}),b=()=>{setTimeout(()=>{N(C)},1e3)};return o.useEffect(()=>{window.opener&&_("zohoCreator")},[]),e.jsxs("div",{children:[e.jsx(I,{snack:j,setSnackbar:i}),e.jsx(U,{formID:h,creatorConf:v,setCreatorConf:l,step:x,setStep:r,isLoading:p,setisLoading:u,setSnackbar:i,authorizedAction:b})]})}export{ce as default}; |