var E=Object.defineProperty;var N=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var y=(s,t,a)=>t in s?E(s,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[t]=a,h=(s,t)=>{for(var a in t||(t={}))R.call(t,a)&&y(s,a,t[a]);if(N)for(var a of N(t))I.call(t,a)&&y(s,a,t[a]);return s};import{k as Z,g as _,j as e,_ as i}from"./main.2.8.1.js";import{d as z}from"./react-router-dom.9mCuUg3q.js";import{B as $}from"./BackIcn._kGL_vVw.js";import{a2 as k,z as B}from"./Note.BeM7sN-p.js";import{k as D}from"./Integrations.D2bgBas2.js";import{d as P}from"./ZohoRecruitCommonFunc.DFWLUnzn.js";import{t as f}from"./tutorialLinks.kMkIDzcD.js";import{T as w}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";import"./SnackMsg.S8DrwLlT.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function Y({formID:s,recruitConf:t,setRecruitConf:a,step:p,setstep:A,isLoading:x,setIsLoading:b,setSnackbar:o,redirectLocation:T,isInfo:n}){const[d,L]=z.useState(!1),[r,u]=z.useState({dataCenter:"",clientId:"",clientSecret:""}),j=Z(_),S="ZohoRecruit.users.ALL,ZohoRecruit.modules.all",{zohoRecruit:l}=f,C=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),A(2),P(s,t,a,b,o)},c=m=>{const g=h({},t),v=h({},r);v[m.target.name]="",g[m.target.name]=m.target.value,u(v),a(g)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:p===1&&900,height:p===1&&"auto"},children:[e.jsx(w,{title:"Zoho Recruit",youTubeLink:l==null?void 0:l.youTubeLink}),e.jsx(w,{title:"Zoho Recruit",docLink:l==null?void 0:l.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Data Center:","bit-integrations")})}),e.jsxs("select",{onChange:c,name:"dataCenter",value:t.dataCenter,className:"btcd-paper-inp w-6 mt-1",disabled:n,children:[e.jsx("option",{value:"",children:i("--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:r.dataCenter}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Homepage URL:","bit-integrations")})}),e.jsx(k,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",setSnackbar:o,readOnly:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(k,{value:T||`${j.api}/redirect`,className:"field-key-cpy w-6 ml-0",setSnackbar:o,readOnly:n}),e.jsxs("small",{className:"d-blk mt-5",children:[i("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:i("Zoho API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:r.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Client secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:c,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:r.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>D("zohoRecruit","zrecruit",S,t,a,u,L,b,o,j),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:d||x,children:[d?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),x&&e.jsx(B,{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:[i("Next","bit-integrations"),e.jsx($,{className:"ml-1 rev-icn"})]})]})]})}export{Y as default};
