(()=>{function e(e,t,n,o){var s=this,c="c8yAppInstanceLogsUiAceSettings",a={theme:"monokai",fontSize:14,themeLabel:n("Dark theme")};function i(){s.instancesCopy=_.cloneDeep(s.instances)}function l(){var e=s.aceInstance.session.getLength()-1;s.aceInstance.gotoLine(1+e,0)}_.assign(s,{$onInit:function(){s.uiAceSettings={useWrapMode:!0,mode:"java",showPrintMargin:!1,onLoad:function(e){s.aceInstance=e,s.aceInstance.$blockScrolling=1/0}},o.get(c).then(function(e){_.isUndefined(e)||(s.uiAceOptions.theme=e.theme,s.uiAceOptions.fontSize=e.fontSize)})},uiAceSettings:{},uiAceOptions:a,onNewLogs:function(e){(e=>{var n=e.dateFrom,t=e.dateTo,e=e.logs;s.selectedInstance.dateFrom=n,s.selectedInstance.dateTo=t,s.selectedInstance.logs=e})(e),s.aceInstance.session.getScrollTop()===s.aceInstance.renderer.layerConfig.maxHeight-s.aceInstance.renderer.$size.scrollerHeight+s.aceInstance.renderer.scrollMargin.bottom&&setTimeout(l)},updateRealtimeState:function(e){s.isRealtimeEnabled=e},onInstances:i,instancesCopy:{}}),e.$watchCollection("vm.uiAceOptions",function(e){var n;_.isUndefined(e)||(e=e,s.aceInstance.setFontSize(e.fontSize),s.aceInstance.setTheme("ace/theme/".concat(e.theme)),e=a.theme,n=a.fontSize,e={theme:e,fontSize:n},o.set(c,e))}),e.$watch("vm.dateFromPickerOpen",function(e,n){n&&!e?(s.shouldClose="disabled",t(function(){s.shouldClose="outsideClick"},0)):s.shouldClose="outsideClick"}),e.$watch("vm.instances",i)}e.$inject=["$scope","$timeout","gettext","c8yUserPreferences"],angular.module("c8y.appLogs").component("c8yAppInstanceLogs",{bindings:{selectedInstance:"=",mo:"<",instances:"<",onNextButtonClick:"<",onFastBackwardButtonClick:"<",onBackButtonClick:"<",onFastForwardButtonClick:"<",logsString:"<",buttonsDisabled:"<",isRealtimeEnabled:"<",onInstanceChange:"<",onDateFromChange:"<"},templateUrl:":::PLUGIN_PATH:::/app-instance-logs/app-instance-logs.html",controller:e,controllerAs:"vm"})})();