/home/ivoiecob/email.hirewise-va.com/static/js/7565.app.8feeadbe9f830b5b5d30.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[7565],{"2dqB":(e,t,i)=>{var s=i("a7T2"),o=i("p09A"),r=i("69av");function n(){r.call(this),this.fCallback=null,this.name=o.observable(""),this.focused=o.observable(!1),this.error=o.observable(""),this.name.subscribe(function(){this.error("")},this)}s.extendOwn(n.prototype,r.prototype),n.prototype.PopupTemplate="FilesWebclient_RenamePopup",n.prototype.onOpen=function(e,t){this.fCallback=t,this.name(e),this.focused(!0),this.error("")},n.prototype.onOKClick=function(){if(this.error(""),s.isFunction(this.fCallback)){var e=this.fCallback(this.name());e?this.error(e):setTimeout(function(){this.closePopup()}.bind(this))}else setTimeout(function(){this.closePopup()}.bind(this))},e.exports=new n},"5njy":(e,t,i)=>{var s=i("8QQh"),o=i("aSuo");s.registerAbortRequestHandler(o.ServerModuleName,function(e,t){return"GetFiles"===e.Method&&"GetFiles"===t.Method}),e.exports={send:function(e,t,i,r){s.send(o.ServerModuleName,e,t,i,r)},sendToWebclient:function(e,t,i,o){s.send("FilesWebclient",e,t,i,o)}}},DSoz:(e,t,i)=>{var s=i("a7T2"),o=i("M4cL"),r=i("p09A"),n=i("ERH9"),l=i("uQaC"),h=i("yU9o"),a=i("/Odb"),c=i("PMEU");function u(e,t,i,l,a,c,u,d,p,f,m){this.active=r.observable(!1),this.fSelectCallback=t||function(){},this.fDeleteCallback=i||function(){},this.fDblClickCallback=!h.isMobile()&&l?l:function(){},this.fEnterCallback=a||function(){},this.bResetCheckedOnClick=!!u,this.bCheckOnSelect=!!d,this.bUnselectOnCtrl=!!p,this.bDisableMultiplySelection=!!f,this.bChangeOnSelect=void 0===m||!!m,this.useKeyboardKeys=r.observable(!1),this.list=r.observableArray([]),e&&e.subscribe&&e.subscribe(function(e){this.list(e)},this),this.multiplyLineFactor=c,this.oLast=null,this.oListScope=null,this.oScrollScope=null,this.iTimer=0,this.iFactor=1,this.KeyUp=Enums.Key.Up,this.KeyDown=Enums.Key.Down,this.KeyLeft=Enums.Key.Up,this.KeyRight=Enums.Key.Down,this.multiplyLineFactor&&(this.multiplyLineFactor.subscribe?this.multiplyLineFactor.subscribe(function(e){this.iFactor=0<e?e:1},this):this.iFactor=n.pInt(this.multiplyLineFactor),this.KeyUp=Enums.Key.Up,this.KeyDown=Enums.Key.Down,this.KeyLeft=Enums.Key.Left,this.KeyRight=Enums.Key.Right,o("html").hasClass("rtl")&&(this.KeyLeft=Enums.Key.Right,this.KeyRight=Enums.Key.Left)),this.sActionSelector="",this.sSelectableSelector="",this.sCheckboxSelector="";var y=this;this.listChecked=r.computed({read:function(){return s.filter(this.list(),function(e){var t=e&&e.checked&&e.checked(),i=e&&e.selected&&e.selected();return t||y.bCheckOnSelect&&i})},write:function(e){e=!!e,s.each(this.list(),function(t){t.checked(e)}),this.list.valueHasMutated()},owner:this}),this.checkAll=r.computed({read:function(){return 0<this.listChecked().length},write:function(e){this.listChecked(!!e)},owner:this}),this.selectorHook=r.observable(null),this.selectorHook.subscribe(function(){this.active()&&this.selectorHook()&&this.selectorHook().selected(!1)},this,"beforeChange"),this.selectorHook.subscribe(function(){this.active()&&this.selectorHook()&&this.selectorHook().selected(!0)},this),this.itemSelected=r.computed({read:this.selectorHook,write:function(e){this.selectorHook(e),e&&(y.scrollToSelected(),this.oLast=e)},owner:this}),this.list.subscribe(function(e){var t=this.itemSelected();Array.isArray(e)&&t&&e.find(function(e){return"function"==typeof t.isEqual?t.isEqual(e):t===e})||this.itemSelected(null)},this),this.listCheckedOrSelected=r.computed({read:function(){var e=this.itemSelected(),t=this.listChecked();return 0<t.length?t:e?[e]:[]},write:function(e){e?this.listChecked(!0):(this.itemSelected(null),this.listChecked(!1))},owner:this}),this.listCheckedAndSelected=r.computed({read:function(){var e=[],t=this.itemSelected(),i=this.listChecked();return i&&(e=i.slice(0)),t&&-1===s.indexOf(i,t)&&e.push(t),e},write:function(e){e?this.listChecked(!0):(this.itemSelected(null),this.listChecked(!1))},owner:this}),this.isIncompleteChecked=r.computed(function(){var e=this.list().length,t=this.listChecked().length;return 0<e&&0<t&&e>t},this),this.onKeydownBound=s.bind(this.onKeydown,this)}u.prototype.iTimer=0,u.prototype.bResetCheckedOnClick=!1,u.prototype.bCheckOnSelect=!1,u.prototype.bUnselectOnCtrl=!1,u.prototype.bDisableMultiplySelection=!1,u.prototype.getLastOrSelected=function(){var e=0,t=null;return s.each(this.list(),function(i){i&&s.isFunction(i.checked)&&(i.checked()&&e++,i.selected()&&(t=i))}),0===e&&t?t:this.oLast},u.prototype.unbind=function(){this.active(!1),this.itemSelected()&&this.itemSelected().selected(!1),o(document).off("keydown",this.onKeydownBound),o(this.oListScope).off()},u.prototype.initOnApplyBindings=function(e,t,i,s,n){this.active(!0),o(document).on("keydown",this.onKeydownBound),this.oListScope=s,this.oScrollScope=n,this.sActionSelector=e,this.sSelectableSelector=t,this.sCheckboxSelector=i;var l=this,h=function(e,t,i){var s=0,o=0,r=null,n=!1,h=!1,a=[],c=!1;if(t=t||null,i&&i.shiftKey&&null!==t&&null!==e&&t!==e)for(a=l.list(),c=t.checked(),s=0,o=a.length;s<o;s++)n=!1,(r=a[s])!==e&&r!==t||(n=!0),n&&(h=!h),(h||n)&&r&&r.checked&&r.checked(c);t&&(l.oLast=t)};o(this.oListScope).on("dblclick",e,function(e){var t=r.dataFor(this);!t||!e||e.ctrlKey||e.altKey||e.shiftKey||l.onDblClick(t)}),a.mobileDevice&&o(this.oListScope).on("touchstart",e,function(e){if(e){var t=e.timeStamp,i=t-(o(this).data("lastTouch")||t),s=e.originalEvent&&e.originalEvent.touches?e.originalEvent.touches.length:0;o(this).data("lastTouch",t),!i||i>250||s>1||(e.preventDefault(),o(this).trigger("dblclick"))}}),o(this.oListScope).on("click",e,function(e){var t=!0,i=null,s=l.getLastOrSelected(),o=r.dataFor(this);o&&e&&(e.shiftKey?(t=!1,l.bDisableMultiplySelection||(null===l.oLast&&(l.oLast=o),o.checked(!o.checked()),h(s,o,e))):(e.ctrlKey||e.metaKey)&&(t=!1,l.bDisableMultiplySelection||(l.oLast=o,!(i=l.itemSelected())||i.checked()||o.checked()||i.checked(!0),l.bUnselectOnCtrl&&o===l.itemSelected()?(o.checked(!o.selected()),l.itemSelected(null)):o.checked(!o.checked()))),t&&l.selectionFunc(o))}),o(this.oListScope).on("click",i,function(e){var t=r.dataFor(this);t&&e&&!l.bDisableMultiplySelection&&(e.shiftKey?(null===l.oLast&&(l.oLast=t),h(l.getLastOrSelected(),t,e)):l.oLast=t),e&&e.stopPropagation&&e.stopPropagation()}),o(this.oListScope).on("dblclick",i,function(e){e&&e.stopPropagation&&e.stopPropagation()})},u.prototype.getResultSelection=function(e,t){var i=this,r=!1,n=!1,l=null,h=this.iFactor,a=!!this.multiplyLineFactor,c=0,u=0,d=[];if(!e&&-1<o.inArray(t,[this.KeyUp,this.KeyDown,this.KeyLeft,this.KeyRight,Enums.Key.PageUp,Enums.Key.PageDown,Enums.Key.Home,Enums.Key.End]))(d=this.list())&&0<d.length&&(-1<o.inArray(t,[this.KeyDown,this.KeyRight,Enums.Key.PageUp,Enums.Key.Home])?l=d[0]:-1<o.inArray(t,[this.KeyUp,this.KeyLeft,Enums.Key.PageDown,Enums.Key.End])&&(l=d[d.length-1]));else if(e&&0<(u=(d=this.list())?d.length:0))if(Enums.Key.Home===t||Enums.Key.PageUp===t||Enums.Key.End===t||Enums.Key.PageDown===t||a&&(Enums.Key.Left===t||Enums.Key.Right===t)||!a&&(Enums.Key.Up===t||Enums.Key.Down===t))s.each(d,function(s){if(!r)switch(t){case i.KeyUp:case i.KeyLeft:e===s?r=!0:l=s;break;case Enums.Key.Home:case Enums.Key.PageUp:l=s,r=!0;break;case i.KeyDown:case i.KeyRight:n?(l=s,r=!0):e===s&&(n=!0);break;case Enums.Key.End:case Enums.Key.PageDown:l=s}});else if(a&&this.KeyDown===t){for(;c<u;c++)if(e===d[c]){u-1<(c+=h)&&(c-=h),l=d[c];break}}else if(a&&this.KeyUp===t)for(c=u;c>=0;c--)if(e===d[c]){0>(c-=h)&&(c+=h),l=d[c];break}return l},u.prototype.shiftClickResult=function(e,t,i){if(t){var r=!!this.multiplyLineFactor,n=!1,l=!1;-1<o.inArray(i,r?[Enums.Key.Left,Enums.Key.Right]:[Enums.Key.Up,Enums.Key.Down])?t.checked(!t.checked()):-1<o.inArray(i,r?[Enums.Key.Up,Enums.Key.Down,Enums.Key.PageUp,Enums.Key.PageDown,Enums.Key.Home,Enums.Key.End]:[Enums.Key.Left,Enums.Key.Right,Enums.Key.PageUp,Enums.Key.PageDown,Enums.Key.Home,Enums.Key.End])&&(l=!t.checked(),s.each(this.list(),function(i){var s=!1;i!==e&&t!==i||(n=!n,s=!0),(n||s)&&(i.checked(l),s=!1)}),r&&e&&(i===Enums.Key.Up||i===Enums.Key.Down)&&e.checked(!e.checked()))}},u.prototype.clickNewSelectPosition=function(e,t){var i=this.itemSelected(),s=this.getResultSelection(i,e);s&&(t&&this.shiftClickResult(s,i,e),this.selectionFunc(s))},u.prototype.onKeydown=function(e){var t=!0,i=0;return this.useKeyboardKeys()&&e&&!l.isTextFieldFocused()&&!c.hasOpenedMaximizedPopups()&&(i=e.keyCode,e.ctrlKey||this.KeyUp!==i&&this.KeyDown!==i&&this.KeyLeft!==i&&this.KeyRight!==i&&Enums.Key.PageUp!==i&&Enums.Key.PageDown!==i&&Enums.Key.Home!==i&&Enums.Key.End!==i?Enums.Key.Del!==i||e.ctrlKey||e.shiftKey?Enums.Key.Enter===i?0<this.list().length&&!e.ctrlKey&&(this.onEnter(this.itemSelected()),t=!1):!e.ctrlKey||e.altKey||e.shiftKey||Enums.Key.a!==i||(this.checkAll(!(this.checkAll()&&!this.isIncompleteChecked())),t=!1):0<this.list().length&&(this.onDelete(),t=!1):(this.clickNewSelectPosition(i,e.shiftKey),t=!1)),t},u.prototype.onDelete=function(){this.fDeleteCallback.call(this,this.listCheckedOrSelected())},u.prototype.onEnter=function(e){e&&this.fEnterCallback.call(this,e)},u.prototype.selectionFunc=function(e){this.bChangeOnSelect&&this.itemSelected(null),this.bResetCheckedOnClick&&this.listChecked(!1),this.bChangeOnSelect&&this.itemSelected(e),this.fSelectCallback.call(this,e)},u.prototype.onDblClick=function(e){this.fDblClickCallback.call(this,e)},u.prototype.koCheckAll=function(){return r.computed({read:this.checkAll,write:this.checkAll,owner:this})},u.prototype.koCheckAllIncomplete=function(){return r.computed({read:this.isIncompleteChecked,write:this.isIncompleteChecked,owner:this})},u.prototype.scrollToSelected=function(){if(!(this.oListScope&&this.oScrollScope&&this.oScrollScope[0]&&this.oScrollScope[0].isConnected))return!1;var e=o(this.sSelectableSelector,this.oScrollScope),t=e[0]?e[0].offsetTop:void 0,i=this.oScrollScope.height(),s=this.oScrollScope.scrollTop(),r=e.outerHeight();return!(t&&t>=s&&t<=s+i-r||(t<s+i&&t+r>s+i?this.oScrollScope.scrollTop(t+r+20-i):this.oScrollScope.scrollTop(t-20),0))},e.exports=u},Ui65:(e,t,i)=>{var s=i("a7T2"),o=i("ERH9"),r=i("aSuo"),n={};function l(e){return"p."===e.substr(0,2)}n.getFiles=function(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=[r.HashModuleName];return e&&""!==e&&o.push(e),t&&""!==t&&o.push("p."+t),i&&""!==i&&o.push("s."+i),s&&s.prefix&&o.push(s.prefix+s.value),o},n.parseFiles=function(e){var t=0,i="personal",s="",r="";return o.isNonEmptyArray(e)&&(e.length>t&&!l(e[t])&&(i=o.pString(e[t]),t++),e.length>t&&l(e[t])&&(s=o.pString(e[t].substr(2)),t++),e.length>t&&"s."===e[t].substr(0,2)&&(r=o.pString(e[t].substr(2)),t++)),n.getParsedParams(i,s,r,e[t])},n.getParsedParams=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=[],l="";return o.isNonEmptyString(t)?l=(n=s.without(t.split(/(?:\/|\$ZIP\:)/g),""))[n.length-1]:t="",{Storage:e,Path:t,PathParts:n,Name:l,Search:i,Custom:r}},e.exports=n},WJcO:(e,t,i)=>{var s=i("a7T2"),o=i("p09A"),r=i("69av");function n(){r.call(this),this.fCallback=null,this.folderName=o.observable(""),this.folderName.focus=o.observable(!1),this.folderName.error=o.observable(""),this.folderName.subscribe(function(){this.folderName.error("")},this)}s.extendOwn(n.prototype,r.prototype),n.prototype.PopupTemplate="FilesWebclient_CreateFolderPopup",n.prototype.onOpen=function(e){this.folderName(""),this.folderName.focus(!0),this.folderName.error(""),s.isFunction(e)&&(this.fCallback=e)},n.prototype.onOKClick=function(){if(this.folderName.error(""),this.fCallback){var e=this.fCallback(this.folderName());e?this.folderName.error(""+e):setTimeout(function(){this.closePopup()}.bind(this))}else setTimeout(function(){this.closePopup()}.bind(this))},e.exports=new n},a2fk:(e,t,i)=>{var s=i("a7T2"),o=i("p09A"),r=i("LKDt"),n=i("ERH9"),l=i("yU9o"),h=i("LIBG"),a=i("ebd4"),c=i("pJZ0");function u(e){this.oParent=e,this.IS_FOLDER=!0,this.selected=o.observable(!1),this.checked=o.observable(!1),this.deleted=o.observable(!1),this.recivedAnim=o.observable(!1).extend({autoResetToFalse:500}),this.published=o.observable(!1),this.fileName=o.observable(""),this.sLastModified=0,this.iLastModified=0,this.fullPath=o.observable(""),this.path=o.observable(""),this.storageType=o.observable(Enums.FileStorageType.Personal),this.id=o.observable(""),this.sMainAction="list",this.sOwnerName="",this.sInitiator="",this.oExtendedProps={},this.sharedWithMeAccessReshare=o.observable(!1),this.sharedWithMeAccessWrite=o.observable(!1),this.sharedWithMe=o.observable(!1),this.sharedWithOthers=o.observable(!1),this.favorite=o.observable(!1),this.readOnly=o.computed(function(){return this.sharedWithMe()&&!this.sharedWithMeAccessWrite()},this),this.uploadingFilesCount=o.observable(0),this.uploadedFilesCount=o.observable(0),this.progressPercent=o.computed(function(){return this.uploadingFilesCount()>0?Math.floor(this.uploadedFilesCount()/this.uploadingFilesCount()*100):0},this),this.isIncomplete=o.computed(function(){return this.uploadingFilesCount()>0},this),this.uploaded=o.computed(function(){return 0===this.uploadingFilesCount()},this),this.allowDrag=o.computed(function(){return!e.bInPopup&&!this.isIncomplete()&&!l.isPublic()},this),this.allowDrop=o.computed(function(){if(!this.oParent.bInPopup&&!this.isIncomplete()){var e=this.oParent.sharedParentFolder();if(e)return e.sharedWithMeAccessWrite();if(this.storageType()!==Enums.FileStorageType.Shared)return!this.sharedWithMe()||this.sharedWithMeAccessWrite()&&(!this.oParent.selectedHasShared()||this.oParent.needToCopyDraggedItems())}return!1},this)}s.extendOwn(u.prototype,c),u.prototype.parse=function(e){this.published(!!e.Published),this.fileName(n.pString(e.Name)),this.fullPath(n.pString(e.FullPath)),this.path(n.pString(e.Path)),this.storageType(n.pString(e.Type)),this.id(n.pString(e.Id)),this.favorite(n.pBool(e.IsFavorite)),e.MainAction&&(this.sMainAction=n.pString(e.MainAction)),this.sLastModified=u.parseLastModified(e.LastModified),this.iLastModified=n.pInt(e.LastModified),this.sOwnerName=n.pString(e.Owner),this.sInitiator=n.pString(e.Initiator,this.sOwnerName),this.oExtendedProps=n.pObject(e.ExtendedProps),this.parseExtendedProps(),this.displayName=o.computed(function(){return this.storageType()!==Enums.FileStorageType.Shared||this.oParent.sharedParentFolder()?this.fileName():this.fullPath().replace(/^\//,"")},this),this.sHeaderText=function(){return this.sharedWithMe()&&this.sInitiator?r.i18n("FILESWEBCLIENT/INFO_SHARED_BY",{OWNER:this.sInitiator}):""}.bind(this)(),l.broadcastEvent("FilesWebclient::ParseFolder::after",[this,e])},u.parseLastModified=function(e){var t=new a;return e?(t.parse(e),t.getShortDate()):""},u.prototype.getMainAction=function(){return this.sMainAction},u.prototype.increaseUploadingFiles=function(){return this.uploadingFilesCount(this.uploadingFilesCount()+1)},u.prototype.increaseUploadedFiles=function(){return this.uploadedFilesCount(this.uploadedFilesCount()+1)},u.prototype.eventDragStart=h.prototype.eventDragStart,e.exports=u},aSuo:(e,t,i)=>{var s=i("a7T2"),o=i("ERH9");e.exports={ServerModuleName:"Files",CorporateServerModuleName:"CorporateFiles",PersonalServerModuleName:"PersonalFiles",HashModuleName:"files",Storages:[],EnableUploadSizeLimit:!1,PublicFolderName:"",PublicHash:"",UploadSizeLimitMb:0,UserSpaceLimitMb:0,TenantSpaceLimitMb:0,CorporateSpaceLimitMb:0,AllowTrash:!1,AllowFavorites:!1,EditFileNameWithoutExtension:!1,ShowCommonSettings:!0,ShowFilesApps:!0,BottomLeftCornerLinks:[],CustomTabTitle:"",ShowPersonalFilesAdminSection:!1,ShowCorporateFilesAdminSection:!1,PublicLinksEnabled:!0,Sorting:{Allow:!1},init:function(e){var t=e[this.ServerModuleName],i=e[this.CorporateServerModuleName],r=e.FilesWebclient;s.isEmpty(t)||(this.Storages=o.pArray(t.Storages,this.Storages),this.EnableUploadSizeLimit=o.pBool(t.EnableUploadSizeLimit,this.EnableUploadSizeLimit),this.PublicFolderName=o.pString(t.PublicFolderName,this.PublicFolderName),this.PublicHash=o.pString(t.PublicHash,this.PublicHash),this.UploadSizeLimitMb=o.pNonNegativeInt(t.UploadSizeLimitMb,this.UploadSizeLimitMb),this.UserSpaceLimitMb=o.pNonNegativeInt(t.UserSpaceLimitMb,this.UserSpaceLimitMb),this.TenantSpaceLimitMb=o.pNonNegativeInt(t.TenantSpaceLimitMb,this.TenantSpaceLimitMb),this.AllowTrash=o.pBool(t.AllowTrash,this.AllowTrash),this.AllowFavorites=o.pBool(t.AllowFavorites,this.AllowFavorites)),this.ShowPersonalFilesAdminSection=!0,s.isEmpty(i)||(this.ShowCorporateFilesAdminSection=!0,this.CorporateSpaceLimitMb=o.pNonNegativeInt(i.SpaceLimitMb,this.CorporateSpaceLimitMb)),s.isEmpty(r)||(this.EditFileNameWithoutExtension=o.pBool(r.EditFileNameWithoutExtension,this.EditFileNameWithoutExtension),this.ShowCommonSettings=o.pBool(r.ShowCommonSettings,this.ShowCommonSettings),this.ShowFilesApps=o.pBool(r.ShowFilesApps,this.ShowFilesApps),this.BottomLeftCornerLinks=o.pArray(r.BottomLeftCornerLinks,this.BottomLeftCornerLinks),this.PublicLinksEnabled=o.pBool(r.PublicLinksEnabled,this.PublicLinksEnabled),this.Sorting=this.getSortConfig(o.pObject(r.FilesSortBy)),this.CustomTabTitle=o.pString(r.CustomTabTitle,this.CustomTabTitle))},updateAdmin:function(e,t){this.EnableUploadSizeLimit=e,this.UploadSizeLimitMb=t},updateAdminPersonal:function(e){this.PersonalSpaceLimitMb=e},updateAdminCorporate:function(e){this.CorporateSpaceLimitMb=e},getSortConfig:function(e){return{Allow:o.pBool(null==e?void 0:e.Allow),DisplayOptions:(null==e?void 0:e.DisplayOptions)||[],DefaultSortBy:o.pEnum(Enums.FilesSortField[null==e?void 0:e.DefaultSortBy],Enums.FilesSortField,Enums.FilesSortField.Filename),DefaultSortOrder:o.pEnum(Enums.SortOrder[null==e?void 0:e.DefaultSortOrder],Enums.SortOrder,Enums.SortOrder.Desc)}}}},fnuI:(e,t,i)=>{var s=i("a7T2"),o=i("p09A"),r=i("uQaC"),n=i("69av"),l=i("5njy"),h=i("8ri2");function a(){n.call(this),this.fCallback=null,this.link=o.observable(""),this.linkPrev=o.observable(""),this.linkFocus=o.observable(!1),this.checkTimeout=null,this.urlChecked=o.observable(!1),this.saveCommand=r.createCommand(this,this.executeSave,function(){return this.urlChecked()}),this.fileItem=o.observable(null)}s.extendOwn(a.prototype,n.prototype),a.prototype.PopupTemplate="FilesWebclient_CreateLinkPopup",a.prototype.onOpen=function(e){this.link(""),this.linkFocus(!0),this.fCallback=e,this.checkTimer=setTimeout(s.bind(this.checkUrl,this),2e3)},a.prototype.checkUrl=function(){clearTimeout(this.checkTimer),this.link()!==this.linkPrev()&&(this.linkPrev(this.link()),l.send("CheckUrl",{Url:this.link()},this.onCheckUrlResponse,this)),this.checkTimer=setTimeout(s.bind(this.checkUrl,this),1e3)},a.prototype.onCheckUrlResponse=function(e,t){if(e.Result){var i=h.prepareLinkData(e.Result,this.link()),s=new h(i);this.fileItem(s),this.urlChecked(!0)}},a.prototype.executeSave=function(){s.isFunction(this.fCallback)&&(this.fCallback(this.fileItem()),this.link(""),this.linkPrev(""),this.urlChecked(!1)),clearTimeout(this.checkTimer),this.closePopup()},a.prototype.cancelPopup=function(){this.link(""),this.linkPrev(""),this.urlChecked(!1),clearTimeout(this.checkTimer),this.closePopup()},e.exports=new a},lzoy:(e,t,i)=>{i("a7T2");var s=i("p09A"),o=i("ERH9");function r(e){this.isCurrentStorageDroppable=e,this.isExternal=!1,this.type="",this.displayName="",this.hideInList=!1,this.isDroppable=s.observable(!0),this.droppable=s.computed(function(){return this.isDroppable()&&this.isCurrentStorageDroppable()},this),this.droppableDisabled=s.computed(function(){return!this.droppable()},this)}r.prototype.parse=function(e){this.isExternal=o.pBool(e.IsExternal),this.type=o.pString(e.Type),this.displayName=o.pString(e.DisplayName),this.hideInList=o.pBool(!!e.HideInList),this.isDroppable(o.pBool(e.IsDroppable))},e.exports=r},sISN:(e,t,i)=>{var s=i("a7T2"),o=i("p09A"),r=i("LKDt"),n=i("3cxN"),l=i("Z9uT"),h=i("69av"),a=i("5D2l"),c=i("PMEU"),u=i("5njy"),d=i("a2fk"),p=a.run("ActivityHistory","getShowHistoryPopup");function f(){h.call(this),this.item=null,this.pub=o.observable(""),this.pubFocus=o.observable(!1),this.bAllowShowHistory=!!p}s.extendOwn(f.prototype,h.prototype),f.prototype.PopupTemplate="FilesWebclient_SharePopup",f.prototype.onOpen=function(e){this.item=e,this.pub(""),u.send("CreatePublicLink",{Type:e.storageType(),Path:e.path(),Name:e.fileName(),Size:e instanceof d?0:e.size(),IsFolder:e instanceof d},this.onCreatePublicLinkResponse,this)},f.prototype.onCreatePublicLinkResponse=function(e){e.Result?(this.pub(n.getAppPath()+e.Result),this.pubFocus(!0),this.item.published(!0)):l.showErrorByCode(e,r.i18n("FILESWEBCLIENT/ERROR_CREATE_PUBLIC_LINK"))},f.prototype.onCancelSharingClick=function(){this.item&&(u.send("DeletePublicLink",{Type:this.item.storageType(),Path:this.item.path(),Name:this.item.fileName()},function(e){e.Result?this.closePopup():l.showErrorByCode(e,r.i18n("FILESWEBCLIENT/ERROR_DELETE_PUBLIC_LINK"))},this),this.item.published(!1))},f.prototype.showHistory=function(){this.bAllowShowHistory&&c.showPopup(p,[r.i18n("FILESWEBCLIENT/HEADING_HISTORY_POPUP"),this.item])},e.exports=new f},v0iR:(e,t,i)=>{function s(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=Array(t);i<t;i++)s[i]=e[i];return s}var r=i("a7T2"),n=i("M4cL"),l=i("p09A"),h=i("LKDt"),a=i("ERH9"),c=i("uQaC"),u=i("Z9uT"),d=i("yU9o"),p=i("hr1f"),f=i("DSoz"),m=i("5D2l"),y=i("ioSH"),S=i("D2Gh"),b=i("KIwC"),E=i("db2p"),g=i("PMEU"),F=i("Rjyw"),C=i("MYiO"),P=i("WJcO"),L=i("fnuI"),T=i("2dqB"),I=i("sISN"),v=i("Ui65"),A=i("5njy"),R=i("aSuo"),N=i("8ri2"),k=i("a2fk"),w=i("lzoy"),O=m.run("SharedFiles","getFilesSharePopup"),D=m.run("MailWebclient","getComposeMessageWithAttachments"),_=window.Enums;function U(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];E.call(this,"FilesWebclient"),this.disableRoute=!1,this.browserTitle=l.observable(h.i18n("FILESWEBCLIENT/HEADING_BROWSER_TAB")),this.bAllowSendEmails=r.isFunction(D),this.error=l.observable(!1),this.loaded=l.observable(!1),this.bPublic=d.isPublic(),this.storages=l.observableArray([]),this.folders=l.observableArray(),this.files=l.observableArray(),this.uploadingFiles=l.observableArray(),this.rootPath=l.observable(this.bPublic?R.PublicFolderName:h.i18n("FILESWEBCLIENT/LABEL_PERSONAL_STORAGE")),this.storageType=l.observable(_.FileStorageType.Personal),this.currentStorage=l.computed(function(){return this.getStorageByType(this.storageType())},this),this.storageDroppable=l.computed(function(){return this.currentStorage()?this.currentStorage().droppable():""},this),this.storageDisplayName=l.computed(function(){return this.currentStorage()?this.currentStorage().displayName:""},this),this.storageType.subscribe(function(){this.bPublic?this.rootPath(R.PublicFolderName):(this.currentStorage()&&this.rootPath(this.currentStorage().displayName),this.selector.listCheckedAndSelected(!1))},this),this.createButtonsControllers=l.observableArray([]),this.pathItems=l.observableArray(),this.currentPath=l.observable(""),this.isZipFolder=l.computed(function(){var e=this.currentPath().split("$ZIP:");return"zip"===c.getFileExtension(e[0])},this),this.dropPath=l.observable(""),l.computed(function(){this.dropPath(this.currentPath())},this),this.isCorporateStorage=l.computed(function(){return this.storageType()===_.FileStorageType.Corporate},this),this.isSharedStorage=l.computed(function(){return this.storageType()===_.FileStorageType.Shared},this),this.isEncryptedStorage=l.computed(function(){return this.storageType()===_.FileStorageType.Encrypted},this),this.isExternalStorage=l.computed(function(){return this.currentStorage()&&this.currentStorage().isExternal},this),this.isTrashStorage=l.computed(function(){return this.storageType()===_.FileStorageType.Trash},this),this.foldersCollection=l.computed(function(){var e=this,t=this.folders();return t.sort(function(t,i){var s;switch(e.sortBy()){case _.FilesSortField.Filename:case _.FilesSortField.Size:s=t.fileName()===i.fileName()?0:t.fileName()<i.fileName()?-1:1;break;case _.FilesSortField.Modified:s=t.iLastModified===i.iLastModified?0:t.iLastModified<i.iLastModified?-1:1}return e.sortBy()!==_.FilesSortField.Size&&(s*=e.sortOrder()===_.SortOrder.Desc?-1:1),s}),t},this),this.filesCollection=l.computed(function(){var e=this,t=r.union(this.files(),this.getUploadingFiles());return t.sort(function(t,i){var s;switch(e.sortBy()){case _.FilesSortField.Filename:s=t.fileName()===i.fileName()?0:t.fileName()<i.fileName()?-1:1;break;case _.FilesSortField.Size:s=t.size()===i.size()?0:t.size()<i.size()?-1:1;break;case _.FilesSortField.Modified:s=t.iLastModified===i.iLastModified?0:t.iLastModified<i.iLastModified?-1:1}return s*(e.sortOrder()===_.SortOrder.Desc?-1:1)}),t},this),this.collection=l.computed(function(){return r.union(this.foldersCollection(),this.filesCollection())},this),this.columnCount=l.observable(1),this.selector=new f(this.collection,r.bind(this.onItemSelect,this),r.bind(this.onItemDelete,this),r.bind(this.onItemDblClick,this),r.bind(this.onEnter,this),this.columnCount,!0,!0,!0,!1,i),this.firstSelectedFile=l.computed(function(){return r.find(this.selector.listCheckedAndSelected(),function(e){return e.IS_FILE})},this),this.selectedOwnItems=l.computed(function(){return r.filter(this.selector.listCheckedAndSelected(),function(e){return!e.sharedWithMe()})},this),this.selectedHasShared=l.computed(function(){return!!r.find(this.selector.listCheckedAndSelected(),function(e){return e.sharedWithMe()})},this),this.searchPattern=l.observable(""),this.newSearchPattern=l.observable(""),this.isSearchFocused=l.observable(!1),this.selectedFolders=l.computed(function(){return r.filter(this.selector.listCheckedAndSelected(),function(e){return e.IS_FOLDER},this)},this),this.selectedFiles=l.computed(function(){return r.filter(this.selector.listCheckedAndSelected(),function(e){return e.IS_FILE},this)},this),this.allSelectedFilesReady=l.computed(function(){return r.every(this.selectedFiles(),function(e){var t=!1===e.uploaded(),i=!0===e.downloading();return!t&&!i})},this),this.sharedParentFolder=l.computed(function(){return r.find(this.pathItems(),function(e){return e.sharedWithMe()})},this),this.isDownloadAllowed=l.computed(function(){var e=this.getFileIfOnlyOneSelected();return!!e&&e.hasAction("download")&&this.allSelectedFilesReady()},this),this.downloadCommand=c.createCommand(this,this.executeDownload,this.isDownloadAllowed),this.isSendAllowed=l.computed(function(){return!this.isZipFolder()&&this.selectedFiles().length>0&&this.allSelectedFilesReady()},this),this.sendCommand=c.createCommand(this,this.executeSend,this.isSendAllowed),this.isRenameAllowed=l.computed(function(){var e=this.sharedParentFolder(),t=this.selector.listCheckedAndSelected(),i=1===t.length?t[0]:null;return!this.isZipFolder()&&(!e||e.sharedWithMeAccessWrite())&&this.allSelectedFilesReady()&&i},this),this.renameCommand=c.createCommand(this,this.executeRename,this.isRenameAllowed),this.bSortEnabled=R.Sorting&&R.Sorting.Allow&&R.Sorting.DisplayOptions&&R.Sorting.DisplayOptions.length>0,this.sortBy=l.observable(R.Sorting.DefaultSortBy),this.sortOrder=l.observable(R.Sorting.DefaultSortOrder),this.aSortList=[],this.bSortEnabled&&r.each(_.FilesSortField,function(e,t){R.Sorting.DisplayOptions.indexOf(t)>=0&&this.aSortList.push({sText:h.i18n("FILESWEBCLIENT/SORT_OPTION_"+t.toUpperCase()),sSortBy:e})}.bind(this)),this.itemsToDeleteCount=l.computed(function(){var e=this.sharedParentFolder();return e&&e.sharedWithMeAccessWrite()?this.selector.listCheckedAndSelected().length:this.selectedOwnItems().length},this),this.isDeleteAllowed=l.computed(function(){return!this.isZipFolder()&&this.itemsToDeleteCount()>0&&this.allSelectedFilesReady()},this),this.deleteCommand=c.createCommand(this,this.executeDelete,this.isDeleteAllowed),this.itemsToRestoreCount=l.computed(function(){return this.selector.listCheckedAndSelected().length},this),this.isRestoreAllowed=l.computed(function(){return this.isTrashStorage()&&this.itemsToRestoreCount()>0&&this.allSelectedFilesReady()},this),this.restoreCommand=c.createCommand(this,this.executeRestore,this.isRestoreAllowed),this.needToCopyDraggedItems=l.observable(!1),this.isCurrentStorageDroppable=l.computed(function(){return!this.sharedParentFolder()||this.needToCopyDraggedItems()||this.sharedParentFolder()&&this.sharedParentFolder().sharedWithMeAccessWrite()},this),this.isCutAllowed=l.computed(function(){var e=this.sharedParentFolder(),t=this.selector.listCheckedAndSelected();return!this.isZipFolder()&&(!e&&!this.isSharedStorage()||!!e&&e.sharedWithMeAccessWrite())&&this.allSelectedFilesReady()&&t.length>0},this),this.isCopyAllowed=l.computed(function(){return this.allSelectedFilesReady()&&this.selector.listCheckedAndSelected().length>0},this),this.isDragAllowed=l.computed(function(){return this.isCutAllowed()||this.needToCopyDraggedItems()&&this.isCopyAllowed()},this),this.isShareAllowed=l.computed(function(){var e=this.selector.listCheckedAndSelected(),t=1===e.length?e[0]:null;return t&&t.oExtendedProps,!this.isZipFolder()&&t&&!t.bIsLink&&(!this.sharedParentFolder()||this.sharedParentFolder().sharedWithMeAccessReshare()||t.sharedWithMeAccessReshare())&&this.allSelectedFilesReady()&&(t.IS_FILE||!this.isEncryptedStorage())&&(!t.sharedWithMe()||t.sharedWithMeAccessReshare())},this),this.createPublicLinkCommand=c.createCommand(this,this.createPublicLink,this.isShareAllowed),this.isCreateAllowed=l.computed(function(){var e=this.sharedParentFolder();return!this.isTrashStorage()&&!this.isZipFolder()&&(e&&e.sharedWithMeAccessWrite()||!e&&!this.isSharedStorage())},this),this.createFolderCommand=c.createCommand(this,this.executeCreateFolder,this.isCreateAllowed),this.isCreateShortcutAllowed=l.computed(function(){return this.isCreateAllowed()&&!this.isExternalStorage()&&!this.isEncryptedStorage()},this),this.createShortcutCommand=c.createCommand(this,this.executeCreateShortcut,this.isCreateShortcutAllowed),this.checkstateCommand=c.createCommand(this,this.executeCheckstate),this.uploaderButton=l.observable(null),this.uploaderArea=l.observable(null),this.bDragActive=l.observable(!1),this.isNewItemsMenuOpened=l.observable(!1),this.bDragActiveComp=l.computed(function(){return this.bDragActive()&&""===this.searchPattern()},this),this.isDragAndDropSupported=l.observable(!1),this.isCreateAllowed.subscribe(function(){this.oJua&&this.oJua.setDragAndDropEnabledStatus(this.isCreateAllowed())},this),this.uploadError=l.observable(!1),this.quota=l.observable(0),this.used=l.observable(0),this.quotaDesc=l.observable(""),this.quotaProc=l.observable(-1),this.bShowQuotaBarTextAsTooltip=b.ShowQuotaBarTextAsTooltip,this.aBottomLeftCornerLinks=R.BottomLeftCornerLinks,l.computed(function(){if(!b.ShowQuotaBar)return!0;var e=this.quota(),t=this.used(),i=0<e?Math.round(t/e*100):-1;i=100<i?100:i,this.quotaProc(i),this.quotaDesc(-1<i?h.i18n("COREWEBCLIENT/INFO_QUOTA",{PROC:i,QUOTA:h.getFriendlySize(e)}):""),b.QuotaWarningPerc>0&&-1!==i&&b.QuotaWarningPerc>100-i&&S.showError(h.i18n("COREWEBCLIENT/WARNING_QUOTA_ALMOST_REACHED"),!0)},this),this.dragover=l.observable(!1),this.loading=l.observable(!1),this.loadedFiles=l.observable(!1),this.fileListInfoText=l.computed(function(){var e="";return this.loading()?e=h.i18n("COREWEBCLIENT/INFO_LOADING"):this.loadedFiles()?0===this.collection().length&&(""!==this.searchPattern()?e=h.i18n("FILESWEBCLIENT/INFO_NOTHING_FOUND"):this.isSharedStorage()?e=h.i18n("FILESWEBCLIENT/INFO_SHARED_FOLDER_IS_EMPTY"):""!==this.currentPath()||this.bInPopup||this.bPublic?e=h.i18n("FILESWEBCLIENT/INFO_FOLDER_IS_EMPTY"):this.isDragAndDropSupported()&&(e=h.i18n("FILESWEBCLIENT/INFO_DRAGNDROP_FILES_OR_CREATE_FOLDER"))):this.error()&&(e=h.i18n("FILESWEBCLIENT/ERROR_FILES_NOT_RECEIVED")),e},this),this.bInPopup=!!t,this.timerId=null,this.itemsViewTemplate=l.observable("FilesWebclient_ItemsView"),d.subscribeEvent("Files::ShowList",r.bind(function(e){this.shown()&&e.Item&&this.routeFiles(e.Item.storageType(),e.Item.fullPath())},this)),C.opened.subscribe(r.bind(function(){this.shown()&&this.selector.useKeyboardKeys(!0)},this)),this.PublicLinksEnabled=R.PublicLinksEnabled,this.bAllowFavorites=R.AllowFavorites,this.currentFolderStatsString=l.computed(function(){var e=0,t=0,i="";return this.files().forEach(function(i){e+=i.selected()||i.checked()?i.size():0,t+=i.size()}),i=0===this.files().length&&0===this.folders().length?"":h.i18n("FILESWEBCLIENT/CURRENT_FOLDER_STATS",{SIZE_OVERAL:h.getFriendlySize(t),FILES_OVERAL:this.files().length,FOLDERS_OVERAL:this.folders().length}),(i+=0===this.selectedFiles().length?"":" | "+h.i18n("FILESWEBCLIENT/CURRENT_FOLDER_STATS_SELECTED_FILES",{SIZE_SELECTED:h.getFriendlySize(e),FILES_SELECTED:this.selectedFiles().length}))+(0===this.selectedFolders().length?"":" | "+h.i18n("FILESWEBCLIENT/CURRENT_FOLDER_STATS_SELECTED_FOLDERS",{FOLDERS_SELECTED:this.selectedFolders().length}))},this).extend({rateLimit:{timeout:100,method:"notifyWhenChangesStop"}}),this.addToolbarButtons=l.observableArray([]),this.storageControllers=l.observableArray(),this.controllers=l.computed(function(){return[].concat(s(e.addToolbarButtons()),s(e.storageControllers()))}),d.broadcastEvent("FilesWebclient::RegisterFilesController",function(t,i){e.registerController(t,i)}),d.broadcastEvent("FilesWebclient::ConstructView::after",{Name:this.ViewConstructorName,View:this})}r.extendOwn(U.prototype,E.prototype),U.prototype.ViewTemplate=d.isPublic()?"FilesWebclient_PublicFilesView":"FilesWebclient_FilesView",U.prototype.ViewConstructorName="CFilesView",U.prototype.registerCreateButtonsController=function(e){this.createButtonsControllers.push(e)},U.prototype.onBind=function(e){var t=this,i=this.$viewDom||e;this.selector.initOnApplyBindings(".items_sub_list .item",".items_sub_list .selected.item",".items_sub_list .item .custom_checkbox",n(".panel.files .items_list",i),n(".panel.files .items_list .files_scroll.scroll-inner",i)),n(".files_scroll").on("click",function(e){var i,s=(null===(i=e.target)||void 0===i?void 0:i.className)||"";(s.includes("files_scroll")||s.includes("items_list")||s.includes("items_sub_list"))&&t.selector.listCheckedAndSelected(!1)}),this.initUploader(),this.hotKeysBind()},U.prototype.hotKeysBind=function(){n(document).on("keydown",r.bind(function(e){this.shown()&&e&&e.keyCode===_.Key.s&&this.selector.useKeyboardKeys()&&!c.isTextFieldFocused()&&(e.preventDefault(),this.isSearchFocused(!0))},this))},U.prototype.initUploader=function(){var e=this;!this.bPublic&&this.uploaderButton()&&this.uploaderArea()&&(this.oJua=new p({action:"?/Api/",name:"jua-uploader",queueSize:2,clickElement:this.uploaderButton(),hiddenElementsPosition:b.IsRTL?"right":"left",dragAndDropElement:this.uploaderArea(),disableAjaxUpload:!1,disableFolderDragAndDrop:!1,disableDragAndDrop:!1,hidden:r.extendOwn({Module:R.ServerModuleName,Method:"UploadFile",Parameters:function(t){return JSON.stringify({Type:e.storageType(),SubPath:t&&t.Folder||"",Path:e.dropPath(),Overwrite:!1})}},d.getCommonRequestParameters())}),this.oJua.on("onProgress",r.bind(this.onFileUploadProgress,this)).on("onSelect",r.bind(this.onFileUploadSelect,this)).on("onStart",r.bind(this.onFileUploadStart,this)).on("onDrop",r.bind(this.onDrop,this)).on("onEmptyFolderDrop",this.onEmptyFolderDrop.bind(this)).on("onComplete",r.bind(this.onFileUploadComplete,this)).on("onBodyDragEnter",r.bind(this.bDragActive,this,!0)).on("onBodyDragLeave",r.bind(this.bDragActive,this,!1)).on("onCancel",r.bind(this.onCancelUpload,this)).on("onDialog",r.bind(function(){setTimeout(r.bind(this.isNewItemsMenuOpened,this,!1),10)},this,!1)),this.isDragAndDropSupported(this.oJua.isDragAndDropSupported()))},U.prototype.isFileCanBeUploaded=function(e){return R.EnableUploadSizeLimit&&e.Size/1048576>R.UploadSizeLimitMb?(g.showPopup(F,[h.i18n("FILESWEBCLIENT/ERROR_SIZE_LIMIT",{FILENAME:e.FileName,SIZE:R.UploadSizeLimitMb})]),!1):!(this.storageType()===_.FileStorageType.Personal&&a.isPositiveNumber(this.quota())&&this.quota()>0&&this.used()+e.Size>this.quota()&&(g.showPopup(F,[h.i18n("COREWEBCLIENT/ERROR_CANT_UPLOAD_FILE_QUOTA")]),1))},U.prototype.onFileUploadSelect=function(e,t){var i=this;if(!this.isFileCanBeUploaded(t))return!1;if(""===this.searchPattern()){var s=this.storageType(),o=this.currentPath(),n=N.prepareUploadFileData(t,o,s,function(e){return!!i.getFileByName(e)||!!r.find(i.getUploadingFiles(),function(t){return t.fileName()===e})}),l=this.getUploadFileByUid(e);return l?(l.fileName(n.Name),l.fullPath(n.FullPath)):l=new N(n,this),l.onUploadSelect(e,t,!0),this.uploadingFiles.push(l),this.onFileFromSubfolderUploadSelect(t),!0}return!1},U.prototype.onFileFromSubfolderUploadSelect=function(e){if(a.isNonEmptyString(e.Folder)){var t=r.compact(e.Folder.split("/"))[0],i=r.find(this.folders(),function(e){return e.fileName()===t});t&&!i&&((i=new k(this)).parse({Name:t}),this.folders.push(i)),i.increaseUploadingFiles()}},U.prototype.onFileUploadStart=function(e){var t=this.getUploadFileByUid(e);t&&t.onUploadStart()},U.prototype.onFileUploadProgress=function(e,t,i){if(""===this.searchPattern()){var s=this.getUploadFileByUid(e);s&&s.onUploadProgress(t,i)}},U.prototype.onFileUploadComplete=function(e,t,i){if(""===this.searchPattern()){var s=this.getUploadFileByUid(e),o=!1;s?(s.onUploadComplete(e,t,i),this.onFileWithSubfolderUploadComplete(s),this.deleteUploadFileByUid(e),s.uploadError()?(this.uploadError(!0),i&&i.ErrorCode===_.Errors.CanNotUploadFileQuota?(g.showPopup(F,[h.i18n("COREWEBCLIENT/ERROR_CANT_UPLOAD_FILE_QUOTA")]),o=!0):i&&i.ErrorCode===_.Errors.FileAlreadyExists?(o=!0,S.showError(h.i18n("COREWEBCLIENT/ERROR_FILE_ALREADY_EXISTS"))):i&&i.ErrorCode===_.Errors.FileNotFound?(o=!0,S.showError(h.i18n("COREWEBCLIENT/ERROR_FILE_NOT_FOUND"))):S.showError(s.statusText())):(s.path()===this.currentPath()&&s.storageType()===this.storageType()&&this.files.push(s),0===this.uploadingFiles().length&&S.showReport(h.i18n("COREWEBCLIENT/REPORT_UPLOAD_COMPLETE"))),0===this.uploadingFiles().length&&(o=!0)):o=!0,o&&this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)}},U.prototype.onFileWithSubfolderUploadComplete=function(e){if(e.sUploadSubFolder){var t=r.compact(e.sUploadSubFolder.split("/"))[0],i=r.find(this.folders(),function(e){return e.fileName()===t});i&&i.increaseUploadedFiles()}},U.prototype.onEmptyFolderDrop=function(e){e&&e.fullPath&&("/"===e.fullPath.charAt(0)?e.fullPath.substr(1):e.fullPath,A.send("CreateFolder",{Type:this.storageType(),Path:this.currentPath(),FolderName:e.fullPath},this.onCreateFolderResponse,this))},U.prototype.onDrop=function(e,t){if(!this.bPublic)if(t&&t.target&&""===this.searchPattern()){var i=l.dataFor(t.target);i&&i instanceof k&&this.dropPath(i.fullPath())}else S.showReport(h.i18n("FILESWEBCLIENT/INFO_CANNOT_UPLOAD_SEARCH_RESULT"))},U.prototype.filesDrop=function(e,t,i){if(!this.bPublic&&this.isDragAllowed()&&t){var s=this.selector.listCheckedAndSelected(),o=this.needToCopyDraggedItems()?"Copy":"Move";this.moveItems(o,e,s)&&c.uiDropHelperAnim(t,i)}},U.prototype.moveItems=function(e,t,i){if(this.bPublic)return!1;var s="",o="",n=!0,l=t instanceof k?t.fullPath():"",a=[],c=t?t instanceof k?t.storageType():t.type:this.storageType(),u=this.getStorageByType(c),d=this.currentStorage(),p=u.type===d.type,f=this.used(),m=this.quota();if(p||!p&&!u.isExternal&&!d.isExternal&&_.FileStorageType.Shared!==u.type){if(u.type===_.FileStorageType.Personal&&d.type!==_.FileStorageType.Personal&&!r.every(i,function(e){if(e instanceof N){if(m>0&&f+e.size()>m)return!1;f+=e.size()}return!0}))return g.showPopup(F,[h.i18n("FILESWEBCLIENT/ERROR_CANT_MOVE_FILES_QUOTA_PLURAL",{},"",i.length)]),!1;if(r.each(i,r.bind(function(t){(""!==s&&s!==t.path()||""!==o&&o!==t.storageType())&&(n=!1),s=t.path(),o=t.storageType(),t instanceof k&&l===s+"/"+t.id()||("Move"===e&&(t instanceof N?this.deleteFileByName(t.id()):this.deleteFolderByName(t.fileName())),a.push({FromType:o,FromPath:s,Name:t.id(),IsFolder:t instanceof k}))},this)),a.length>0)return n||(o="",s=""),A.send(e,{FromType:o,ToType:c,FromPath:s,ToPath:l,Files:a},this.onMoveResponse,this),t instanceof k&&t.recivedAnim(!0),!0}return!1},U.prototype.onMoveResponse=function(e,t){e.Result?this.storageType()===t.Parameters.ToType&&this.currentPath()===t.Parameters.ToPath?this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern()):this.getQuota():(e.ErrorCode===_.Errors.CanNotUploadFileQuota?g.showPopup(F,[h.i18n("FILESWEBCLIENT/ERROR_CANT_MOVE_FILES_QUOTA_PLURAL",{},"",t.Parameters.Files.length)]):u.showErrorByCode(e,h.i18n("FILESWEBCLIENT/ERROR_FILES_MOVE_PLURAL",{},"",t.Parameters.Files.length)),this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern()))},U.prototype.dragAndDropHelper=function(e,t){if(!e||!e.allowDrag())return n("<span></span>");if(e.checked(!0),this.needToCopyDraggedItems(t),!this.isDragAllowed())return n("<span></span>");var i,s=c.draggableItems(),o=this.selector.listCheckedAndSelected(),l=r.countBy(o,function(e){return e.IS_FILE?"file":"folder"}),a=t?"+ ":"";return i=l.file?l.folder?h.i18n("FILESWEBCLIENT/LABEL_DRAG_ITEMS_PLURAL",{COUNT:a+o.length},null,o.length):h.i18n("FILESWEBCLIENT/LABEL_DRAG_FILES_PLURAL",{COUNT:a+l.file},null,l.file):h.i18n("FILESWEBCLIENT/LABEL_DRAG_FOLDERS_PLURAL",{COUNT:a+l.folder},null,l.folder),n(".count-text",s).text(i),s},U.prototype.onItemDelete=function(){this.isDeleteAllowed()&&this.executeDelete()},U.prototype.onItemSelect=function(e){d.isMobile()&&e instanceof k&&this.onItemDblClick(e)},U.prototype.onEnter=function(e){this.onItemDblClick(e)},U.prototype.onItemDblClick=function(e){if(e){var t=e.getMainAction();switch(t){case"view":e instanceof N&&(this.onSelectClickPopupBound?this.onSelectClickPopupBound():e.executeAction(t));break;case"list":e instanceof k&&e.isIncomplete()||this.routeFiles(e.storageType(),e.fullPath())}}},U.prototype.onGetFilesResponse=function(e,t){var i=e.Result,s=t.Parameters;if(this.bNotLoading=!1,(s.Type===this.storageType()||s.Hash===R.PublicHash)&&s.Path===this.currentPath())if(i){var o=[],n=[];if(r.each(i.Items,function(e){if(e.IsFolder){var t=new k(this);t.parse(e),this.checkIfFolderUploading(t),o.push(t)}else{var i=new N(e,this);i.oExtendedProps&&i.oExtendedProps.Loading&&(i.uploadError(!0),i.statusText(h.i18n("COREWEBCLIENT/LABEL_FILE_LOADING"))),i.index(n.length),n.push(i)}},this),r.each(this.files(),function(e,t,i){if(e.downloading()){var s=r.findIndex(n,function(t){return e.fileName()===t.fileName()});-1!==s&&(i[t].index(n[s].index()),n[s]=i[t])}}),this.folders(o),this.files(n),this.newSearchPattern(s.Pattern||""),this.searchPattern(s.Pattern||""),this.loadedFiles(!0),clearTimeout(this.timerId),this.parseQuota(i.Quota),r.isArray(i.Path)&&(this.pathItems.removeAll(),r.each(i.Path.reverse(),r.bind(function(e){var t=new k(this);t.parse(e),this.pathItems.push(t)},this))),this.loading(!1),i.Access&&this.pathItems().length>0){var l=this.pathItems().length-1,a=this.pathItems()[l];a.oExtendedProps&&a.oExtendedProps.SharedWithMeAccess||(this.pathItems()[l].updateExtendedProps({SharedWithMeAccess:i.Access}),this.pathItems.valueHasMutated())}}else e.ErrorCode!==_.Errors.NotDisplayedError&&(this.loading(!1),this.error(!0),u.showErrorByCode(e,h.i18n("FILESWEBCLIENT/ERROR_FILES_NOT_RECEIVED")))},U.prototype.checkIfFolderUploading=function(e){r.each(this.uploadingFiles(),function(t){if(t.sUploadSubFolder){var i=r.compact(t.sUploadSubFolder.split("/"))[0];e.fileName()===i&&e.increaseUploadingFiles()}})},U.prototype.parseQuota=function(e){e&&(this.quota(a.pInt(e.Limit)),this.used(a.pInt(e.Used)))},U.prototype.onDeleteResponse=function(e,t){e.Result?(this.expungeFileItems(),this.getQuota()):(u.showErrorByCode(e),this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern()))},U.prototype.executeRename=function(){var e=r.first(this.selector.listCheckedAndSelected()),t=R.EditFileNameWithoutExtension&&e instanceof N,i=t?c.getFileNameWithoutExtension(e.fileName()):e.fileName(),s=t?c.getFileExtension(e.fileName()):"";!this.bPublic&&e&&g.showPopup(T,[i,r.bind(this.renameItem,this,s)])},U.prototype.renameItem=function(e,t){var i=""===e?t:t+"."+e,s=r.first(this.selector.listCheckedAndSelected());return c.validateFileOrFolderName(i)?(A.send("Rename",{Type:s.storageType(),Path:s.path(),Name:s.id()||s.fileName(),NewName:i,IsLink:s.bIsLink,IsFolder:!s.IS_FILE},this.onRenameResponse,this),""):s instanceof k?h.i18n("FILESWEBCLIENT/ERROR_INVALID_FOLDER_NAME"):h.i18n("FILESWEBCLIENT/ERROR_INVALID_FILE_NAME")},U.prototype.executeSort=function(e){var t=this.sortBy();this.sortBy(e),t===e?this.sortOrder(this.sortOrder()===_.SortOrder.Asc?_.SortOrder.Desc:_.SortOrder.Asc):this.sortOrder(R.Sorting.DefaultSortOrder)},U.prototype.getFileIfOnlyOneSelected=function(){var e=this.selector.listCheckedAndSelected();return 1===e.length&&e[0]instanceof N?e[0]:null},U.prototype.executeDownload=function(){var e=this.getFileIfOnlyOneSelected();e&&e.executeAction("download")},U.prototype.createPublicLink=function(){var e=r.first(this.selector.listCheckedAndSelected());!this.bPublic&&e&&g.showPopup(I,[e])},U.prototype.executeSend=function(){var e=r.map(this.selectedFiles(),function(e){return{Storage:e.storageType(),Path:e.path(),Name:e.id()||e.fileName()}});this.bAllowSendEmails&&e.length>0&&A.send("SaveFilesAsTempFiles",{Files:e},function(e){e.Result&&D(e.Result)},this)},U.prototype.onFavoriteClick=function(e){if(e){var t=e.favorite();e.favorite(!e.favorite()),A.send(t?"RemoveFromFavorites":"AddToFavorites",{Items:[{Type:"personal",Path:e.path(),Name:e.fileName()}]},function(i){t?e.favorite(!i.Result):e.favorite(!!i.Result),i.Result||S.showError(h.i18n("FILESWEBCLIENT/ERROR_FAVORITE_NOT_SET"))},this)}},U.prototype.onShareIconClick=function(e){e&&g.showPopup(I,[e])},U.prototype.onSecureIconClick=function(e){e&&r.isFunction(e.onSecureIconClick)&&e.onSecureIconClick(e)},U.prototype.onFileShareIconClick=function(e){O&&e&&g.showPopup(O,[e,this.expungeFileItems.bind(this)])},U.prototype.onRenameResponse=function(e,t){e.Result||u.showErrorByCode(e,h.i18n("FILESWEBCLIENT/ERROR_FILE_RENAME")),this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)},U.prototype.refresh=function(){this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)},U.prototype.executeDelete=function(){var e=this.sharedParentFolder(),t=!!e&&e.sharedWithMeAccessWrite(),i=this.selector.listCheckedAndSelected()||[],s=t?i:this.selectedOwnItems(),o=s.length;if(!this.bPublic&&o>0){var n=[_.FileStorageType.Personal,_.FileStorageType.Shared,_.FileStorageType.Corporate,_.FileStorageType.Encrypted];if(R.AllowTrash&&-1!==n.indexOf(this.storageType()))r.find(s,function(e){return e.sharedWithOthers()})?(this.selector.useKeyboardKeys(!1),g.showPopup(C,[h.i18n("FILESWEBCLIENT/CONFIRM_SOME_ITEMS_SHARED_WITH_OTHERS"),r.bind(this.deleteItems,this,s),"",h.i18n("COREWEBCLIENT/ACTION_DELETE")])):this.deleteItems(s,!0);else{var l,a=i.length!==o,c=!!r.find(s,function(e){return!e.IS_FILE}),u=!!r.find(s,function(e){return e.IS_FILE});l=a?h.i18n("FILESWEBCLIENT/CONFIRM_NOT_ALL_ITEMS_OWN"):c&&u?h.i18n("FILESWEBCLIENT/CONFIRM_DELETE_ITEMS_PLURAL",{COUNT:o},null,o):c?h.i18n("FILESWEBCLIENT/CONFIRM_DELETE_FOLDERS_PLURAL",{COUNT:o},null,o):h.i18n("FILESWEBCLIENT/CONFIRM_DELETE_FILES_PLURAL",{COUNT:o},null,o),this.selector.useKeyboardKeys(!1),g.showPopup(C,[l,r.bind(this.deleteItems,this,s),"",h.i18n("COREWEBCLIENT/ACTION_DELETE")])}}},U.prototype.executeRestore=function(){var e,t=this.selector.listCheckedAndSelected()||[],i=t.length,s=h.i18n("FILESWEBCLIENT/CONFIRM_RESTORE_ITEMS_PLURAL",{COUNT:i},null,i),o=[];r.each(t,function(e){e&&e.oExtendedProps&&e.oExtendedProps.TrashOriginalPath&&o.push(h.i18n("FILESWEBCLIENT/LABEL_PERSONAL_STORAGE")+e.oExtendedProps.TrashOriginalPath)}),e=o.length,o=r.first(o,3),e>0&&(s=s+"<br><br>"+o.join("<br>"),e>3&&(s+="<br>...")),this.selector.useKeyboardKeys(!1),g.showPopup(C,[s,r.bind(this.restoreItems,this,t),"",h.i18n("FILESWEBCLIENT/ACTION_RESTORE")])},U.prototype.onShow=function(){this.loaded(!0),this.bPublic||this.requestStorages(),this.selector.useKeyboardKeys(!0),this.oJua&&this.oJua.setDragAndDropEnabledStatus(!0),this.controllers().forEach(function(e){"function"==typeof e.onShow&&e.onShow()})},U.prototype.onHide=function(){this.selector.useKeyboardKeys(!1),this.oJua&&this.oJua.setDragAndDropEnabledStatus(!1),this.controllers().forEach(function(e){"function"==typeof e.onHide&&e.onHide()})},U.prototype.getQuota=function(){A.send("GetQuota",{Type:this.storageType()},function(e){e.Result&&this.parseQuota(e.Result)},this)},U.prototype.getStorageByType=function(e){return r.find(this.storages(),function(t){return t.type===e})},U.prototype.requestStorages=function(){A.send("GetStorages",null,this.onGetStoragesResponse,this)},U.prototype.onGetStoragesResponse=function(e,t){var i=e.Result;i&&(r.each(i,function(e){if(e.Type&&!this.getStorageByType(e.Type)){var t=new w(this.isCurrentStorageDroppable);t.parse(e),this.storages.push(t)}},this),this.expungeExternalStorages(r.map(i,function(e){return e.Type},this))),this.currentStorage()||(this.storageType(_.FileStorageType.Personal),this.pathItems.removeAll()),this.bInPopup&&this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)},U.prototype.clearAndShowLoading=function(){this.folders([]),this.files([]),this.loading(!0)},U.prototype.currentGetFiles=function(){var e=this.pathItems().length,t={Type:this.storageType(),Path:this.currentPath(),Pattern:this.searchPattern(),PathRequired:""!==this.currentPath()&&0===e};A.send("GetFiles",t,this.onGetFilesResponse,this)},U.prototype.routeFiles=function(e,t,i,s){this.disableRoute||(this.bPublic?y.setHash(v.getFiles("",t,""))&&(this.clearAndShowLoading(),A.send("GetPublicFiles",{Hash:R.PublicHash,Path:this.currentPath()},this.onGetFilesResponse,this)):(this.bNotLoading=s,this.bInPopup?this.onUserRoute(v.getParsedParams(e,t,i)):y.setHash(v.getFiles(e,t,i))&&(this.clearAndShowLoading(),this.currentGetFiles())))},U.prototype.addPathItems=function(e,t,i){var s=new k(this);s.storageType(e),s.fileName(i),s.path(t),s.fullPath(t),this.pathItems.unshift(s)},U.prototype.onRoute=function(e){var t=v.parseFiles(e);this.bPublic?this.onPublicRoute(t):this.onUserRoute(t),this.controllers().forEach(function(e){"function"==typeof e.onRoute&&e.onRoute(t)})},U.prototype.onUserRoute=function(e){var t=0===this.storages().length||r.find(this.storages(),function(t){return t.type===e.Storage})?e.Storage:this.storages().length>0?this.storages()[0].type:"",i=e.Path;this.error(!1),this.storageType(t),this.currentPath(i),this.searchPattern(a.pString(e.Search)),this.loadedFiles(!1),this.populatePathItems(e),this.bNotLoading&&(this.files().length>0||this.folders().length>0)?this.timerId=setTimeout(r.bind(function(){this.loadedFiles()||this.error()||this.clearAndShowLoading()},this),3e3):this.clearAndShowLoading(),this.currentGetFiles()},U.prototype.populatePathItems=function(e){var t=this.currentPath(),i=e.PathParts.reverse(),s=r.find(this.folders(),function(e){return e.fullPath()===t}),o=r.findIndex(this.pathItems(),function(e){return e.fullPath()===t});if(-1!==o)this.pathItems(this.pathItems().slice(0,o+1));else if(s)this.pathItems.push(s);else if("google"!==this.storageType()||""===t){this.pathItems.removeAll(),r.each(i,r.bind(function(e){var i=t.lastIndexOf(e);this.addPathItems(this.storageType(),t,e),t=t.substr(0,i)},this));var n={Type:this.storageType(),Path:this.currentPath()};A.send("GetAccessInfoForPath",n,function(e){e&&e.Result&&(r.each(this.pathItems(),function(t){var i=t.fullPath();"/"===i.substr(i.length-1,1)&&(i=i.substr(0,i.length-1)),e.Result[i]&&t.updateExtendedProps({SharedWithMeAccess:e.Result[i]})}),this.pathItems.valueHasMutated())},this)}},U.prototype.onPublicRoute=function(e){var t=e.Path,i=e.PathParts.reverse(),s="";this.currentPath(t),this.pathItems.removeAll(),r.each(i,r.bind(function(i){var o=t.lastIndexOf(i);this.addPathItems(e.Storage,t,i),t=t.substr(0,o),s=i},this)),s!==this.rootPath()&&this.addPathItems(e.Storage,"",this.rootPath()),this.clearAndShowLoading(),A.send("GetPublicFiles",{Hash:R.PublicHash,Path:this.currentPath()},this.onGetFilesResponse,this)},U.prototype.deleteItems=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Delete",s=this.storageType(),o=this.currentPath();if(t&&0<e.length){var n=r.compact(r.map(e,function(e){return""!==e.id()?(e.deleted(!0),s=e.storageType(),{Path:e.path(),Name:e.id(),IsFolder:!e.IS_FILE}):null}));n.length&&A.send(i,{Type:s,Path:o,Items:n},this.onDeleteResponse,this)}},U.prototype.restoreItems=function(e,t){if(t&&0<e.length){var i=r.compact(r.map(e,function(e){return""!==e.id()?(e.deleted(!0),e.id()):null}));i.length&&A.send("Restore",{Items:i},this.onDeleteResponse,this)}},U.prototype.getFileByName=function(e){return r.find(this.files(),function(t){return t.fileName()===e})},U.prototype.addFileToCurrentFolder=function(e){""===this.searchPattern()&&this.files.push(e)},U.prototype.deleteFileByName=function(e){this.files(r.filter(this.files(),function(t){return t.id()!==e}))},U.prototype.deleteFolderByName=function(e){this.folders(r.filter(this.folders(),function(t){return t.fileName()!==e}))},U.prototype.expungeFileItems=function(){this.folders(r.filter(this.folders(),function(e){return!e.deleted()},this)),this.files(r.filter(this.files(),function(e){return!e.deleted()},this))},U.prototype.expungeExternalStorages=function(e){this.storages(r.filter(this.storages(),function(t){return!t.isExternal||r.include(e,t.type)},this))},U.prototype.getUploadFileByUid=function(e){return r.find(this.uploadingFiles(),function(t){return t.uploadUid()===e})},U.prototype.deleteUploadFileByUid=function(e){this.uploadingFiles(r.filter(this.uploadingFiles(),function(t){return t.uploadUid()!==e}))},U.prototype.getUploadingFiles=function(){return r.filter(this.uploadingFiles(),r.bind(function(e){return e.path()===this.currentPath()&&e.storageType()===this.storageType()},this))},U.prototype.onCancelUpload=function(e){this.deleteUploadFileByUid(e),this.oJua&&this.oJua.cancel(e)},U.prototype.onCreateFolderResponse=function(e,t){e.Result||u.showErrorByCode(e),this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)},U.prototype.createFolder=function(e){return e=n.trim(e),c.validateFileOrFolderName(e)?(A.send("CreateFolder",{Type:this.storageType(),Path:this.currentPath(),FolderName:e},this.onCreateFolderResponse,this),""):h.i18n("FILESWEBCLIENT/ERROR_INVALID_FOLDER_NAME")},U.prototype.executeCreateFolder=function(){g.showPopup(P,[r.bind(this.createFolder,this)])},U.prototype.onCreateLinkResponse=function(e,t){this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern(),!0)},U.prototype.createLink=function(e){A.send("CreateLink",{Type:this.storageType(),Path:this.currentPath(),Link:e.sLinkUrl,Name:e.fileName()},this.onCreateLinkResponse,this)},U.prototype.executeCreateShortcut=function(){var e=r.bind(this.createLink,this);g.showPopup(L,[e])},U.prototype.onSearch=function(){this.routeFiles(this.storageType(),this.currentPath(),this.newSearchPattern())},U.prototype.clearSearch=function(){this.routeFiles(this.storageType(),this.currentPath())},U.prototype.executeCheckstate=function(){this.routeFiles(this.storageType(),this.currentPath(),this.searchPattern())},U.prototype.getCurrentFolder=function(){var e=new k(this);return e.fullPath(this.currentPath()),e.storageType(this.storageType()),e},U.prototype.registerToolbarButtons=function(e){var t=this;a.isNonEmptyArray(e)&&e.forEach(function(e){t.registerController(e,"ToolbarButton")})},U.prototype.registerController=function(e,t){var i=!1;switch(t){case"Storage":this.storageControllers.push(e),i=!0;break;case"ToolbarButton":this.addToolbarButtons.push(e),i=!0}i&&"function"==typeof e.useFilesViewData&&e.useFilesViewData(this)},U.prototype.onFileRemove=function(e,t){var i=r.bind(function(e,t){var i={Type:this.storageType(),Path:this.currentPath(),Items:[{Path:this.currentPath(),Name:t,IsFolder:!1}]};A.send("Delete",i,function(e){e.Result||u.showErrorByCode(e),this.currentGetFiles()},this),this.onCancelUpload(e)},this);t.downloading()?d.broadcastEvent("CFilesView::FileDownloadCancel",{oFile:t}):!t.uploaded()&&e&&(d.broadcastEvent("CFilesView::FileUploadCancel",{sFileUploadUid:e,sFileUploadName:t.fileName(),fOnUploadCancelCallback:i})||i(e,t.fileName()))},e.exports=U}}]);