/home/ivoiecob/email.hirewise-va.com/static/js/Dropbox.app.ec0061df009b88311439.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[287],{YvIo:(e,t,o)=>{e.exports=function(e){var t=o("a7T2"),n=o("LKDt"),c=o("yU9o"),s=o("z+cb");return s.init(e),c.isUserNormalOrTenant()&&s.EnableModule&&t.isArray(s.Scopes)&&s.Scopes.length>0?{start:function(e){e.run("SettingsWebclient","registerSettingsTab",[function(){return o("goct")},s.HashModuleName,n.i18n("DROPBOX/LABEL_SETTINGS_TAB")])}}:null}},goct:(e,t,o)=>{var n=o("a7T2"),c=o("M4cL"),s=o("p09A"),a=o("ERH9"),i=o("3cxN"),r=o("8QQh"),u=o("Z9uT"),p=o("yU9o"),l=o("5D2l"),h=o("zVyH"),d=l.run("SettingsWebclient","getAbstractSettingsFormViewClass"),b=o("z+cb");function S(){d.call(this,b.ServerModuleName),this.connected=s.observable(b.Connected),this.scopes=s.observable(b.getScopesCopy()),this.bRunCallback=!1,window.dropboxConnectCallback=n.bind(function(e,t,o){this.bRunCallback=!0,e?(this.connected(!0),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):u.showErrorByCode({ErrorCode:a.pInt(t),ErrorMessage:"",Module:o},"",!0)},this)}n.extendOwn(S.prototype,d.prototype),S.prototype.ViewTemplate="Dropbox_DropboxSettingsFormView",S.prototype.getCurrentValues=function(){var e=n.map(this.scopes(),function(e){return e.Name+e.Value()});return[this.connected(),e]},S.prototype.revertGlobalValues=function(){this.connected(b.Connected),this.scopes(b.getScopesCopy())},S.prototype.checkAndConnect=function(){var e={Scopes:[],Service:"dropbox",AllowConnect:!0},t=n.find(this.scopes(),function(e){return"auth"===e.Name}),o=!!t&&!!t.Value(),c=n.find(b.getScopesCopy(),function(e){return"auth"===e.Name}),s=!!c&&!!c.Value();n.each(this.scopes(),function(t){t.Value()&&e.Scopes.push(t.Name)}),p.broadcastEvent("OAuthAccountChange::before",e),e.AllowConnect&&(o||o===s||!o&&p.isAccountDeletingAvailable())&&this.connect(e.Scopes)},S.prototype.connect=function(e){c.removeCookie("oauth-scopes"),c.cookie("oauth-scopes",e.join("|")),c.cookie("oauth-redirect","connect"),this.bRunCallback=!1;var t=h.open(i.getAppPath()+"?oauth=dropbox-connect","Dropbox"),o=setInterval(n.bind(function(){t.closed&&(clearInterval(o),this.bRunCallback?(p.broadcastEvent("OAuthAccountChange::after"),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):window.location.reload())},this),1e3)},S.prototype.checkAndDisconnect=function(){var e={Service:"dropbox",AllowDisconnect:!0},t=n.find(b.getScopesCopy(),function(e){return"auth"===e.Name}),o=!!t&&!!t.Value();p.broadcastEvent("OAuthAccountChange::before",e),!e.AllowDisconnect||o&&!p.isAccountDeletingAvailable()||this.disconnect()},S.prototype.disconnect=function(){r.send(b.ServerModuleName,"DeleteAccount",null,function(e){e.Result?(this.connected(!1),n.each(this.scopes(),function(e){e.Value(!1)}),p.broadcastEvent("OAuthAccountChange::after"),this.updateSavedState(),b.updateScopes(this.connected(),this.scopes())):u.showErrorByCode(e,"",!0)},this)},e.exports=new S},"z+cb":(e,t,o)=>{var n=o("a7T2"),c=o("p09A"),s=o("ERH9");e.exports={ServerModuleName:"Dropbox",HashModuleName:"dropbox",Connected:!1,EnableModule:!1,Id:"",Secret:"",Scopes:[],init:function(e){var t=e.Dropbox;n.isEmpty(t)||(this.Connected=s.pBool(t.Connected,this.Connected),this.EnableModule=s.pBool(t.EnableModule,this.EnableModule),this.Id=s.pString(t.Id,this.Id),this.Secret=s.pString(t.Secret,this.Secret),this.Scopes=s.pArray(t.Scopes,this.Scopes))},getScopesCopy:function(){var e=[];return n.each(this.Scopes,function(t){e.push({Description:t.Description,Name:t.Name,Value:c.observable(t.Value)})}),e},updateScopes:function(e,t){var o=[];n.each(t,function(e){o.push({Description:e.Description,Name:e.Name,Value:e.Value()})}),this.Connected=e,this.Scopes=o},updateAdmin:function(e,t,o,n){this.EnableModule=e,this.Id=t,this.Secret=o,this.Scopes=n}}}}]);