(()=>{function e(e,t,n,i,r,a,o,c){_.isFunction(e.preAssignBindingsEnabled)?e.preAssignBindingsEnabled(!0):e.preAssignBindingsEnabled=function(){return!0},t.hashPrefix(""),_.isFunction(n.errorOnUnhandledRejections)&&n.errorOnUnhandledRejections(!1),r.defaults.headers.get||(r.defaults.headers.get={}),r.interceptors.push("c8yLoadingIndicator"),c.theme="selectize",i.decorator("$$sanitizeUri",s),a.options.backdrop="static",i.decorator("$http",o.$get)}function s(i){return function(e,t){var n=/^\s*(https?|ftp|mailto|file|data|blob):/.test(e),e=i(e,t);return e=n?e&&e.replace(/^unsafe:/,""):e}}function t(t,e,n,i,r,a){var o,c=e.$on("authStateChange",function(e,t){t.hasAuth&&(i.clearAll(),window.c8y_testing||r.warnIfPasswordExpiresSoon(),c())}),s=t.navigator.onLine;window.c8y_testing||a(function(){var e;s!==t.navigator.onLine&&((e=t.navigator.onLine)||(o=moment()),e)&&o&&(10<=moment().diff(o,"minutes")&&n.reload(),o=null),s=t.navigator.onLine},1e3,0,!1)}function n(i,r,a,o,e){var c,s=e("An error occurred, please contact support."),t=0;function d(e){t+=e,i.loading=!!t}function u(){return u.cache=u.cache?u.cache:a.get("gettextCatalog")}var l=document.createElement("div");function g(t){return!_.isUndefined(t)&&_.find(["/notification/realtime","/cep/notifications","/cep/customnotifications"],function(e){return 0<=t.indexOf(e)})}return l.innerHTML="<a></a>",l.innerHTML=l.innerHTML,{request:function(e){var t=o.valueOf(e.url);return g(t)||d(1),t.match(/(?:\.html)|(?:\.template)|(?:\.json)$/)||_.isObjectLike(e.params)||(e.params={}),e},response:function(e){return g(o.valueOf(e.config.url))||d(-1),e},responseError:function(e){var t=o.valueOf(e.config.url),n=e.data;return g(t)||d(-1),(e=>{var t,n;return!(!e||(t=(c=c||a.get("c8yBase")).getFlag("baseUrl"),l.firstChild.href=e,l.innerHTML=l.innerHTML,n=l.firstChild.host||l.firstChild.href.split("/")[2],t&&0===e.indexOf(t))||n===window.location.host)})(t)&&!e.config.silentError?i.$emit("alert",{type:"danger",text:s,detailedData:e}):n&&n.message&&!e.config.silentError?403===e.status?i.$emit("accessDenied",{data:n,request:e}):i.$emit("alert",{type:"danger",text:$("<div/>").text(u().getString(n.message)).html(),detailedData:n}):500<=e.status&&e.status<600&&!e.config.silentError&&i.$emit("alert",{type:"danger",text:s}),r.reject(e)}}}s.$inject=["$delegate"],n.$inject=["$rootScope","$q","$injector","$sce","gettext"],t.$inject=["$window","$rootScope","$route","c8yAlert","c8yUserUtil","$interval"],e.$inject=["$compileProvider","$locationProvider","$qProvider","$provide","$httpProvider","$uibModalProvider","httpCacheProvider","uiSelectConfig"],angular.module("c8y.ui",["ngRoute","ngAnimate","ngSanitize","ngMessages","ngCsv","ui.bootstrap","ui.select","ui.sortable","ui.ace","tmh.dynamicLocale","schemaForm","gettext","c8y.core","leaflet-directive"]).config(e).run(t).factory("c8yLoadingIndicator",n)})();