var _=Object.defineProperty;var N=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var y=(a,t,i)=>t in a?_(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,o=(a,t)=>{for(var i in t||(t={}))f.call(t,i)&&y(a,i,t[i]);if(N)for(var i of N(t))I.call(t,i)&&y(a,i,t[i]);return a};import{k as R,f as T,j as e,_ as s}from"./main.2.9.0.js";import{b as v}from"./react-router.DMwpH23k.js";import{a2 as A,y as E}from"./Note.NSUdvR3c.js";import{b as C,g as O}from"./OneDriveCommonFunc.BBNhC02r.js";import{T as P}from"./TutorialLink.CFG7bS5c.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.CEA_lFLo.js";function M({flowID:a,oneDriveConf:t,setOneDriveConf:i,step:m,setStep:w,isLoading:p,setIsLoading:b,setSnackbar:h,redirectLocation:k,isInfo:r}){const[l,z]=v.useState(!1),[n,x]=v.useState({clientId:"",clientSecret:""}),g=R(T),S=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),O(a,t,i,b),w(2)},c=d=>{const u=o({},t),j=o({},n);j[d.target.name]="",u[d.target.name]=d.target.value,x(j),i(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[e.jsx(P,{linkKey:"oneDrive"}),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:r}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Homepage URL:","bit-integrations")})}),e.jsx(A,{value:`${window.location.origin}`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:h}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(A,{value:k||`${g.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:h}),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://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",target:"_blank",rel:"noreferrer",children:s("Azure Portal","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("OneDrive 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:r}),e.jsx("div",{style:{color:"red"},children:n.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("OneDrive 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:r}),e.jsx("div",{style:{color:"red"},children:n.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>C(t,i,z,b,x,g),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:l||p,children:[l?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:S,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!l,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{M as default};
