var T=Object.defineProperty;var j=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var u=(n,i,s)=>i in n?T(n,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[i]=s,m=(n,i)=>{for(var s in i||(i={}))z.call(i,s)&&u(n,s,i[s]);if(j)for(var s of j(i))_.call(i,s)&&u(n,s,i[s]);return n};import{r as N,h as f,j as t}from"./main-406.js";import{k as E,_ as a,X as P,L as R}from"./bi.394.85.js";import{a as F,g as $}from"./bi.646.844.js";import{T as y,t as B}from"./bi.150.760.js";function X({flowID:n,pCloudConf:i,setPCloudConf:s,step:b,setStep:k,isLoading:h,setIsLoading:v,setSnackbar:I,redirectLocation:S,isInfo:r}){const[c,w]=N.useState(!1),[l,x]=N.useState({clientId:"",clientSecret:""}),A=f(E),{pCloud:e}=B,L=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),$(i,s,"fetch"),k(2)},d=o=>{const g=m({},i),p=m({},l);p[o.target.name]="",g[o.target.name]=o.target.value,x(p),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(y,{title:e==null?void 0:e.title,youTubeLink:e==null?void 0:e.youTubeLink}),(e==null?void 0:e.docLink)&&t.jsx(y,{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:r}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Authorized Redirect URIs:","bit-integrations")})}),t.jsx(P,{value:S||`${A.api.base}/redirect`,className:"field-key-cpy w-6 ml-0",readOnly:r,setSnackbar:I}),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://docs.pcloud.com/my_apps/",target:"_blank",rel:"noreferrer",children:a("pCloud API apps","bit-integrations")})]}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("PCloud 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:r}),t.jsx("div",{style:{color:"red"},children:l.clientId}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("PCloud 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:r}),t.jsx("div",{style:{color:"red"},children:l.clientSecret}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:()=>F(i,s,w,v,x),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||h,children:[c?a("Authorized ✔","bit-integrations"):a("Authorize","bit-integrations"),h&&t.jsx(R,{size:"20",clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:L,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[a("Next","bit-integrations"),t.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{X as default};
