var A=Object.defineProperty;var x=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var j=(n,t,s)=>t in n?A(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,p=(n,t)=>{for(var s in t||(t={}))I.call(t,s)&&j(n,s,t[s]);if(x)for(var s of x(t))z.call(t,s)&&j(n,s,t[s]);return n};import{j as e,_ as i}from"./main.2.8.1.js";import{d as N}from"./react-router-dom.9mCuUg3q.js";import{z as C}from"./Note.BeM7sN-p.js";import{a as D,g as T}from"./DropboxCommonFunc.CVFsAsv5.js";import{t as L}from"./tutorialLinks.kMkIDzcD.js";import{T as k}from"./TutorialLink.BAFX--T3.js";import"./CopyIcn.3gZpHton.js";function $({flowID:n,dropboxConf:t,setDropboxConf:s,step:b,setStep:y,isLoading:h,setIsLoading:v,isInfo:c}){const[o,w]=N.useState(!1),[r,d]=N.useState({clientId:"",clientSecret:""}),{dropbox:a}=L,S=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),T(n,t,s),y(2)},l=m=>{const u=p({},t),g=p({},r);g[m.target.name]="",u[m.target.name]=m.target.value,d(g),s(u)},_=()=>{if(!t.clientId||!t.clientSecret){d({clientId:t.clientId?"":i("Client Id can't be empty","bit-integrations"),clientSecret:t.clientSecret?"":i("Client Secret can't be empty","bit-integrations")});return}window.open(`https://www.dropbox.com/oauth2/authorize?client_id=${t.clientId}&token_access_type=offline&response_type=code`,"_blank")};return e.jsxs("div",{className:"btcd-stp-page",style:{width:b===1&&900,height:b===1&&"auto"},children:[e.jsx(k,{title:"Dropbox",youTubeLink:a==null?void 0:a.youTubeLink}),e.jsx(k,{title:"Dropbox",docLink:a==null?void 0:a.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"name",value:t.name,type:"text",placeholder:i("Integration Name...","bit-integrations"),disabled:c}),e.jsxs("small",{className:"d-blk mt-3",children:[i("To Get Client Id & Secret, Please Visit","bit-integrations")," ",e.jsx("a",{className:"btcd-link",rel:"noreferrer",target:"_blank",href:"https://www.dropbox.com/developers/apps/create?_tk=pilot_lp&_ad=ctabtn1&_camp=create",children:i("Dropbox API Console","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Dropbox Client id:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"clientId",value:t.clientId,type:"text",placeholder:i("client ID...","bit-integrations"),disabled:c}),e.jsx("div",{style:{color:"red"},children:r.clientId}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Dropbox Client Secret:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"clientSecret",value:t.clientSecret,type:"text",placeholder:i("client Secret...","bit-integrations"),disabled:c}),e.jsx("div",{style:{color:"red"},children:r.clientSecret}),e.jsxs("small",{className:"d-blk mt-3",children:[i("To Get Access Code, Please Visit","bit-integrations")," ",e.jsx("span",{className:"btcd-link",style:{cursor:"pointer"},onClick:_,"aria-hidden":"true",children:i("Dropbox Access Code","bit-integrations")})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Dropbox Access Code:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:l,name:"accessCode",value:t.accessCode,type:"text",placeholder:i("Access Code...","bit-integrations"),disabled:c}),e.jsx("div",{style:{color:"red"},children:r.accessCode}),!c&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>D(t,s,w,v,d),className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:o||h,children:[o?i("Authorized ✔","bit-integrations"):i("Authorize","bit-integrations"),h&&e.jsx(C,{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:!o,children:[i("Next","bit-integrations"),e.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]})]})}export{$ as default};
