var Z=Object.defineProperty;var N=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var y=(l,t,i)=>t in l?Z(l,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[t]=i,h=(l,t)=>{for(var i in t||(t={}))D.call(t,i)&&y(l,i,t[i]);if(N)for(var i of N(t))S.call(t,i)&&y(l,i,t[i]);return l};import{r as k,h as _,j as e}from"./main-406.js";import{k as z,_ as a,X as A,Y as I,L as $}from"./bi.394.85.js";import{B as P}from"./bi.46.744.js";import{d as O}from"./bi.679.710.js";import{T as E,t as U}from"./bi.150.760.js";function q({formID:l,biginConf:t,setBiginConf:i,step:u,setstep:w,isLoading:p,setIsLoading:x,setSnackbar:r,redirectLocation:L,isInfo:n}){const[d,R]=k.useState(!1),[c,b]=k.useState({dataCenter:"",clientId:"",clientSecret:""}),j=_(z),T="ZohoBigin.settings.modules.READ,ZohoBigin.settings.fields.READ,ZohoBigin.settings.tags.READ,ZohoBigin.users.READ,ZohoBigin.modules.ALL,ZohoBigin.settings.layouts.READ",{zohoBigin:s}=U,C=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),w(2),O(l,t,i,x,r)},o=m=>{const g=h({},t),v=h({},c);v[m.target.name]="",g[m.target.name]=m.target.value,b(v),i(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:u===1&&900,height:u===1&&"auto"},children:[(s==null?void 0:s.youTubeLink)&&e.jsx(E,{title:s==null?void 0:s.title,youTubeLink:s==null?void 0:s.youTubeLink}),(s==null?void 0:s.docLink)&&e.jsx(E,{title:s==null?void 0:s.title,docLink:s==null?void 0:s.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:o,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:n,children:[e.jsx("option",{value:"",children:a("--Select a data center--","bit-integrations")}),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:a("Homepage URL:","bit-integrations")})}),e.jsx(A,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(A,{value:L||`${j.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:r,readOnly:n}),e.jsxs("small",{className:"d-blk mt-5",children:[a("To get Client ID and SECRET , Please Visit","bit-integrations")," ",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","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientId",value:t.clientId,type:"text",placeholder:a("Client id...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:c.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:a("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:o,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:a("Client secret...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:c.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>I("zohoBigin","zbigin",T,t,i,b,R,x,r,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||p,children:[d?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),p&&e.jsx($,{size:20,clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:C,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!d,children:[a("Next","bit-integrations"),e.jsx(P,{className:"ml-1 rev-icn"})]})]})]})}export{q as default};
