var I=Object.defineProperty;var j=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var N=(a,t,i)=>t in a?I(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,o=(a,t)=>{for(var i in t||(t={}))_.call(t,i)&&N(a,i,t[i]);if(j)for(var i of j(t))f.call(t,i)&&N(a,i,t[i]);return a};import{k as C,f as T,j as e,_ as s}from"./main.2.9.0.js";import{b as y}from"./react-router.DMwpH23k.js";import{a2 as v,y as E}from"./Note.NSUdvR3c.js";import{a as R,g as G}from"./GoogleDriveCommonFunc.CP1Ay2xG.js";import{T as P}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function V({flowID:a,googleDriveConf:t,setGoogleDriveConf:i,step:m,setStep:w,isLoading:p,setIsLoading:k,setSnackbar:b,redirectLocation:S,isInfo:n}){const[r,A]=y.useState(!1),[l,h]=y.useState({clientId:"",clientSecret:""}),x=C(T),z=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),G(a,t,i),w(2)},c=d=>{const u=o({},t),g=o({},l);g[d.target.name]="",u[d.target.name]=d.target.value,h(g),i(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[e.jsx(P,{linkKey:"googleDrive"}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("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:s("Integration Name...","bit-integrations"),disabled:n}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(v,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:b}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(v,{value:S||`${x.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:b}),e.jsxs("small",{className:"d-blk mt-3",children:[s("To Get Client Id & Secret, Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",href:"https://console.developers.google.com/apis/credentials",target:"_blank",rel:"noreferrer",children:s("Google API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleDrive 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:s("client ID...","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:l.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("GoogleDrive 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:s("Client Secret.....","bit-integrations"),disabled:n}),e.jsx("div",{style:{color:"red"},children:l.clientSecret}),!n&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R(t,i,A,k,h,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||p,children:[r?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),p&&e.jsx(E,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:z,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{V as default};
