1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00
Files
seahub/media/assets/frontend/static/js/settings.90adc1a3.js

1 line
47 KiB
JavaScript

"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[6472],{21870:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(58195),c=n(14113),d=n(99308),h=n(76152),u=n(55627),m=n(85077),p=n(85907),g=n(18849),f=n(40326),A=n(44414),x=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).toggle=function(){n.props.toggleDialog()},n.executeOperation=function(){n.toggle(),n.props.executeOperation(n.state.isChecked)},n.onInputChange=function(e){n.setState({isChecked:e.target.checked})},n.state={isChecked:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,A.jsxs)(l.A,{isOpen:!0,toggle:this.toggle,children:[(0,A.jsx)(c.A,{toggle:this.toggle,children:(0,f.AP)("Unlink device")}),(0,A.jsxs)(d.A,{children:[(0,A.jsx)("p",{children:(0,f.AP)("Are you sure you want to unlink this device?")}),(0,A.jsx)(h.A,{check:!0,children:(0,A.jsxs)(u.A,{check:!0,children:[(0,A.jsx)(m.A,{type:"checkbox",checked:this.state.isChecked,onChange:this.onInputChange}),(0,A.jsx)("span",{children:(0,f.AP)("Delete files from this device the next time it comes online.")})]})})]}),(0,A.jsxs)(p.A,{children:[(0,A.jsx)(g.A,{color:"secondary",onClick:this.toggle,children:(0,f.AP)("Cancel")}),(0,A.jsx)(g.A,{color:"primary",onClick:this.executeOperation,children:(0,f.AP)("Unlink")})]})]})}}])}(r.Component);t.A=x},34555:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(44414),c=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this;return(0,l.jsx)("div",{className:"side-nav",children:(0,l.jsx)("div",{className:"side-nav-con",children:(0,l.jsx)("ul",{className:"nav nav-pills flex-column",children:this.props.data.map((function(t,n){return t.show?(0,l.jsx)("li",{className:"nav-item".concat(e.props.curItemID==t.href.substr(1)?" active":""),children:(0,l.jsx)("a",{className:"nav-link".concat(e.props.curItemID==t.href.substr(1)?" active":""),href:t.href,children:t.text})},n):null}))})})})}}])}(r.Component);t.A=c},57208:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(17119),c=n(70446),d=n.n(c),h=n(58195),u=n(65604),m=n(40326),p=n(97011),g=n(4086),f=n(44414),A=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsx)("div",{className:"main-panel",children:this.props.children})}}])}(r.Component),x=A,v=n(49403),j=n(48738),w=n.n(j),b=n(34555),P=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)("div",{className:w()("side-panel",{"left-zero":!this.props.isSidePanelClosed}),children:[(0,f.jsx)("div",{className:"side-panel-north",children:(0,f.jsx)(v.A,{onCloseSidePanel:this.props.onCloseSidePanel})}),(0,f.jsx)("div",{className:"side-panel-center",children:(0,f.jsx)(b.A,{data:this.props.data,curItemID:this.props.curItemID})})]})}}])}(r.Component),k=P,C=n(27288),S=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.onShowSidePanel,n=e.onSearchedClick,s=e.children,a=e.showSearch;return(0,f.jsxs)("div",{className:"main-panel-north ".concat(s?"border-left-show":""),children:[(0,f.jsxs)("div",{className:"cur-view-toolbar",children:[(0,f.jsx)("span",{title:"Side Nav Menu",onClick:t,className:"sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"}),this.props.children]}),(0,f.jsx)(C.A,{showSearch:a,searchPlaceholder:this.props.searchPlaceholder,onSearchedClick:n})]})}}])}(r.Component),y=S,D=window.app.pageOptions,N=D.avatarURL,O=D.csrfToken,I=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).fileInputChange=function(){if(n.fileInput.current.files.length){var e=n.fileInput.current.files[0],t=e.name;if(-1==t.lastIndexOf("."))return g.A.danger((0,m.AP)("Please choose an image file."),{duration:5}),!1;var s=t.substr(t.lastIndexOf(".")+1).toLowerCase(),a=["jpg","jpeg","png","gif"];if(-1==a.indexOf(s)){var i=(0,m.AP)("File extensions can only be {placeholder}.").replace("{placeholder}",a.join(", "));return g.A.danger(i,{duration:5}),!1}if(e.size>1048576){var o=(0,m.AP)("The file is too large. Allowed maximum size is 1MB.");return g.A.danger(o,{duration:5}),!1}p.e.updateUserAvatar(e).then((function(e){n.setState({avatarSrc:e.data.avatar_url}),g.A.success((0,m.AP)("Avatar updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))}},n.openFileInput=function(){n.fileInput.current.click()},n.handleMouseOver=function(){n.setState({isEditShown:!0})},n.handleMouseOut=function(){n.setState({isEditShown:!1})},n.onEditIconKeyDown=function(e){"Enter"!=e.key&&"Space"!=e.key||e.target.click()},n.state={avatarSrc:N,isEditShown:!1},n.fileInput=r.createRef(),n.form=r.createRef(),n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)("form",{ref:this.form,className:"form-group row",encType:"multipart/form-data",method:"post",action:"".concat(m.Yc,"avatar/add/"),children:[(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:O}),(0,f.jsx)("label",{className:"col-sm-1 col-form-label",children:(0,m.AP)("Avatar:")}),(0,f.jsxs)("div",{className:"col-auto position-relative",onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut,onFocus:this.handleMouseOver,tabIndex:"0",children:[(0,f.jsx)("img",{src:this.state.avatarSrc,width:"80",height:"80",alt:"",className:"user-avatar"}),(0,f.jsx)("input",{type:"file",name:"avatar",className:"d-none",onChange:this.fileInputChange,ref:this.fileInput}),(0,f.jsx)("span",{className:"avatar-edit sf3-font sf3-font-rename ".concat(!this.state.isEditShown&&"d-none"),onClick:this.openFileInput,role:"button","aria-label":(0,m.AP)("Edit"),tabIndex:"0",onKeyDown:this.onEditIconKeyDown})]})]})}}])}(r.Component),M=window.app.pageOptions,T=M.nameLabel,U=M.enableUpdateUserInfo,E=M.enableUserSetContactEmail,V=M.enableUserSetName,R=function(e){function t(e){var n;(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).handleNameInputChange=function(e){n.setState({name:e.target.value})},n.handleContactEmailInputChange=function(e){n.setState({contactEmail:e.target.value})},n.handleSubmit=function(e){e.preventDefault();var t={};V&&(t.name=n.state.name),E&&(t.contact_email=n.state.contactEmail),n.props.updateUserInfo(t)};var a=n.props.userInfo,o=a.contact_email,r=a.login_id,l=a.name;return n.state={contactEmail:o,loginID:r,name:l},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.state,t=e.contactEmail,n=e.loginID,s=e.name;return(0,f.jsxs)("form",{action:"",method:"post",onSubmit:this.handleSubmit,children:[(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"name",children:T}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"name",type:"text",name:"nickname",value:s,disabled:!U||!V,onChange:this.handleNameInputChange})})]}),n&&(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"user-name",children:(0,m.AP)("Username:")}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"user-name",type:"text",name:"username",value:n,disabled:!0,readOnly:!0})}),(0,f.jsx)("p",{className:"col-sm-5 m-0 input-tip",children:(0,m.AP)("You can use this field at login.")})]}),(t||E)&&(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"contact-email",children:(0,m.AP)("Contact Email:")}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"contact-email",type:"text",name:"contact_email",value:t,disabled:!E,readOnly:!E,onChange:this.handleContactEmailInputChange})}),(0,f.jsx)("p",{className:"col-sm-5 m-0 input-tip",children:(0,m.AP)("Your notifications will be sent to this email.")})]}),(0,f.jsx)("button",{type:"submit",className:"btn btn-outline-primary offset-sm-1",disabled:!U,children:(0,m.AP)("Submit")})]})}}])}(r.Component),L=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).getAuthToken=function(){p.e.getAuthTokenBySession().then((function(e){n.setState({authToken:e.data.token})})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.createAuthToken=function(){p.e.createAuthTokenBySession().then((function(e){n.setState({authToken:e.data.token,isAuthTokenVisible:!1}),g.A.success((0,m.AP)("Auth Token created"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.deleteAuthToken=function(){p.e.deleteAuthTokenBySession().then((function(e){n.setState({authToken:"",isAuthTokenVisible:!1}),g.A.success((0,m.AP)("Auth Token deleted"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.toggleAuthTokenVisible=function(){n.setState({isAuthTokenVisible:!n.state.isAuthTokenVisible})},n.onIconKeyDown=function(e){"Enter"!=e.key&&"Space"!=e.key||e.target.click()},n.state={authToken:"",isAuthTokenVisible:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"componentDidMount",value:function(){this.getAuthToken()}},{key:"render",value:function(){var e=this.state,t=e.authToken,n=e.isAuthTokenVisible;return(0,f.jsx)(r.Fragment,{children:(0,f.jsxs)("div",{id:"get-auth-token",className:"setting-item",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Web API Auth Token")}),t?(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"d-flex align-items-center",children:[(0,f.jsx)("label",{className:"m-0 mr-2",htmlFor:"token",children:(0,m.AP)("Token:")}),(0,f.jsx)("input",{id:"token",className:"border-0 mr-1",type:"text",value:n?t:"****************************************",readOnly:!0,size:Math.max(t.length,10)}),(0,f.jsx)("span",{tabIndex:"0",role:"button","aria-label":n?(0,m.AP)("Hide"):(0,m.AP)("Show"),onKeyDown:this.onIconKeyDown,onClick:this.toggleAuthTokenVisible,className:"eye-icon sf3-font sf3-font-eye".concat(this.state.isAuthTokenVisible?"":"-slash")})]}),(0,f.jsx)("button",{className:"btn btn-outline-primary mt-2",onClick:this.deleteAuthToken,children:(0,m.AP)("Delete")})]}):(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.createAuthToken,children:(0,m.AP)("Generate")})]})})}}])}(r.Component),F=n(40866),_=n(14113),W=n(99308),q=n(48918),Y=n(85077),B=n(30038),z=n(18849),K=n(76115),G=n(85907),H=window.app.pageOptions,J=H.webdavSecretMinLength,Q=H.webdavSecretStrengthLevel,X=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).submit=function(){return 0===n.state.password.length?(n.setState({errMsg:(0,m.AP)("Please enter a password.")}),!1):n.state.password.length<J?(n.setState({errMsg:(0,m.AP)("The password is too short.")}),!1):u.Aq.getStrengthLevel(n.state.password)<Q?(n.setState({errMsg:(0,m.AP)("The password is too weak. It should include at least {passwordStrengthLevel} of the following: number, upper letter, lower letter and other symbols.").replace("{passwordStrengthLevel}",Q)}),!1):(n.setState({btnDisabled:!0}),void n.props.setPassword(n.state.password.trim()))},n.handleInputChange=function(e){n.setState({password:e.target.value})},n.togglePasswordVisible=function(){n.setState({isPasswordVisible:!n.state.isPasswordVisible})},n.generatePassword=function(){var e=u.Aq.generatePassword(J);n.setState({password:e})},n.state={password:"",isPasswordVisible:!1,btnDisabled:!1,errMsg:""},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props.toggle,t=(0,m.AP)("(at least {passwordMinLength} characters and includes {passwordStrengthLevel} of the following: number, upper letter, lower letter and other symbols)").replace("{passwordMinLength}",J).replace("{passwordStrengthLevel}",Q);return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:e,children:[(0,f.jsx)(_.A,{toggle:e,children:(0,m.AP)("Set WebDAV Password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(q.A,{children:[(0,f.jsx)(Y.A,{type:this.state.isPasswordVisible?"text":"password",value:this.state.password,onChange:this.handleInputChange,autoComplete:"new-password"}),(0,f.jsxs)(B.A,{addonType:"append",children:[(0,f.jsx)(z.A,{onClick:this.togglePasswordVisible,children:(0,f.jsx)("i",{className:"sf3-font sf3-font-eye".concat(this.state.isPasswordVisible?"":"slash")})}),(0,f.jsx)(z.A,{onClick:this.generatePassword,children:(0,f.jsx)("i",{className:"sf3-font sf3-font-magic"})})]})]}),(0,f.jsx)("p",{className:"form-text text-muted m-0",children:t}),this.state.errMsg&&(0,f.jsx)(K.A,{color:"danger",className:"m-0 mt-2",children:(0,m.AP)(this.state.errMsg)})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:e,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.submit,disabled:this.state.btnDisabled,children:(0,m.AP)("Submit")})]})]})}}])}(r.Component),Z=window.app.pageOptions,$=Z.webdavSecretMinLength,ee=Z.webdavSecretStrengthLevel,te=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).submit=function(){return 0===n.state.password.length?(n.setState({errMsg:(0,m.AP)("Please enter a password.")}),!1):n.state.password.length<$?(n.setState({errMsg:(0,m.AP)("The password is too short.")}),!1):u.Aq.getStrengthLevel(n.state.password)<ee?(n.setState({errMsg:(0,m.AP)("The password is too weak. It should include at least {passwordStrengthLevel} of the following: number, upper letter, lower letter and other symbols.").replace("{passwordStrengthLevel}",ee)}),!1):(n.setState({btnDisabled:!0}),void n.props.resetPassword(n.state.password.trim()))},n.handleInputChange=function(e){n.setState({password:e.target.value})},n.togglePasswordVisible=function(){n.setState({isPasswordVisible:!n.state.isPasswordVisible})},n.generatePassword=function(){var e=u.Aq.generatePassword($);n.setState({password:e})},n.state={password:"",isPasswordVisible:!1,btnDisabled:!1,errMsg:""},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props.toggle,t=(0,m.AP)("(at least {passwordMinLength} characters and includes {passwordStrengthLevel} of the following: number, upper letter, lower letter and other symbols)").replace("{passwordMinLength}",$).replace("{passwordStrengthLevel}",ee);return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:e,children:[(0,f.jsx)(_.A,{toggle:e,children:(0,m.AP)("Reset WebDAV Password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(q.A,{children:[(0,f.jsx)(Y.A,{type:this.state.isPasswordVisible?"text":"password",value:this.state.password,onChange:this.handleInputChange,autoComplete:"new-password"}),(0,f.jsxs)(B.A,{addonType:"append",children:[(0,f.jsx)(z.A,{onClick:this.togglePasswordVisible,children:(0,f.jsx)("i",{className:"sf3-font sf3-font-eye".concat(this.state.isPasswordVisible?"":"-slash")})}),(0,f.jsx)(z.A,{onClick:this.generatePassword,children:(0,f.jsx)("i",{className:"sf3-font sf3-font-magic"})})]})]}),(0,f.jsx)("p",{className:"form-text text-muted m-0",children:t}),this.state.errMsg&&(0,f.jsx)(K.A,{color:"danger",className:"m-0 mt-2",children:(0,m.AP)(this.state.errMsg)})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:e,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.submit,disabled:this.state.btnDisabled,children:(0,m.AP)("Submit")})]})]})}}])}(r.Component),ne=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).submit=function(){n.setState({btnDisabled:!0}),n.props.removePassword()},n.state={btnDisabled:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props.toggle;return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:e,children:[(0,f.jsx)(_.A,{toggle:e,children:(0,m.AP)("Delete WebDAV Password")}),(0,f.jsx)(W.A,{children:(0,f.jsx)("p",{children:(0,m.AP)("Are you sure you want to delete WebDAV password?")})}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:e,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.submit,disabled:this.state.btnDisabled,children:(0,m.AP)("Delete")})]})]})}}])}(r.Component),se=window.app.pageOptions,ae=se.username,ie=se.webdavUrl,oe=se.webdavPasswordSetted,re=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).toggleSetPasswordDialog=function(){n.setState({isSetPasserdDialogOpen:!n.state.isSetPasserdDialogOpen})},n.setPassword=function(e){p.e.updateWebdavSecret(e).then((function(e){n.toggleSetPasswordDialog(),n.setState({isWebdavPasswordSetted:!n.state.isWebdavPasswordSetted}),g.A.success((0,m.AP)("Password updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);n.toggleSetPasswordDialog(),g.A.danger(t)}))},n.toggleResetPasswordDialog=function(){n.setState({isResetPasswordDialogOpen:!n.state.isResetPasswordDialogOpen})},n.resetPassword=function(e){p.e.updateWebdavSecret(e).then((function(e){n.toggleResetPasswordDialog(),g.A.success((0,m.AP)("Password reset"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);n.toggleResetPasswordDialog(),g.A.danger(t)}))},n.toggleRemovePasswordDialog=function(){n.setState({isRemovePasswordDialogOpen:!n.state.isRemovePasswordDialogOpen})},n.removePassword=function(){p.e.updateWebdavSecret().then((function(e){n.toggleRemovePasswordDialog(),n.setState({isWebdavPasswordSetted:!n.state.isWebdavPasswordSetted}),g.A.success((0,m.AP)("Password removed"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);n.toggleRemovePasswordDialog(),g.A.danger(t)}))},n.onIconKeyDown=function(e){"Enter"!=e.key&&"Space"!=e.key||e.target.click()},n.state={isWebdavPasswordSetted:oe,isSetPasserdDialogOpen:!1,isResetPasserdDialogOpen:!1,isRemovePasserdDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.state.isWebdavPasswordSetted;return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{id:"update-webdav-passwd",className:"setting-item",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("WebDAV Access")}),(0,f.jsxs)("p",{children:["WebDAV URL: ",(0,f.jsx)("a",{href:ie,children:ie})]}),(0,f.jsxs)("p",{children:[(0,m.AP)("WebDAV username:")," ",ae]}),e?(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("p",{children:[(0,m.AP)("WebDAV password:")," ***"]}),(0,f.jsx)("button",{className:"btn btn-outline-primary mr-2",onClick:this.toggleResetPasswordDialog,children:(0,m.AP)("Reset Password")}),(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.toggleRemovePasswordDialog,children:(0,m.AP)("Delete Password")})]}):(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("p",{children:[(0,m.AP)("WebDAV password:")," ",(0,m.AP)("not set")]}),(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.toggleSetPasswordDialog,children:(0,m.AP)("Set Password")})]})]}),this.state.isSetPasserdDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(X,{setPassword:this.setPassword,toggle:this.toggleSetPasswordDialog})}),this.state.isResetPasswordDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(te,{resetPassword:this.resetPassword,toggle:this.toggleResetPasswordDialog})}),this.state.isRemovePasswordDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(ne,{removePassword:this.removePassword,toggle:this.toggleRemovePasswordDialog})})]})}}])}(r.Component),le=n(51164),ce=window.app.pageOptions,de=ce.currentLang,he=ce.langList,ue=function(e){function t(){var e;(0,s.A)(this,t);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return(e=(0,i.A)(this,t,[].concat(a))).onSelectChange=function(e){location.href="".concat(m.Yc,"i18n/?lang=").concat(e.value)},e}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=he.map((function(e,t){return{value:e.langCode,label:e.langName}}));return(0,f.jsxs)("div",{className:"setting-item",id:"lang-setting",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Language Setting")}),(0,f.jsx)(le.by,{className:"language-selector",value:{value:de.langCode,label:de.langName},options:e,onChange:this.onSelectChange})]})}}])}(r.Component),me=ue,pe=function(e){function t(e){var n;(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).handleInputChange=function(e){var t=e.target.checked;n.setState({inputChecked:t}),n.props.updateUserInfo({list_in_address_book:t.toString()})};var a=n.props.userInfo.list_in_address_book;return n.state={inputChecked:a},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.state.inputChecked;return(0,f.jsxs)("div",{className:"setting-item",id:"list-in-address-book",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Global Address Book")}),(0,f.jsxs)("div",{className:"d-flex align-items-center",children:[(0,f.jsx)("input",{type:"checkbox",id:"list-in-address-book",name:"list_in_address_book",className:"mr-1",checked:e,onChange:this.handleInputChange}),(0,f.jsx)("label",{htmlFor:"list-in-address-book",className:"m-0",children:(0,m.AP)("List your account in global address book, so that others can find you by typing your name.")})]})]})}}])}(r.Component),ge=pe,fe=window.app.pageOptions,Ae=fe.fileUpdatesEmailInterval,xe=fe.collaborateEmailInterval,ve=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).inputFileUpdatesEmailIntervalChange=function(e){e.target.checked&&n.setState({fileUpdatesEmailInterval:parseInt(e.target.value)})},n.inputCollaborateEmailIntervalChange=function(e){e.target.checked&&n.setState({collaborateEmailInterval:parseInt(e.target.value)})},n.formSubmit=function(e){e.preventDefault();var t=n.state,s=t.fileUpdatesEmailInterval,a=t.collaborateEmailInterval;p.e.updateEmailNotificationInterval(s,a).then((function(e){g.A.success((0,m.AP)("Email notification updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.fileUpdatesOptions=[{interval:0,text:(0,m.AP)("Don't send emails")},{interval:3600,text:(0,m.AP)("Per hour")},{interval:14400,text:(0,m.AP)("Per 4 hours")},{interval:86400,text:(0,m.AP)("Per day")},{interval:604800,text:(0,m.AP)("Per week")}],n.collaborateOptions=[{interval:0,text:(0,m.AP)("Don't send emails")},{interval:3600,text:(0,m.AP)("Per hour")+" ("+(0,m.AP)("If notifications have not been read within one hour, they will be sent to your mailbox.")+")"}],n.state={fileUpdatesEmailInterval:Ae,collaborateEmailInterval:xe},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this,t=this.state,n=t.fileUpdatesEmailInterval,s=t.collaborateEmailInterval;return(0,f.jsxs)("div",{className:"setting-item",id:"email-notice",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Email Notification")}),(0,f.jsxs)("form",{method:"post",action:"",id:"set-email-notice-interval-form",onSubmit:this.formSubmit,children:[(0,f.jsx)("h4",{className:"h6",children:(0,m.AP)("Notifications of file changes")}),(0,f.jsx)("p",{className:"mb-1",children:(0,m.AP)("The list of added, deleted and modified files will be sent to your mailbox.")}),this.fileUpdatesOptions.map((function(t,s){return(0,f.jsxs)("div",{className:"d-flex",children:[(0,f.jsx)("input",{type:"radio",name:"file-interval",value:t.interval,id:"file-updates-interval-option-".concat(s+1),checked:n==t.interval,onChange:e.inputFileUpdatesEmailIntervalChange}),(0,f.jsx)("label",{className:"m-0 ml-2",htmlFor:"file-updates-interval-option-".concat(s+1),children:t.text})]},"file-updates-".concat(s))})),(0,f.jsx)("h4",{className:"mt-3 h6",children:(0,m.AP)("Notifications of collaboration")}),(0,f.jsx)("p",{className:"mb-1",children:(0,m.AP)("Whether the notifications of collaboration such as sharing library or joining group should be sent to your mailbox.")}),this.collaborateOptions.map((function(t,n){return(0,f.jsxs)("div",{className:"d-flex align-items-start",children:[(0,f.jsx)("input",{type:"radio",name:"col-interval",value:t.interval,className:"mt-1",id:"collaborate-interval-option-".concat(n+1),checked:s==t.interval,onChange:e.inputCollaborateEmailIntervalChange}),(0,f.jsx)("label",{className:"m-0 ml-2",htmlFor:"collaborate-interval-option-".concat(n+1),children:t.text})]},"collaborate-".concat(n))})),(0,f.jsx)("button",{type:"submit",className:"btn btn-outline-primary mt-4",children:(0,m.AP)("Submit")})]})]})}}])}(r.Component),je=ve,we=window.app.pageOptions,be=we.defaultDevice,Pe=we.backupTokens,ke=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).renderEnabled=function(){return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsx)("p",{className:"mb-2",children:(0,m.AP)("Status: enabled")}),(0,f.jsx)("a",{className:"btn btn-outline-primary mb-4",href:"".concat(m.Yc,"profile/two_factor_authentication/disable/"),children:(0,m.AP)("Disable Two-Factor Authentication")}),(0,f.jsxs)("p",{className:"mb-2",children:[(0,m.AP)("If you don't have any device with you, you can access your account using backup codes."),1==Pe?(0,m.AP)("You have only one backup code remaining."):(0,m.AP)("You have {num} backup codes remaining.").replace("{num}",Pe)]}),(0,f.jsx)("a",{href:"".concat(m.Yc,"profile/two_factor_authentication/backup/tokens/"),className:"btn btn-outline-primary",children:(0,m.AP)("Show Codes")})]})},n.renderDisabled=function(){return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsx)("p",{className:"mb-2",children:(0,m.AP)("Two-factor authentication is not enabled for your account. Enable two-factor authentication for enhanced account security.")}),(0,f.jsx)("a",{href:"".concat(m.Yc,"profile/two_factor_authentication/setup/"),className:"btn btn-outline-primary",children:(0,m.AP)("Enable Two-Factor Authentication")})]})},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)("div",{className:"setting-item",id:"two-factor-auth",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Two-Factor Authentication")}),be?this.renderEnabled():this.renderDisabled()]})}}])}(r.Component),Ce=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).disconnect=function(){n.form.current.submit()},n.form=r.createRef(),n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.formActionURL,n=e.csrfToken,s=e.toggle;return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:s,children:[(0,f.jsx)(_.A,{toggle:s,children:(0,m.AP)("Disconnect")}),(0,f.jsxs)(W.A,{children:[(0,f.jsx)("p",{children:(0,m.AP)("Are you sure you want to disconnect?")}),(0,f.jsx)("form",{ref:this.form,className:"d-none",method:"post",action:t,children:(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:n})})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:s,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.disconnect,children:(0,m.AP)("Disconnect")})]})]})}}])}(r.Component),Se=Ce,ye=window.app.pageOptions,De=ye.csrfToken,Ne=ye.langCode,Oe=ye.socialConnected,Ie=ye.socialNextPage,Me=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).confirmDisconnect=function(){n.setState({isConfirmDialogOpen:!0})},n.toggleDialog=function(){n.setState({isConfirmDialogOpen:!n.state.isConfirmDialogOpen})},n.state={isConfirmDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"setting-item",id:"social-auth",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Social Login")}),(0,f.jsx)("p",{className:"mb-2",children:"zh-cn"==Ne?"\u4f01\u4e1a\u5fae\u4fe1":"WeChat Work"}),Oe?(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.confirmDisconnect,children:(0,m.AP)("Disconnect")}):(0,f.jsx)("a",{href:"".concat(m.Yc,"work-weixin/oauth-connect/?next=").concat(encodeURIComponent(Ie)),className:"btn btn-outline-primary",children:(0,m.AP)("Connect")})]}),this.state.isConfirmDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(Se,{formActionURL:"".concat(m.Yc,"work-weixin/oauth-disconnect/?next=").concat(encodeURIComponent(Ie)),csrfToken:De,toggle:this.toggleDialog})})]})}}])}(r.Component),Te=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).disconnect=function(){n.form.current.submit()},n.form=r.createRef(),n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.formActionURL,n=e.csrfToken,s=e.toggle;return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:s,children:[(0,f.jsx)(_.A,{toggle:s,children:(0,m.AP)("Disconnect")}),(0,f.jsxs)(W.A,{children:[(0,f.jsx)("p",{children:(0,m.AP)("Are you sure you want to disconnect?")}),(0,f.jsx)("form",{ref:this.form,className:"d-none",method:"post",action:t,children:(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:n})})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:s,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.disconnect,children:(0,m.AP)("Disconnect")})]})]})}}])}(r.Component),Ue=Te,Ee=window.app.pageOptions,Ve=Ee.csrfToken,Re=Ee.langCode,Le=Ee.socialConnectedDingtalk,Fe=Ee.socialNextPage,_e=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).confirmDisconnect=function(){n.setState({isConfirmDialogOpen:!0})},n.toggleDialog=function(){n.setState({isConfirmDialogOpen:!n.state.isConfirmDialogOpen})},n.state={isConfirmDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"setting-item",id:"social-auth",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Social Login")}),(0,f.jsx)("p",{className:"mb-2",children:"zh-cn"==Re?"\u9489\u9489":"Dingtalk"}),Le?(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.confirmDisconnect,children:(0,m.AP)("Disconnect")}):(0,f.jsx)("a",{href:"".concat(m.Yc,"dingtalk/connect/?next=").concat(encodeURIComponent(Fe)),className:"btn btn-outline-primary",children:(0,m.AP)("Connect")})]}),this.state.isConfirmDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(Ue,{formActionURL:"".concat(m.Yc,"dingtalk/disconnect/?next=").concat(encodeURIComponent(Fe)),csrfToken:Ve,toggle:this.toggleDialog})})]})}}])}(r.Component),We=window.app.pageOptions,qe=We.csrfToken,Ye=We.isOrgContext,Be=We.orgID,ze=We.samlConnected,Ke=We.enableMultiADFS,Ge=We.orgSamlConnected,He=We.socialNextPage,Je=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).confirmDisconnect=function(){n.setState({isConfirmDialogOpen:!0})},n.disconnect=function(){n.form.current.submit()},n.toggleDialog=function(){n.setState({isConfirmDialogOpen:!n.state.isConfirmDialogOpen})},n.form=r.createRef(),n.state={isConfirmDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=Ke&&Ye?"".concat(m.Yc,"org/custom/").concat(Be,"/saml2/connect/?next=").concat(encodeURIComponent(He)):"".concat(m.Yc,"saml2/connect/?next=").concat(encodeURIComponent(He)),t=Ge&&Ye?"".concat(m.Yc,"org/custom/").concat(Be,"/saml2/disconnect/?next=").concat(encodeURIComponent(He)):"".concat(m.Yc,"saml2/disconnect/?next=").concat(encodeURIComponent(He));return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"setting-item",id:"social-auth",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Social Login")}),(0,f.jsx)("p",{className:"mb-2",children:"SAML"}),ze||Ge&&Ye?(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.confirmDisconnect,children:(0,m.AP)("Disconnect")}):(0,f.jsx)("a",{href:e,className:"btn btn-outline-primary",children:(0,m.AP)("Connect")})]}),this.state.isConfirmDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:this.toggleDialog,children:[(0,f.jsx)(_.A,{toggle:this.toggleDialog,children:(0,m.AP)("Disconnect")}),(0,f.jsxs)(W.A,{children:[(0,f.jsx)("p",{children:(0,m.AP)("Are you sure you want to disconnect?")}),(0,f.jsx)("form",{ref:this.form,className:"d-none",method:"post",action:t,children:(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:qe})})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:this.toggleDialog,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.disconnect,children:(0,m.AP)("Disconnect")})]})]})})]})}}])}(r.Component),Qe=n(4159),Xe=n.n(Qe),Ze=n(37609),$e=n.n(Ze),et=n(19260),tt=n(6030),nt=n(68879),st=n(21870);Xe().extend($e());var at=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.loading,n=e.errorMsg,s=e.items;if(t)return(0,f.jsx)("span",{className:"loading-icon loading-tip"});if(n)return(0,f.jsx)("p",{className:"error text-center",children:n});var a=(0,f.jsx)("p",{children:(0,m.AP)("No linked devices. You have not accessed your files with any client (desktop or mobile) yet. Configure clients on your devices to access your data more comfortably.")}),i=(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{width:"13%",children:(0,m.AP)("Platform")}),(0,f.jsx)("th",{width:"30%",children:(0,m.AP)("Device Name")}),(0,f.jsx)("th",{width:"30%",children:(0,m.AP)("IP")}),(0,f.jsx)("th",{width:"17%",children:(0,m.AP)("Last Access")}),(0,f.jsx)("th",{width:"10%"})]})}),o=(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{width:"92%"}),(0,f.jsx)("th",{width:"8%"})]})}),r=u.Aq.isDesktop();return s.length?(0,f.jsxs)("table",{className:"table-hover ".concat(r?"":"table-thead-hidden"),children:[r?i:o,(0,f.jsx)("tbody",{children:s.map((function(e,t){return(0,f.jsx)(it,{data:e,isDesktop:r},t)}))})]}):a}}])}(r.Component),it=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).toggleOpMenu=function(){n.setState({isOpMenuOpen:!n.state.isOpMenuOpen})},n.handleMouseOver=function(){n.setState({isOpIconShown:!0})},n.handleMouseOut=function(){n.setState({isOpIconShown:!1})},n.toggleDialog=function(){n.setState({isConfirmUnlinkDialogOpen:!n.state.isConfirmUnlinkDialogOpen})},n.handleClick=function(e){if(e.preventDefault(),n.props.data.is_desktop_client)n.toggleDialog();else{n.unlinkDevice(!0)}},n.unlinkDevice=function(e){var t=n.props.data;p.e.unlinkDevice(t.platform,t.device_id,e).then((function(e){n.setState({unlinked:!0});var s=(0,m.AP)("Successfully unlinked %(name)s.");s=s.replace("%(name)s",t.device_name),g.A.success(s)})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.renderDesktop=function(){var e=n.props.data,t="sf3-font-delete1 sf3-font unlink-device action-icon";return t+=n.state.isOpIconShown?"":" invisible",(0,f.jsxs)("tr",{onMouseOver:n.handleMouseOver,onMouseOut:n.handleMouseOut,onFocus:n.handleMouseOver,children:[(0,f.jsx)("td",{children:e.platform}),(0,f.jsx)("td",{children:e.device_name}),(0,f.jsx)("td",{children:e.last_login_ip}),(0,f.jsx)("td",{children:Xe()(e.last_accessed).fromNow()}),(0,f.jsx)("td",{children:(0,f.jsx)("a",{href:"#",className:t,title:(0,m.AP)("Unlink"),role:"button","aria-label":(0,m.AP)("Unlink"),onClick:n.handleClick})})]})},n.renderMobile=function(){var e=n.props.data;return(0,f.jsxs)("tr",{children:[(0,f.jsxs)("td",{children:[e.device_name,(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"item-meta-info",children:e.last_login_ip}),(0,f.jsx)("span",{className:"item-meta-info",children:Xe()(e.last_accessed).fromNow()}),(0,f.jsx)("span",{className:"item-meta-info",children:e.platform})]}),(0,f.jsx)("td",{children:(0,f.jsxs)(et.A,{isOpen:n.state.isOpMenuOpen,toggle:n.toggleOpMenu,children:[(0,f.jsx)(tt.A,{tag:"i",className:"sf-dropdown-toggle sf3-font sf3-font-more-vertical ml-0",title:(0,m.AP)("More operations"),"aria-label":(0,m.AP)("More operations"),"data-toggle":"dropdown","aria-expanded":n.state.isOpMenuOpen}),(0,f.jsxs)("div",{className:n.state.isOpMenuOpen?"":"d-none",onClick:n.toggleOpMenu,children:[(0,f.jsx)("div",{className:"mobile-operation-menu-bg-layer"}),(0,f.jsx)("div",{className:"mobile-operation-menu",children:(0,f.jsx)(nt.A,{className:"mobile-menu-item",onClick:n.handleClick,children:(0,m.AP)("Unlink")})})]})]})})]})},n.state={isOpMenuOpen:!1,isOpIconShown:!1,unlinked:!1,isConfirmUnlinkDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return this.state.unlinked?null:(0,f.jsxs)(r.Fragment,{children:[this.props.isDesktop?this.renderDesktop():this.renderMobile(),this.state.isConfirmUnlinkDialogOpen&&(0,f.jsx)(st.A,{executeOperation:this.unlinkDevice,toggleDialog:this.toggleDialog})]})}}])}(r.Component),ot=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).state={loading:!0,errorMsg:"",items:[]},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"componentDidMount",value:function(){var e=this;p.e.listLinkedDevices().then((function(t){e.setState({loading:!1,items:t.data})})).catch((function(t){e.setState({loading:!1,errorMsg:u.Aq.getErrorMsg(t,!0)})}))}},{key:"render",value:function(){var e=this.state,t=e.loading,n=e.errorMsg,s=e.items;return(0,f.jsxs)("div",{className:"setting-item",id:"linked-devices",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Linked Devices")}),(0,f.jsx)("div",{children:(0,f.jsx)(at,{loading:t,errorMsg:n,items:s})})]})}}])}(r.Component),rt=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).action=function(){n.form.current.submit()},n.form=r.createRef(),n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.formActionURL,n=e.csrfToken,s=e.toggle;return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:s,children:[(0,f.jsx)(_.A,{toggle:s,children:(0,m.AP)("Delete Account")}),(0,f.jsxs)(W.A,{children:[(0,f.jsx)("p",{children:(0,m.AP)("Really want to delete your account?")}),(0,f.jsx)("form",{ref:this.form,className:"d-none",method:"post",action:t,children:(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:n})})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:s,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",onClick:this.action,children:(0,m.AP)("Delete")})]})]})}}])}(r.Component),lt=rt,ct=window.app.pageOptions.csrfToken,dt=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).confirmDelete=function(e){e.preventDefault(),n.setState({isConfirmDialogOpen:!0})},n.toggleDialog=function(){n.setState({isConfirmDialogOpen:!n.state.isConfirmDialogOpen})},n.state={isConfirmDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"setting-item",id:"del-account",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Delete Account")}),(0,f.jsx)("p",{className:"mb-2",children:(0,m.AP)("This operation will not be reverted. Please think twice!")}),(0,f.jsx)("button",{type:"button",className:"btn btn-outline-primary",onClick:this.confirmDelete,children:(0,m.AP)("Delete")})]}),this.state.isConfirmDialogOpen&&(0,f.jsx)(F.A,{children:(0,f.jsx)(lt,{formActionURL:"".concat(m.Yc,"profile/delete/"),csrfToken:ct,toggle:this.toggleDialog})})]})}}])}(r.Component),ht=n(5544),ut=n(19247),mt=n(76152),pt=n(55627),gt=n(1858),ft={empty:{classNames:["default","default","default","default"],textValue:""},weak:{classNames:["weak","default","default","default"],textValue:"weak"},medium:{classNames:["medium","medium","default","default"],textValue:"medium"},strong:{classNames:["strong","strong","strong","default"],textValue:"strong"},very_strong:{classNames:["very-strong","very-strong","very-strong","very-strong"],textValue:"very strong"}},At=function(e){var t=e.passwordValue,n=(0,r.useMemo)((function(){return ft[(0,u.OT)(t)]||{}}),[t]),s=n.classNames,a=void 0===s?[]:s,i=n.textValue,o=void 0===i?"":i,l=Array.isArray(a)&&a.length>0?a[0]:"";return(0,f.jsx)("div",{className:"password-strength-check-container",children:(0,f.jsxs)("div",{className:"password-strength-check-box",children:[(0,f.jsxs)("div",{className:"password-strength-value",children:[(0,f.jsxs)("span",{children:[(0,m.AP)("Password strength"),": "]}),(0,f.jsx)("span",{className:l,children:(0,m.AP)(o)})]}),(0,f.jsx)(gt.A,{multi:!0,children:a.map((function(e,t){return(0,f.jsx)(gt.A,{bar:!0,className:e,value:"25"},t)}))}),(0,f.jsx)("div",{className:"password-strength-description",children:(0,f.jsx)("span",{children:(0,m.AP)("Password must be at least 8 characters long and contain different characters: uppercase letters, lowercase letters, numbers, and special symbols")})})]})})},xt=function(e){var t=e.value,n=e.labelValue,s=e.enableCheckStrength,a=e.onChangeValue,i=(0,r.useState)(t||""),o=(0,ht.A)(i,2),l=o[0],c=o[1],d=(0,r.useState)(!1),h=(0,ht.A)(d,2),m=h[0],p=h[1],g=(0,r.useState)(!1),A=(0,ht.A)(g,2),x=A[0],v=A[1];return(0,f.jsxs)(mt.A,{className:w()("password-input-container position-relative",{mobile:u.Fr}),children:[(0,f.jsx)(pt.A,{children:n}),(0,f.jsxs)(q.A,{className:"password",children:[(0,f.jsx)(Y.A,{type:m?"text":"password",value:t,onChange:function(e){var t=e.target.value;a(t),c(t)},onFocus:function(){s&&v(!0)},onBlur:function(){s&&v(!1)}}),x&&s&&(0,f.jsx)(At,{passwordValue:l}),(0,f.jsx)(B.A,{addonType:"append",children:(0,f.jsx)(z.A,{onClick:function(){return p(!m)},children:(0,f.jsx)("i",{className:"password-icon sf3-font sf3-font-eye".concat(m?"":"-slash")})})})]})]})};xt.defaultProps={enableCheckStrength:!0};var vt=xt,jt=n(71361),wt=function(e){var t=e.toggle,n=(0,r.useState)(""),s=(0,ht.A)(n,2),a=s[0],i=s[1],o=(0,r.useState)(""),l=(0,ht.A)(o,2),c=l[0],d=l[1],p=(0,r.useState)(""),A=(0,ht.A)(p,2),x=A[0],v=A[1],j=(0,r.useState)(!0),w=(0,ht.A)(j,2),b=w[0],P=w[1];return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:t,children:[(0,f.jsx)(_.A,{toggle:t,children:(0,m.AP)("Set password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(ut.A,{children:[(0,f.jsx)(vt,{value:a,labelValue:(0,m.AP)("Password"),onChangeValue:i}),(0,f.jsx)(vt,{value:c,labelValue:(0,m.AP)("Confirm password"),onChangeValue:d,enableCheckStrength:!1})]}),x&&(0,f.jsx)(K.A,{color:"danger",children:x})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:t,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",disabled:!b,onClick:function(){a?c?a===c?(0,u.Oj)(a)?(v(""),P(!1),jt.E.resetPassword(null,a).then((function(){g.A.success((0,m.AP)("Password set")),location.reload(),t()})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t),P(!0)}))):v((0,m.AP)("Insufficient password strength")):v((0,m.AP)("Passwords don't match")):v((0,m.AP)("Please enter the password again")):v((0,m.AP)("Password cannot be blank"))},children:(0,m.AP)("Submit")})]})]})},bt=function(e){var t=e.toggle,n=(0,r.useState)(""),s=(0,ht.A)(n,2),a=s[0],i=s[1],o=(0,r.useState)(""),l=(0,ht.A)(o,2),c=l[0],d=l[1],p=(0,r.useState)(""),A=(0,ht.A)(p,2),x=A[0],v=A[1],j=(0,r.useState)(""),w=(0,ht.A)(j,2),b=w[0],P=w[1],k=(0,r.useState)(!0),C=(0,ht.A)(k,2),S=C[0],y=C[1];return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:t,children:[(0,f.jsx)(_.A,{toggle:t,children:(0,m.AP)("Update password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(ut.A,{children:[(0,f.jsx)(vt,{value:a,labelValue:(0,m.AP)("Current password"),enableCheckStrength:!1,onChangeValue:i}),(0,f.jsx)(vt,{value:c,labelValue:(0,m.AP)("New password"),onChangeValue:d}),(0,f.jsx)(vt,{value:x,labelValue:(0,m.AP)("Confirm password"),onChangeValue:v,enableCheckStrength:!1})]}),b&&(0,f.jsx)(K.A,{color:"danger",children:b})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:t,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",disabled:!S,onClick:function(){a?c?x?c===x?(a===c&&P((0,m.AP)("New password cannot be the same as old password")),(0,u.Oj)(c)?(P(""),y(!1),jt.E.resetPassword(a,c).then((function(){g.A.success((0,m.AP)("Password updated")),t()})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t),y(!0)}))):P((0,m.AP)("Insufficient password strength"))):P((0,m.AP)("Passwords don't match")):P((0,m.AP)("Please enter the password again")):P((0,m.AP)("Password cannot be blank")):P((0,m.AP)("Current password cannot be blank"))},children:(0,m.AP)("Submit")})]})]})},Pt=(n(16322),n(18291),n(81848),n(30923),window.app.pageOptions),kt=Pt.canUpdatePassword,Ct=Pt.passwordOperationText,St=Pt.enableGetAuthToken,yt=Pt.enableWebdavSecret,Dt=Pt.enableAddressBook,Nt=Pt.twoFactorAuthEnabled,Ot=Pt.enableWechatWork,It=Pt.enableDingtalk,Mt=Pt.isOrgContext,Tt=Pt.enableADFS,Ut=Pt.enableMultiADFS,Et=Pt.enableDeleteAccount,Vt=Pt.userUnusablePassword,Rt=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).updateUserInfo=function(e){p.e.updateUserInfo(e).then((function(e){n.setState({userInfo:e.data}),g.A.success((0,m.AP)("User info updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.handleContentScroll=function(e){var t=e.target.scrollTop,s=n.sideNavItems.filter((function(e,n){return e.show&&document.getElementById(e.href.substr(1)).offsetTop-45<t}));s.length&&n.setState({curItemID:s[s.length-1].href.substr(1)})},n.onCloseSidePanel=function(){n.setState({isSidePanelClosed:!n.state.isSidePanelClosed})},n.onShowSidePanel=function(){n.setState({isSidePanelClosed:!n.state.isSidePanelClosed})},n.toggleSidePanel=function(){n.setState({isSidePanelClosed:!n.state.isSidePanelClosed})},n.toggleSetPassword=function(){n.setState({isSetPasswordDialogOpen:!n.state.isSetPasswordDialogOpen})},n.toggleUpdatePassword=function(){n.setState({isUpdatePasswordDialogOpen:!n.state.isUpdatePasswordDialogOpen})},n.togglePassword=function(){Vt?n.toggleSetPassword():n.toggleUpdatePassword()},n.sideNavItems=[{show:!0,href:"#user-basic-info",text:(0,m.AP)("Profile")},{show:kt,href:"#update-user-passwd",text:(0,m.AP)("Password")},{show:St,href:"#get-auth-token",text:(0,m.AP)("Web API Auth Token")},{show:yt,href:"#update-webdav-passwd",text:(0,m.AP)("WebDav Access")},{show:Dt,href:"#list-in-address-book",text:(0,m.AP)("Global Address Book")},{show:!0,href:"#lang-setting",text:(0,m.AP)("Language")},{show:m.am,href:"#email-notice",text:(0,m.AP)("Email Notification")},{show:Nt,href:"#two-factor-auth",text:(0,m.AP)("Two-Factor Authentication")},{show:Ot||It||Tt||Ut||Mt,href:"#social-auth",text:(0,m.AP)("Social Login")},{show:!0,href:"#linked-devices",text:(0,m.AP)("Linked Devices")},{show:Et,href:"#del-account",text:(0,m.AP)("Delete Account")}],n.state={isSidePanelClosed:!1,curItemID:n.sideNavItems[0].href.substr(1),isSetPasswordDialogOpen:!1,isUpdatePasswordDialogOpen:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"componentDidMount",value:function(){var e=this;p.e.getUserInfo().then((function(t){e.setState({userInfo:t.data})})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))}},{key:"render",value:function(){var e=this.state.isSidePanelClosed;return(0,f.jsxs)("div",{id:"main",className:"h-100",children:[(0,f.jsx)(k,{isSidePanelClosed:e,onCloseSidePanel:this.onCloseSidePanel,data:this.sideNavItems,curItemID:this.state.curItemID}),(0,f.jsxs)(x,{children:[(0,f.jsx)(y,{onShowSidePanel:this.onShowSidePanel,showSearch:!1}),(0,f.jsx)("div",{className:"main-panel-center flex-row",children:(0,f.jsxs)("div",{className:"cur-view-container",children:[(0,f.jsx)("div",{className:"cur-view-path",children:(0,f.jsx)("h3",{className:"sf-heading m-0",children:(0,m.AP)("Settings")})}),(0,f.jsxs)("div",{className:"cur-view-content content position-relative",onScroll:this.handleContentScroll,children:[(0,f.jsxs)("div",{id:"user-basic-info",className:"setting-item",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Profile Setting")}),(0,f.jsx)(I,{}),this.state.userInfo&&(0,f.jsx)(R,{userInfo:this.state.userInfo,updateUserInfo:this.updateUserInfo})]}),kt&&(0,f.jsxs)("div",{id:"update-user-passwd",className:"setting-item",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Password")}),(0,f.jsx)("button",{className:"btn btn-outline-primary ml-2 mb-2",onClick:this.togglePassword,children:Ct})]}),St&&(0,f.jsx)(L,{}),yt&&(0,f.jsx)(re,{}),Dt&&this.state.userInfo&&(0,f.jsx)(ge,{userInfo:this.state.userInfo,updateUserInfo:this.updateUserInfo}),(0,f.jsx)(me,{}),(m.am||!m.Ez)&&(0,f.jsx)(je,{}),Nt&&(0,f.jsx)(ke,{}),Ot&&(0,f.jsx)(Me,{}),It&&(0,f.jsx)(_e,{}),(Tt||Ut&&Mt)&&(0,f.jsx)(Je,{}),(0,f.jsx)(ot,{}),Et&&(0,f.jsx)(dt,{})]})]})})]}),(0,f.jsx)(d(),{query:"(max-width: 767.8px)",children:(0,f.jsx)(h.A,{zIndex:"1030",isOpen:!e,toggle:this.toggleSidePanel,contentClassName:"d-none"})}),this.state.isSetPasswordDialogOpen&&(0,f.jsx)(wt,{toggle:this.toggleSetPassword}),this.state.isUpdatePasswordDialogOpen&&(0,f.jsx)(bt,{toggle:this.toggleUpdatePassword})]})}}])}(r.Component);l.render((0,f.jsx)(Rt,{}),document.getElementById("wrapper"))},30923:function(){}},function(e){e.O(0,[4223],(function(){return t=57208,e(e.s=t);var t}));e.O()}]);