export const __webpack_esm_id__=8489;export const __webpack_esm_ids__=[8489,11803];export const __webpack_esm_modules__={8489(e,t,n){n(22742),n(33136),n(61809),n(11803),n(88274),n(67260),n(28918),n(21146),n(63030),angular.module("graphdb.framework.settings",["toastr","ui.bootstrap","graphdb.framework.rest.license.service","graphdb.framework.settings.controllers","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.interceptors.authentication","graphdb.framework.core.services.jwtauth"])},11803(e,t,n){n(22742),n(28918);var s=n(57154);function r(e,t,n,s,r){e.supportsStatistics=!0,e.settings={statistics:!1},e.getSettings=function(){e.loader=!0,s.getStatistics().then(function(t){e.settings.statistics="true"===t.data,e.supportsStatistics=!0},function(n){if(404===n.status)e.supportsStatistics=!1;else{const e=getError(n.data);t.error(e,r.instant("error.getting.settings"))}})},e.getSettings(),e.setSettings=function(){e.loader=!0,s.toggleStatistics(e.settings.statistics).then(function(){n.close(),t.success(r.instant("saving.settings.success"))},function(e){const n=getError(e.data);t.error(n,r.instant("saving.settings.error"))})},e.submitForm=function(){e.setSettings()},e.cancel=function(){n.dismiss("cancel")}}function i(e,t,n,r,i,o){const c=(0,s.service)(s.LicenseService),a=(0,s.service)(s.LicenseContextService);e.isLicenseHardcoded=!0,e.removeLicense=function(){r.openSimpleModal({title:i.instant("confirm.operation"),message:i.instant("remove.license.warning.msg"),warning:!0}).result.then(()=>c.unregisterLicense()).then(()=>c.updateLicenseStatus()).then(()=>o.applyTrackingConsent()).catch(e=>{const n=getError(e.data,e.status);t.error(n,i.instant("common.error"))})};const l=a.onIsLicenseHardcodedChanged(t=>e.isLicenseHardcoded=t);e.$on("$destroy",()=>{l?.()})}function o(e,t,n,r,i,o,c){const a=(0,s.service)(s.AuthorizationService),l=(0,s.service)(s.LicenseService);e.isLicenseHardcodedValue=!0,a.isAdmin()||s.RoutingUtil.navigate("license"),e.validateLicenseCode=e=>{g(e)};const u=$(".license-textarea");e.$watch("currentFile",function(){if(e.currentFile){const t=e.currentFile;l.extractFromLicenseFile(t).then(e=>{g(e)}).catch(()=>{r.error(c.instant("could.not.upload.file.error"))})}}),e.getBackToPreviousPage=function(){const e=(0,s.service)(s.NavigationContextService).getPreviousRoute();(0,s.navigate)(e??"./")};const g=e=>{l.validateLicense(e).then(t=>{t.present?(u.val(e),function(e,t){n.open({templateUrl:"js/angular/settings/modal/validate-license.html",controller:"ValidateLicenseModalCtrl",size:"lg",resolve:{license:function(){return e}}}).result.then(function(){!function(e){if(e||(e=u.val()),e){const t=atob(e.replace(/\s/g,""));l.registerLicense(t).then(()=>{const e=(0,s.service)(s.NavigationContextService).getPreviousRoute();(0,s.navigate)(e??"./")}).catch(e=>{const t=getError(e);r.error(t,c.instant("license.register.error"))})}else r.error(c.instant("no.license.code.error"))}(t)})}(t,e)):(u.val(""),r.error(t.message))}).catch(()=>{r.error(c.instant("invalid.license"))})}}function c(e,t,n){e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")},e.license=n}function a(e){e.loader=!0,e.setLoader=function(t){e.loader=t}}angular.module("graphdb.framework.settings.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","toastr"]).controller("ActiveLocationSettingsCtrl",r).controller("ValidateLicenseModalCtrl",c).controller("LicenseCtrl",i).controller("RegisterLicenseCtrl",o).controller("LoaderSamplesCtrl",a),r.$inject=["$scope","toastr","$uibModalInstance","LicenseRestService","$translate"],i.$inject=["$scope","toastr","$rootScope","ModalService","$translate","TrackingService"],o.$inject=["$scope","$location","$uibModal","toastr","$window","$jwtAuth","$translate"],c.$inject=["$scope","$uibModalInstance","license"],a.$inject=["$scope"]}};
//# sourceMappingURL=8489.f7c014152e55a39d0a3c.bundle.js.map