var A=Object.defineProperty;var u=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var j=(a,t,i)=>t in a?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)&&j(a,i,t[i]);if(u)for(var i of u(t))z.call(t,i)&&j(a,i,t[i]);return a};import{k as _,f as T,j as e,_ as s}from"./main.2.8.10.js";import{b as N}from"./react-router.DMwpH23k.js";import{a2 as E,y as P}from"./Note.DalStCGz.js";import{a as R,g as C}from"./PCloudCommonFunc.CgTQgi5q.js";import{T as D}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function V({flowID:a,pCloudConf:t,setPCloudConf:i,step:m,setStep:y,isLoading:b,setIsLoading:v,setSnackbar:S,redirectLocation:k,isInfo:r}){const[n,I]=N.useState(!1),[l,p]=N.useState({clientId:"",clientSecret:""}),h=_(T),w=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),C(t,i,"fetch"),y(2)},c=d=>{const x=o({},t),g=o({},l);g[d.target.name]="",x[d.target.name]=d.target.value,p(g),i(x)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:m===1&&900,height:m===1&&"auto"},children:[e.jsx(D,{linkKey:"pCloud"}),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("Authorized Redirect URIs:","bit-integrations")})}),e.jsx(E,{value:k||`${h.api}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:S}),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://docs.pcloud.com/my_apps/",target:"_blank",rel:"noreferrer",children:s("pCloud API apps","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("PCloud 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:l.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:s("PCloud 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:l.clientSecret}),!r&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>R(t,i,I,v,p,h),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:n||b,children:[n?s("Authorized ✔","bit-integrations"):s("Authorize","bit-integrations"),b&&e.jsx(P,{size:"20",clr:"#022217",className:"ml-2"})]}),e.jsx("br",{}),e.jsxs("button",{onClick:w,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!n,children:[s("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{V as default};
