var I=Object.defineProperty;var N=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var y=(l,i,s)=>i in l?I(l,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[i]=s,m=(l,i)=>{for(var s in i||(i={}))R.call(i,s)&&y(l,s,i[s]);if(N)for(var s of N(i))C.call(i,s)&&y(l,s,i[s]);return l};import{r as k,h as E,j as t}from"./main-406.js";import{k as f,_ as a,X as A,L as O}from"./bi.394.85.js";import{b as P,g as $}from"./bi.665.713.js";import{T as w,t as v}from"./bi.150.760.js";function M({flowID:l,oneDriveConf:i,setOneDriveConf:s,step:b,setStep:z,isLoading:p,setIsLoading:h,setSnackbar:u,redirectLocation:L,isInfo:n}){const[r,S]=k.useState(!1),[c,x]=k.useState({clientId:"",clientSecret:""}),T=E(f),{oneDrive:e}=v,_=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),$(l,i,s,h),z(2)},d=o=>{const g=m({},i),j=m({},c);j[o.target.name]="",g[o.target.name]=o.target.value,x(j),s(g)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[(e==null?void 0:e.youTubeLink)&&t.jsx(w,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(w,{title:e==null?void 0:e.title,docLink:e==null?void 0:e.docLink}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"name",value:i.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:n}),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",readOnly:n,setSnackbar:u}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(A,{value:L||`${T.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:n,setSnackbar:u}),t.jsxs("small",{className:"d-blk mt-3",children:[a("To Get Client Id & Secret, Please Visit","bit-integrations")," ",t.jsx("a",{className:"btcd-link",href:"https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade",target:"_blank",rel:"noreferrer",children:a("Azure Portal","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("OneDrive Client Id:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientId",value:i.clientId,type:"text",placeholder:a("Client Id...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red"},children:c.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("OneDrive Client Secret:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:d,name:"clientSecret",value:i.clientSecret,type:"text",placeholder:a("Client Secret...","bit-integrations"),disabled:n}),t.jsx("div",{style:{color:"red"},children:c.clientSecret}),!n&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>P(i,s,S,h,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:r||p,children:[r?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),p&&t.jsx(O,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:_,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!r,children:[a("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{M as default};
