export const __webpack_esm_id__=99402;export const __webpack_esm_ids__=[8056,99402];export const __webpack_esm_modules__={99402(e,n,t){t(8056),angular.module("graphdb.framework.plugins",["ngRoute","graphdb.framework.plugins.controllers"])},8056(e,n,t){t(94312);var i=t(57154);function r(e,n,t,r,o,s,l){const u=(0,i.service)(i.LicenseContextService);let a;const c=function(){e.clear(),u.getLicenseSnapshot().valid&&r.getActiveRepository()&&!r.isActiveRepoOntopType()&&!r.isActiveRepoFedXType()&&g()};e.clear=function(){e.searchPluginsTerm="",e.plugins=[],e.displayedPlugins=[]};const g=function(){d(),a=n(function(){d()},5e3)},d=function(){s.getPlugins(e.getActiveRepository()).success(function(n){e.plugins=e.buildPluginsArray(n.results.bindings)}).error(function(e){t.error(getError(e))}).finally(function(){e.filterResults(),e.setLoader(!1)})};e.buildPluginsArray=function(e){return e.map(e=>({name:e.s.value,enabled:"true"===e.o.value})).filter(function(e){return"plugincontrol"!==e.name&&"literals-index"!==e.name}).sort(function(e,n){const t=e.name.toLowerCase(),i=n.name.toLowerCase();return t<i?-1:t>i?1:0})},e.filterResults=function(){const n=e.plugins.filter(n=>-1!==n.name.indexOf(e.searchPluginsTerm));f(n)&&e.updateDisplayedPlugins(n)};const f=function(n){if(!e.displayedPlugins||e.displayedPlugins.length!==n.length)return!0;for(const t in n)if(!e.displayedPlugins.find(e=>angular.equals(e,n[t])))return!0;return!1};function p(){a&&n.cancel(a)}e.updateDisplayedPlugins=function(n){e.displayedPlugins=n,setTimeout(function(){e.applyRowStyles()},0)},e.setLoader=function(n,t){o.cancel(e.loaderTimeout),n?e.loaderTimeout=o(function(){e.loader=n,e.loaderMessage=t},300):e.loader=!1},e.$on("repositoryIsSet",function(){p(),c()}),e.$on("$destroy",function(){p(),$(window).off("resize.plugin")}),$(window).on("resize.plugin",function(){e.applyRowStyles()}),e.applyRowStyles=function(){const n=$("#wb-plugins-pluginInPlugins").width(),t=$("tr").width(),i=Math.floor(n/t);$(".wb-plugins-row").toArray().forEach((n,t)=>{e.isGreyBackground(i,t)?$(n).addClass("grey-row"):$(n).removeClass("grey-row")})},e.isGreyBackground=function(e,n){const t=(Math.floor(n/e)+1)%2!=1,i=n%2!=0;if(e%2!=0){if(t&&!i||!t&&!i)return!0;if(t&&i||!t&&i)return!1}else{if(t&&!i||!t&&i)return!1;if(t&&i||!t&&!i)return!0}},e.togglePlugin=function(n,i){const r=e.getActiveRepository(),o=i?l.instant("deactivating.plugin",{pluginName:n}):l.instant("activating.plugin",{pluginName:n});e.setLoader(!0,o),s.togglePlugin(r,i,n).error(function(e){t.error(getError(e))}).finally(function(){d(),e.setLoader(!1)})},e.getLoaderMessage=function(){return e.loaderMessage||l.instant("common.loading")},e.onSearchTermChanged=function(){e.filterResults()},c()}angular.module("graphdb.framework.plugins.controllers",["graphdb.framework.rest.plugins.service"]).controller("PluginsCtrl",r),r.$inject=["$scope","$interval","toastr","$repositories","$timeout","PluginsRestService","$translate"]}};
//# sourceMappingURL=99402.9aadbfbe19b2b0cfdeeb.bundle.js.map