var u=Object.defineProperty;var g=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(e,t,a)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,c=(e,t)=>{for(var a in t||(t={}))y.call(t,a)&&b(e,a,t[a]);if(g)for(var a of g(t))C.call(t,a)&&b(e,a,t[a]);return e};import{_ as n,b as h,c as d}from"./bi.394.85.js";const _=(e,t,a)=>{const r=c({},t),{name:o}=e.target;e.target.value!==""?r[o]=e.target.value:delete r[o],a(c({},r))},F=(e,t,a)=>{const r={flowID:e!=null?e:null,clientId:t.clientId,clientSecret:t.clientSecret,tokenDetails:t.tokenDetails},o=h(r,"dropbox_get_all_folders").then(i=>{if(i&&i.success){const s=c({},t);return i.data.dropboxFoldersList&&(s.foldersList=i.data.dropboxFoldersList,s.tokenDetails=i.data.tokenDetails),a(s),"Dropbox Folders List refreshed successfully"}else return"Dropbox Folders List refresh failed. please try again"});d.promise(o,{success:i=>i,error:n("Error Occurred","bit-integrations"),loading:n("Loading Dropbox Folders List...","bit-integrations")})},f=(e,t,a,r,o)=>{if(!e.accessCode||!e.clientId||!e.clientSecret){o({clientId:e.clientId?"":n("Client Id can't be empty","bit-integrations"),clientSecret:e.clientSecret?"":n("Client Secret can't be empty","bit-integrations"),accessCode:e.accessCode?"":n("Access Code can't be empty","bit-integrations")});return}r(!0);const i={clientId:e.clientId,clientSecret:e.clientSecret,accessCode:e.accessCode};h(i,"dropbox_authorization").then(s=>s).then(s=>{if(s&&s.success){const l=c({},e);l.tokenDetails=s.data,t(l),a(!0),d.success(n("Authorized Successfully","bit-integrations"))}else s&&s.data&&s.data.data||!s.success&&typeof s.data=="string"?d.error(`${n("Authorization failed Cause: ","bit-integrations")}${s.data.data||s.data}. ${n("please try again","bit-integrations")}`):d.error(n("Authorization failed. please try again","bit-integrations"));r(!1)})};export{f as a,F as g,_ as h};
