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